View Single Post
Old 01-13-2005, 07:43 PM   #1 (permalink)
Dracolique
Forum Expert
 
Dracolique's Avatar
 
Join Date: Apr 2003
Age: 28
Posts: 395
Default Sick of AOS armor defenses?

I got sick of the crappy AOS armor defenses ( wearing plate didnt really DO anything anymore ). I dont know if this has ever been done before, so if it has, dont scream at me.

I spent 15 minutes just now creating and testing this, and it seems to work fine for what I want on my shard. You can play around with the numbers if you want to modify the damage reduction. This is a VERY simple script, and Im sure anyone will be able to modify it to their personal needs.

It takes a look at what the defending player is wearing on all the relevant Armor layers ( including the shield ), adds up their total ArmorBase, divides it by 10, and then subtracts that from the initial damage done.

It does all this before the AOS/skill/resistance calculations are completed, so it doesnt affect those. it simply drops the initial damage done, so the overall damage is reduced as well.

Since it analyzes each piece of armor individually, it also comes up with the correct damage reduction if you are wearing a combo-set ( for instance, chain chest with plate legs and leather arms ).

The ArmorBase for platemail items is 40, so if a player is wearing a full set of platemail ( which is 6 items ), their total armorbase will be 240. Divide that by ten, and the initial damage is reduced by 24.

Just find the OnHit method in your BaseWeapon.cs, locate the line that says "int damage = ComputeDamage( attacker, defender );", and paste this in right below it:

Code:
//Trying to undo some of the stupid AOS bullshit damage calculations
			if ( defender.Player )
			{
				int armor = 0;
				PlayerMobile Pm = defender as PlayerMobile;
								
				Item aa = Pm.FindItemOnLayer(Layer.Helm);
				Item bb = Pm.FindItemOnLayer(Layer.Gloves);
				Item cc = Pm.FindItemOnLayer(Layer.Neck);
				Item dd = Pm.FindItemOnLayer(Layer.InnerTorso);
				Item ee = Pm.FindItemOnLayer(Layer.Pants);
				Item ff = Pm.FindItemOnLayer(Layer.Arms);
				Item gg = Pm.FindItemOnLayer(Layer.TwoHanded);
								
				if ( aa != null && aa is BaseArmor )
				{
					armor += ((BaseArmor)aa).ArmorBase;					
				}
				if ( bb != null && bb is BaseArmor )
				{
					armor += ((BaseArmor)bb).ArmorBase;
				}
				if ( cc != null && cc is BaseArmor )
				{
					armor += ((BaseArmor)cc).ArmorBase;
				}
				if ( dd != null && dd is BaseArmor )
				{
					armor += ((BaseArmor)dd).ArmorBase;
				}
				if ( ee != null && ee is BaseArmor )
				{
					armor += ((BaseArmor)ee).ArmorBase;
				}
				if ( ff != null && ff is BaseArmor )
				{
					armor += ((BaseArmor)ff).ArmorBase;
				}
				if ( gg != null && gg is BaseArmor )
				{
					armor += ((BaseArmor)gg).ArmorBase;
				}
				
				damage -= ( armor / 10 );
				if ( damage < 1 )
				{
					damage = 1;
				}
				
			}				
			//End stupid AOS Bullshit undo.
__________________
I reserve the right to be wrong or mistaken about anything at any time, and hereby exercise my constitutional right to never be flamed by anyone :)
http://pix2.hotornot.com/pics/HQ/KY/...RUORSFGBLU.jpg
Dracolique is offline   Reply With Quote