PDA

View Full Version : Calculating Bonus Damage


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));
}

ChaosSlayer
09-09-2008, 06:14 PM
I have inline question on the subject as well.
does dmg bonsu of a weapon is been added to the base dmg of the weapon (so a dmg 10 weapon with dmg bonsu of 2 becomes 12 dmg base weapon) or does the dmg added to the final strike? (10 dmg weapon say produced 14 dmg and 2 added at the end)?

if its the 2nd way the dmg bonus not realy adding all that much dmg... (you prabobly hiting for 1200+ with 50 dmg weapon around lev 75 so say +25 dmg bonus to 1200 dmg delivered hardly noticeable)

KLS
09-10-2008, 04:00 AM
That above is basically the code. It's added on top of the calculated hit not as part of base damage. People have been pestering me to fix it but I really haven't been able to figure out a formula that works; there's so variable I'm missing.

It's only about 50% accurate right now on most weapons, so I think people are kind of deluding themselves into thinking it will fix all 2h weapon's problems. It would certainly help if it worked right though.

cybernine186
09-10-2008, 11:56 AM
So the client actually views the weapon as the correct Bonus Damage but its only for a reference. If I can determine the correct formula I will post it.

Thanks for the quick reply.