Jump to content

[Fix][alt.patch from #66 post in [8237]] Mobs and AttackPower


Auntie Mangos

Recommended Posts

What bug does the patch fix? What features does the patch add?

It fixes damage formula for mobs, concerning Attack Power.

For which repository revision was the patch created?

8078

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

http://getmangos.eu/community/viewtopic.php?id=8564

Who has been writing this patch? Please include either forum user names or email addresses.

Me. [email protected]

[HIGHLIGHT=diff]diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp

index 2e512c3..1880f2b 100644

--- a/src/game/StatSystem.cpp

+++ b/src/game/StatSystem.cpp

@@ -414,7 +414,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, fl

float att_speed = GetAPMultiplier(attType,normalized);

- float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType)/ 14.0f * att_speed;

+ float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType) * att_speed / 14.0f;

float base_pct = GetModifierValue(unitMod, BASE_PCT);

float total_value = GetModifierValue(unitMod, TOTAL_VALUE);

float total_pct = GetModifierValue(unitMod, TOTAL_PCT);

@@ -802,8 +802,8 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)

return;

UnitMods unitMod = UNIT_MOD_DAMAGE_MAINHAND;

-

- float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType);

+ float dmg_from_ap = GetTotalAttackPowerValue(attType) * GetAPMultiplier(attType, false) / 14.0f;

+ float base_value = GetModifierValue(unitMod, BASE_VALUE) + dmg_from_ap;

float base_pct = GetModifierValue(unitMod, BASE_PCT);

float total_value = GetModifierValue(unitMod, TOTAL_VALUE);

float total_pct = GetModifierValue(unitMod, TOTAL_PCT);[/HIGHLIGHT]

It needs DB support. I've made a temp mini-patch to keep the damage a bit higher:

[HIGHLIGHT=SQL]UPDATE creature_template SET mindmg = mindmg * 7, maxdmg = maxdmg * 7 WHERE unit_class != 0 AND attackpower != 0;

UPDATE creature_template SET mindmg = (mindmg - (mindmg MOD 1)) WHERE (mindmg MOD 1) < 0.5 AND (mindmg MOD 1) > 0;

UPDATE creature_template SET mindmg = (maxdmg - (maxdmg MOD 1)) WHERE (maxdmg MOD 1) < 0.5 AND (maxdmg MOD 1) > 0;

UPDATE creature_template SET mindmg = (mindmg - (mindmg MOD 1) + 1) WHERE (mindmg MOD 1) > 0;

UPDATE creature_template SET maxdmg = (maxdmg - (maxdmg MOD 1) + 1) WHERE (maxdmg MOD 1) > 0;

UPDATE creature_template SET mindmg = 0.5943 + 1.407 * minlevel - 0.00058831 * minlevel * minlevel - 0.00074332 * minlevel * minlevel * minlevel + 0.0000137742 * minlevel * minlevel * minlevel * minlevel WHERE maxlevel < 81 AND rank = 0;

UPDATE creature_template SET maxdmg = -0.18526 + 2.2117 * minlevel - 0.02589 * minlevel * minlevel - 0.0005102 * minlevel * minlevel * minlevel + 0.0000168259 * minlevel * minlevel * minlevel * minlevel WHERE maxlevel < 81 AND rank = 0;

UPDATE creature_template SET attackpower = -0.19963 + 4.169 * minlevel + 0.032563 * minlevel * minlevel - 0.00200482 * minlevel * minlevel * minlevel + 0.000025775 * minlevel * minlevel * minlevel * minlevel WHERE maxlevel < 81 AND rank = 0;

UPDATE creature_template SET mindmg = mindmg * baseattacktime / 2000 WHERE maxlevel < 81 AND rank = 0;

UPDATE creature_template SET maxdmg = maxdmg * baseattacktime / 2000 WHERE maxlevel < 81 AND rank = 0;[/HIGHLIGHT]

That's a very temporary DB 'fix'.

Link to comment
Share on other sites

  • 39 years later...
  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic

I still don't get why the formula was changed in [7904] in the first place...they did add the damage multiplier, fine, but why did attack power suddenly give one damage per AP and disregard attack speed?

I thought they just changed meaning of the attack power field, but seeing that AP debuffs are now totally overpowered, it seems just wrong now...

