OnCast() public abstract method

public abstract OnCast ( ) : void
return void
Example #1
0
            protected override void OnTick()
            {
                if (m_Spell.State == SpellState.Casting && m_Spell.Caster.Spell == m_Spell)
                {
                    m_Spell.State       = SpellState.Sequencing;
                    m_Spell.m_CastTimer = null;
                    m_Spell.Caster.OnSpellCast(m_Spell);
                    m_Spell.Caster.Region.OnSpellCast(m_Spell.Caster, m_Spell);
                    m_Spell.Caster.NextSpellTime = DateTime.UtcNow + m_Spell.GetCastRecovery();                     // Spell.NextSpellDelay;
                    if (!m_Spell.m_Caster.Deleted && m_Spell.m_Caster.NetState != null && m_Spell.m_Caster is BaseCreature)
                    // pseudoseer controlled
                    {
                        m_Spell.m_Caster.NextSpellTime += ((BaseCreature)m_Spell.m_Caster).Pseu_SpellDelay;
                    }

                    Target originalTarget = m_Spell.Caster.Target;

                    m_Spell.OnCast();

                    if (m_Spell.Caster.Player && m_Spell.Caster.Target != null && m_Spell.Caster.Target != originalTarget)
                    {
                        m_Spell.Caster.Target.BeginTimeout(m_Spell.Caster, TimeSpan.FromSeconds(30.0));
                    }

                    m_Spell.m_CastTimer = null;
                }
            }
Example #2
0
            protected override void OnTick()
            {
                if (m_Spell.State == SpellState.Casting && m_Spell.Caster.Spell == m_Spell)
                {
                    m_Spell.State       = SpellState.Sequencing;
                    m_Spell.m_CastTimer = null;
                    m_Spell.Caster.OnSpellCast(m_Spell);
                    m_Spell.Caster.Region.OnSpellCast(m_Spell.Caster, m_Spell);
                    m_Spell.Caster.NextSpellTime = DateTime.UtcNow + m_Spell.GetCastRecovery();

                    Target originalTarget = m_Spell.Caster.Target;

                    m_Spell.Caster.TargetLocked = true;
                    m_Spell.OnCast();

                    if (m_Spell.Caster.Player && m_Spell.Caster.Target != originalTarget && m_Spell.Caster.Target != null)
                    {
                        if (m_Spell.MacroTarget != null)
                        {
                            m_Spell.Caster.Target.Invoke(m_Spell.Caster, m_Spell.MacroTarget);
                        }
                        else
                        {
                            m_Spell.Caster.Target.BeginTimeout(m_Spell.Caster, TimeSpan.FromSeconds(30.0));
                        }
                    }

                    m_Spell.Caster.TargetLocked = false;
                    m_Spell.m_CastTimer         = null;
                }
            }
Example #3
0
            protected override void OnTick()
            {
                if (m_Spell == null || m_Spell.m_Caster == null)
                {
                    return;
                }
                else if (m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell)
                {
                    m_Spell.m_State     = SpellState.Sequencing;
                    m_Spell.m_CastTimer = null;
                    m_Spell.m_Caster.OnSpellCast(m_Spell);
                    if (m_Spell.m_Caster.Region != null)
                    {
                        m_Spell.m_Caster.Region.OnSpellCast(m_Spell.m_Caster, m_Spell);
                    }
                    m_Spell.m_Caster.NextSpellTime = Core.TickCount + (int)m_Spell.GetCastRecovery().TotalMilliseconds;
                    // Spell.NextSpellDelay;

                    Target originalTarget = m_Spell.m_Caster.Target;

                    m_Spell.OnCast();

                    if (m_Spell.m_Caster.Player && m_Spell.m_Caster.Target != originalTarget && m_Spell.Caster.Target != null)
                    {
                        m_Spell.m_Caster.Target.BeginTimeout(m_Spell.m_Caster, TimeSpan.FromSeconds(30.0));
                    }

                    m_Spell.m_CastTimer = null;
                }
            }
Example #4
0
            protected override void OnTick()
            {
                if (m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell)
                {
                    m_Spell.m_State     = SpellState.Sequencing;
                    m_Spell.m_CastTimer = null;
                    m_Spell.m_Caster.OnSpellCast(m_Spell);
                    m_Spell.m_Caster.Region.OnSpellCast(m_Spell.m_Caster, m_Spell);
                    m_Spell.m_Caster.NextSpellTime = DateTime.Now + m_Spell.GetCastRecovery();// Spell.NextSpellDelay;

                    Target originalTarget = m_Spell.m_Caster.Target;

                    m_Spell.OnCast();

                    if (m_Spell.m_Caster.Player && m_Spell.m_Caster.Target != originalTarget && m_Spell.Caster.Target != null)
                    {
                        m_Spell.m_Caster.Target.BeginTimeout(m_Spell.m_Caster, TimeSpan.FromSeconds(30.0));
                    }

                    #region GeNova: KR Supports
                    if (m_Spell.Targeted != null && m_Spell.Targeted is Mobile)
                    {
                        m_Spell.Caster.Target.Invoke(m_Spell.Caster, m_Spell.Targeted);
                        m_Spell.m_Caster.NetState.Send(CancelTarget.Instance);
                    }
                    #endregion

                    m_Spell.m_CastTimer = null;
                }
            }
Example #5
0
            protected override void OnTick()
            {
                if (m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell)
                {
                    m_Spell.m_State     = SpellState.Sequencing;
                    m_Spell.m_CastTimer = null;
                    m_Spell.m_Caster.OnSpellCast(m_Spell);
                    m_Spell.m_Caster.Region.OnSpellCast(m_Spell.m_Caster, m_Spell);
                    m_Spell.m_Caster.NextSpellTime = DateTime.Now.Ticks + m_Spell.GetCastRecovery().Ticks;                    // Spell.NextSpellDelay;

                    Target originalTarget = m_Spell.m_Caster.Target;

                    if (m_Spell.Caster is PlayerMobile && m_Spell is MagerySpell && ((MagerySpell)m_Spell).UseSphereSystem)
                    {
                        ((MagerySpell)m_Spell).OnSphereCast();
                    }
                    else
                    {
                        m_Spell.OnCast();
                    }

                    if (m_Spell.m_Caster.Player && m_Spell.m_Caster.Target != originalTarget && m_Spell.Caster.Target != null)
                    {
                        m_Spell.m_Caster.Target.BeginTimeout(m_Spell.m_Caster, TimeSpan.FromSeconds(30.0));
                    }

                    m_Spell.m_CastTimer = null;
                }
            }
Example #6
0
            protected override void OnTick()
            {
                if (m_Spell == null || m_Spell.m_Caster == null)
                {
                    return;
                }

                else if (m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell)
                {
                    m_Spell.m_State     = SpellState.Sequencing;
                    m_Spell.m_CastTimer = null;
                    m_Spell.m_Caster.OnSpellCast(m_Spell);

                    if (m_Spell.m_Caster.Region != null)
                    {
                        m_Spell.m_Caster.Region.OnSpellCast(m_Spell.m_Caster, m_Spell);
                    }

                    if (!(m_Spell.m_Caster is BaseCreature))
                    {
                        m_Spell.m_Caster.NextSpellTime = DateTime.UtcNow + TimeSpan.FromMilliseconds(250);
                    }

                    Target originalTarget = m_Spell.m_Caster.Target;

                    m_Spell.OnCast();

                    if (m_Spell.m_Caster.Player && m_Spell.m_Caster.Target != originalTarget && m_Spell.Caster.Target != null)
                    {
                        m_Spell.m_Caster.Target.BeginTimeout(m_Spell.m_Caster, TimeSpan.FromSeconds(30.0));
                    }

                    m_Spell.m_CastTimer = null;
                }
            }
