Server.Mobiles.BaseCreature.Damage C# (CSharp) Method

Damage() public method

public Damage ( int amount, Mobile from ) : void
amount int
from Mobile
return void
        public override void Damage( int amount, Mobile from )
        {
            int oldHits = this.Hits;

            if ( Core.AOS && !this.Summoned && this.Controlled && 0.2 > Utility.RandomDouble() )
                amount = (int)(amount * BonusPetDamageScalar);

            if ( Spells.Necromancy.EvilOmenSpell.TryEndEffect( this ) )
                amount = (int)(amount * 1.25);

            Mobile oath = Spells.Necromancy.BloodOathSpell.GetBloodOath( from );

            if ( oath == this )
            {
                amount = (int)(amount * 1.1);
                from.Damage( amount, from );
            }

            base.Damage( amount, from );

            if ( SubdueBeforeTame && !Controlled )
            {
                if ( (oldHits > (this.HitsMax / 10)) && (this.Hits <= (this.HitsMax / 10)) )
                    PublicOverheadMessage( MessageType.Regular, 0x3B2, false, "* The creature has been beaten into subjugation! *" );
            }
        }
BaseCreature