Jump to content

Recommended Posts

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
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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