From what i can tell, line 9 and 10 of the patch here are equivalent anyway, and 20+21 are pretty much equivalent to what the code was before 7904...so it's a (partial) revert...

So the only change remaining from 7904 is that final min/max damage are multiplied with new damage multiplier...

Link to comment
Share on other sites

Why change calc in playerdmg? Lines 9, 10

And also the / 14 was removed since it was not needed. If you halved the AP with that high amount you needed to put -> 4k ap to have any effect on it.

Attackspeed is contributed to mob's dps straight since it defines how fast it attacks, it doesn't need to be part of attackpower, mindmg, maxdmg calculation..

And for retail, the highest attackpower a mob has is somewhere ~700, the goal was to have real use for these values.

Whenever i have time to work on this i will work it on both udb / mangos side.. it may be that no additional mangos patches are needed, just db data change.

Link to comment
Share on other sites

Changes in playerdmg was purely cosmetic.

The /14 is needed, because it affects the way how do AP buffs/debuffs work on mobs. Without / 14 and having all mobs AP multiplied by 14 in DB, all players AP debuffs would be effectively 14 times weaker against mobs. It is better to keep formulas blizzlike.

Attackspeed is directly relevant when considering DPS and DPS is relevant when considering AP.

Link to comment
Share on other sites

"Without / 14 and having all mobs AP multiplied by 14 in DB, all players AP debuffs would be effectively 14 times weaker against mobs. It is better to keep formulas blizzlike."

Why would they be? If mob has 720 AP in db table (For example lvl 83 boss in naxx) And that is / 14 before anything else is done, it would be 51. So when you use demoralizing shout for example, it removes what.. 510 ap when talented?

Would the mob be then -459 AP ? :P

In player dmg calculation 1 AP = 14 DPS, but after alot of research the case seems not to be the same on mobs.

And think if you want to add 1000 dmg to mob by adding attakckpower to it, you would need to add 14 000 attackpower in db table. Doesn't sound very good..

Link to comment
Share on other sites

"Without / 14 and having all mobs AP multiplied by 14 in DB, all players AP debuffs would be effectively 14 times weaker against mobs. It is better to keep formulas blizzlike."

Why would they be? If mob has 720 AP in db table (For example lvl 83 boss in naxx) And that is / 14 before anything else is done, it would be 51. So when you use demoralizing shout for example, it removes what.. 510 ap when talented?

No, no, no... 720 AP in db table = 720 AP in core calculations. And that is bonus DPS that is = 51 in that case. -510 AP from Demoralizing Shout would make it 210 AP which makes the bonus DPS 15 instead of 51.

BTW. If a Naxx boss has only 720 AP, that's just wrong data, it would mean that he has ~ 170 DPS * multiplier. Before my patch it would give him +720 DMG instead of +720/14 DPS adn that may be the cause of wrong data in DB.

Would the mob be then -459 AP ? :P

As I said earlier, no, and you cannot have negative AP.

In player dmg calculation 1 AP = 14 DPS, but after alot of research the case seems not to be the same on mobs.

It is the same on mobs. Mobs are different from players only thanks to the dmg_muliplier. And it is 14 AP = 1 DPS , not the other way.

And think if you want to add 1000 dmg to mob by adding attakckpower to it, you would need to add 14 000 attackpower in db table. Doesn't sound very good..

If you want to add 1000 DPS via pure attackpower then yes, you'd have to add 14 000 AP, and yes, it would be a bad idea. Because you should increase mindmg and maxdmg too..... And that's all we need to do.

Link to comment
Share on other sites

http://www.tankspot.com/forums/f14/42342-level-80-boss-ap.html

Also, there is data straight from the server itself, where the attackpower values are, lvl 82 elite mob had ~600 ap if i remember right.

"It is the same on mobs" I would like to see the research data on that, instead of just an hunch, since my own research shows it the opposite.

But i don't bother arguin more than this. Gl with your patch.

Link to comment
Share on other sites

Thanks for the link. Their research says that after stripping around 573 AP from boss, you cannot strip more, ergo it has ~ 573 AP. But you are forgetting dmg_multilpier, which is high on Bosses.

My calculations (corresponding to formula presented on wowwiki):

32.8 AP reduction difference = 191 damage difference

574 total AP / 32.8 = 17.5 times a 32.8 AP reduction has to be stacked in order to make Maexxna have 0 AP

