Despero 131 Posted April 8, 2015 Share Posted April 8, 2015 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hello Metin2DEV, i release today a Metin2 Pet Level System for Revision 34K-40K Each pet has own Level Spoiler quest pet_system begin state start begin when letter begin cmdchat("petguihideshow "..q.getcurrentquestindex()) end function givebonus(x) local mobVnum = pc.getqf("mobVnum") local y,boni = {10,54,1},pet_system.bonusliste() table.foreach(boni[x],function(i,l) cmdchat("HaustierBonus"..i.." "..l.."") affect.add_collect(y[i],l,60*60*24*365*60) end ) cmdchat("HaustierLevel "..pc.getqf('petlevel_'..mobVnum).."") cmdchat("HaustierName "..pc.get_name().."") pc.setqf("petruf",1) pc.setqf("petguishow",1) end function bonusliste() return { [1] = {20,10,500}, [2] = {30,20,1000}, [3] = {40,30,1500}, [4] = {50,45,2000}, [5] = {65,60,3000}, } end function removebonus(x) local y,boni = {10,54,1},pet_system.bonusliste() table.foreach(boni[x],function(i,l) affect.remove_collect(y[i],l,60*60*24*365*60) end ) pc.setqf("petruf",0) --cmdchat("HidePetGui") pc.setqf("petguishow",0) cleartimer("bugcheck") end function get_pet_info(itemVnum) pet_info_map = { -- [ITEM VNUM] MOB_VNUM, DEFAULT NAME, buff_idx, spawn_effect_idx [53001] = { 34001, "-Feuerphönix", 1}, [53002] = { 34002, "-Rentier", 1, "rentier"}, [53003] = { 34003, "-Eisphönix", 1, "icephoenix"}, [53005] = { 34004, "-Azrael", 1, "azrael"}, [53006] = { 34009, "-Gold-Azrael", 1, "azrael"}, [53007] = { 34010, "-Bambi", 1, "rentier"}, [53008] = { 34011, "-Knuud", 1}, [53009] = { 34012, "-Bao Bao", 1, "baobao"}, [53010] = { 34008, "-Leonidas", 1, "leonidas"}, [53011] = { 34007, "-Khan", 1, "khan"}, [53012] = { 34005, "-Porkie", 1, "porky"}, [53013] = { 34006, "-Rufus", 1, "rufus"}, [53014] = { 34013, "-Henkerchen", 1}, [53015] = { 34014, "-Gold-Henkerchen", 1}, [53016] = { 34015, "-Boney", 1}, [53017] = { 34016, "-Jadephönix", 1}, [53018] = { 34020, "-Schnee-Leonidas", 1}, [53019] = { 34019, "-Arktis-Khan", 1}, [53020] = { 34017, "-Polar-Porkie", 1}, [53021] = { 34018, "-Frost-Rufus", 1}, --2014 LAST UPDATE 18.11.2014 [53022] = { 34021, "-Sheldon", 1}, [53023] = { 34022, "-Cooper", 1}, [53024] = { 34023, "-Panther", 1}, [53025] = { 34024, "-Leopard", 1}, [34026] = { 34024, "-halloween_pumpkin_pet", 1}, [34027] = { 34024, "-halloween_broom", 1}, } itemVnum = tonumber(itemVnum) return pet_info_map[itemVnum] end function get_spawn_effect_file(idx) effect_table = { [0] = nil, [1] = "d:ymir workeffectetcappear_diemonster_appear.mse", } return effect_table [idx] end when 53007.use or 53013.use or 53012.use or 53011.use or 53010.use or 53005.use or 53006.use or 53003.use or 53002.use or 53001.use or 53014.use or 53015.use or 53017.use or 53018.use or 53019.use or 53016.use or 53008.use or 53009.use or 53020.use or 53021.use or 53022.use or 53023.use or 53024.use or 53025.use begin local pet_info = pet_system.get_pet_info(item.vnum) if null != pet_info then local mobVnum = pet_info[1] local petName = pet_info[2] local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[4]) pc.setqf("mobVnum",mobVnum) if true == pet.is_summon(mobVnum) then if spawn_effect_file_name != nil then pet.spawn_effect (mobVnum, spawn_effect_file_name) end pet.unsummon(mobVnum) pet_system.removebonus(pc.getqf('petlevel_'..mobVnum)) cmdchat("HidePetGui") syschat("Dein Haustier wurde weggeschickt") else if pet.count_summoned() < 1 then pet.summon(mobVnum, petName, false) if pet_info[4] ~= nil then cmdchat(pet_info[4]) end if pc.getqf('petlevel_'..mobVnum) == 0 then pc.setqf('petlevel_'..mobVnum,1) end syschat("Dein Haustier wurde gerufen.") pet_system.givebonus(pc.getqf('petlevel_'..mobVnum)) local expprocent1 = {20, 80, 160, 350, 400} cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent1[pc.getqf("petlevel_"..mobVnum)]).."") cmdchat("ShowPetGui") loop_timer("bugcheck", 0.2) else syschat("Du hast bereits ein Haustier gerufen!") end if spawn_effect_file_name != nil then pet.spawn_effect(mobVnum, spawn_effect_file_name) end end -- if pet.is_summon end -- if null != pet_info end -- when when kill with not npc.is_pc() begin local mobVnum = pc.getqf("mobVnum") if pc.getqf("petlevel_"..mobVnum) == 5 then return else if pc.getqf("petruf")==1 then --intervall = 10 --if pc.get_level() <= mob.get_level(npc.get_race())+ intervall then -- du darfst nur max 10 lvl über das monster sein pc.setqf("exp_"..mobVnum,pc.getqf("exp_"..mobVnum)+1) local exp2up = {2000, 8000, 16000, 35000, 40000} local expprocent = {20, 80, 160, 350, 400} cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent[pc.getqf("petlevel_"..mobVnum)]).."") if pc.getqf("exp_"..mobVnum) == exp2up[pc.getqf("petlevel_"..mobVnum)] then if pc.getqf("petlevel_"..mobVnum) == 4 then say_title("Herzlichen Glückwunsch") say("Dein Haustier erreicht Level "..(pc.getqf("petlevel_"..mobVnum)+1).."") say_reward("Dies war das letzte Level!") end say_title("Herzlichen Glückwunsch") say("Dein Haustier erreicht Level "..(pc.getqf("petlevel_"..mobVnum)+1).."") say("Rufe dein Pet bitte erneut!") pc.setqf("petlevel_"..mobVnum,pc.getqf("petlevel_"..mobVnum)+1) pc.setqf("exp_"..mobVnum,0) pet_system.removebonus(pc.getqf('petlevel')) end end -- if not... end -- if pc.get... end -- when -- Bugschutz when bugcheck.timer begin if pc.is_dead() then pet_system.removebonus(pc.getqf('petlevel')) end end when login or logout or disconnect with pc.getqf("petruf") == 1 begin local mobVnum = pc.getqf("mobVnum") pet_system.removebonus(pc.getqf('petlevel_'..mobVnum)) cmdchat("HidePetGui") chat("Dein Haustier ist nicht mitgekommen...") chat("Rufe es erneut!") end when button or info begin local mobVnum = pc.getqf("mobVnum") if pc.getqf("petruf") == 1 and pc.getqf("petguishow") == 1 then cmdchat("HidePetGui") pc.setqf("petguishow",0) syschat("Dein Haustierfenster wurde geschlossen, du kannst es über den Button im Inventar erneut öffnen!") elseif pc.getqf("petruf") == 1 and pc.getqf("petguishow") == 0 then cmdchat("ShowPetGui") local expprocent1 = {20, 80, 160, 350, 400} cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent1[pc.getqf("petlevel_"..mobVnum)]).."") pc.setqf("petguishow",1) syschat("Dein Haustierfenster wurde geöffnet, du kannst es über den Button im Inventar wieder schließen!") elseif pc.getqf("petruf") == 0 then syschat("Du hast kein Haustier gerufen!") end end end -- state end -- quest Each pet has the same level Spoiler quest pet_system1 begin state start begin when letter begin cmdchat("petguihideshow "..q.getcurrentquestindex()) end function givebonus(x) local y,boni = {10,54,1},pet_system.bonusliste() table.foreach(boni[x],function(i,l) cmdchat("HaustierBonus"..i.." "..l.."") affect.add_collect(y[i],l,60*60*24*365*60) end ) cmdchat("HaustierLevel "..pc.getqf('petlevel').."") cmdchat("HaustierName "..pc.get_name().."") pc.setqf("petruf",1) pc.setqf("petguishow",1) end function bonusliste() return { [1] = {20,10,500}, [2] = {30,20,1000}, [3] = {40,30,1500}, [4] = {50,45,2000}, [5] = {65,60,3000}, } end function removebonus(x) local y,boni = {10,54,1},pet_system.bonusliste() table.foreach(boni[x],function(i,l) affect.remove_collect(y[i],l,60*60*24*365*60) end ) pc.setqf("petruf",0) cmdchat("HidePetGui") pc.setqf("petguishow",0) cleartimer("bugcheck") end function get_pet_info(itemVnum) pet_info_map = { -- [ITEM VNUM] MOB_VNUM, DEFAULT NAME, buff_idx, spawn_effect_idx [53001] = { 34001, "-Feuerphönix", 1}, [53002] = { 34002, "-Rentier", 1, "rentier"}, [53003] = { 34003, "-Eisphönix", 1, "icephoenix"}, [53005] = { 34004, "-Azrael", 1, "azrael"}, [53006] = { 34009, "-Gold-Azrael", 1, "azrael"}, [53007] = { 34010, "-Bambi", 1, "rentier"}, [53008] = { 34011, "-Knuud", 1}, [53009] = { 34012, "-Bao Bao", 1, "baobao"}, [53010] = { 34008, "-Leonidas", 1, "leonidas"}, [53011] = { 34007, "-Khan", 1, "khan"}, [53012] = { 34005, "-Porkie", 1, "porky"}, [53013] = { 34006, "-Rufus", 1, "rufus"}, [53014] = { 34013, "-Henkerchen", 1}, [53015] = { 34014, "-Gold-Henkerchen", 1}, [53016] = { 34015, "-Boney", 1}, [53017] = { 34016, "-Jadephönix", 1}, [53018] = { 34020, "-Schnee-Leonidas", 1}, [53019] = { 34019, "-Arktis-Khan", 1}, [53020] = { 34017, "-Polar-Porkie", 1}, [53021] = { 34018, "-Frost-Rufus", 1}, --2014 LAST UPDATE 18.11.2014 [53022] = { 34021, "-Sheldon", 1}, [53023] = { 34022, "-Cooper", 1}, [53024] = { 34023, "-Panther", 1}, [53025] = { 34024, "-Leopard", 1}, [34026] = { 34024, "-halloween_pumpkin_pet", 1}, [34027] = { 34024, "-halloween_broom", 1}, } itemVnum = tonumber(itemVnum) return pet_info_map[itemVnum] end function get_spawn_effect_file(idx) effect_table = { [0] = nil, [1] = "d:ymir workeffectetcappear_diemonster_appear.mse", } return effect_table [idx] end when 53007.use or 53013.use or 53012.use or 53011.use or 53010.use or 53005.use or 53006.use or 53003.use or 53002.use or 53001.use or 53014.use or 53015.use or 53017.use or 53018.use or 53019.use or 53016.use or 53008.use or 53009.use or 53020.use or 53021.use or 53022.use or 53023.use or 53024.use or 53025.use begin local pet_info = pet_system.get_pet_info(item.vnum) if null != pet_info then local mobVnum = pet_info[1] local petName = pet_info[2] local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[3]) if true == pet.is_summon(mobVnum) then if spawn_effect_file_name != nil then pet.spawn_effect (mobVnum, spawn_effect_file_name) end pet.unsummon(mobVnum) pet_system.removebonus(pc.getqf('petlevel')) syschat("Dein Haustier wurde weggeschickt") else if pet.count_summoned() < 1 then pet.summon(mobVnum, petName, false) if pet_info[4] ~= nil then cmdchat(pet_info[4]) end if pc.getqf('petlevel') == 0 then pc.setqf('petlevel',1) end syschat("Dein Haustier wurde gerufen.") pet_system.givebonus(pc.getqf('petlevel')) local expprocent1 = {20, 80, 160, 350, 400} cmdchat("PetProcentExp "..(pc.getqf("exp")/expprocent1[pc.getqf("petlevel")]).."") cmdchat("ShowPetGui") loop_timer("bugcheck", 0.2) else syschat("Du hast bereits ein Haustier gerufen!") end if spawn_effect_file_name != nil then pet.spawn_effect(mobVnum, spawn_effect_file_name) end end -- if pet.is_summon end -- if null != pet_info end -- when when kill with not npc.is_pc() begin if pc.getqf("petlevel") == 5 then return else if pc.getqf("petruf")==1 then --intervall = 10 --if pc.get_level() <= mob.get_level(npc.get_race())+ intervall then -- du darfst nur max 10 lvl über das monster sein pc.setqf("exp",pc.getqf("exp")+1) local exp2up = {2000, 8000, 16000, 35000, 40000} local expprocent = {20, 80, 160, 350, 400} cmdchat("PetProcentExp "..(pc.getqf("exp")/expprocent[pc.getqf("petlevel")]).."") if pc.getqf("exp") == exp2up[pc.getqf("petlevel")] then if pc.getqf("petlevel") == 4 then say_title("Herzlichen Glückwunsch") say("Dein Haustier erreicht Level "..(pc.getqf("petlevel")+1).."") say_reward("Dies war das letzte Level!") end say_title("Herzlichen Glückwunsch") say("Dein Haustier erreicht Level "..(pc.getqf("petlevel")+1).."") say("Rufe dein Pet bitte erneut!") pc.setqf("petlevel",pc.getqf("petlevel")+1) pc.setqf("exp",0) pet_system.removebonus(pc.getqf('petlevel')) end end -- if not... end -- if pc.get... end -- when -- Bugschutz when bugcheck.timer begin if pc.is_dead() then pet_system.removebonus(pc.getqf('petlevel')) end end when login or logout or disconnect with pc.getqf("petruf") == 1 begin pet_system.removebonus(pc.getqf('petlevel')) cmdchat("HidePetGui") chat("Dein Haustier ist nicht mitgekommen...") chat("Rufe es erneut!") end when button or info begin if pc.getqf("petruf") == 1 and pc.getqf("petguishow") == 1 then cmdchat("HidePetGui") pc.setqf("petguishow",0) syschat("Dein Haustierfenster wurde geschlossen, du kannst es über den Button im Inventar erneut öffnen!") elseif pc.getqf("petruf") == 1 and pc.getqf("petguishow") == 0 then cmdchat("ShowPetGui") local expprocent1 = {20, 80, 160, 350, 400} cmdchat("PetProcentExp "..(pc.getqf("exp")/expprocent1[pc.getqf("petlevel")]).."") pc.setqf("petguishow",1) syschat("Dein Haustierfenster wurde geöffnet, du kannst es über den Button im Inventar wieder schließen!") elseif pc.getqf("petruf") == 0 then syschat("Du hast kein Haustier gerufen!") end end end -- state end -- quest Only the Client Part: http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/2308812-release-petgui-quest-levelbar.html Kind Regards Despero 13 1 1 1 18 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted April 8, 2015 Premium Share Posted April 8, 2015 Thanks ! Link to comment Share on other sites More sharing options...
Premium TAUMP 855 Posted April 9, 2015 Premium Share Posted April 9, 2015 Core dumped.. Link to comment Share on other sites More sharing options...
TheSLZ 107 Posted September 2, 2015 Share Posted September 2, 2015 (edited) Quest and clientside works fine. Edited September 2, 2015 by TheSLZ Link to comment Share on other sites More sharing options...
Exodus88 6 Posted September 2, 2015 Share Posted September 2, 2015 Core dumped.. look on client part , missing this quest_functions make core dump quest_functions: Code: pet.summon pet.unsummon pet.is_summon Link to comment Share on other sites More sharing options...
kieranFMT2 302 Posted September 3, 2015 Share Posted September 3, 2015 Hey dude do u release the client interface? Link to comment Share on other sites More sharing options...
alondark 59 Posted September 8, 2015 Share Posted September 8, 2015 Merhaba Metin2DEV, i Revizyon 34K-40K için bugün Metin2 Pet Seviye Sistemi bırakın Her hayvan var kendi Seviye Hidden Content Her hayvan aynı düzeyde sahip Hidden Content Sadece Müşteri Bölüm: http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/2308812-release-petgui-quest-levelbar.html Saygılarımla Despero I wonder which system 34k I added the server, but it didn't work I wonder if you have the chance to be helpful sykpe alondark7 1 Link to comment Share on other sites More sharing options...
fatihbab34 15 Posted September 12, 2015 Share Posted September 12, 2015 Thank you. Link to comment Share on other sites More sharing options...
BeHappy4Ever 250 Posted September 25, 2015 Share Posted September 25, 2015 (edited) The pets are not getting lv and the exp goes more than 100% have u got any ideas ? :/ Edited September 25, 2015 by BeHappy4Ever Link to comment Share on other sites More sharing options...
JwDoK 0 Posted November 21, 2016 Share Posted November 21, 2016 The system has a bug, when you die info window remains open to give pet reinvi and pet's pet is chicken again. You can do that continues. Is there any resolution to this bug? Link to comment Share on other sites More sharing options...
[007]DawisHU 278 Posted February 15, 2017 Share Posted February 15, 2017 (edited) Hello, Dont say this is our system.. U uploaded or released buged and not cleared system My OWN pet system 100% own 1. Python + .quest + locale_interface + files + effect summoned effect,Real time bonus giving +Real time checker.Link to the pics 1. Owner name. 2. Level 3.-4.-5. Bonus 6. exp percent + exp bar Best Regards, On 2015. 09. 08. at 9:28 AM, alondark said: I wonder which system 34k I added the server, but it didn't work I wonder if you have the chance to be helpful sykpe alondark7 Hi, what are hapening? happened? Best regard, On 2015. 09. 25. at 10:13 AM, BeHappy4Ever said: The pets are not getting lv and the exp goes more than 100% have u got any ideas ? :/ Hi, python and quest file is not clear Best regard, On 2016. 11. 21. at 10:47 PM, JwDoK said: The system has a bug, when you die info window remains open to give pet reinvi and pet's pet is chicken again. You can do that continues. Is there any resolution to this bug? just writte debugger example when petdebugger.timer begin timer("petdebugger1", 1) pc.get_hp() if pc.hp <0 then cmdchat("HidePetGUI") end end when petdebugger1.timer begin timer("petdebugger", 0,1) end end Best Regards, Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 Link to comment Share on other sites More sharing options...
JwDoK 0 Posted February 23, 2017 Share Posted February 23, 2017 I tried solving your [007] DawisHU at that bug fail ... I dropped the system because of that bug, a las quest if I can help you with him quest pet_system begin state start begin when letter begin cmdchat("petguihideshow "..q.getcurrentquestindex()) end function givebonus(x) local mobVnum = pc.getqf("mobVnum") local y,boni = {17,16,1},pet_system.bonusliste() table.foreach(boni[x],function(i,l) cmdchat("HaustierBonus"..i.." "..l.."") affect.add_collect(y[i],l,60*60*24*365*60) end ) cmdchat("HaustierLevel "..pc.getqf('petlevel_'..mobVnum).."") cmdchat("HaustierName "..pc.get_name().."") pc.setqf("petruf",1) pc.setqf("petguishow",1) end function bonusliste() return { [1] = {1,1,200}, [2] = {2,2,300}, [3] = {3,3,400}, [4] = {4,4,500}, [5] = {5,5,600}, [6] = {6,6,700}, [7] = {7,7,800}, [8] = {8,8,900}, [9] = {9,9,1000}, [10] = {10,10,1100}, [11] = {11,11,1200}, [12] = {12,12,1300}, [13] = {13,13,1400}, [14] = {14,14,1500}, [15] = {15,15,1600}, [16] = {16,16,1700}, [17] = {17,17,1800}, [18] = {18,18,1900}, [19] = {19,19,1950}, [20] = {20,20,2000}, } end function removebonus(x) local y,boni = {17,16,1},pet_system.bonusliste() table.foreach(boni[x],function(i,l) affect.remove_collect(y[i],l,60*60*24*365*60) end ) pc.setqf("petruf",0) --cmdchat("HidePetGui") pc.setqf("petguishow",0) cleartimer("bugcheck") end function get_pet_info(itemVnum) pet_info_map = { -- [ITEM VNUM] MOB_VNUM, DEFAULT NAME, buff_idx, spawn_effect_idx [53225] = { 34029, "-Sigiliu Clopotel de Nea", 1}, } itemVnum = tonumber(itemVnum) return pet_info_map[itemVnum] end function get_spawn_effect_file(idx) effect_table = { [0] = nil, [1] = "d:ymir workeffectetcappear_diemonster_appear.mse", } return effect_table [idx] end when 53007.use or 53013.use or 53012.use or 53011.use or 53010.use or 53005.use or 53006.use or 53003.use or 53002.use or 53001.use or 53014.use or 53015.use or 53017.use or 53018.use or 53019.use or 53016.use or 53008.use or 53009.use or 53020.use or 53021.use or 53022.use or 53023.use or 53024.use or 53224.use or 53225.use begin local pet_info = pet_system.get_pet_info(item.vnum) if null != pet_info then local mobVnum = pet_info[1] local petName = pet_info[2] local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[4]) pc.setqf("mobVnum",mobVnum) if true == pet.is_summon(mobVnum) then if spawn_effect_file_name != nil then pet.spawn_effect (mobVnum, spawn_effect_file_name) end pet.unsummon(mobVnum) pet_system.removebonus(pc.getqf('petlevel_'..mobVnum)) cmdchat("HidePetGui") syschat("Animalul de companie a fost alungat") else if pet.count_summoned() < 1 then pet.summon(mobVnum, petName, false) if pet_info[4] ~= nil then cmdchat(pet_info[4]) end if pc.getqf('petlevel_'..mobVnum) == 0 then pc.setqf('petlevel_'..mobVnum,1) end syschat("Animalul de companie a fost chemat.") pet_system.givebonus(pc.getqf('petlevel_'..mobVnum)) local expprocent1 = {20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 350, 400, 450, 500} cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent1[pc.getqf("petlevel_"..mobVnum)]).."") cmdchat("ShowPetGui") loop_timer("bugcheck", 0.2) else syschat("Ai deja chemat un animalut!") end if spawn_effect_file_name != nil then pet.spawn_effect(mobVnum, spawn_effect_file_name) end end -- if pet.is_summon end -- if null != pet_info end -- when when kill with not npc.is_pc() begin local mobVnum = pc.getqf("mobVnum") if pc.getqf("petlevel_"..mobVnum) == 20 then return else if pc.getqf("petruf")==1 then --intervall = 10 --if pc.get_level() <= mob.get_level(npc.get_race())+ intervall then -- Poate fi doar lvl max 10 peste monstru pc.setqf("exp_"..mobVnum,pc.getqf("exp_"..mobVnum)+1) local exp2up = {2000, 4000, 6000, 8000, 10000, 12000, 14000, 16000, 18000, 20000, 22000, 24000, 26000, 28000, 30000, 32000, 35000, 40000, 45000, 50000} local expprocent = {20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 350, 400, 450, 500} cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent[pc.getqf("petlevel_"..mobVnum)]).."") if pc.getqf("exp_"..mobVnum) == exp2up[pc.getqf("petlevel_"..mobVnum)] then if pc.getqf("petlevel_"..mobVnum) == 19 then say_title("Animal de companie") say("Animalut de companie Level "..(pc.getqf("petlevel_"..mobVnum)+1).."") say_reward("Acesta a fost ultimul nivel!") end say_title("Animal de companie") say("Animalut de companie Level "..(pc.getqf("petlevel_"..mobVnum)+1).."") say("Felicitarii!") pc.setqf("petlevel_"..mobVnum,pc.getqf("petlevel_"..mobVnum)+1) pc.setqf("exp_"..mobVnum,0) pet_system.removebonus(pc.getqf('petlevel')) end end -- if not... end -- if pc.get... end -- when -- Bugschutz when bugcheck.timer begin if pc.is_dead() then pet_system.removebonus(pc.getqf('petlevel')) end end when login or dead or logout or disconnect with pc.getqf("petruf") == 1 begin local mobVnum = pc.getqf("petlevel_") pet_system.removebonus(petlevel_) end end -- state end -- quest Link to comment Share on other sites More sharing options...
[007]DawisHU 278 Posted February 25, 2017 Share Posted February 25, 2017 On Thursday, February 23, 2017 at 8:12 PM, JwDoK said: I tried solving your [007] DawisHU at that bug fail ... I dropped the system because of that bug, a las quest if I can help you with him quest pet_system begin state start begin when letter begin cmdchat("petguihideshow "..q.getcurrentquestindex()) end function givebonus(x) local mobVnum = pc.getqf("mobVnum") local y,boni = {17,16,1},pet_system.bonusliste() table.foreach(boni[x],function(i,l) cmdchat("HaustierBonus"..i.." "..l.."") affect.add_collect(y[i],l,60*60*24*365*60) end ) cmdchat("HaustierLevel "..pc.getqf('petlevel_'..mobVnum).."") cmdchat("HaustierName "..pc.get_name().."") pc.setqf("petruf",1) pc.setqf("petguishow",1) end function bonusliste() return { [1] = {1,1,200}, [2] = {2,2,300}, [3] = {3,3,400}, [4] = {4,4,500}, [5] = {5,5,600}, [6] = {6,6,700}, [7] = {7,7,800}, [8] = {8,8,900}, [9] = {9,9,1000}, [10] = {10,10,1100}, [11] = {11,11,1200}, [12] = {12,12,1300}, [13] = {13,13,1400}, [14] = {14,14,1500}, [15] = {15,15,1600}, [16] = {16,16,1700}, [17] = {17,17,1800}, [18] = {18,18,1900}, [19] = {19,19,1950}, [20] = {20,20,2000}, } end function removebonus(x) local y,boni = {17,16,1},pet_system.bonusliste() table.foreach(boni[x],function(i,l) affect.remove_collect(y[i],l,60*60*24*365*60) end ) pc.setqf("petruf",0) --cmdchat("HidePetGui") pc.setqf("petguishow",0) cleartimer("bugcheck") end function get_pet_info(itemVnum) pet_info_map = { -- [ITEM VNUM] MOB_VNUM, DEFAULT NAME, buff_idx, spawn_effect_idx [53225] = { 34029, "-Sigiliu Clopotel de Nea", 1}, } itemVnum = tonumber(itemVnum) return pet_info_map[itemVnum] end function get_spawn_effect_file(idx) effect_table = { [0] = nil, [1] = "d:ymir workeffectetcappear_diemonster_appear.mse", } return effect_table [idx] end when 53007.use or 53013.use or 53012.use or 53011.use or 53010.use or 53005.use or 53006.use or 53003.use or 53002.use or 53001.use or 53014.use or 53015.use or 53017.use or 53018.use or 53019.use or 53016.use or 53008.use or 53009.use or 53020.use or 53021.use or 53022.use or 53023.use or 53024.use or 53224.use or 53225.use begin local pet_info = pet_system.get_pet_info(item.vnum) if null != pet_info then local mobVnum = pet_info[1] local petName = pet_info[2] local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[4]) pc.setqf("mobVnum",mobVnum) if true == pet.is_summon(mobVnum) then if spawn_effect_file_name != nil then pet.spawn_effect (mobVnum, spawn_effect_file_name) end pet.unsummon(mobVnum) pet_system.removebonus(pc.getqf('petlevel_'..mobVnum)) cmdchat("HidePetGui") syschat("Animalul de companie a fost alungat") else if pet.count_summoned() < 1 then pet.summon(mobVnum, petName, false) if pet_info[4] ~= nil then cmdchat(pet_info[4]) end if pc.getqf('petlevel_'..mobVnum) == 0 then pc.setqf('petlevel_'..mobVnum,1) end syschat("Animalul de companie a fost chemat.") pet_system.givebonus(pc.getqf('petlevel_'..mobVnum)) local expprocent1 = {20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 350, 400, 450, 500} cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent1[pc.getqf("petlevel_"..mobVnum)]).."") cmdchat("ShowPetGui") loop_timer("bugcheck", 0.2) else syschat("Ai deja chemat un animalut!") end if spawn_effect_file_name != nil then pet.spawn_effect(mobVnum, spawn_effect_file_name) end end -- if pet.is_summon end -- if null != pet_info end -- when when kill with not npc.is_pc() begin local mobVnum = pc.getqf("mobVnum") if pc.getqf("petlevel_"..mobVnum) == 20 then return else if pc.getqf("petruf")==1 then --intervall = 10 --if pc.get_level() <= mob.get_level(npc.get_race())+ intervall then -- Poate fi doar lvl max 10 peste monstru pc.setqf("exp_"..mobVnum,pc.getqf("exp_"..mobVnum)+1) local exp2up = {2000, 4000, 6000, 8000, 10000, 12000, 14000, 16000, 18000, 20000, 22000, 24000, 26000, 28000, 30000, 32000, 35000, 40000, 45000, 50000} local expprocent = {20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 350, 400, 450, 500} cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent[pc.getqf("petlevel_"..mobVnum)]).."") if pc.getqf("exp_"..mobVnum) == exp2up[pc.getqf("petlevel_"..mobVnum)] then if pc.getqf("petlevel_"..mobVnum) == 19 then say_title("Animal de companie") say("Animalut de companie Level "..(pc.getqf("petlevel_"..mobVnum)+1).."") say_reward("Acesta a fost ultimul nivel!") end say_title("Animal de companie") say("Animalut de companie Level "..(pc.getqf("petlevel_"..mobVnum)+1).."") say("Felicitarii!") pc.setqf("petlevel_"..mobVnum,pc.getqf("petlevel_"..mobVnum)+1) pc.setqf("exp_"..mobVnum,0) pet_system.removebonus(pc.getqf('petlevel')) end end -- if not... end -- if pc.get... end -- when -- Bugschutz when bugcheck.timer begin if pc.is_dead() then pet_system.removebonus(pc.getqf('petlevel')) end end when login or dead or logout or disconnect with pc.getqf("petruf") == 1 begin local mobVnum = pc.getqf("petlevel_") pet_system.removebonus(petlevel_) end end -- state end -- quest I'am no need help in this system i finished work on this. 1-2 week ago. Link to comment Share on other sites More sharing options...
JwDoK 0 Posted February 25, 2017 Share Posted February 25, 2017 Ok........ Link to comment Share on other sites More sharing options...
Recommended Posts