Boa Tarde a todos estou com um problema em uma magia de sumonar um monstro,
criei uma magia que o player sumona um monstro no caso ai "azerus" e o no lugar do monstro atacar o target ele ataca o player q sumonou, alguem pode me ajudar?
function onTargetTile(cid, position)
position.stackpos = 255
doConvinceCreature(cid, doCreateMonster("azerus", position, false))
doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
return true
end
local arr = {
{1, 0, 1},
{0, 2, 0},
{1, 0, 1},
}
local removeTime = 1.0 --time to remove the clones
local function removeCreatures(cid, creature)
if isCreature(creature) == TRUE then
doRemoveCreature(creature)
end
end
function onTargetTile(cid, pos)
local creature = doSummonCreature("azerus", pos)
doCreatureAddMana(cid, -1500)
doCreatureSay(cid, "Utevo", TALKTYPE_ORANGE_1)
doConvinceCreature(cid, creature)
addEvent(removeCreatures, removeTime * 1000, cid, creature)
return TRUE
end
local area, combat = createCombatArea(arr), createCombatObject()
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
<instant name="Utevo" words="utevo" lvl="400" mana="1600" prem="0" exhaustion="1200" selftarget="0" needlearn="0" script="attack/Utevo.lua">
<vocation name="Master Sorcerer"/>
<vocation name="Elder Druid"/>
<vocation name="Master Sorcerer (VIP)"/>
<vocation name="Elder Druid (VIP)"/>
</instant>