Damage Increase

Name says it all
Locked
User avatar
Adrias
Legendary Scribe
Posts: 426
Joined: Tue Sep 07, 2010 10:34 pm

Damage Increase

Post by Adrias »

This is mostly just a "More you know" post. Code for Damage increase is attached at bottom

This is for base Runuo 1.0 (what the server uses), not sure if this has been modified by anyone from the base though.

in short:
- there is no "300%" damage cap
- only a 100% cap from the item property Damage Increase

in long:
-Damage increase is the only property that contributes to a cap of any kind (maximum of 100%)
-Divine Fury gives a 10% Damage Increase (can be over 100%)
-Horrific Beast gives a 25% Damage Increase (can be over 100%)
-Tactics, Anatomy, Lumberjacking, and Str contribute to damage with no cap on them
-Enemy of One, Slayer Weapons, and Weapon abilities do not have any kind of cap

Comparison to runuo 2.0 (for no reason really, but the 300% damage cap exists in runuo 2.0):
-100% Damage Increase cap
-Divine fury and Horrific beast give the same bonuses but contribute to the 100% cap
-Tactics, Anatomy, Lumberjacking, and Str still have no cap
-Damage Increase item property, enemy of one, slayer weapons, and weapon abilities have a 300% total cap

in Scripts\Items\Weapons\Baseweapon.cs

Code: Select all

public virtual void OnHit( Mobile attacker, Mobile defender )
		{
			PlaySwingAnimation( attacker );
			PlayHurtAnimation( defender );

			attacker.PlaySound( GetHitAttackSound( attacker, defender ) );
			defender.PlaySound( GetHitDefendSound( attacker, defender ) );

			int damage = ComputeDamage( attacker, defender );

			CheckSlayerResult cs = CheckSlayers( attacker, defender );

			if ( cs != CheckSlayerResult.None )
			{
				if ( cs == CheckSlayerResult.Slayer )
					defender.FixedEffect( 0x37B9, 10, 5 );

				damage *= 2;
			}

			if ( !attacker.Player )
			{
				if ( defender is PlayerMobile )
				{
					PlayerMobile pm = (PlayerMobile)defender;

					if ( pm.EnemyOfOneType != null && pm.EnemyOfOneType != attacker.GetType() )
						damage *= 2;
				}
			}
			else if ( !defender.Player )
			{
				if ( attacker is PlayerMobile )
				{
					PlayerMobile pm = (PlayerMobile)attacker;

					if ( pm.WaitingForEnemy )
					{
						pm.EnemyOfOneType = defender.GetType();
						pm.WaitingForEnemy = false;
					}

					if ( pm.EnemyOfOneType == defender.GetType() )
					{
						defender.FixedEffect( 0x37B9, 10, 5, 1160, 0 );
						damage += AOS.Scale( damage, 50 );
					}
				}
			}

			int packInstinctBonus = GetPackInstinctBonus( attacker, defender );

			if ( packInstinctBonus != 0 )
				damage += AOS.Scale( damage, packInstinctBonus );

			if ( m_InDoubleStrike )
				damage -= AOS.Scale( damage, 10 ); // 10% loss when attacking with double-strike

			TransformContext context = TransformationSpell.GetContext( defender );

			if ( m_Slayer == SlayerName.Silver && context != null && context.Type != typeof( HorrificBeastSpell ) )
				damage += AOS.Scale( damage, 25 ); // Every necromancer transformation other than horrific beast take an additional 25% damage

			if ( attacker is BaseCreature )
				((BaseCreature)attacker).AlterMeleeDamageTo( defender, ref damage );

			if ( defender is BaseCreature )
				((BaseCreature)defender).AlterMeleeDamageFrom( attacker, ref damage );

			WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker );

			damage = AbsorbDamage( attacker, defender, damage );

			if ( !Core.AOS && damage < 1 )
				damage = 1;
			else if ( Core.AOS && damage == 0 ) // parried
			{
				if ( a != null && a.Validate( attacker ) /*&& a.CheckMana( attacker, true )*/ ) // Parried special moves have no mana cost 
				{
					a = null;
					WeaponAbility.ClearCurrentAbility( attacker );

					attacker.SendLocalizedMessage( 1061140 ); // Your attack was parried!
				}
			}
...

Code: Select all

public virtual double ScaleDamageAOS( Mobile attacker, double damage, bool checkSkills, bool checkAbility )
		{
			if ( checkSkills )
			{
				attacker.CheckSkill( SkillName.Tactics, 0.0, 120.0 ); // Passively check tactics for gain
				attacker.CheckSkill( SkillName.Anatomy, 0.0, 120.0 ); // Passively check Anatomy for gain

				if ( Type == WeaponType.Axe )
					attacker.CheckSkill( SkillName.Lumberjacking, 0.0, 100.0 ); // Passively check Lumberjacking for gain
			}

			double strengthBonus = GetBonus( attacker.Str,										0.300, 100.0,  5.00 );
			double  anatomyBonus = GetBonus( attacker.Skills[SkillName.Anatomy].Value,			0.500, 100.0,  5.00 );
			double  tacticsBonus = GetBonus( attacker.Skills[SkillName.Tactics].Value,			0.625, 100.0,  6.25 );
			double   lumberBonus = GetBonus( attacker.Skills[SkillName.Lumberjacking].Value,	0.200, 100.0, 10.00 );

			if ( Type != WeaponType.Axe )
				lumberBonus = 0.0;

			// Damage Increase = 100%
			int damageBonus = AosAttributes.GetValue( attacker, AosAttribute.WeaponDamage );
			if ( damageBonus > 100 )
				damageBonus = 100;

			double totalBonus = strengthBonus + anatomyBonus + tacticsBonus + lumberBonus + ((double)(GetDamageBonus() + damageBonus) / 100);

			if ( TransformationSpell.UnderTransformation( attacker, typeof( HorrificBeastSpell ) ) )
				totalBonus += 0.25;

			if ( Spells.Chivalry.DivineFurySpell.UnderEffect( attacker ) )
				totalBonus += 0.1;

			double discordanceScalar = 0.0;

			if ( SkillHandlers.Discordance.GetScalar( attacker, ref discordanceScalar ) )
				totalBonus += discordanceScalar * 2;

			damage += (damage * totalBonus);

			WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker );

			if ( checkAbility && a != null )
				damage *= a.DamageScalar;

			return damage;
		}
User avatar
Adrias
Legendary Scribe
Posts: 426
Joined: Tue Sep 07, 2010 10:34 pm

Re: Damage Increase

Post by Adrias »

bumping this cause some people were talking about it the other day
Locked