demon088
#088 in the Horde
Hello again OtLand!
I've been working on mixing systems that gives you random equipment using an item and obtained items could be improved like this post from @zbizu - https://otland.net/threads/tfs-1-1-random-item-stats.228990. This system works giving creature loots with items that can be "rare" or anything else with aditional attributes like def +15%. This system is totally working for me on TFS 1.2 and I wanted to add another way to obtain rare items not only by looting them, but quests or this item action.
This code is an action of an item capable of give you random items:
I've been trying to mix both systems but I think I'm not enough experienced for making such system works. I'd be thankful if you could help me with this and I'd be happy to share this system with the OtLand community!
I've been working on mixing systems that gives you random equipment using an item and obtained items could be improved like this post from @zbizu - https://otland.net/threads/tfs-1-1-random-item-stats.228990. This system works giving creature loots with items that can be "rare" or anything else with aditional attributes like def +15%. This system is totally working for me on TFS 1.2 and I wanted to add another way to obtain rare items not only by looting them, but quests or this item action.
This code is an action of an item capable of give you random items:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doSendMagicEffect(getPlayerPosition(cid), 31)
local RANDOM_ITEM = {7903, 24429, 2488, 7891}
local randomChance = math.random(2, #RANDOM_ITEM)
doPlayerAddItem(cid, RANDOM_ITEM[randomChance], 1)
doRemoveItem(item.uid, 1)
return true
end