Aeronx
Intermediate OT User
- Joined
- Dec 17, 2015
- Messages
- 746
- Solutions
- 9
- Reaction score
- 125
Hello everybody!
I've been searching, testing and trying to do magic to solve this, but i dont find an answer.
I have this script:
Which works and all BUT the items like gold coins, platinum coints, etc, they dont stack. No action id, nothing different so far, but they dont stack.
I've checked github since there are "stack" fixes for sources there, but my sources have it implemented already, so i dont really know whats going on here.
Any idea?
Thank you for your time!
I've been searching, testing and trying to do magic to solve this, but i dont find an answer.
I have this script:
Code:
function onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
if not creature then
return true
end
if not creature:getType():getLoot() then
return true
end
local tc = 0
for i, k in pairs(creature:getType():getLoot()) do
tc = tc + k.chance
end
local BONUS_RATE = 2 -- 1 normal loot, 2 double loot etc
for i = 1, BONUS_RATE do
for i, k in pairs(creature:getType():getLoot()) do
if math.random(100) < killer:getStorageValue(88893) then
local item = corpse:addItem(k.itemId,math.random(k.maxCount) or k.subType)
if item then
if k.actionId and k.actionId ~= -1 then item:setActionId(k.actionId) end
if k.text then item:setAttribute(ITEM_ATTRIBUTE_TEXT, k.text) end
end
end
end
end
return true
end
Which works and all BUT the items like gold coins, platinum coints, etc, they dont stack. No action id, nothing different so far, but they dont stack.
I've checked github since there are "stack" fixes for sources there, but my sources have it implemented already, so i dont really know whats going on here.
Any idea?
Thank you for your time!