BboyChaos
Member
- Joined
- May 20, 2014
- Messages
- 10
- Reaction score
- 7
Causes targeted monster to aggro the players summon.
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
function onCastSpell(cid, var)
local player = Player(cid)
local player_summon = Player(cid):getSummons()
if not next(player_summon) then
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:sendCancelMessage("You don't have any summons.")
return false
end
for i = 1, #player_summon, +1
do
doChallengeCreature(player_summon[i], player:getTarget())
player_summon[i]:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
player:getTarget():getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
return true
end
return doCombat(cid, combat, var)
end