Jump to content

Change Lua drop to Locale_Name


Recommended Posts

  • Premium

Hey helpers! ^_^:o

I have this system running on my server, but he's getting the ID of the mob.
It's possible to get the ID using Locale_Name from mob_proto table?

TIP: Really? It's to do something with the wiki from the oficial's...

dofile("/usr/home/game/share/locale/germany/droplist.lua")

function drop(self)
    if dropList[self].typ == "limit" then
        if dropList[self].min_level == nil or dropList[self].max_level == nil then return end
        if dropList[self].min_level > pc.level or dropList[self].max_level < pc.level then return end
        local chance,count
        table.foreach(dropList[self].dropps, function(i)
            if dropList[self].dropps[3] ~= nil then
                chance = dropList[self].dropps[3]
            else
                chance = 100
            end
            if dropList[self].dropps[2] ~= nil then
                count = dropList[self].dropps[2]
            else
                count = 1
            end
            if math.random(1, 100) < chance then
                game.drop_item_with_ownership(dropList[self].dropps[1], count)
            end
        end)
    elseif dropList[self].typ == "drop" then
        local chance,count
        table.foreach(dropList[self].dropps, function(i)
            if dropList[self].dropps[3] ~= nil then
                chance = dropList[self].dropps[3]
            else
                chance = 100
            end
            if dropList[self].dropps[2] ~= nil then
                count = dropList[self].dropps[2]
            else
                count = 1
            end
            if math.random(1, 100) < chance then
                game.drop_item_with_ownership(dropList[self].dropps[1], count)
            end
        end)
    else
        return
    end
end

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.