Então... estou com essa magia aqui e não consegui colocar ela para funcionar somente se o player estiver com algum target, antes que venham falar para eu colocar needtarget="1" no spells.xml, eu ja fiz isso e não deu...
Essa é a magia:
local conf = {
summon = {"Headcaptor", "Headcaptor", "Headcaptor", "Headcaptor"}, -- nome dos 4 monstros que irão aparecer.
min = 500, -- dano minimo de cada SD
max = 550, -- 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, 200 * i, cid, target, conf.min, conf.max)
end
addEvent(summon.remove, conf.hits * 500 + 500, cid)
end
exhaustion.set(cid, conf.storage, conf.exhaustionInSeconds)
return true
end
Quando eu solto ela sem target, aparece a magia no default, gasta mana e da alguns erros no distro:
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaGetThingPosition) Thing not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaGetThingPosition) Thing not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaDoConvinceCreature) Creature not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaGetThingPosition) Thing not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaGetThingPosition) Thing not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaDoConvinceCreature) Creature not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaGetThingPosition) Thing not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaGetThingPosition) Thing not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaDoConvinceCreature) Creature not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaGetThingPosition) Thing not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell
[14/03/2012 13:51:50] Description:
[14/03/2012 13:51:50] (luaGetThingPosition) Thing not found
[14/03/2012 13:51:50] [Error - Spell Interface]
[14/03/2012 13:51:50] data/spells/scripts/edits/utevo mort.lua:onCastSpell