Jump to content

Unsummon Pet after teleport


Recommended Posts

How should I edit that quest to don't unsummon pet after teleport?


-- # --------------------------------------------- #
-- #  Questfile from Metin2SF by Terenzo  #
-- # --------------------------------------------- #

quest pet_system begin
    state start begin
        function get_pet_info(itemVnum)
            pet_info_map = {
                [53001] = {34001, "- Ognisty Feniks", 0},
                [53002] = {34002, "- Reniferek", 0},
                [53003] = {34003, "- Lodowy Feniks", 0},
                [53005] = {34004, "- Azraeluś ", 1},
                [53006] = {34027, "- Smoczek ", 1},
                [53007] = {34010, " - Bambi", 0},
                [53008] = {34011, "- Knuud", 0},
                [53009] = {34012, "- Bao Bao", 0},
                [53010] = {34008, "- Lwiątko", 0},
                [53011] = {34007, "- Tygrysek", 0},
                [53012] = {34005, "- Świnka ", 0},
                [53013] = {34006, "- Piesek", 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 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 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)
                else
                    if pet.count_summoned() < 1 or pc.is_gm() then
                        pet.summon(mobVnum, " ".. petName, false)
                    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

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Premium

That's not quest-sided.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.