Exemplo n.º 1
0
            private bool CheckResistPoison()
            {
                double naturalResistChance   = PoisonResistance.GetNaturalResistChance(m_Mobile, m_Poison);
                double temporaryResistChance = PoisonResistance.GetTemporaryResistChance(m_Mobile, m_Poison);

                if (naturalResistChance + temporaryResistChance > Utility.RandomDouble())
                {
                    return(true);
                }

                if (m_Poison.Level < 4 && TransformationSpell.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell)))
                {
                    return(true);
                }

                if (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile))
                {
                    return(true);
                }

                return(false);
            }
Exemplo n.º 2
0
            protected override void OnTick()
            {
                if ((Core.AOS && m_Poison.Level < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) ||
                    AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.SendAsciiMessage("You feel yourself resisting the effects of the poison");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x22, true,
                                                         String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }



                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                       // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                IHonorTarget honorTarget = m_Mobile as IHonorTarget;

                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0);

                //if (0.60 <= Utility.RandomDouble()) // OSI: randomly revealed between first and third damage tick, guessing 60% chance
                //    m_Mobile.RevealingAction();

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
Exemplo n.º 3
0
            protected override void OnTick()
            {
                if ((m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                      "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                         String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                       // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                if (Interval == m_Poison.m_Delay)
                {
                    Interval = m_Poison.m_Interval;
                }
                else                 //if ( Delay == m_Poison.m_Interval )
                {
                    Interval = m_Poison.m_Delay;
                }

                int damage;

                if (m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                if (XmlScript.HasTrigger(m_Mobile, TriggerName.onPoisonTick) && UberScriptTriggers.Trigger(m_Mobile, m_From, TriggerName.onPoisonTick, null, null, null, damage))
                {
                    return;
                }

                m_Mobile.Damage(damage, m_From);

                //if ( Utility.RandomBool() ) // OSI: randomly revealed between first and third damage tick, guessing 60% chance
                //		m_Mobile.RevealingAction();

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
Exemplo n.º 4
0
            protected override void OnTick()
            {
                if (m_Mobile is NubiaPlayer)
                {
                    if (((NubiaPlayer)m_Mobile).hasDon(DonEnum.CorpDiamant))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                      "* Votre corps est imunisé contre le poison *");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                         String.Format("* {0} ne semble pas affecté par le poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }

                if ((Core.AOS && m_Poison.Level < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) ||
                    AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                      "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                         String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                       // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                IHonorTarget honorTarget = m_Mobile as IHonorTarget;

                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0);

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
Exemplo n.º 5
0
            protected override void OnTick()
            {
                #region Mondain's Legacy
                if ((Core.AOS && m_Poison.RealLevel < 4 &&
                     TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (m_Poison.RealLevel < 3 && OrangePetals.UnderEffect(m_Mobile)) ||
                    AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(
                            MessageType.Emote, 0x3F, true, "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(
                            MessageType.Emote, 0x3F, true, String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }
                #endregion

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                     // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                IHonorTarget honorTarget = m_Mobile as IHonorTarget;
                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                #region Mondain's Legacy
                if (Core.ML)
                {
                    if (m_From != null && m_Mobile != m_From && !m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 10 &&
                        m_Poison.m_Level <= 13)                         // darkglow
                    {
                        m_From.SendLocalizedMessage(1072850);           // Darkglow poison increases your damage!

                        Stop();

                        new DarkglowTimer(m_Mobile, m_From, m_Poison, m_Index).Start();
                    }

                    if (m_From != null && m_Mobile != m_From && m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 14 &&
                        m_Poison.m_Level <= 18)                         // parasitic
                    {
                        Stop();

                        new ParasiticTimer(m_Mobile, m_From, m_Poison, m_Index).Start();
                    }
                }
                #endregion

                AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0);

                if (0.60 <= Utility.RandomDouble())
                // OSI: randomly revealed between first and third damage tick, guessing 60% chance
                {
                    m_Mobile.RevealingAction();
                }

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
Exemplo n.º 6
0
            protected override void OnTick()
            {
                bool usingPetals = OrangePetals.UnderEffect(m_Mobile);

                if (Core.SA && usingPetals && m_Poison.RealLevel >= 3 && 0.25 > Utility.RandomDouble())
                {
                    OrangePetals.RemoveContext(m_Mobile);
                    usingPetals = false;

                    m_Mobile.LocalOverheadMessage(MessageType.Regular, 0x3F, 1053093); // * The strength of the poison overcomes your resistance! *
                }

                if ((Core.AOS && m_Poison.RealLevel < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (m_Poison.RealLevel <= 3 && usingPetals) ||
                    AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, 1053092);                   // * You feel yourself resisting the effects of the poison *

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, 1114442, m_Mobile.Name); // * ~1_NAME~ seems resistant to the poison *

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    if (m_Mobile is PlayerMobile)
                    {
                        BuffInfo.RemoveBuff((PlayerMobile)m_Mobile, BuffIcon.Poison);
                    }

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                IHonorTarget honorTarget = m_Mobile as IHonorTarget;

                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                #region Mondain's Legacy
                if (Core.ML)
                {
                    if (m_From != null && m_Mobile != m_From && !m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 10 && m_Poison.m_Level <= 13) // darkglow
                    {
                        m_From.SendLocalizedMessage(1072850);                                                                                              // Darkglow poison increases your damage!
                        damage = (int)Math.Floor(damage * 1.1);
                    }

                    if (m_From != null && m_Mobile != m_From && m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 14 && m_Poison.m_Level <= 18) // parasitic
                    {
                        int toHeal = Math.Min(m_From.HitsMax - m_From.Hits, damage);

                        if (toHeal > 0)
                        {
                            m_From.SendLocalizedMessage(1060203, toHeal.ToString()); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed.
                            m_From.Heal(toHeal, m_Mobile, false);
                        }
                    }
                }
                #endregion

                AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0);

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
Exemplo n.º 7
0
            protected override void OnTick()
            {
                if ((Core.AOS && m_Poison.Level < 4 && TransformationSpell.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) || (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                      "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                         String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                       // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                AOS.Damage(m_Mobile, damage, 0, 0, 0, 100, 0);

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_Mobile, m_Poison, m_Poison);
                }
            }
Exemplo n.º 8
0
            protected override void OnTick()
            {
                if (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                      "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                         String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                       // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                double Moddamage = damage;

                if (m_Mobile is BaseCreature)
                {
                    ((BaseCreature)m_Mobile).CheckSpellImmunity(Server.Spells.SpellDamageType.Posion, (double)damage, out Moddamage);
                    //Console.WriteLine("Old Damage {0}, new Damage {1}",damage,Moddamage);
                }

                AOS.Damage(m_Mobile, (int)Moddamage, 0, 0, 0, 100, 0);

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_Mobile, m_Poison, m_Poison);
                }
            }
Exemplo n.º 9
0
            protected override void OnTick()
            {
                if (Core.UOR && m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                      "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                         String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                       // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                // Note: Poison has no damage source after initial application pre AOS
                IHonorTarget honorTarget = m_Mobile as IHonorTarget;

                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                AOS.Damage(m_Mobile, damage, 0, 0, 0, 100, 0);

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_Mobile, m_Poison, m_Poison);
                }
            }
Exemplo n.º 10
0
            protected override void OnTick()
            {
                if ((Core.AOS && m_Poison.Level < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) ||
                    AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                      "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                         String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                       // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                IHonorTarget honorTarget = m_Mobile as IHonorTarget;

                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                // Genova: suporte ao UO:ML.
                #region Mondain's Legacy
                if (m_Mobile != m_From && m_From.InRange(m_Mobile.Location, 1) && Utility.InsensitiveCompare(m_Poison.Name, "Parasitic") == 0)
                {
                    m_From.Heal((int)(damage * 0.4));                          // TODO check
                }
                #endregion

                AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0);

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
Exemplo n.º 11
0
            protected override void OnTick()
            {
                #region Mondain's Legacy
                if ((Core.AOS && this.m_Poison.RealLevel < 4 && TransformationSpellHelper.UnderTransformation(this.m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (this.m_Poison.RealLevel < 3 && OrangePetals.UnderEffect(this.m_Mobile)) ||
                    AnimalForm.UnderTransformation(this.m_Mobile, typeof(Unicorn)))
                {
                    if (this.m_Mobile.CurePoison(this.m_Mobile))
                    {
                        this.m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                           "* You feel yourself resisting the effects of the poison *");

                        this.m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                              String.Format("* {0} seems resistant to the poison *", this.m_Mobile.Name));

                        this.Stop();
                        return;
                    }
                }
                #endregion

                if (this.m_Index++ == this.m_Poison.m_Count)
                {
                    this.m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off.
                    this.m_Mobile.Poison = null;

                    this.Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && this.m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = this.m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(this.m_Mobile.Hits * this.m_Poison.m_Scalar);

                    if (damage < this.m_Poison.m_Minimum)
                    {
                        damage = this.m_Poison.m_Minimum;
                    }
                    else if (damage > this.m_Poison.m_Maximum)
                    {
                        damage = this.m_Poison.m_Maximum;
                    }

                    this.m_LastDamage = damage;
                }

                if (this.m_From != null)
                {
                    this.m_From.DoHarmful(this.m_Mobile, true);
                }

                IHonorTarget honorTarget = this.m_Mobile as IHonorTarget;
                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                #region Mondain's Legacy
                if (Core.ML)
                {
                    if (this.m_From != null && this.m_Mobile != this.m_From && !this.m_From.InRange(this.m_Mobile.Location, 1) && this.m_Poison.m_Level >= 10 && this.m_Poison.m_Level <= 13) // darkglow
                    {
                        this.m_From.SendLocalizedMessage(1072850);                                                                                                                            // Darkglow poison increases your damage!
                        damage = (int)Math.Floor(damage * 1.1);
                    }

                    if (this.m_From != null && this.m_Mobile != this.m_From && this.m_From.InRange(this.m_Mobile.Location, 1) && this.m_Poison.m_Level >= 14 && this.m_Poison.m_Level <= 18) // parasitic
                    {
                        int toHeal = Math.Min(this.m_From.HitsMax - this.m_From.Hits, damage);

                        if (toHeal > 0)
                        {
                            this.m_From.SendLocalizedMessage(1060203, toHeal.ToString()); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed.
                            this.m_From.Heal(toHeal, this.m_Mobile, false);
                        }
                    }
                }
                #endregion

                AOS.Damage(this.m_Mobile, this.m_From, damage, 0, 0, 0, 100, 0);

                if (0.60 <= Utility.RandomDouble()) // OSI: randomly revealed between first and third damage tick, guessing 60% chance
                {
                    this.m_Mobile.RevealingAction();
                }

                if ((this.m_Index % this.m_Poison.m_MessageInterval) == 0)
                {
                    this.m_Mobile.OnPoisoned(this.m_From, this.m_Poison, this.m_Poison);
                }
            }
Exemplo n.º 12
0
            protected override void OnTick()
            {
                if ((Core.AOS && m_Poison.Level < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) ||
                    AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true, "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true, String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendAsciiMessage("The poison seems to have worn off.");                       // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomMinMax(1, 3) != 1)
                {
                    damage = m_LastDamage;
                }
                else
                {
                    //damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);
                    damage = 2 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);

                    /*if ( damage < m_Poison.m_Minimum )
                     *      damage = m_Poison.m_Minimum;
                     * else if ( damage > m_Poison.m_Maximum )
                     *      damage = m_Poison.m_Maximum;*/

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                IHonorTarget honorTarget = m_Mobile as IHonorTarget;

                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0);

                //if ( (m_Index % m_Poison.m_MessageInterval) == 0 )
                //	m_Mobile.OnPoisoned( m_From, m_Poison, m_Poison );
            }