Example #7
0
            protected override void OnTick()
            {
                if (m_Spell == null || m_Spell.m_Caster == null)
                {
                    return;
                }
                else if (m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell)
                {
                    m_Spell.m_State     = SpellState.Sequencing;
                    m_Spell.m_CastTimer = null;
                    m_Spell.m_Caster.OnSpellCast(m_Spell);
                    if (m_Spell.m_Caster.Region != null)
                    {
                        m_Spell.m_Caster.Region.OnSpellCast(m_Spell.m_Caster, m_Spell);
                    }
                    m_Spell.m_Caster.NextSpellTime = DateTime.UtcNow + m_Spell.GetCastRecovery();                    // Spell.NextSpellDelay;

                    if (m_Spell.PlayerCaster != null && !(m_Spell is PaladinSpell) && !(m_Spell is NecromancerSpell))
                    {
                        int mana = m_Spell.ScaleMana(m_Spell.GetMana());
                        if (m_Spell.m_Caster.Mana < mana)
                        {
                            m_Spell.m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502625); // Insufficient mana for this spell.
                            m_Spell.DoFizzle();
                            return;
                        }
                        m_Spell.OnPlayerCast();
                    }
                    else
                    {
                        Target originalTarget = m_Spell.m_Caster.Target;

                        m_Spell.OnCast();

                        if (m_Spell.m_Caster.Player && m_Spell.m_Caster.Target != originalTarget && m_Spell.Caster.Target != null)
                        {
                            m_Spell.m_Caster.Target.BeginTimeout(m_Spell.m_Caster, TimeSpan.FromSeconds(30.0));
                        }

                        m_Spell.m_CastTimer = null;
                    }
                }
            }
Example #8
0
            protected override void OnTick()
            {
                if (m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell)
                {
                    m_Spell.m_State     = SpellState.Sequencing;
                    m_Spell.m_CastTimer = null;
                    m_Spell.m_Caster.OnSpellCast(m_Spell);
                    m_Spell.m_Caster.Region.OnSpellCast(m_Spell.m_Caster, m_Spell);
                    m_Spell.m_Caster.NextSpellTime = DateTime.Now + m_Spell.GetCastRecovery();                    // Spell.NextSpellDelay;

                    Target originalTarget = m_Spell.m_Caster.Target;

                    m_Spell.OnCast();

                    if (m_Spell.m_Caster.Player && m_Spell.m_Caster.Target != originalTarget && m_Spell.Caster.Target != null)
                    {
                        m_Spell.m_Caster.Target.BeginTimeout(m_Spell.m_Caster, TimeSpan.FromSeconds(30.0));
                    }

                    m_Spell.m_CastTimer = null;
                }
            }
Example #9
0
            protected override void OnTick()
            {
                try
                {
                    if (m_Spell != null && m_Spell.Caster != null && m_Spell.State == SpellState.Casting && m_Spell.Caster.Spell == m_Spell)
                    {
                        m_Spell.State       = SpellState.Sequencing;
                        m_Spell.m_CastTimer = null;
                        m_Spell.Caster.OnSpellCast(m_Spell);
                        m_Spell.Caster.Region.OnSpellCast(m_Spell.Caster, m_Spell);
                        m_Spell.Caster.NextSpellTime = Core.TickCount + Core.GetTicks(m_Spell.GetCastRecovery());

                        Target originalTarget = m_Spell.Caster.Target;

                        m_Spell.OnCast();

                        if (m_Spell.Caster.Player && m_Spell.Caster.Target != originalTarget && m_Spell.Caster.Target != null)
                        {
                            m_Spell.Caster.Target.BeginTimeout(m_Spell.Caster, TimeSpan.FromSeconds(30.0));
                        }

                        m_Spell.m_CastTimer = null;

                        m_Spell.OnEndCast();
                    }
                }
                catch
                {
                    m_Spell.m_CastTimer = null;

                    if (m_Spell != null && m_Spell.Caster != null)
                    {
                        m_Spell.Caster.NextSpellTime = Core.TickCount;
                    }
                }
            }