cybernine186
09-09-2008, 06:09 PM
I am trying to determine the formula for calculating bonus damage on all weapons.
I have looked through the code and the only thing I can find is this code below. However say when I use "A Weighted Axe" with a delay of 150 and a character level of 50 the calculation works according to lucy (http://lucy.allakhazam.com/dmgbonus.html). Now the problem is if I change the level of the character to 60 it does not calculate out right. This is the information I get when I use this formula to calculate out the following levels. (The formula I used rounded down all fractions)
LEVEL || Bonus Dmg
50 || 52
53 || 54
55 || 56
60 || 58
Example: A Weighted Axe for a lvl 50 character
(0 + (((50 - 25) / 3) + 1) + ((50 - 27) / 4) + ((150 - 34) / 3)) = 52
Example: A Weighted Axe for a lvl 60 character
(0 + (((60 - 25) / 3) + 1) + ((60 - 27) / 4) + ((150 - 34) / 3)) = 58
Is the EMU Server just using there own formula of calculating the bonus damage of a weapon or am I not doing something right?
Any information is greatly appreciated.
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;
// Things get more complicated with 2 handers, the bonus is based on the delay of
// the weapon as well as a number stored inside the weapon.
int WeaponBonus = 0; // How do you find this out?
// Data for this, again, from www.monkly-business.com
if (Weapon->Delay <= 27)
return (WeaponBonus + BasicBonus + 1);
if (Weapon->Delay <= 39)
return (WeaponBonus + BasicBonus + ((GetLevel()-27) / 4));
if (Weapon->Delay <= 42)
return (WeaponBonus + BasicBonus + ((GetLevel()-27) / 4) + 1);
// Weapon must be > 42 delay
return (WeaponBonus + BasicBonus + ((GetLevel()-27) / 4) + ((Weapon->Delay-34) / 3));
}
I have looked through the code and the only thing I can find is this code below. However say when I use "A Weighted Axe" with a delay of 150 and a character level of 50 the calculation works according to lucy (http://lucy.allakhazam.com/dmgbonus.html). Now the problem is if I change the level of the character to 60 it does not calculate out right. This is the information I get when I use this formula to calculate out the following levels. (The formula I used rounded down all fractions)
LEVEL || Bonus Dmg
50 || 52
53 || 54
55 || 56
60 || 58
Example: A Weighted Axe for a lvl 50 character
(0 + (((50 - 25) / 3) + 1) + ((50 - 27) / 4) + ((150 - 34) / 3)) = 52
Example: A Weighted Axe for a lvl 60 character
(0 + (((60 - 25) / 3) + 1) + ((60 - 27) / 4) + ((150 - 34) / 3)) = 58
Is the EMU Server just using there own formula of calculating the bonus damage of a weapon or am I not doing something right?
Any information is greatly appreciated.
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;
// Things get more complicated with 2 handers, the bonus is based on the delay of
// the weapon as well as a number stored inside the weapon.
int WeaponBonus = 0; // How do you find this out?
// Data for this, again, from www.monkly-business.com
if (Weapon->Delay <= 27)
return (WeaponBonus + BasicBonus + 1);
if (Weapon->Delay <= 39)
return (WeaponBonus + BasicBonus + ((GetLevel()-27) / 4));
if (Weapon->Delay <= 42)
return (WeaponBonus + BasicBonus + ((GetLevel()-27) / 4) + 1);
// Weapon must be > 42 delay
return (WeaponBonus + BasicBonus + ((GetLevel()-27) / 4) + ((Weapon->Delay-34) / 3));
}