17.5 times AP reduction * 191 damage difference from this AP reduction = 3342.5 DMG coming from AP

Assuming 2000 (2 sec) baseattacktime

Before multiplier => 574 AP would give 82 DMG

multiplier = 3342.5 / 82 ~= 40

With my patch applied Maexnna should have:

[HIGHLIGHT=cpp]573 AP

2000 baseattacktime

405,5 mindmg

587,5 maxdmg

40 multiplier[/HIGHLIGHT]

And it is not about arguing, it's about finding out the truth.

Link to comment
Share on other sites

Exactly. But it has indirect relevance

Basic math: (a + b) * m = a*m + b*m

If anything happens to b (dmg_from_ap), it happens m times harder.

A player has a -1400 AP Demoralizing Shout.

Mob A has multiplier = 1 and 1400 AP and attacks once per second => dmg_from_ap = 100

Players uses DS, mob loses all his dmg_from_ap => DS decreased the total dmg by 100

Mob B has multiplier = 40 and 1400 AP and attacks once per second => dmg_from_ap = 4000

Players uses DS, mob loses all his dmg_from_ap => DS decreased the total dmg by 4000

The same spell, but works with different power on mobs with different multipliers.

Multipliers are here to make static ap buffs/debuffs work on hard mobs too. Nobody would even bother putting talents into Demoralizing Shout if it has worked 40 times weaker than currently.

Link to comment
Share on other sites

I find Dagguh's math plausible too, the proof of wowwiki formulas is in Fenier's post of the posted tankspot thread:

The Infesting Jormungar.

If we assume normal mobs have a dmg_multiplier of one, things work out perfectly:

Demoralizing Roar: Base Value of -411 AP

That would be -29.3 dps. In UDB this mob has attack time of 2s, which would translate into ~58.7 damage reduction, and the values listed are indeed 59 lower with Demoralizing Roar.

Unfortunately there's several different "Azure Mage Slayer" entries in UDB, but dmg_multiplier would be between 1.35 and 1.8 for the values listed...

And bosses like Maxxnar would indeed have a multiplier of 40 according to the data, that's quite a bit higher than i expected.

As it is right now, we would have to fix the dmg_multiplier for normal mobs by multiplying with baseattacktime/(1000*14) so the AP contribution aswell as player's AP debuffs aren't horribly overpowered.

Link to comment
Share on other sites

Azure Mage Slayer is a Dungeon Elite and deserves that higher multiplier ;)

I was a bit surprised by the 40 factor as well, but after thinking about it for a while, you can see how Blizz made their job easier via this multiplier. They don't have to code AP buffs/debuffs differently for different mobs. Thanks to multipliers, they are useful against both trash mobs and bosses and still are not imbalanced. Gj Blizz.

Yea, that would fix AP contribution, but would also mess up the min-max dmg influence terribly. Especially when now all creatures with unit_class != 0 and ap != 0 havbe theri min-max dmg divided by 7.

Link to comment
Share on other sites

Especially when now all creatures with unit_class != 0 and ap != 0 havbe theri min-max dmg divided by 7.

You do understand that this has nothing to do with the core? This is db related data, in this case UDB.

The dmg values which the said db project implented were gotten from data packets, they were not made up by excel or anything.

All the data and the dmg patch i wrote was based on this chunk of data and the research of it.

But there was a thing we didin't notice. We did got mindmg, maxdmg, attackpower from the data but it seems that it was sent as real mindmg, real maxdmg, attackpower

Eg. The mindmg, maxdmg already had the damage from attackpower plussed to them.

Which caused the high dmg on mobs offcourse..

Which was then countered as temp solution to / 7 the dmg's but it didin't help much as AP stayed relatively high for named mobs.

So if you are making this patch to support the values in udb (if thats the db you use to test it) it will go wrong, as the values in current udb are not 100% the ones they should be. The goal is to use the values straight without any hacks in either core, or db.

That is the reason why i do not look at this patch so deeply yet.

Link to comment
Share on other sites

The goal is to use the values straight without any hacks in either core, or db.

This.

This is everything I am trying to do here.

And I can't stress it out more: this patch is supposed to work with original, blizzard values in DB and vastly needs DB support.

You do understand that this has nothing to do with the core? This is db related data, in this case UDB.

