MrAkroMenToS 0 Posted August 23, 2014 Share Posted August 23, 2014 I have head about this a couple times. How can i do this? I want to make a table in database which contains the drops. (basically i dont want to suffer with writing the drop in txt stuff) Link to comment Share on other sites More sharing options...
Solution Denis 1474 Posted August 23, 2014 Solution Share Posted August 23, 2014 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 1 2 Link to comment Share on other sites More sharing options...
MrAkroMenToS 0 Posted August 23, 2014 Author Share Posted August 23, 2014 Thank you very much! I will use this one! One more question! I would like the mob drop items to player to the ground with the name on it. How? Link to comment Share on other sites More sharing options...
Denis 1474 Posted August 23, 2014 Share Posted August 23, 2014 Replace pc.give_item2(bsp[luck],1) with game.drop_item_with_ownership(bsp[luck],1) 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now