Jump to content

[Patch] Exclusive Resistance Auras and Aura Stacking in General


Auntie Mangos

Recommended Posts

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

This patch provides a system for handling nonstacking aura effects and implements AuraModResistanceExclusive as an example of it (AuraModResistanceExclusive effects should never stack).

For which repository revision was the patch created?

8237

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=2838&highlight=exclusive+resistance

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

Myself

Patch Here

First off, let me state that this is a different issue from entire spells not stacking, like when one paladin casts a blessing on a target, then a different blessing on the same target, and the old spell gets completely removed.

The issue addressed by this patch are the individual aura effects of buffs. For example, when a unit has Mark of the Wild, and then Shadow Protection is cast, the shadow resistance they provide shouldn't stack. Of course, Shadow Protection shouldn't remove Mark of the Wild just because it provides more of that resistance, and when Shadow Protection is removed, Mark of the Wild's shadow resistance should kick in again. So with this patch, I added new categories of UnitModifierTypes, NONSTACKING_VALUE and NONSTACKING_PCT. This is to make it easier to find what the highest value for the nonstacking aura is, and whether one aura should replace another.

Additionally, these fields can be used for auras other than AuraModResistanceExclusive. For example, Horn of Winter should not stack with Totem of Strength of Earth, Unleashed Rage should not stack with Abomination's Strength or Trueshot Aura, etc (a more extensive list here). I added a flag in Auras (m_stacking) because I don't think a method for determining which of these buffs should stack exists in code (not all are as simple as AuraModResistanceExclusive :P), so they may have to be implemented via hack in the future.

Note: You will still see multiple buffs of the same spell with different ranks. For example, with two hunters in a party, you can have Aspect of the Wild ranks 4 and 3; this is a different issue, but still only one Aspect has any function.

Thoughts, criticisms, comments, advice? Not too hacky I hope? All appreciated. :)

Edit: Replaced GetAuras with GetAurasByType

Edit2: Rebased diff on 8077

Edit3: Added more auras, 8140

Edit4: Updated to 8237 (small Unit.h change after 8236)

Link to comment
Share on other sites

  • 39 years later...

So here's an update on this patch. In short, I added checks for auras that do not stack with SPELL_AURA_MOD_POWER_REGEN, SPELL_AURA_MOD_ATTACK_POWER, SPELL_AURA_MOD_ATTACK_POWER_PCT, SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT.

I created a new method for auras, IsEffectStacking, that basically handles the unavoidable (at least as far as I see) hacky aspect of this fix. This is currently called in the Aura constructor, only because that's where most of the other members are defined. It might not make sense to check if the aura effects stack before checking if the spell itself stacks and can be applied to the target, so this isn't set in stone of course. If it ends up being a slower call, it can be moved, of course.

I changed how HandleModPowerRegen works with mana completely; mana regen bonuses from auras are now handled through UnitMods and m_auraModifiersGroup. The whole point of this field as I see it is to avoid unnecessary iteration through aura effects, so it made sense to put these auras here (even if the values aren't applied in exactly the same way, see UpdateManaRegen), and this was necessary to apply my fix to the stacking of Blessing of Wisdom and Mana Spring Totem.

Edit: Updated to 8097; fixed whitespace error and typo

Link to comment
Share on other sites

Nice job, I hope this will be implemented in master :)

Checking your code, I saw this:

case SPELL_AURA_MOD_POWER_REGEN:

// (Greater) Blessing of Wisdom / Mana Spring Totem

if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_PALADIN ||

GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN)

return false; break;

1-I think that "break;" is not needed here, it's redundant because of the return right before it.

2-By just checking the spell family name, what happens with judgment of wisdom? (I mean the one which gives mana to 10 members in the raid, same as SP & Hunters).

Link to comment
Share on other sites

1-I think that "break;" is not needed here, it's redundant because of the return right before it.

If those breaks aren't there, then if the if's condition returns false, it'll fall through the cases. For example, all the mod_attack_power (above resistance_exclusive) would always return false. ;)

I looked through the spells and only Blessing of Wisdom and Greater Blessing of Wisdom were in the paladin spell family and had SPELL_AURA_MOD_POWER_REGEN. Likewise, only Mana Spring Totem had that aura and was in the shaman spell family. Judgement of Wisdom is a script effect, and it triggers a spell that has spell_effect_energize, so it isn't an aura and shouldn't be affected by this.

