Jelly 0 Report post Posted May 30, 2016 hi guys is there a way to add a drop into all monsters without adding it to every monster in characterinfo? if there is can someone help me? ty Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted May 30, 2016 .txt are loaded by GS at the beginning and becomes static throughout the execution of program. So ideally, this is not possible. People often go to Check_Baoliao(), but this is a mere calculator. Quote Share this post Link to post Share on other sites
Onioni 58 Report post Posted May 30, 2016 45 minutes ago, Jelly said: hi guys is there a way to add a drop into all monsters without adding it to every monster in characterinfo? if there is can someone help me? ty I think one way u can use is to add it in function GetExp_New(dead , atk ) and then just add the item to give in inventory... but that way it wont drop then on floor.. Quote Download: Nightmare Demonic Helm Dimension Pirates Online files: get now New map Project: Flag PK Black Skin 3.1.3 for pko 1: Get now Share this post Link to post Share on other sites
Billy 164 Report post Posted May 30, 2016 (edited) You could try giving the monster an item when it is killed, idk if it would drop it though. I know if you give a monster an item and then kill it then it drops. Edited May 30, 2016 by 7n6 Quote Share this post Link to post Share on other sites
Billy 164 Report post Posted May 30, 2016 (edited) GlobalDrops = {Enabled = true} GlobalDrops.GlobalItems = { {ID = 1, Amount = 2, Chance = 1},--These items drop from all non-players {ID = 2, Amount = 3, Chance = 1},--These items drop from all non-players {ID = 3, Amount = 4, Chance = 1},--These items drop from all non-players } GlobalDrops.MobItems = { [185] = { --These items only drop from mystic flowers(ID 185). {ID = 7, Amount = 2, Chance = 1},--These items only drop from mystic flowers(ID 185). {ID = 8, Amount = 7, Chance = 1},--These items only drop from mystic flowers(ID 185). {ID = 9, Amount = 5, Chance = 1},--These items only drop from mystic flowers(ID 185). }, --These items only drop from mystic flowers(ID 185). [885] = { --These items only drop from BD phyliss(ID 885). {ID = 12, Amount = 2, Chance = 1},--These items only drop from BD phyliss(ID 885). {ID = 83, Amount = 7, Chance = 1},--These items only drop from BD phyliss(ID 885). {ID = 96, Amount = 5, Chance = 1},--These items only drop from BD phyliss(ID 885). }, } function GlobalDrops.Drop(role,array) for i,v in pairs(array) do if Percentage_Random(v.Chance) == 1 then GiveItem(role,0,v.ID,v.Amount,4) RemoveChaItem( role , v.ID , v.Amount , 2 , -1, 0 , 1 ) end end end function GlobalDrops.Check(DEFER,ATKER) if GlobalDrops.Enabled ~= true then return true end if GetChaTypeID( DEFER ) > 4 then GlobalDrops.Drop(DEFER,GlobalDrops.GlobalItems) end local array = GlobalDrops.MobItems[GetChaTypeID( DEFER )] if array ~= nil then GlobalDrops.Drop(DEFER,array) end end Hook:AddPreHook("GetExp_PKM",GlobalDrops.Check) You could use this as a base, just note that items will be protected for a few seconds after dropping. Change Chance if you want to adjust rates. 0.5 = 50%, 1 = 100%, 0.1 = 10% etc Edited May 30, 2016 by 7n6 Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted May 30, 2016 good concept! But as I mentioned above, Check_Baoliao is only a calculator, if you are targeting monster's to forcefully drop items, the better function to hook is GetExp_PKM. 1 Quote Share this post Link to post Share on other sites
Jelly 0 Report post Posted May 30, 2016 @7n6 thank you! will this make the monster drop it or will it give the item to the player when its killed? thx! Quote Share this post Link to post Share on other sites
Billy 164 Report post Posted May 30, 2016 it makes the monster drop it, but the player cant loot for a few seconds until protection wears off. Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted May 30, 2016 There is a function which drops item from role. I don't remember its name. I will try find out it tomorrow 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