RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Directional Damage

A_Li_N

Knight
Directional Damage

Got bored and figured I'd try something out. So I made a very basic addition of Directional Damage. Basically, if your opponent is facing away from you, you do 2x the damage, if he's facing away and to the side, you do 1.5x the damage. If you flank him (from the side), you do 1.25x damage. If you come at him from the front-side, you do normal damage. If you come at him from the front, you do .75 damage.

Again, this is very basic, and if anyone has any ideas or suggestions for me along these lines, please say so and I'll see what I can do.

Simple addition to the BaseWeapon.cs.
My file is commented with
Code:
/*Directional Damage*/
if you already have a modified BaseWeapon.cs. The changes are in the AbsorbDamageAos method, around line 967. Here is the changes I made.

Change the 'return damage;' to this
Code:
/*Directional Damage*/
			Direction DefDirection = defender.Direction;
			Direction DefToAtt = defender.GetDirectionTo( attacker.Location.X, attacker.Location.Y );
			double mult = 1;

			switch( Math.Abs( (int)DefDirection - (int)DefToAtt ) )
			{
				case 0:	mult = .75; break;	//Front
				case 1:	mult = 1; break;		//Front-Side
				case 2:								//Side
				{
					mult = 1.25;
					attacker.SendMessage( "You flank your opponent, dealing {0} damage!", mult );
					break;
				}
				case 3:	mult = 1.5; break;	//Back-Side
				case 4:								//Back
				{
					mult = 2;
					attacker.SendMessage( "You struck your opponent in the back, dealing {0} damage!", mult );
					break;
				}
			}

			return (int)(damage * mult);
/*Directional Damage*/

Enjoy!
 

Attachments

  • Directional Damage.zip
    16.9 KB · Views: 110

Atomic

Wanderer
Make it so that it will also calculate where the wepon hit the opponent, depending on your fight skill and also a random value. Then make the damage proportional to the place that was hit.
 

Nagash

Sorceror
A gump? :confused:

Maybe we will just have too much damage making it way too unbalanced if we start adding too much stuff like damage by direction you hit, where you hit, etc. We just consider that your damage bonuses from tactics and anatomy come from this body part thing. Maybe something saying where you hit as if you had 120% skill with 90%+ of possible damage of your str with 120% being a hit on the head and so on...
 
Top