Swoo

Member
Hi,

iam askiing myself what VirtualArmor = 60 means?
is this somekind of a shield? what does this value mean?

(talking about a monster.cs,)
 
As far as I remember virtual armor is used for pre aos servers. Instead of giving monsters elemental resistances you would give it a singular armor value that would essentially set the difficulty of the monster.
 
Was kinda wondering this myself so this was helpful. I just figured it was some sort of flat damage reduction value, though I was unsure of the actual arithmetic behind it. If it was used pre-aos does that mean that it checks Core.AOS when calculating virtual armor into damage? Otherwise it'd essentially be additional damage reduction on top of resistances for AOS+ servers. I seem to recall some newer mobs having virtual armor on them, but I can't think of any specific ones off the top of my head.

Edit: Just found an example, a SA boss Navrey has VirtualArmor. I'm quite sure there's others.
 
Last edited:
Looking at the AbsorbDamage method in BaseWeapon.cs we can see that virtualarmor is only taken into account on a pre aos server. If the core is set to AOS or higher it will fall back to another method that takes into account aos properties.

Code:
public virtual int AbsorbDamage(Mobile attacker, Mobile defender, int damage)
		{
			if (Core.AOS)
			{
				return AbsorbDamageAOS(attacker, defender, damage);
			}

			BaseShield shield = defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield;
			if (shield != null)
			{
				damage = shield.OnHit(this, damage);
			}

			double chance = Utility.RandomDouble();

			Item armorItem;

			if (chance < 0.07)
			{
				armorItem = defender.NeckArmor;
			}
			else if (chance < 0.14)
			{
				armorItem = defender.HandArmor;
			}
			else if (chance < 0.28)
			{
				armorItem = defender.ArmsArmor;
			}
			else if (chance < 0.43)
			{
				armorItem = defender.HeadArmor;
			}
			else if (chance < 0.65)
			{
				armorItem = defender.LegsArmor;
			}
			else
			{
				armorItem = defender.ChestArmor;
			}

			IWearableDurability armor = armorItem as IWearableDurability;

			if (armor != null)
			{
				damage = armor.OnHit(this, damage);
			}

			int virtualArmor = defender.VirtualArmor + defender.VirtualArmorMod;

			damage -= XmlAttach.OnArmorHit(attacker, defender, armorItem, this, damage);
			damage -= XmlAttach.OnArmorHit(attacker, defender, shield, this, damage);

			if (virtualArmor > 0)
			{
				double scalar;

				if (chance < 0.14)
				{
					scalar = 0.07;
				}
				else if (chance < 0.28)
				{
					scalar = 0.14;
				}
				else if (chance < 0.43)
				{
					scalar = 0.15;
				}
				else if (chance < 0.65)
				{
					scalar = 0.22;
				}
				else
				{
					scalar = 0.35;
				}

				int from = (int)(virtualArmor * scalar) / 2;
				int to = (int)(virtualArmor * scalar);

				damage -= Utility.Random(from, (to - from) + 1);
			}

			return damage;
		}
 
Awesome. I'm sure I could have looked that up myself but I'm pretty mentally exhausted from my stats exam studying, so I thank you sir :)
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back