HA!
Ok after reviewing my damage code and tweaking and more tweaking and even MORE tweaking.
I think I found it!
I put the original code back in and removed if/case switch.
All that was needed was a
simple way for it to scale by level.
- Code: Select all
(1+(Level * .01) + (1 - (Level *0.02)))
I was trying to
over complicate things. Thats all that is needed to make the damage scale at reasonable rate
SHEESH!
Ok in
GameLiving.cs- Code: Select all
/// <summary>
/// Returns the Damage this Living does on an attack
/// </summary>
/// <param name="weapon">the weapon used for attack</param>
/// <returns></returns>
public virtual double AttackDamage(InventoryItem weapon)
{
double damage = (1.0 + Level / 3.7 + Level * Level / 175.0) * AttackSpeed(weapon) * 0.001;
if (weapon == null || weapon.Item_Type == Slot.RIGHTHAND || weapon.Item_Type == Slot.LEFTHAND || weapon.Item_Type == Slot.TWOHAND)
{
//Melee damage buff and debuff
damage *= GetModified(eProperty.MeleeDamage) * 0.01;
}
else if (weapon.Item_Type == Slot.RANGED)
{
//Ranged damage buff and debuff
damage *= GetModified(eProperty.RangedDamage) * 0.01;
}
//original code: return damage;
//Krugus - damage level modifier. Starts off at x2 dmg at level 0 and by 100th level its x1 dmg modifier.
return damage * (1+(Level * .01) + (1 - (Level *0.02)));
}
/// <summary>
/// Max. Damage possible without style
/// </summary>
/// <param name="weapon">attack weapon</param>
/// <returns></returns>
Also you'll want to put in the pet damage code to make pets do better damage (same code as posted above but just repeating it to have it all in one place)
In
GameLiving.cs- Code: Select all
// apply total damage cap
ad.UncappedDamage = ad.Damage;
ad.Damage = Math.Min(ad.Damage, (int)(UnstyledDamageCap(weapon) * effectiveness));
//Krugus - Start of dmg mod for PETS (1+(level*.06)
//By 17th x2dmg, by 34th x3 dmg, by 50th x4 assuming default Server Properties of 1.0
if ((this is GameNPC && (this as GameNPC).Brain is ControlledNpc && this.Realm != 0) && target is GameNPC)
ad.Damage = (int)((double)ad.Damage * (1+(Level*.06) * (ServerProperties.Properties.PVE_DAMAGE)));//PET PVE dmg mod
if ((this is GameNPC && (this as GameNPC).Brain is ControlledNpc && this.Realm != 0) && target is GamePlayer)
ad.Damage = (int)((double)ad.Damage * (1+(Level*.06) * (ServerProperties.Properties.PVP_DAMAGE)));//PET PVP dmg mod
//End of DMG mod for PETS
if ((this is GamePlayer || (this is GameNPC && (this as GameNPC).Brain is IControlledBrain && this.Realm != 0)) && target is GamePlayer)
ad.Damage = (int)((double)ad.Damage * ServerProperties.Properties.PVP_DAMAGE);
else if ((this is GamePlayer || (this is GameNPC && (this as GameNPC).Brain is IControlledBrain && this.Realm != 0)) && target is GameNPC)
ad.Damage = (int)((double)ad.Damage * ServerProperties.Properties.PVE_DAMAGE);
ad.UncappedDamage = ad.Damage;
// patch to missed when 0 damage
Ok now I'm going to work on something else and stop tweaking the damage code.
"Stand back man! I have a Holy Avenger and I know how to use it! " ...quote from the unknown paladin.