queria saber se voces conseguem misturar essas 2 scripts de trap/summon, queria que quando lançasse o trap, tambem summonar 3 monstros dentro da area da trap e tudo sumir em 10 segundos, incluindo os summons
script da trap que eu uso
local c = {
trapId = 1497, -- id do trap
trapTime = 10, -- tempo do trap em segundos
exhaustStorage = 34914, -- storage do exhausted
exhaustTime = 40 -- tempo do exhausted em segundos
}
local trap = createCombatObject()
setCombatArea(trap, createCombatArea({
{1,1,1,1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,2,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,1},
{1,1,1,1,1,1,1,1,1,1,1}
}))
function onTargetTile(cid, pos)
doCreateItem(c.trapId, 1, pos)
addEvent(function()
local thing = getTileItemById(pos, c.trapId).uid
if(thing ~= 0) then
doRemoveItem(thing)
end
end, c.trapTime * 1000)
end
setCombatCallback(trap, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
local target = variantToNumber(var)
if(isPlayer(cid)) then
if(math.max(0, (exhaustion.get(cid, c.exhaustStorage) or 0)) > 0) then
doPlayerSendCancel(cid, "You are exhausted. Wait " .. exhaustion.get(cid, c.exhaustStorage) .. " second" .. (exhaustion.get(cid, c.exhaustStorage) > 1 and "s" or "") .. ".")
return false
else
exhaustion.set(cid, c.exhaustStorage, c.exhaustTime)
end
end
doCombat(cid, trap, var)
return true
end
script do summon que eu tenho
function onCastSpell(cid, var)
local t = {
storage = ??????, --poe numero de storage aqui que não tenha no servidor
time = 1, --tempo em minutos sem poder usar dinovo
quant = 1, -- quantidade de monstros sumonados
summon = "", -- poe name aki
nMin = 1, -- tempo em minutos aqui da creatura sumir
effect = CONST_ME_MAGIC_RED
}
if exhaustion.check(cid, t.storage) == false then
if(#getCreatureSummons(cid) < t.quant)then
exhaustion.set(cid, t.storage, t.time*60*1000)
local mons = doSummonMonster(cid, t.summon)
doConvinceCreature(cid,mons)
addEvent(doRemoveCreature, t.nMin * 60 *1000, mons)
doSendMagicEffect(getCreaturePosition(mons), t.effect)
else
doPlayerSendTextMessage(cid, 27, "Você já tem criatura summonada")
end
else
return doPlayerSendCancel(cid, "Pode Summonar outro em: " ..exhaustion.get(cid, t.storage).."segundos.")
end
return true
end