Yes, of course. I was just reffering to Lynx3d, telling him that trying to manipulate with current DB data, will not fix things.

As it is right now, we would have to fix the dmg_multiplier for normal mobs by multiplying with baseattacktime/(1000*14) so the AP contribution aswell as player's AP debuffs aren't horribly overpowered.

This is what I was replying to, and you must agree, that it's not the way to do it.

Link to comment
Share on other sites

Yes, normal mobs do require dmg_multiplier != 1 currently to have blizzlike damage behaviour, and min/maxdmg indeed gets skewed by that.

Let me calculate the example of the Infesting Jormunga again:

Melee Damage 421 - 587

Attack Speed: 2.0s

That's am average DPS of 252.

Say we want 30% of that from AP, that is 75.6 DPS, or 151.2 damage per hit.

So let's substract that from min/max damage, and set the attack power to 75.6*14 = 1058.

You can already see, a ~500 AP debuff would remove about half of the AP bonus of this mob, wich is inline with the mentioned ~16% reduced damage with skilled demo roar.

With the proposed patch here, we would set the DB values to:

mindmg: 270

maxdmg: 436

attack_power: 1058

dmg_multiplier: 1

However with the current core code, we have to adjust the damage multiplier by 2/14, which backfires on our mindmg and maxdmg so we get:

mindmg: 1890

maxdmg: 3052

attack_power: 1058

dmg_multiplier: 0.14285

This is obviously far from intuitive. And yes, i just set these values in the DB and fought some of the mobs, the damage is as expected, and demoralizing shout reduces it as expected.

Link to comment
Share on other sites

With the proposed patch here, we would set the DB values to:

mindmg: 270

maxdmg: 436

attack_power: 1058

dmg_multiplier: 1

Big snowfall sends these values to lvl 80 mob, warrior (What infesting jormungar is)

mindmg = 422

maxdmg = 586

attackpower=642

Not 1058 attackpower definitely.

Link to comment
Share on other sites

Fine, then it has only ~18% total damage from AP, still more than most (all?) classes can debuff solo, but that's not the point...the point is, attack power currently scales with complicated factor that is dependant of attack speed and hence needs individual dmg_multiplier calculation for each mob.

Link to comment
Share on other sites

Using data from tankspot and according to my calculations, Infesting Jormungar should have:

[HIGHLIGHT=cpp]571 AP

2010 baseattacktime

339 mindmg

505 maxdmg

1 multiplier[/HIGHLIGHT]

The AP contribution here is 16,26984 %

Apparently the 70:30 proportion is not in power, at least not for 60+/70+/80+ level mobs. Wiki says it is a general distribution, and we all know that on higher levels, things work out a bit differently with mobs.

@Seizer: Well, tehre are some discrepancies and this is understandable, because results coming from you and tankspot are a bit different, but that IMO is negligible.

Test Case 1:

Mob: Infesting Jormungar

Zone: Storm Peaks

Mob Type: Normal

Base Stats:

Melee Damage 421 - 587 Damage

I infer that they might have some imprecise data.

Link to comment
Share on other sites

I just unweared all my armor, that left me with 0.69% dmg reduction, since the base armor.

Also the dmg range is basically the same on tankspot & on me, since of that 0.69% reduction and if i would have sitted there for 3 hours i might have gotten the absolute mindmg and absolute maxdmg, i just went there for 1 health bar.

But

  1.
     571  AP
  2.
     2010 baseattacktime
  3.
     339  mindmg
  4.
     505  maxdmg
  5.
     1    multiplier

Are too far away from the values they should have, eg no need to do "hacks" on db..

And on related info, baseattacktime can be gotten from packets, it should not be treated as manually changeable data.

Link to comment
Share on other sites

I just unweared all my armor, that left me with 0.69% dmg reduction, since the base armor.

Also the dmg range is basically the same on tankspot & on me, since of that 0.69% reduction and if i would have sitted there for 3 hours i might have gotten the absolute mindmg and absolute maxdmg, i just went there for 1 health bar.

But

  1.
     571  AP
  2.
     2010 baseattacktime
  3.
     339  mindmg
  4.
     505  maxdmg
  5.
     1    multiplier

Are too far away from the values they should have, eg no need to do "hacks" on db..

Excuse me, what hacks?

And how do you know what values should they have? The values you are getting might be already processed. E.g. they already include AP.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use