Shrek 0 Report post Posted October 14, 2017 Can someone help me make A Monster / Boss whatever ( just 1 of them ), After killing it, it gives an item directly to player's invertory ( but not always, with a %, sometimes it gives sometimes it doesnt ). Quote Share this post Link to post Share on other sites
iZae 55 Report post Posted October 14, 2017 (edited) go into exp_and_level.lua and find the function GetExp_PKM somewhere inside of it add local dead_id = GetChaID(dead) if dead_id == XXXX then local rand = math.random(1,100) if rand < 60 then GiveItem ( atk , 0 , ItemID , Qt , Ql ) else BickerNotice ( atk, "You weren't lucky enough. Keep trying!") end end changin XXXX for the boss/monster Id, ItemID item's id, Qt for the quantity, Ql for the quality and 60 for the desired % of success rate. Edited October 14, 2017 by iZae 3 Quote Share this post Link to post Share on other sites
Shrek 0 Report post Posted October 14, 2017 (edited) @iZae can you give me an example also if i want to use 3 mobs for the same item ( the item is random still ) This would work? if dead_id == XXXX and if dead_id == XXXX and if dead_id == XXXX then or this: if dead_id == XXXX or if dead_id == XXXX or if dead_id == XXXX then Edited October 14, 2017 by Shrek Quote Share this post Link to post Share on other sites
iZae 55 Report post Posted October 14, 2017 40 minutes ago, Shrek said: @iZae can you give me an example also if i want to use 3 mobs for the same item ( the item is random still ) This would work? if dead_id == XXXX and if dead_id == XXXX and if dead_id == XXXX then or this: if dead_id == XXXX or if dead_id == XXXX or if dead_id == XXXX then you have to use "OR". it is physically impossible to get more than 1 id every time you kill a mob, so "if id=... and id= ..." would be senseless. Quote Share this post Link to post Share on other sites
Syntax 28 Report post Posted October 14, 2017 (edited) local dead_id = GetChaID(dead) local mob = {} mob[111] = {ItemDrop = 3457, Quantity = 1, Quality = 4, Rate = 0.1} --10% drop mob[112] = {ItemDrop = 3457, Quantity = 1, Quality = 4, Rate = 0.2} --20% drop if mob[dead_id] ~= nil then if Percentage_Random(mob[dead_id].Rate) == 1 then GiveItem ( atk, 0, mob[dead_id].ItemDrop, mob[dead_id].Quantity , mob[dead_id].Quality) end end Edited October 14, 2017 by Syntax 5 Quote Share this post Link to post Share on other sites
V3ct0r 2,116 Report post Posted October 21, 2017 В 14.10.2017 в 17:29, Shrek сказал: @iZae can you give me an example also if i want to use 3 mobs for the same item ( the item is random still ) This would work? if dead_id == XXXX and if dead_id == XXXX and if dead_id == XXXX then or this: if dead_id == XXXX or if dead_id == XXXX or if dead_id == XXXX then if dead_id == XXXX or dead_id == XXXX or dead_id == XXXX then -- Give Items end Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites