Esempio n. 1
0
 protected override void OnTick()
 {
     if (m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Body || (m_Hue != 0 && m_Mobile.Hue != m_Hue))
     {
         AnimalForm.RemoveContext(m_Mobile, true);
         Stop();
     }
 }
Esempio n. 2
0
        protected override void OnTick()
        {
            #region Heritage Items
            if (!m_Mobile.Deleted && m_Mobile.Alive)
            {
                if (m_Body == 0x115)                   // Cu Sidhe
                {
                    if (m_Mobile.Hits < m_Mobile.HitsMax || m_Delay < 9)
                    {
                        if (m_Delay-- <= 0)
                        {
                            m_Mobile.Hits += Utility.RandomMinMax(28, 32);
                            m_Delay        = 10;
                        }
                    }
                }
                else if (m_Body == 0x114)                   // Reptalon
                {
                    if (m_Mobile.Combatant != null && m_Mobile.Combatant != m_Target)
                    {
                        m_Delay  = 0;
                        m_Target = m_Mobile.Combatant;
                    }

                    if (m_Target != null && m_Mobile.InRange(m_Target.Location, 1))
                    {
                        m_Delay -= 8;
                    }

                    if (m_Target != null && m_Delay-- <= 0)
                    {
                        if (m_Target.Alive && !m_Target.IsDeadBondedPet && m_Mobile.CanBeHarmful(m_Target) && m_Target.Map == m_Mobile.Map && m_Target.InRange(m_Mobile.Location, BaseCreature.DefaultRangePerception) && m_Mobile.InLOS(m_Target))
                        {
                            m_Mobile.Direction = m_Mobile.GetDirectionTo(m_Target);
                            m_Mobile.Freeze(TimeSpan.FromSeconds(1));
                            m_Mobile.PlaySound(0x16A);
                            m_Mobile.Animate(12, 5, 1, true, false, 0);

                            Timer.DelayCall(TimeSpan.FromSeconds(1.3), new TimerStateCallback(BreathEffect_Callback), m_Target);
                        }

                        m_Delay = 10;
                    }
                }
            }
            #endregion

            if (m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Body || (m_Hue != 0 && m_Mobile.Hue != m_Hue))
            {
                AnimalForm.RemoveContext(m_Mobile, true);
                Stop();
            }
        }
Esempio n. 3
0
        protected override void OnTick()
        {
            // Scriptiz : arrêt du sort après un certain temps en rajoutant ceci devant tout :  m_Ticks++ > m_Duration ||
            if (/*++m_Ticks > m_Duration || */ m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Body || m_Mobile.Hue != m_Hue)

            {
                AnimalForm.RemoveContext(m_Mobile, true);
                Stop();
            }
            else
            {
                if (m_Body == 0x115)                 // Cu Sidhe
                {
                    if (m_Counter++ >= 8)
                    {
                        if (m_Mobile.Hits < m_Mobile.HitsMax && m_Mobile.Backpack != null)
                        {
                            Bandage b = m_Mobile.Backpack.FindItemByType(typeof(Bandage)) as Bandage;

                            if (b != null)
                            {
                                m_Mobile.Hits += Utility.RandomMinMax(20, 50);
                                b.Consume();
                            }
                        }

                        m_Counter = 0;
                    }
                }
                else if (m_Body == 0x114)                 // Reptalon
                {
                    if (m_Mobile.Combatant != null && m_Mobile.Combatant != m_LastTarget)
                    {
                        m_Counter    = 1;
                        m_LastTarget = m_Mobile.Combatant;
                    }

                    if (m_Mobile.Warmode && m_LastTarget != null && m_LastTarget.Alive && !m_LastTarget.Deleted && m_Counter-- <= 0)
                    {
                        if (m_Mobile.CanBeHarmful(m_LastTarget) && m_LastTarget.Map == m_Mobile.Map && m_LastTarget.InRange(m_Mobile.Location, BaseCreature.DefaultRangePerception) && m_Mobile.InLOS(m_LastTarget))
                        {
                            m_Mobile.Direction = m_Mobile.GetDirectionTo(m_LastTarget);
                            m_Mobile.Freeze(TimeSpan.FromSeconds(1));
                            m_Mobile.PlaySound(0x16A);

                            Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(1.3), new TimerStateCallback <Mobile>(BreathEffect_Callback), m_LastTarget);
                        }

                        m_Counter = Math.Min((int)m_Mobile.GetDistanceToSqrt(m_LastTarget), 10);
                    }
                }
            }
        }
