I am trying to add resistances to various types of damage to various types of armor, but using the old UO system rather than the AoS. I realize that the AoS resistances are more elegant and simple, but I want to stick with the old school style, and I also find the AoS stuff a bit too sterile and intricate, too "gamey" perhaps, for the the look and feel I am going for.

I have added the following method to PlayerMobile I am hoping to decrease damage from fire based attacks, spells, etc by 10% for a full suit of this armor, essentially multiplying damage (after resist) by the resfire variable:

Code:
  public virtual double BarbedLeatherFireResist( Mobile from )
        {


            double resfire;
            resfire = 0;

            Item chest = FindItemOnLayer( Layer.MiddleTorso );
            Item chesttwo = FindItemOnLayer( Layer.InnerTorso );
            Item arms = FindItemOnLayer( Layer.Arms );
            Item legs = FindItemOnLayer( Layer.Pants );
            Item helm = FindItemOnLayer( Layer.Helm );
            Item gloves = FindItemOnLayer( Layer.Gloves );
            Item gorget = FindItemOnLayer( Layer.Neck );

            if ( chest != null && chest is BarbedLeatherChest )
            {
                    resfire += 0.2; 
            }

            if ( chesttwo != null && chesttwo is BarbedFemaleLeatherChest )
            {
                    resfire += 0.2; 
            }

            if ( arms != null && arms is BarbedLeatherArms )
            {
                    resfire += 0.15; 
            }

            if ( legs != null && (legs is BarbedLeatherLegs || legs is BarbedLeatherSkirt ) )
            {
                    resfire += 0.15; 
            }

            if ( helm != null && helm is BarbedLeatherCap )
            {
                    resfire += 0.1; 
            }

            if ( gloves != null && gloves is BarbedLeatherGloves )
            {
                    resfire += 0.15; 
            }

            if ( gorget != null && gorget is BarbedLeatherGorget )
            {
                    resfire += 0.15; 
            }

            return resfire;

        }


I realize it is a bit of a tedious approach, and that I will need to add this to each spell, attack, etc., but I want to invoke this method to reduce damage for fire based spells attacks, breath weapons, etc. by 10%. I am hoping someone can help me with what to add, for example, to this snipet from Fireball.cs:

Code:
                    damage = Utility.Random( 10, 7 );

                    if ( CheckResisted( m ) )
                    {
                        damage *= 0.75;

                        m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
                    }

                   //What to add here to mutilply damage by resfire (up to 0.9)? Assuming I got the above method anywhere near correct.

                    damage *= GetDamageScalar( m );

Any help is much appreciated!
 
Back