Jump to content
×
×
  • Create New...
  • 0

Pet Quest


damcej

Question

Don't work this quest, pls help.

 

	quest nowe_pety begin
    state start begin
        function get_pet_info(itemVnum)
            pet_info_map = {
                [1500] = {33011, "Misio", 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 1500.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
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0

Try this one:

quest nowe_pety begin
    state start begin
    
        function get_pet_info(itemVnum)
        
            local pet_info_map = {
                [1500] = {33011, "Misio", 0}
            }
            return pet_info_map[tonumber(itemVnum)]
            
        end
        
        function get_spawn_effect_file(idx)
            local effect_table = {
                [0] = nil,
                [1] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\npc2_appear.mse"
            }
            return effect_table [idx]
        end
        
        when 1500.use begin 
        
            local pet_info = pet_system.get_pet_info(item.get_vnum())
            
            if nil != 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 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


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.