item que vai summonar o monstro:
local summon = {
["Dragon"] = {1},
}
local config = {
tempo = 3, -- exausted para usar o item
storage = 28992,
}
function onUse(cid, item)
sm = getCreatureSummons(cid)
if #sm > 0 then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendTextMessage(cid, 25, "Seu monstro ainda esta vivo!")
return true
end
for l, m in pairs(summon) do
if getPlayerStorageValue(cid, config.storage) < os.time() and sm then
setPlayerStorageValue(cid, config.storage, os.time() + config.tempo)
doConvinceCreature(cid, doSummonCreature(l, getCreaturePosition(cid)))
doCreatureSay(cid, "Vai Dragon!!", 1)
doSendMagicEffect(getThingPos(cid), 12)
break
else
doPlayerSendTextMessage(cid, 25, "Espere para usar novamente!")
doSendMagicEffect(getThingPos(cid), 2)
end
end
end
Item que vai remover o monstro :
function onUse(cid, item)
sm = getCreatureSummons(cid)
if sm then
for n, p in ipairs(sm) do
doRemoveCreature(p)
doSendMagicEffect(getThingPos(cid), 28)
doCreatureSay(cid, "Volta Dragon!!", 1)
doPlayerSendTextMessage(cid, 25, "Seu monstro foi removido!")
end
return true
end
end
Actions.xml
<action itemid="item_id" script="remover.lua"/>
<action itemid="item_id" script="criar.lua"/>