tenta assim
arrumado
local conf = {
summon = {"Comander", "Comander", "Comander", "Comander"}, -- nome dos 4 monstros que irão aparecer.
min = 350, -- dano minimo de cada SD
max = 450, -- dano maximo de cada SD
hits = 1, -- qntos hits cada summon vai dar
exhaustionInSeconds = 50, -- segundos de exausted
storage = 34534 -- storage(não mexa)
}
local summon = {
monster = function (cid, tab, k)
for _, mid in pairs(tab) do
s = doSummonCreature(mid, getThingPos(k))
doSendMagicEffect(getThingPos(s), 10)
doConvinceCreature(cid, s)
end
end,
attack = function (cid, target, min, max)
for _, summon in pairs(getCreatureSummons(cid)) do
if isCreature(target) and isCreature(summon) then
doSendDistanceShoot(getThingPos(summon), getThingPos(target), CONST_ANI_SUDDENDEATH)
doAreaCombatHealth(summon, COMBAT_DEATHDAMAGE, getThingPos(target), 0, -min, -max, CONST_ME_MORTAREA)
end
end
end,
remove = function (cid)
for _, summon in pairs(getCreatureSummons(cid)) do
if isCreature(summon) then
doRemoveCreature(summon)
end
end
end,
}
function onCastSpell(cid, var)
if(exhaustion.check(cid, conf.storage) == TRUE) then
doPlayerSendCancel(cid, "You can only use after [" .. exhaustion.get(cid, 34534).."] seconds.")
return false
end
local target = getCreatureTarget(cid)
if target then
summon.monster(cid, conf.summon, target)
for i = 1, conf.hits do
addEvent(summon.attack, 1000 * i, cid, target, conf.min, conf.max)
end
addEvent(summon.remove, conf.hits * 1000 + 1000, cid)
end
exhaustion.set(cid, conf.storage, conf.exhaustionInSeconds)
return true
end




info
Grupo: Campones
Registrado: 01/06/08
Posts: 45
Reputação: 0
Então, tenho essa magia que faz o seguinte, summona 4 bichos envolta da pessoa, dá um hit e somem:
local conf = {
summon = {"Comander", "Comander", "Comander", "Comander"}, -- nome dos 4 monstros que irão aparecer.
min = 350, -- dano minimo de cada SD
max = 450, -- dano maximo de cada SD
hits = 1, -- qntos hits cada summon vai dar
exhaustionInSeconds = 50, -- segundos de exausted
storage = 34534 -- storage(não mexa)
}
local summon = {
monster = function (cid, tab)
for _, mid in pairs(tab) do
s = doSummonCreature(mid, getThingPos(cid))
doSendMagicEffect(getThingPos(s), 10)
doConvinceCreature(cid, s)
end
end,
attack = function (cid, target, min, max)
for _, summon in pairs(getCreatureSummons(cid)) do
if isCreature(target) and isCreature(summon) then
doSendDistanceShoot(getThingPos(summon), getThingPos(target), CONST_ANI_SUDDENDEATH)
doAreaCombatHealth(summon, COMBAT_DEATHDAMAGE, getThingPos(target), 0, -min, -max, CONST_ME_MORTAREA)
end
end
end,
remove = function (cid)
for _, summon in pairs(getCreatureSummons(cid)) do
if isCreature(summon) then
doRemoveCreature(summon)
end
end
end,
}
function onCastSpell(cid, var)
if(exhaustion.check(cid, conf.storage) == TRUE) then
doPlayerSendCancel(cid, "You can only use after [" .. exhaustion.get(cid, 34534).."] seconds.")
return false
end
local target = getCreatureTarget(cid)
if target then
summon.monster(cid, conf.summon)
for i = 1, conf.hits do
addEvent(summon.attack, 1000 * i, cid, target, conf.min, conf.max)
end
addEvent(summon.remove, conf.hits * 1000 + 1000, cid)
end
exhaustion.set(cid, conf.storage, conf.exhaustionInSeconds)
return true
end
Gostaria que alguém colocasse essa magia para summonar envolta do target, da seguinte forma:
Legenda:
2 = target
1 = summons
{1, 0, 1},
{0, 2, 0},
{1, 0, 1}
Agradeço desde já
Editado Março 13 por luakao