/// <summary> /// called when spell effect has to be started and applied to targets /// </summary> public override bool StartSpell(GameLiving target) { if (target == null) { return(false); } if (m_maxTick >= 0) { m_maxTick = (Spell.Pulse > 1)?Spell.Pulse:1; m_currentTick = 1; m_currentSource = target; } int ticksToTarget = m_currentSource.GetDistanceTo(target) * 100 / 85; // 85 units per 1/10s int delay = 1 + ticksToTarget / 100; foreach (GamePlayer player in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) { player.Out.SendSpellEffectAnimation(m_currentSource, target, m_spell.ClientEffect, (ushort)(delay), false, 1); } BoltOnTargetAction bolt = new BoltOnTargetAction(Caster, target, this); bolt.Start(1 + ticksToTarget); m_currentSource = target; m_currentTick++; return(true); }
private void DealDamage(GameLiving target) { int ticksToTarget = m_caster.GetDistanceTo(target) * 100 / 85; // 85 units per 1/10s int delay = 1 + ticksToTarget / 100; foreach (GamePlayer player in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) { player.Out.SendSpellEffectAnimation(m_caster, target, m_spell.ClientEffect, (ushort)(delay), false, 1); } BoltOnTargetAction bolt = new BoltOnTargetAction(Caster, target, this); bolt.Start(1 + ticksToTarget); }
/// <summary> /// called when spell effect has to be started and applied to targets /// </summary> public override bool StartSpell(GameLiving target) { if (target == null) return false; if (m_maxTick >= 0) { m_maxTick = (Spell.Pulse > 1) ? Spell.Pulse : 1; m_currentTick = 1; m_currentSource = target; } int ticksToTarget = m_currentSource.GetDistanceTo(target) * 100 / 85; // 85 units per 1/10s int delay = 1 + ticksToTarget / 100; foreach (GamePlayer player in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) { player.Out.SendSpellEffectAnimation(m_currentSource, target, m_spell.ClientEffect, (ushort)(delay), false, 1); } BoltOnTargetAction bolt = new BoltOnTargetAction(Caster, target, this); bolt.Start(1 + ticksToTarget); m_currentSource = target; m_currentTick++; return true; }