Discussion in   General Discussions   started     11 years ago   October 08, 2013, 02:11:50 PM   by   Fruit

What is Virtual Armor for a pet

Fruit
Offline
4 Posts
Topic :   What is Virtual Armor for a pet
11 years ago  October 08, 2013, 02:11:50 PM

I can't find info on this.  What is Virtual Armor and what does it do?

Kyn
Offline
336 Posts
#1 Re :   What is Virtual Armor for a pet
11 years ago  October 08, 2013, 03:24:09 PM

I can't find info on this.  What is Virtual Armor and what does it do?


Virtual armor is a Pre Age of Shadows method that absorbs a certain amount of damage on a player or on a pet.


Here is the code for how AoS+ shards handle damage absorbs for a player. See how there is no reference to Virtual armor? That is because AoS+ does not use virtual armor as a method of damage mitigation for players.
Code: [Select]
public virtual int AbsorbDamageAOS( Mobile attacker, Mobile defender, int damage )
        {
            double positionChance = Utility.RandomDouble();
            BaseArmor armor;


            if ( positionChance < 0.07 )
                armor = defender.NeckArmor as BaseArmor;
            else if ( positionChance < 0.14 )
                armor = defender.HandArmor as BaseArmor;
            else if ( positionChance < 0.28 )
                armor = defender.ArmsArmor as BaseArmor;
            else if ( positionChance < 0.43 )
                armor = defender.HeadArmor as BaseArmor;
            else if ( positionChance < 0.65 )
                armor = defender.LegsArmor as BaseArmor;
            else
                armor = defender.ChestArmor as BaseArmor;


            if ( armor != null )
                armor.OnHit( this, damage ); // call OnHit to lose durability


            if ( defender.Player || defender.Body.IsHuman )
            {
                BaseShield shield = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseShield;


                bool blocked = false;


                // Dexterity below 80 reduces the chance to parry
                double chance = ( defender.Skills[SkillName.Parry].Value * 0.0030 );
                if ( defender.Dex < 80 )
                    chance = chance * (20 + defender.Dex) / 100;


                if ( shield != null )
                {
                    blocked = defender.CheckSkill( SkillName.Parry, chance );
                }
                else if ( !(defender.Weapon is Fists) && !(defender.Weapon is BaseRanged) )
                {
                    chance /= 2;


                    blocked = ( chance > Utility.RandomDouble() ); // Only skillcheck if wielding a shield
                }


                if ( blocked )
                {
                    defender.FixedEffect( 0x37B9, 10, 16 );
                    damage = 0;


                    if ( shield != null )
                    {
                        double halfArmor = shield.ArmorRating / 2.0;
                        int absorbed = (int)(halfArmor + (halfArmor*Utility.RandomDouble()));


                        if ( absorbed < 2 )
                            absorbed = 2;


                        int wear;


                        if ( Type == WeaponType.Bashing )
                            wear = (absorbed / 2);
                        else
                            wear = Utility.Random( 2 );


                        if ( wear > 0 && shield.MaxHitPoints > 0 )
                        {
                            if ( shield.HitPoints >= wear )
                            {
                                shield.HitPoints -= wear;
                                wear = 0;
                            }
                            else
                            {
                                wear -= shield.HitPoints;
                                shield.HitPoints = 0;
                            }


                            if ( wear > 0 )
                            {
                                if ( shield.MaxHitPoints > wear )
                                {
                                    shield.MaxHitPoints -= wear;


                                    if ( shield.Parent is Mobile )
                                        ((Mobile)shield.Parent).LocalOverheadMessage( MessageType.Regular, 0x3C3, 1061121 ); // Your equipment is severely damaged.
                                }
                                else
                                {
                                    shield.Delete();
                                }
                            }
                        }
                    }
                }
            }


            return damage;
        }


Pets however do still receive a bonus from virtual armor IE) 75 virtual armor = 75/100 chance for damage absorb through resists/armor. Sorry if my response was a little confusing, its hard to explain in full detail :(

Fruit
Offline
4 Posts
#2 Re :   What is Virtual Armor for a pet
11 years ago  October 08, 2013, 03:46:00 PM

That's EXACTLY  what I thought it was.  :)