Hi I've been trying all day to add attribute to monster loot, but I can't fix it -.- it keeps saying: "doItemSetAttribute Item not found".
I've tried this code (with registered addLoot in login.lua, and creaturescripts.xml, and event tag in rotworm.xml):
And I've tried this code (with registered kill.lua in login.lua, creaturescripts.xml):
Grateful for help !!
I've tried this code (with registered addLoot in login.lua, and creaturescripts.xml, and event tag in rotworm.xml):
Code:
function onDeath(cid, corpse, deathList)
item = doAddContainerItem(corpse, 2180, 1) // also tried corpse.uid
doItemSetAttribute(item, "description", "Hello")
return true
end
And I've tried this code (with registered kill.lua in login.lua, creaturescripts.xml):
Code:
//this code should add actionid 15321 to corpse, so corpse gives random rare item.
function event(x)
posit = x.posi
item = getThingFromPos({x = posit.x, y = posit.y, z = posit.z, stackpos = 255})
doItemSetAttribute(item, "aid", 15321)
end
function onKill(cid, target)
posi = getCreaturePosition(target)
local x = {target = target, posi = posi}
addEvent(event, 0, x)
return TRUE
end
Grateful for help !!