Esempio n. 4
0
        protected override void OnTick()
        {
            if (this.m_Mobile.Deleted || !this.m_Mobile.Alive || this.m_Mobile.Body != this.m_Body || this.m_Mobile.Hue != this.m_Hue)
            {
                AnimalForm.RemoveContext(this.m_Mobile, true);
                this.Stop();
            }
            else
            {
                if (this.m_Body == 0x115) // Cu Sidhe
                {
                    if (this.m_Counter++ >= 8)
                    {
                        if (this.m_Mobile.Hits < this.m_Mobile.HitsMax && this.m_Mobile.Backpack != null)
                        {
                            Bandage b = this.m_Mobile.Backpack.FindItemByType(typeof(Bandage)) as Bandage;

                            if (b != null)
                            {
                                this.m_Mobile.Hits += Utility.RandomMinMax(20, 50);
                                b.Consume();
                            }
                        }

                        this.m_Counter = 0;
                    }
                }
                else if (this.m_Body == 0x114) // Reptalon
                {
                    if (this.m_Mobile.Combatant != null && this.m_Mobile.Combatant != this.m_LastTarget)
                    {
                        this.m_Counter    = 1;
                        this.m_LastTarget = this.m_Mobile.Combatant;
                    }

                    if (this.m_Mobile.Warmode && this.m_LastTarget != null && this.m_LastTarget.Alive && !this.m_LastTarget.Deleted && this.m_Counter-- <= 0)
                    {
                        if (this.m_Mobile.CanBeHarmful(this.m_LastTarget) && this.m_LastTarget.Map == this.m_Mobile.Map && this.m_LastTarget.InRange(this.m_Mobile.Location, BaseCreature.DefaultRangePerception) && this.m_Mobile.InLOS(this.m_LastTarget))
                        {
                            this.m_Mobile.Direction = this.m_Mobile.GetDirectionTo(this.m_LastTarget);
                            this.m_Mobile.Freeze(TimeSpan.FromSeconds(1));
                            this.m_Mobile.PlaySound(0x16A);

                            Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(1.3), new TimerStateCallback <Mobile>(BreathEffect_Callback), this.m_LastTarget);
                        }

                        this.m_Counter = Math.Min((int)this.m_Mobile.GetDistanceToSqrt(this.m_LastTarget), 10);
                    }
                }
            }
        }
Esempio n. 5
0
        protected override void OnTick()
        {
            if (m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Body || m_Mobile.Hue != m_Hue)
            {
                AnimalForm.RemoveContext(m_Mobile, true);
                Stop();
            }
            else
            {
                if (m_Body == 0x115) // Cu Sidhe
                {
                    if (m_Counter++ >= 8)
                    {
                        if (m_Mobile.Hits < m_Mobile.HitsMax && m_Mobile.Backpack != null && m_Mobile.Backpack.FindItemByType(typeof(Bandage)) is Bandage b)
                        {
                            m_Mobile.Hits += Utility.RandomMinMax(20, 50);
                            b.Consume();
                        }

                        m_Counter = 0;
                    }
                }
                else if (m_Body == 0x114) // Reptalon
                {
                    if (m_Mobile.Combatant is Mobile mobile && m_Mobile.Combatant != m_LastTarget)
                    {
                        m_Counter    = 1;
                        m_LastTarget = mobile;
                    }

                    if (m_Mobile.Warmode && m_LastTarget != null && m_LastTarget.Alive && !m_LastTarget.Deleted && m_Counter-- <= 0)
                    {
                        if (m_Mobile.CanBeHarmful(m_LastTarget) && m_LastTarget.Map == m_Mobile.Map &&
                            m_LastTarget.InRange(m_Mobile.Location, BaseCreature.DefaultRangePerception) && m_Mobile.InLOS(m_LastTarget))
                        {
                            m_Mobile.Direction = m_Mobile.GetDirectionTo(m_LastTarget);
                            m_Mobile.Freeze(TimeSpan.FromSeconds(1));
                            m_Mobile.PlaySound(0x16A);

                            DelayCall(TimeSpan.FromSeconds(1.3), BreathEffect_Callback, m_LastTarget);
                        }

                        m_Counter = Math.Min((int)m_Mobile.GetDistanceToSqrt(m_LastTarget), 10);
                    }
                }
            }
        }