Jump to content

avertuss

Inactive Member
  • Posts

    480
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by avertuss

  1. Hi. How to change lenght of the mining animation? In game i edited

    LPEVENT CreateMiningEvent(LPCHARACTER ch, LPCHARACTER load, int count)
    	{
    		mining_event_info* info = AllocEventInfo<mining_event_info>();
    		info->pid = ch->GetPlayerID();
    		info->vid_load = load->GetVID();
    
    		return event_create(mining_event, info, PASSES_PER_SEC(2 * count));
    	}

    to

    LPEVENT CreateMiningEvent(LPCHARACTER ch, LPCHARACTER load, int count)
    	{
    		mining_event_info* info = AllocEventInfo<mining_event_info>();
    		info->pid = ch->GetPlayerID();
    		info->vid_load = load->GetVID();
    
    		return event_create(mining_event, info, PASSES_PER_SEC(1 * count));
    	}

    but i need edit animation or binary

  2. 44 minuty temu, JeeX napisał:

     

    I hope i didn't forgot anything <-

     

    
    //char.cpp
    //add after includes:
    bool IsMountable(int map_index, bool isHorse)
    {
    	if (CArenaManager::instance().IsArenaMap(map_index))
    		return false;
    
    	switch (map_index)
    	{
    		case YOUR_MAPINDEX:	//edit this <- [e.g. 61 - look @ your map_index]
    		return false;
    	}
    	return true;
    }
    
    
    //char_item.cpp
    //add after includes:
    extern bool IsMountable(int map_index, bool isHorse);
    
    //search: bool CHARACTER::CanEquipNow(const LPITEM item, const TItemPos& srcCell, const TItemPos& destCell)
    //add:
    	if (item->IsCostumeMount() && !IsMountable(GetMapIndex(), false))
    		return false;
    
    
    //input_login.cpp
    //add after includes:
    extern bool IsMountable(int map_index, bool isHorse);
    
    //search: void CInputLogin::Entergame(LPDESC d, const char * data)
    	if (!IsMountable(ch->GetMapIndex(), false))
    		ch->UnEquipCostumeMoudeItem(false);
    
    
    //questlua_horse.cpp
    //add after includes:
    extern bool IsMountable(int map_index, bool isHorse);
    
    //search: ALUA(horse_summon)
    //add:
    		if (!IsMountable(ch->GetMapIndex(), true))
    			return 0;
    
    //search: ALUA(horse_in_summonable_area)
    //add:
    lua_pushboolean(L, IsMountable(ch->GetMapIndex(), isMount));
    
    
    //questlua_pc.cpp
    //add after includes:
    extern bool IsMountable(int map_index, bool isHorse);
    
    //search: ALUA(pc_mount)
    //add:
    		if (!IsMountable(ch->GetMapIndex(), mount_vnum == ch->GetMyHorseVnum()))
    			return 0;

     

    I don't have that IsCostumeMount in source. 

  3. Hi. i wrote quest

    quest block_horse begin
    	state start begin
    		when login with pc.get_map_index() >= 1100000 and pc.get_map_index() <= 1110000 begin
    			horse.unride()
    			horse.unsummon()
    			pc.unmount()
    		end
    	end
    end

    quest works but only with horse, with mount too(pc isn't on mount), but mount item is still in the slot0AI7Wh47QZWlJc2nOVHO1Q.png

    How can i fix that? 

  4. 17 godzin temu, Syreldar napisał:
    
    quest daily_bonus begin
    	state start begin
    		function GetData()
    			local data = {
    				[1] =  {["attrtype"] = 1,  ["attrvalue_list"] = {[1] = 1000, [2] = 1500, [3] = 2000}},
    				[2] =  {["attrtype"] = 13, ["attrvalue_list"] = {[1] = 6,    [2] = 12,   [3] = 18}},
    				[3] =  {["attrtype"] = 15, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[4] =  {["attrtype"] = 16, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[5] =  {["attrtype"] = 63, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[6] =  {["attrtype"] = 17, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[7] =  {["attrtype"] = 21, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[8] =  {["attrtype"] = 22, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[9] =  {["attrtype"] = 72, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[10] = {["attrtype"] = 54, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[11] = {["attrtype"] = 53, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}}
    			};
    			
    			return data;
    		end -- function
    		
    		function table_get_random_item(table_ex)
    			return table_ex[math.random(table.getn(table_ex))];
    		end -- function
    	
    		when 80009.use begin
    			local data = daily_bonus.GetData();
    			local chosen_bonus = daily_bonus.table_get_random_item(data);
    			local day_time = 60*60*24;
    
    			affect.add_collect(chosen_bonus["attrtype"], daily_bonus.table_get_random_item(chosen_bonus["attrvalue_list"]), day_time);
    			chat(chat_color("["..item_name(item.vnum).."]", "green").." You got bonus.")
    		end -- when
    	end -- state
    end -- quest

    because you keep modifying things without testing them first. Use this now.

    Now it works but when i wanted to show which bonus player got i saw error

    SYSERR: Jan 30 13:05:49 :: RunState: LUA_ERROR: [string "daily_bonus"]:5: attempt to call field `attrname' (a string value)
    SYSERR: Jan 30 13:05:49 :: WriteRunningStateToSyserr: LUA_ERROR: quest daily_bonus.start click

    Quest:

    quest daily_bonus begin
    	state start begin
    		function GetData()
    			local data = {
    				[1] =  {["attrname"] = "Max. HP", ["attrtype"] = 1,  ["attrvalue_list"] = {[1] = 1000, [2] = 1500, [3] = 2000}},
    				[2] =  {["attrname"] = "Max. HP2", ["attrtype"] = 13, ["attrvalue_list"] = {[1] = 6,    [2] = 12,   [3] = 18}},
    				[3] =  {["attrname"] = "Max. HP3", ["attrtype"] = 15, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[4] =  {["attrname"] = "Max. HP4", ["attrtype"] = 16, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[5] =  {["attrname"] = "Max. HP5", ["attrtype"] = 63, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[6] =  {["attrname"] = "Max. HP6", ["attrtype"] = 17, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[7] =  {["attrname"] = "Max. HP7", ["attrtype"] = 21, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[8] =  {["attrname"] = "Max. HP8", ["attrtype"] = 22, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[9] =  {["attrname"] = "Max. HP9", ["attrtype"] = 72, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[10] = {["attrname"] = "Max. HP10", ["attrtype"] = 54, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[11] = {["attrname"] = "Max. HP11", ["attrtype"] = 53, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}}
    			};
    			
    			return data;
    		end -- function
    		
    		function table_get_random_item(table_ex)
    			return table_ex[math.random(table.getn(table_ex))];
    		end -- function
    	
    		when 80009.use begin
    			local data = daily_bonus.GetData();
    			local chosen_bonus = daily_bonus.table_get_random_item(data);
    			local day_time = 1*1*30;
    
    			affect.add_collect(chosen_bonus["attrtype"], daily_bonus.table_get_random_item(chosen_bonus["attrvalue_list"]), day_time);
    			chat(chat_color("["..item_name(item.vnum).."]", "green").." You got "..chosen_bonus["attrname"]"")
    		end -- when
    	end -- state
    end -- quest

    Can you help me? 

  5. Dnia 28.01.2018 o 17:49, Syreldar napisał:

    You are using the wrong version, i modified that once for a quick fix, c/p it again.

    as for the attrs on chat, why don't you try to figure it yourself man? Try to learn.

    But your quest doesn't work 

    quest daily_bonus begin
    	state start begin
    		function GetData()
    			local data = {
    				[1] =  {["attrtype"] = 1,  ["attrvalue_list"] = {[1] = 1000, [2] = 1500, [3] = 2000}},
    				[2] =  {["attrtype"] = 13, ["attrvalue_list"] = {[1] = 6,    [2] = 12,   [3] = 18}},
    				[3] =  {["attrtype"] = 15, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[4] =  {["attrtype"] = 16, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[5] =  {["attrtype"] = 63, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[6] =  {["attrtype"] = 17, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[7] =  {["attrtype"] = 21, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[8] =  {["attrtype"] = 22, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[9] =  {["attrtype"] = 72, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[10] = {["attrtype"] = 54, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[11] = {["attrtype"] = 53, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}}
    			};
    			
    			return data;
    		end -- function
    		
    		function table_get_random_item(table_ex)
    			return table_ex[math.random(table.getn(table_ex))];
    		end -- function
    	
    		when 80009.use begin
    			local data = daily_bonus.GetData();
    			local random_num = daily_bonus.table_get_random_item(data);
    			local chosen_bonus = data[random_num];
    			local day_time = 60*60*24;
    			affect.add_collect(chosen_bonus["attrtype"], table_get_random_item(chosen_bonus["attrvalue_list"]), day_time);
    			chat(chat_color("["..item_name(item.vnum).."]", "green").." You got bonus.")
    		end -- when
    	end -- state
    end -- quest

    SYSERR: Jan 29 19:10:44 :: RunState: LUA_ERROR: [string "teleport"]:5: attempt to index local `chosen_bonus' (a nil value)
    SYSERR: Jan 29 19:10:44 :: WriteRunningStateToSyserr: LUA_ERROR: quest teleport.start click

  6. Dnia 26.01.2018 o 13:31, Syreldar napisał:
    
    quest daily_bonus begin
    	state start begin
    		function GetData()
    			local data = {
    				[1] =  {["attrtype"] = 1,  ["attrvalue_list"] = {[1] = 1000, [2] = 1500, [3] = 2000}},
    				[2] =  {["attrtype"] = 13, ["attrvalue_list"] = {[1] = 6,    [2] = 12,   [3] = 18}},
    				[3] =  {["attrtype"] = 15, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[4] =  {["attrtype"] = 16, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[5] =  {["attrtype"] = 63, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[6] =  {["attrtype"] = 17, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[7] =  {["attrtype"] = 21, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[8] =  {["attrtype"] = 22, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[9] =  {["attrtype"] = 72, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[10] = {["attrtype"] = 54, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[11] = {["attrtype"] = 53, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}}
    			};
    			
    			return data;
    		end -- function
    		
    		function table_get_random_item(table_ex)
    			return table_ex[math.random(table.getn(table_ex))];
    		end -- function
    	
    		when login with pc.getqf("time") <= get_time() begin
    			local data = daily_bonus.GetData();
    			local random_num = table_get_random_item(data);
    			local chosen_bonus = data[random_num];
    			local day_time = 60*60*24;
    
    			pc.setqf("time", get_time()+day_time);
    			affect.add_collect(chosen_bonus["attrtype"], table_get_random_item(chosen_bonus["attrvalue_list"]), day_time);
    			syschat("You have received your bonus. Come back in 24 hours.")
    		end -- when
    	end -- state
    end -- quest

     

    I have problem. Your quest doesn't work. Error: 

    SYSERR: Jan 28 17:36:56 :: RunState: LUA_ERROR: [string "daily_bonus"]:6: attempt to index local `chosen_bonus' (a nil value)
    SYSERR: Jan 28 17:36:56 :: WriteRunningStateToSyserr: LUA_ERROR: quest daily_bonus.start click

    I wanted add attr_name and value on chat

    quest daily_bonus begin
    	state start begin
    		function GetData()
    			local data = {
    				[1] =  {["attr_name"] = "MAX HP", ["attrtype"] = 1,  ["attrvalue_list"] = {[1] = 1000, [2] = 1500, [3] = 2000}},
    				[2] =  {["attr_name"] = "MAX HP", ["attrtype"] = 13, ["attrvalue_list"] = {[1] = 6,    [2] = 12,   [3] = 18}},
    				[3] =  {["attr_name"] = "MAX HP", ["attrtype"] = 15, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[4] =  {["attr_name"] = "MAX HP", ["attrtype"] = 16, ["attrvalue_list"] = {[1] = 10,   [2] = 15,   [3] = 20}},
    				[5] =  {["attr_name"] = "MAX HP", ["attrtype"] = 63, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[6] =  {["attr_name"] = "MAX HP", ["attrtype"] = 17, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[7] =  {["attr_name"] = "MAX HP", ["attrtype"] = 21, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[8] =  {["attr_name"] = "MAX HP", ["attrtype"] = 22, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[9] =  {["attr_name"] = "MAX HP", ["attrtype"] = 72, ["attrvalue_list"] = {[1] = 5,    [2] = 10,   [3] = 15}},
    				[10] = {["attr_name"] = "MAX HP", ["attrtype"] = 54, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}},
    				[11] = {["attr_name"] = "MAX HP", ["attrtype"] = 53, ["attrvalue_list"] = {[1] = 50,   [2] = 75,   [3] = 100}}
    			};
    			
    			return data;
    		end -- function
    		
    		function table_get_random_item(table_ex)
    			return table_ex[math.random(table.getn(table_ex))];
    		end -- function
    	
    		when 80009.use with pc.getqf("time") <= get_time() begin
    			local data = daily_bonus.GetData();
    			local random_num = table_get_random_item(data);
    			local chosen_bonus = data[random_num];
    			local day_time = 60*60*24;
    
    			pc.setqf("time", get_time()+day_time);
    			affect.add_collect(chosen_bonus["attrtype"], table_get_random_item(chosen_bonus["attrvalue_list"]), day_time);
    			syschat("You got bonus" "..chosen_bonus["attr_name"]..""..value table_get_random_item(chosen_bonus["attrvalue_list"])).."")
    		end -- when
    	end -- state
    end -- quest

    and it doesn't work. Can you help me? 

  7. Hi. I found quest: 

    quest daily_bonus begin
    	state start begin
    		when login begin
    			if pc.getqf("time") == 0 or pc.getqf("time") <= get_time() then
    				pc.setqf("time", get_time()+60*60*24)
    				local bonusy = {
    					{"Max. HP +1000", 1, 1000},
    					{"Szansa na Omdlenie 5%", 13, 6},
    					{"Szansa na Kryt. Uderzenie 8%", 15, 10},
    					{"Szansa na Przeszyw. Uderzenie 8%", 16, 10},
    					{"Silny Przeciwko Potworom 3%", 63, 5},
    					{"Silny Przeciwko Ludziom 3%", 17, 5},
    					{"Silny Przeciwko Nieumarłym 15%", 21, 10},
    					{"Silny Przeciwko Diabłom 15%", 22, 10},
    					{"Średnie Obrażenia +15%", 72, 10},
    					{"Obrona +50", 54, 50},
    					{"Wartość Ataku +50", 53, 50},
    				}
    				local n = number(1, table.getn(bonusy))
    				affect.add_collect(bonusy[n][2], bonusy[n][3], 60*60*24)
    				chat("Za dzisiejsze zalogowanie się otrzymujesz bonus: "..bonusy[n][1])
    				chat("Czas Trwania Bonusu: 24h.")
    				end
    			end
    		end
    	end
    	

    How can i make that value of the bonus will be random from table. For example: {"Max. HP +1000", 1, random(1000 or 1500 or 2000)},

    Thanks for help. 

  8. Hi. I have that syserr: 

    1128 15:33:09993 :: TypeError
    1128 15:33:09993 :: : 
    1128 15:33:09993 :: InsertItem() takes exactly 3 positional arguments (5 given)
    1128 15:33:09993 :: 

     

    function

     

    def InsertItem(self, number, text):
    		self.keyDict[len(self.itemList)] = number
    		self.textDict[len(self.itemList)] = text
    
    		textLine = TextLine()
    		textLine.SetParent(self)
    		textLine.SetText(text)
    		textLine.Show()
    
    		if self.itemCenterAlign:
    			textLine.SetWindowHorizontalAlignCenter()
    			textLine.SetHorizontalAlignCenter()
    
    		self.itemList.append(textLine)
    
    		self._LocateItem()

    Can you help me?

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.