You can see that I added additional checks besides SpellFamilyName where necessary, but I could have missed something, so feel free to check.

Link to comment
Share on other sites

Arf my mistake, it's obvious ... I need more coffee I guess ^^

Thanks again for this patch (as we're still in BC, it's gonna be harder for us to reach the shadow resist cap to defeat Sharaz without Priest + Paladin + Druid resist ^^)

Link to comment
Share on other sites

Arf my mistake, it's obvious ... I need more coffee I guess ^^

Thanks again for this patch (as we're still in BC, it's gonna be harder for us to reach the shadow resist cap to defeat Sharaz without Priest + Paladin + Druid resist ^^)

:D

Edit: Hmmm, you bring up another point though. I don't think this patch can be imported to 0.12 as is, because this was actually a change created in 3.0.2 . The version with just Exclusive Resistances is here, if you want to reference it.

Another update on this patch.

- Added Mod Armor % effects (Inspiration and Ancestral Healing)

- Added Commanding Shout and Blood Pact

- Added support for nonstacking stat buffs (sorry I left it half implemented in the last update).

Unfortunately, I don't think any more aura effects can be implemented unless the underlying code is changed. Specifically, I think more aura effects will have to be switched to using UnitMods, like I did with HandleModPowerRegen.

Link to comment
Share on other sites

Updated this patch to a fix a bug with how the client displayed the buff mod fields' values. When these unit fields are updated,

(UNIT_FIELD_POSSTAT / UNIT_FIELD_NEGSTAT / UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE / UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE)

they are changed without regard to the order that the mods are applied, which should be

((BASE_VALUE * BASE_PCT) + TOTAL_VALUE) * TOTAL_PCT)

So when you alternatingly apply buffs that add values and percents, and then remove them in a different order, things start to get screwy with how the client shows the value. This is a bug that exists on the master branch.

For example, cast mark of the wild, then blessing of kings. Then, remove mark of the wild first and then blessing of kings. Check your base stats before and after.

Also,

- Moved the division step on the NONSTACKING_PCT to a later part of the calculation to avoid storing an inaccurate float, which sometimes would cause minor problems.

- Changed ApplyResistanceBuffMods(Percent)Mod to look like ApplyStat(Percent)BuffMod. Also removed the bool "positive" from those methods, because it's the equivalent of the sign of val. It has been kept in SetResistance because it's used in that case to initialize the fields to 0.

- Also changed the "return false; break;" to two lines to make it clearer. I thought I saw this style elsewhere in the code, maybe I'm imagining things :P

- Changed the comments in UpdateFields.h where some fields were incorrectly described as INTs.

Last tested on 8106

Edit: Forgot to make GetMaxPositiveAuraModifier etc. check only for nonstacking auras where appropriate; patch updated

Link to comment
Share on other sites

