local combat = Combat()
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, true)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
local function resetGroup(cid)
local player = Player(cid)
if not player then
return
end
player:setGroup(Group(1))
end
local function sendEffects(cid)
local player = Player(cid)
if not player then
return
end
if player:getGroup():getId() == 4 then
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
addEvent(sendEffects, 1000, cid)
end
end
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
player:setGroup(Group(4))
addEvent(resetGroup, 5000, player:getId())
sendEffects(player:getId())
return combat:execute(creature, variant)
end
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, true)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
local function resetGroup(cid)
local player = Player(cid)
if not player then
return
end
player:setGroup(Group(1))
end
local function sendEffects(cid)
local player = Player(cid)
if not player then
return
end
if player:getGroup():getId() == 4 then
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
addEvent(sendEffects, 1000, cid)
end
end
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
player:setGroup(Group(4))
addEvent(resetGroup, 5000, player:getId())
sendEffects(player:getId())
return combat:execute(creature, variant)
end