local config = {
monsters = {
['Demon'] = {}
}
}
function onCastSpell(cid, var)
if isMonster(getTopCreature(var.pos).uid) then
if config.monsters[getCreatureName(getTopCreature(var.pos).uid)] then
if math.random(10) == 1 then
local container = doPlayerAddItem(cid, 2299)-- change to right itemid
doItemSetAttribute(container, "description", "It contains a " .. getCreatureName(getTopCreature(var.pos).uid) .. ".")
doRemoveCreature(getTopCreature(var.pos).uid)
doPlayerRemoveItem(cid, ITEMID, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "sorry you failed.") -- remove if you want
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you cant use with this animal.") -- remove if you want
return false
end
end
return true