Blasphemy
Well-Known Member
- Joined
- Jan 5, 2012
- Messages
- 387
- Reaction score
- 67
Get it!Its a "reverse" loop, iterates from the last slot to the first slot of the container
thanksss
I have an issue here..
The thing is that this function works great, but it only scan the main container (dead body) but if the monster drops a bag with items inside, the code doesnt recognizes and ignores them... is there anyway to get the code to read the items inside the bag, inside the main corpse?
Lua:
if corpse:getType():isCorpse() and corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == cid then
for a = corpse:getSize() - 1, 0, -1 do
local containerItem = corpse:getItem(a)
local insideBag = ???????
if containerItem then
for b = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
if player:getStorageValue(b) == containerItem:getId() and player:getStorageValue(b) == insideBag:getId() then
containerItem:moveTo(player)
end
end
end
end
end
I was trying to index a local, but I cant get it because I dont know how to code