aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraDefines.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp24
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h1
4 files changed, 26 insertions, 3 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 9b95fe9b5a4..f65449dbf74 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -16123,7 +16123,7 @@ uint32 Unit::GetCastSpellXSpellVisualId(SpellInfo const* spellInfo) const
Unit::AuraEffectList const& visualOverrides = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_SPELL_VISUAL);
for (AuraEffect const* effect : visualOverrides)
{
- if (effect->GetMiscValue() == spellInfo->Id)
+ if (uint32(effect->GetMiscValue()) == spellInfo->Id)
{
if (SpellInfo const* visualSpell = sSpellMgr->GetSpellInfo(effect->GetMiscValueB()))
{
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index ae34e06fe37..b063788f76f 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -459,7 +459,7 @@ enum AuraType
SPELL_AURA_399 = 399,
SPELL_AURA_MOD_SKILL_2 = 400,
SPELL_AURA_401 = 401,
- SPELL_AURA_402 = 402,
+ SPELL_AURA_MOD_POWER_DISPLAY = 402,
SPELL_AURA_OVERRIDE_SPELL_VISUAL = 403,
SPELL_AURA_OVERRIDE_ATTACK_POWER_BY_SP_PCT = 404,
SPELL_AURA_MOD_RATING_PCT = 405, // NYI
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 136aea7a811..cab3dc8f6e6 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -461,7 +461,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNULL, //399
&AuraEffect::HandleAuraModSkill, //400 SPELL_AURA_MOD_SKILL_2
&AuraEffect::HandleNULL, //401
- &AuraEffect::HandleNULL, //402
+ &AuraEffect::HandleModPowerDisplay, //402 SPELL_AURA_MOD_POWER_DISPLAY
&AuraEffect::HandleNoImmediateEffect, //403 SPELL_AURA_OVERRIDE_SPELL_VISUAL implemented in Unit::GetCastSpellXSpellVisualId
&AuraEffect::HandleOverrideAttackPowerBySpellPower, //404 SPELL_AURA_OVERRIDE_ATTACK_POWER_BY_SP_PCT
&AuraEffect::HandleNULL, //405 SPELL_AURA_MOD_RATING_PCT
@@ -4196,6 +4196,28 @@ void AuraEffect::HandleAuraModIncreaseBaseManaPercent(AuraApplication const* aur
aurApp->GetTarget()->HandleStatModifier(UNIT_MOD_MANA, BASE_PCT, float(GetAmount()), apply);
}
+void AuraEffect::HandleModPowerDisplay(AuraApplication const* aurApp, uint8 mode, bool apply) const
+{
+ if (!(mode & AURA_EFFECT_HANDLE_REAL))
+ return;
+
+ PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(GetMiscValue());
+ if (!powerDisplay)
+ return;
+
+ Unit* target = aurApp->GetTarget();
+ if (target->GetPowerIndex(powerDisplay->PowerType) == MAX_POWERS)
+ return;
+
+ if (apply)
+ {
+ target->RemoveAurasByType(GetAuraType(), ObjectGuid::Empty, GetBase());
+ target->SetUInt32Value(UNIT_FIELD_OVERRIDE_DISPLAY_POWER_ID, powerDisplay->ID);
+ }
+ else
+ target->SetUInt32Value(UNIT_FIELD_OVERRIDE_DISPLAY_POWER_ID, 0);
+}
+
/********************************/
/*** FIGHT ***/
/********************************/
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index a046a675eb4..73766bbcf1a 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -248,6 +248,7 @@ class TC_GAME_API AuraEffect
void HandleAuraModIncreaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraIncreaseBaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraModIncreaseBaseManaPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
+ void HandleModPowerDisplay(AuraApplication const* aurApp, uint8 mode, bool apply) const;
// fight
void HandleAuraModParryPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraModDodgePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;