aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp37
-rw-r--r--src/server/game/Spells/Auras/SpellAuraDefines.h4
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp20
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h3
4 files changed, 31 insertions, 33 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index bff0123aa87..0d035c748f6 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -6693,32 +6693,17 @@ void Unit::UpdateDisplayPower()
break;
default:
{
- ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass());
- if (cEntry && cEntry->PowerType < MAX_POWERS)
- displayPower = Powers(cEntry->PowerType);
- if (GetTypeId() == TYPEID_PLAYER)
+ Unit::AuraEffectList const& powerTypeAuras = GetAuraEffectsByType(SPELL_AURA_MOD_POWER_DISPLAY);
+ if (!powerTypeAuras.empty())
{
- switch (GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID))
- {
- case TALENT_SPEC_PRIEST_SHADOW:
- displayPower = POWER_INSANITY;
- break;
- case TALENT_SPEC_SHAMAN_ELEMENTAL:
- case TALENT_SPEC_SHAMAN_ENHANCEMENT:
- displayPower = POWER_MAELSTROM;
- break;
- case TALENT_SPEC_MONK_MISTWEAVER:
- displayPower = POWER_MANA;
- break;
- case TALENT_SPEC_DRUID_BALANCE:
- displayPower = POWER_LUNAR_POWER; // only balance druids get lunar power, even if other specs have access to moonkin form
- break;
- case TALENT_SPEC_DEMON_HUNTER_VENGEANCE:
- displayPower = POWER_PAIN;
- break;
- default:
- break;
- }
+ AuraEffect const* powerTypeAura = powerTypeAuras.front();
+ displayPower = Powers(powerTypeAura->GetMiscValue());
+ }
+ else
+ {
+ ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass());
+ if (cEntry && cEntry->PowerType < MAX_POWERS)
+ displayPower = Powers(cEntry->PowerType);
}
break;
}
@@ -8297,8 +8282,6 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
{
if (!spellProto->IsPositive())
{
- // Modify critical chance by victim SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE
- crit_chance += victim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE, schoolMask);
// Modify critical chance by victim SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE
crit_chance += victim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE);
}
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index a67021e2045..33640afe0a3 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -236,7 +236,7 @@ enum AuraType
SPELL_AURA_SPIRIT_OF_REDEMPTION = 176,
SPELL_AURA_AOE_CHARM = 177,
SPELL_AURA_178 = 178, // old SPELL_AURA_MOD_DEBUFF_RESISTANCE, unused
- SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179,
+ SPELL_AURA_MOD_POWER_DISPLAY = 179,
SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180,
SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus
SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT = 182,
@@ -459,7 +459,7 @@ enum AuraType
SPELL_AURA_399 = 399,
SPELL_AURA_MOD_SKILL_2 = 400,
SPELL_AURA_401 = 401,
- SPELL_AURA_MOD_POWER_DISPLAY = 402,
+ SPELL_AURA_MOD_OVERRIDE_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 ea1a064461e..dff4a393143 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -238,7 +238,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end
&AuraEffect::HandleCharmConvert, //177 SPELL_AURA_AOE_CHARM
&AuraEffect::HandleUnused, //178 old SPELL_AURA_MOD_DEBUFF_RESISTANCE unused 4.3.4
- &AuraEffect::HandleNoImmediateEffect, //179 SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE implemented in Unit::SpellCriticalBonus
+ &AuraEffect::HandleAuraModPowerDisplay, //179 SPELL_AURA_MOD_POWER_DISPLAY
&AuraEffect::HandleNoImmediateEffect, //180 SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS implemented in Unit::SpellDamageBonus
&AuraEffect::HandleUnused, //181 unused (4.3.4) old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS
&AuraEffect::HandleAuraModResistenceOfStatPercent, //182 SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT
@@ -461,7 +461,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNULL, //399
&AuraEffect::HandleAuraModSkill, //400 SPELL_AURA_MOD_SKILL_2
&AuraEffect::HandleNULL, //401
- &AuraEffect::HandleModPowerDisplay, //402 SPELL_AURA_MOD_POWER_DISPLAY
+ &AuraEffect::HandleAuraModOverridePowerDisplay, //402 SPELL_AURA_MOD_OVERRIDE_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::HandleModRatingPct, //405 SPELL_AURA_MOD_RATING_PCT
@@ -4159,7 +4159,21 @@ 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
+void AuraEffect::HandleAuraModPowerDisplay(AuraApplication const* aurApp, uint8 mode, bool apply) const
+{
+ if (!(mode & AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK))
+ return;
+
+ if (GetMiscValue() >= MAX_POWERS)
+ return;
+
+ if (apply)
+ aurApp->GetTarget()->RemoveAurasByType(GetAuraType(), ObjectGuid::Empty, GetBase());
+
+ aurApp->GetTarget()->UpdateDisplayPower();
+}
+
+void AuraEffect::HandleAuraModOverridePowerDisplay(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
return;
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index c6da3bf57f6..edb7a461b73 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -248,7 +248,8 @@ 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;
+ void HandleAuraModPowerDisplay(AuraApplication const* aurApp, uint8 mode, bool apply) const;
+ void HandleAuraModOverridePowerDisplay(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;