I try to use this script:
Owner: Delusion
But doesn't work, i put this script at login.lua and creaturescript xml corret ?
Owner: Delusion
But doesn't work, i put this script at login.lua and creaturescript xml corret ?
Code:
local rareItems = {1111, 2222, 3333}
local function scanRareItems(name, pos)
local corpse = Tile(pos):getTopDownItem()
for i = corpse:getSize()-1, 0, -1 do
local item = corpse:getItem(i)
if isInArray(rareItems, item:getId()) then
Game.broadcastMessage(("%s has looted a %d %s!"):format(name, item:getCount(), item:getCount() > 1 and ItemType(item:getId()):getPluralName() or item:getName()))
return
end
end
end
function onKill(creature, target)
if creature:isPlayer() and target:isMonster() then
addEvent(scanRareItems, 0, creature:getName(), target:getPosition())
end
return true
end
Last edited: