예제 #1
0
        protected override void OnDamage(Mobile m)
        {
            base.OnDamage(m);

            var dmg = Utility.Random(2, 3);

            if (m is PlayerMobile)
            {
                dmg = (int)BalmOfProtection.HandleDamage((PlayerMobile)m, dmg);
            }

            AOS.Damage(m, dmg, 0, 0, 100, 0, 0);
        }
        public virtual void Damage(Mobile m)
        {
            if (!m.Alive)
            {
                StopTimer(m);
            }

            if (m_Corrosive)
            {
                for (int i = 0; i < m.Items.Count; i++)
                {
                    IDurability item = m.Items[i] as IDurability;

                    if (item != null && Utility.RandomDouble() < 0.25)
                    {
                        if (item.HitPoints > 10)
                        {
                            item.HitPoints -= 10;
                        }
                        else
                        {
                            item.HitPoints -= 1;
                        }
                    }
                }
            }
            else
            {
                int dmg = m_Damage;

                if (m is PlayerMobile)
                {
                    PlayerMobile pm = m as PlayerMobile;
                    dmg = (int)BalmOfProtection.HandleDamage(pm, dmg);
                    AOS.Damage(m, dmg, 0, 0, 0, 100, 0);
                }
                else
                {
                    AOS.Damage(m, dmg, 0, 0, 0, 100, 0);
                }
            }
        }