gweilo321 1 Posted January 26, 2019 Share Posted January 26, 2019 Hi guys ive set up for pet summon after teleport, but when i unsummon the pet with item and then i teleport the pet shows up. Could you help to set this up for the pet only to show when i summon him with an item so it wont summon all the time without the item. -- # --------------------------------------------- # -- # Questfile from Metin2SF by Ethoard # -- # --------------------------------------------- # quest pet_system begin state start begin function get_pet_info(itemVnum) pet_info_map = { [53001] = {34001, "Ognisty Feniks", 0}, [53002] = {34002, "Ma³y Reniferek", 0}, [53003] = {34003, "Lodowy Feniks", 0}, [53005] = {34004, "Azraeluœ ", 1}, [53006] = {34009, "Z³oty Azraeluœ ", 1}, [53007] = {34010, "Bambi", 0}, [53008] = {34011, "Knuud", 0}, [53009] = {34012, "Bao Bao", 0}, [53010] = {34008, "Leonidas", 0}, [53011] = {34007, "Ethan", 0}, [53012] = {34005, "Boczuœ ", 0}, [53013] = {34006, "Rufus", 0}, [53014] = {34021, "Kurczaczek", 0}, [53015] = {34017, "Polarny Boczuœ ", 0}, [53016] = {34015, "Kostek", 0}, } itemVnum = tonumber(itemVnum) return pet_info_map[itemVnum] end function get_spawn_effect_file(idx) effect_table = { [0] = nil, [1] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\npc2_appear.mse", } return effect_table [idx] end when login with pc.getqf("pet_vnum") != 0 begin if pc.get_map_index() == 113 then pet.unsummon(mobVnum) pc.setqf("pet_vnum, 0") else item.select(pc.getqf("pet_item_id")) pet.summon(mobVnum, " ".. petName, false) pc.setqf("pet_vnum", mobVnum) end end when 53001.use or 53002.use or 53003.use or 53005.use or 53006.use or 53007.use or 53008.use or 53009.use or 53010.use or 53011.use or 53012.use or 53013.use or 53014.use or 53015.use or 53016.use begin if pc.get_map_index() == 113 then syschat("Zwierzaki s¹ zablokowane na Konkursie OX.") else local pet_info = pet_system.get_pet_info(item.vnum) pc.setqf("pet_item_id", item.get_id()) 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) pc.setqf("pet_vnum, 0") else if pet.count_summoned() < 1 or pc.is_gm() then pet.summon(mobVnum, " ".. petName, false) pc.setqf("pet_vnum", mobVnum) else syschat("Nie mo¿esz przywo³aæ kilku zwierzaków.") end if spawn_effect_file_name != nil then pet.spawn_effect(mobVnum, spawn_effect_file_name) end end end end end end end -- # --------------------------------------------- # -- # Questfile from Metin2SF by Ethoard # -- # --------------------------------------------- # quest pet_system begin state start begin function get_pet_info(itemVnum) pet_info_map = { [53001] = {34001, "Ognisty Feniks", 0}, [53002] = {34002, "Ma³y Reniferek", 0}, [53003] = {34003, "Lodowy Feniks", 0}, [53005] = {34004, "Azraeluœ ", 1}, [53006] = {34009, "Z³oty Azraeluœ ", 1}, [53007] = {34010, "Bambi", 0}, [53008] = {34011, "Knuud", 0}, [53009] = {34012, "Bao Bao", 0}, [53010] = {34008, "Leonidas", 0}, [53011] = {34007, "Ethan", 0}, [53012] = {34005, "Boczuœ ", 0}, [53013] = {34006, "Rufus", 0}, [53014] = {34021, "Kurczaczek", 0}, [53015] = {34017, "Polarny Boczuœ ", 0}, [53016] = {34015, "Kostek", 0}, } itemVnum = tonumber(itemVnum) return pet_info_map[itemVnum] end function get_spawn_effect_file(idx) effect_table = { [0] = nil, [1] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\npc2_appear.mse", } return effect_table [idx] end when login with pc.getqf("pet_vnum") != 0 begin if pc.get_map_index() == 113 then pet.unsummon(mobVnum) pc.setqf("pet_vnum, 0") else item.select(pc.getqf("pet_item_id")) pet.summon(mobVnum, " ".. petName, false) pc.setqf("pet_vnum", mobVnum) end end when 53001.use or 53002.use or 53003.use or 53005.use or 53006.use or 53007.use or 53008.use or 53009.use or 53010.use or 53011.use or 53012.use or 53013.use or 53014.use or 53015.use or 53016.use begin if pc.get_map_index() == 113 then syschat("Zwierzaki s¹ zablokowane na Konkursie OX.") else local pet_info = pet_system.get_pet_info(item.vnum) pc.setqf("pet_item_id", item.get_id()) 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) pc.setqf("pet_vnum, 0") else if pet.count_summoned() < 1 or pc.is_gm() then pet.summon(mobVnum, " ".. petName, false) pc.setqf("pet_vnum", mobVnum) else syschat("Nie mo¿esz przywo³aæ kilku zwierzaków.") end if spawn_effect_file_name != nil then pet.spawn_effect(mobVnum, spawn_effect_file_name) end end end end end end end Link to comment Share on other sites More sharing options...
Heathcliff 183 Posted January 28, 2019 Share Posted January 28, 2019 Hello! Try this -- # --------------------------------------------- # -- # Questfile from Metin2SF by Ethoard # -- # --------------------------------------------- # quest pet_system begin state start begin function get_pet_info(itemVnum) pet_info_map = { [53001] = {34001, "Ognisty Feniks", 0}, [53002] = {34002, "Ma3y Reniferek", 0}, [53003] = {34003, "Lodowy Feniks", 0}, [53005] = {34004, "Azraeluo ", 1}, [53006] = {34009, "Z3oty Azraeluo ", 1}, [53007] = {34010, "Bambi", 0}, [53008] = {34011, "Knuud", 0}, [53009] = {34012, "Bao Bao", 0}, [53010] = {34008, "Leonidas", 0}, [53011] = {34007, "Ethan", 0}, [53012] = {34005, "Boczuo ", 0}, [53013] = {34006, "Rufus", 0}, [53014] = {34021, "Kurczaczek", 0}, [53015] = {34017, "Polarny Boczuo ", 0}, [53016] = {34015, "Kostek", 0}, } itemVnum = tonumber(itemVnum) return pet_info_map[itemVnum] end function get_spawn_effect_file(idx) effect_table = { [0] = nil, [1] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\npc2_appear.mse", } return effect_table [idx] end when login with pc.getqf("pet_vnum") != 0 begin if pc.get_map_index() == 113 then pet.unsummon(mobVnum) pc.setqf("pet_vnum, 0") else item.select(pc.getqf("pet_item_id")) pet.summon(pc.getqf("pet_vnum"), "'s Pet", false) end end when 53001.use or 53002.use or 53003.use or 53005.use or 53006.use or 53007.use or 53008.use or 53009.use or 53010.use or 53011.use or 53012.use or 53013.use or 53014.use or 53015.use or 53016.use begin if pc.get_map_index() == 113 then syschat("Zwierzaki s1 zablokowane na Konkursie OX.") else local pet_info = pet_system.get_pet_info(item.vnum) pc.setqf("pet_item_id", item.get_id()) 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) pc.setqf("pet_vnum", 0) else if pet.count_summoned() < 1 then pet.summon(mobVnum, petName, false) pc.setqf("pet_vnum", mobVnum) else syschat("Nie moesz przywo3aa kilku zwierzaków.") end if spawn_effect_file_name != nil then pet.spawn_effect(mobVnum, spawn_effect_file_name) end end end end end end end Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now