Update. In short, added support for nonstacking spell power increase, crit %, healing % received, damage % taken reduction buffs, and haste auras. Only a few debuffs are implemented so far, but most just need to be checked into Aura::IsEffectStacking.

  • * I made a better way to check if buffs stacks. First, I implemented a check to see if the aura is from the spell effect SPELL_EFFECT_APPLY_AREA_AURA_RAID, which applies auras that never stack. Then, I added a spell attr checks for SPELL_ATTR_EX6_UNK26, which appear to be used by almost all nonstacking buffs (and some healing spells that are affected by auras that at +%bonus healing power, like the spells affected by Empowered Rejuvenation). For example, all the player versions of blessing of might have this flag, On the other hand, this npc's blessing of might does not have this flag, and it will stack with related buffs. With this change, Rampage is the only buff that needs to be checked with a SpellIconId hack (oddly, it is the only spell with SPELL_ATTR_EX6_UNK30 and not SPELL_ATTR_EX6_UNK26).
    * Implemented stacking for SPELL_AURA_MOD_HEALING_PCT, instead of just using the largest value. So for example, the Paladin talent Divinity will now stack with Tree of Life aura (and Improved Devotion Aura, when that gets fixed).
    * Renamed SPELL_AURA_MOD_HASTE -> SPELL_AURA_MOD_MELEE_HASTE (Improved Icy Talons/Windfury no longer affect ranged weapons) and added a somewhat hackish implementation. Wasn't sure where the most unobtrusive place to plant the nonstacking value for this buff was, so I added two more elements to m_modAttackSpeedPct. A hackish result of this is the two "WeaponAttackTypes" that are used to select for these indexes.
    * Removed two checks to SPELL_AURA_MOD_CRIT_PERCENT_VERSUS in critical healing and damage calculations. No spell has that in 3.1.x, and this patch won't be backported to 0.12 anyway.
    * Removed checks for weapon classes from HandleModDamageDone. I'm pretty sure the auras that this applied to haven't been used since classic beta. (4354, 4443, 4464, 4493, 5361, 5427). Additionally, PLAYER_FIELD_MOD_DAMAGE_DONE_NEG should be an int32; changed calls to ___UInt32Value to ___Int32Value.
    * It seemed somewhat odd that UpdateSpellDamageAndHealingBonus was called when healing bonuses were applied, but not when damage bonuses were applied (granted that there are a lot less auras that only give one and not the other). So I changed it so that both would always call UpdateSpellDamageAndHealingBonus, and made UpdateSpellDamageAndHealingBonus take into consideration the value in PLAYER_FIELD_MOD_DAMAGE_DONE_NEG (which is changed by HandleModDamageDone prior to the call). I found no auras of SPELL_AURA_MOD_DAMAGE_DONE that had an EquippedItemInventoryTypeMask not equal to 0, so the additional check for wands is redundant in Unit::SpellBaseDamageBonus. Therefore, I changed that check to GetTotalAuraModifierByMiscMask.

EDIT: Fixed a bug with drinks not changing mana regen on apply while decreasing it when unapplied.

EDIT2: Part reverted the mana regen changes, and instead changed GetTotalAuraMultiplierByMiscValue and GetTotalAuraModifierByMiscValue to take care of the problem of nonstacking mana regen buffs.

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...
  • 10 months later...

Actually this patch was working perfect. Any chance to get it updated nos4r2zod ? I tryed to work a bit on it but I must have missed something as It wasnt working properly for me... Gonna try again today as it was really good patch (Hope someone else from devs maybe could take look at it and say a word about quality of this ?)

Link to comment
Share on other sites

Compared to blizzard's servers. 3xbuff biving +10% Attack Power (which is multiplied, not added) instead of only 1 such buff, 2xhaste buff, ahh, I could list so many buffs. 10k dps with gear only from Naxxramas and Obsidian Sanctum. Would this be normal on 3.3.5 with such gear?

never seen anyone doing that, maybe you have a core mod that affects damage or your players are hacking in some say

Yep dmg is very high in 25 mode.

I had to increase all mob hp by 1.5x, otherwise they are just freeloot.

scripts are supposed to prevent the "free loot"

Link to comment
Share on other sites

Compared to blizzard's servers. 3xbuff biving +10% Attack Power (which is multiplied, not added) instead of only 1 such buff, 2xhaste buff, ahh, I could list so many buffs. 10k dps with gear only from Naxxramas and Obsidian Sanctum. Would this be normal on 3.3.5 with such gear?

never seen anyone doing that, maybe you have a core mod that affects damage or your players are hacking in some say

Sorry but uhm... that You never seen anyone doing that doesnt mean it doesnt exist;

It is very old problem of mangos - just look at:

Blood Pack + Commanding Shout,

Blessing of Might + Battle Shout,

many many more.

the above patch fixes every case of should-not-stacking spells

Link to comment
Share on other sites

Well, almost all buffs simply stack on mangos so high dps is the natural consequence.

I'm rewriting this patch for my core, also added a few exceptions in the hacky part so that even more buffs won't stack. When I finish I'll post the diff.

I'm doing this with:

http://www.wowwiki.com/Buff#Buffs.2C_debuffs.2C_and_raid_stacking_in_WotLK

OK, I rewritten the patch and added a few small things (Demonic Pact now doesn't stack with totems)

Core rev. 10610 (with custom patches)

http://pastebin.com/i4DW4PeH

Basically, all buffs from the wowwiki link above follow stack rules, only Sanctified Retribution and Ferocious Inspiration still stack (dunno why).

Debuffs aren't handled in it. I will try to fix them in the future.

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