Skip to content

Instantly share code, notes, and snippets.

@tobmaps
Created October 11, 2011 19:06
Show Gist options
  • Save tobmaps/1279062 to your computer and use it in GitHub Desktop.
Save tobmaps/1279062 to your computer and use it in GitHub Desktop.
Ebon Plague, Curse of the Elements stacking fix
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 5ba470e..7cc5ef1 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -10588,7 +10588,25 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32
// from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
// multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085)
- TakenTotalMod *= victim->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, spellProto->GetSchoolMask());
+ float multiplier = 1.0f;
+ int32 dmgBonusNonstackable = 0;
+ uint32 iconId = 0;
+ uint32 misc_mask = spellProto->GetSchoolMask();
+ AuraEffectList const& mTotalAuraList = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
+ for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
+ {
+ if ((*i)->GetMiscValue() & misc_mask)
+ {
+ iconId = (*i)->GetSpellInfo()->SpellIconID;
+ if (!(iconId == 2991 || iconId == 55 || iconId == 1993))
+ AddPctN(multiplier, (*i)->GetAmount());
+ else if ((*i)->GetAmount() > dmgBonusNonstackable)
+ dmgBonusNonstackable = (*i)->GetAmount();
+ }
+ }
+ if (dmgBonusNonstackable != 0)
+ AddPctN(multiplier, dmgBonusNonstackable);
+ TakenTotalMod *= multiplier;
// .. taken pct: dummy auras
AuraEffectList const& mDummyAuras = victim->GetAuraEffectsByType(SPELL_AURA_DUMMY);
@@ -10606,11 +10624,6 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32
AddPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount())));
}
break;
- // Ebon Plague
- case 1933:
- if ((*i)->GetMiscValue() & (spellProto ? spellProto->GetSchoolMask() : 0))
- AddPctN(TakenTotalMod, (*i)->GetAmount());
- break;
}
}
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index cfa2808..2b8bfe1 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3109,6 +3109,7 @@ void SpellMgr::LoadDbcDataCorrections()
case 51726:
spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS;
spellInfo->SpellFamilyFlags[2] = 0x10;
+ spellInfo->EffectApplyAuraName[1] = SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN;
break;
case 41913: // Parasitic Shadowfiend Passive
spellInfo->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends
@DarkS1de
Copy link

In member function 'uint32 Unit::SpellDamageBonus(Unit_, const SpellInfo_, uint32, DamageEffectType, uint32)':
error: 'misc_mask' was not declared in this scope

@tobmaps
Copy link
Author

tobmaps commented Oct 12, 2011

try to add uint32 misc_mask = spellProto->GetSchoolMask(); above uint32 iconId = 0;

@DarkS1de
Copy link

ok, no error now!

@Jildor
Copy link

Jildor commented Oct 17, 2011

and Earth and Moon no?

Edit: I test this fix and I think not works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment