Ok, I have it tested and working, but I had to comment out part of the existing code, and I am not sure what it does.... Someone care to fill me in?
Code:
if (Weapon->ItemClass == ItemClassCommon)
What is ItemClassCommon? Barring that not being important...the below code is tested to work, and add the proper damage bonus(within two, rounding) after all AC calculations as it should. Now, if that little piece of code I commented out is important, I'll go back to the drawing board LOL
Code:
int Mob::GetWeaponDamageBonus(const Item_Struct* Weapon)
{
// Kaiyodo - Calculate the damage bonus for a weapon on the main hand
if (GetLevel() < 28)
return(0);
// Check we're on of the classes that gets a damage bonus
if (!IsWarriorClass())
return 0;
int BasicBonus = ((GetLevel() - 25) / 3) + 1;
if(!Weapon)
return(BasicBonus);
// If we have no weapon, or only a single handed weapon, just return the default
// damage bonus of (Level - 25) / 3
//if (Weapon->ItemClass == ItemClassCommon)
//return BasicBonus;
if ((Weapon->ItemType == ItemType1HS) || (Weapon->ItemType == ItemTypePierce) || (Weapon->ItemType == ItemType1HB))
return BasicBonus;
if (Weapon->Delay <= 27)
return (BasicBonus + 1);
if (Weapon->Delay <= 39)
return (BasicBonus + ((GetLevel()-27) / 4));
if (Weapon->Delay <= 41)
return (BasicBonus + ((GetLevel()-27) / 4) + 1);
//reno-calc 2hand dmg bonus
if (Weapon->Delay >= 42)
{
int levelint = 0;
int delayint = 0;
if (GetLevel() > 54)
levelint++;
if (GetLevel() > 56)
levelint++;
if (GetLevel() > 56)
levelint++;
if (GetLevel() > 58)
levelint++;
if (GetLevel() > 59)
levelint++;
if (GetLevel() > 66)
levelint++;
if (GetLevel() > 71)
levelint++;
if (Weapon->Delay > 42)
delayint++;
if (Weapon->Delay > 44)
delayint++;
return (((Weapon->Delay-37)/3) + ((GetLevel()-25)/5) + ((Weapon->Delay * ((GetLevel()-50) + levelint))/40) + delayint + BasicBonus);
}
}