Jump to content

Drop table


Go to solution Solved by Denis,

Recommended Posts

  • Solution

Here is one quest with table:

quest hdf begin
    state start begin
        function ab()
            local ju = {
                --mob-id--min-level--max-level---item-count---percentage---item-id's----percentage change per level
                {101,     1,         10,             3,        50,30,20,    19, 20, 21,        1},
            }
            return ju
        end
        when kill with not npc.is_pc() begin
            local boni,lck,per,luck,bsp = 0,0,0,0,hdf.ab()
            for i = 1, table.getn(bsp)+1, 1 do
                if npc.get_race() == bsp[i][1] then
                    if pc.get_level() >= bsp[i][2] and pc.get_level() <= bsp[i][3] then
                        boni = (bsp[i][2] - pc.get_level()) * (-1)
                        boni = boni * bsp[i][bsp[i][4]*2+5]
                        luck = number(1,bsp[i][4])
                        luck = luck + 4 + bsp[i][4]
                        lck = luck - bsp[i][4]
                        per = 100 - bsp[i][lck] + boni
                        lck = number(1,100)
                        if lck > per then
                            pc.give_item2(bsp[i][luck], 1)
                        end
                    end
                end
            end
        end
    end
end  
  • Metin2 Dev 1
  • Love 2
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.