local config = {
monsters = {
['Demon'] = {}
}
}
function onUse(cid, item, fromPosition, itemEx, topos)
local summons = getCreatureSummons(cid)
for _, summoned in ipairs(summons) do
if config.monsters[getCreatureName(summoned)] then
doRemoveCreature(summoned)
return true
end
end
if(getTilePzInfo(getCreaturePosition(cid)) == true) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't summon in pz.")
return true
end
if table.maxn(getCreatureSummons(cid)) <= 0 then -- ändra till max antalet summons
doSummonMonster(cid, "Demon")
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You already have a summon.")
end
return true
end