diff options
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 6 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 6 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.h | 2 | ||||
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index d57dc6c4c24..f9f70d5a9f7 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -310,7 +310,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec continue; //Continue if we don't have the mana to actually cast this spell - if (tempSpell->ManaCost > me->GetPower(Powers(tempSpell->PowerType))) + if (tempSpell->ManaCost > me->GetPower(tempSpell->PowerType)) continue; //Check if the spell meets our range requirements diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 98bdfd7ce8c..b36a014d509 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4129,7 +4129,7 @@ void Spell::SendSpellStart() m_targets.Write(castData.Target); if (castFlags & CAST_FLAG_POWER_LEFT_SELF) - castData.RemainingPower = ASSERT_NOTNULL(m_caster->ToUnit())->GetPower(static_cast<Powers>(m_spellInfo->PowerType)); + castData.RemainingPower = ASSERT_NOTNULL(m_caster->ToUnit())->GetPower(m_spellInfo->PowerType); if (castFlags & CAST_FLAG_AMMO) { @@ -4205,7 +4205,7 @@ void Spell::SendSpellGo() m_targets.Write(castData.Target); if (castFlags & CAST_FLAG_POWER_LEFT_SELF) - castData.RemainingPower = ASSERT_NOTNULL(m_caster->ToUnit())->GetPower(static_cast<Powers>(m_spellInfo->PowerType)); + castData.RemainingPower = ASSERT_NOTNULL(m_caster->ToUnit())->GetPower(m_spellInfo->PowerType); if (castFlags & CAST_FLAG_RUNE_LIST) // rune cooldowns list { @@ -6402,7 +6402,7 @@ SpellCastResult Spell::CheckPower() const } // Check power amount - Powers powerType = Powers(m_spellInfo->PowerType); + Powers powerType = m_spellInfo->PowerType; if (int32(unitCaster->GetPower(powerType)) < m_powerCost) return SPELL_FAILED_NO_POWER; else diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 4eab08185a9..64483f03e76 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -809,7 +809,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) BaseLevel = spellEntry->baseLevel; SpellLevel = spellEntry->spellLevel; DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : nullptr; - PowerType = spellEntry->powerType; + PowerType = static_cast<Powers>(spellEntry->powerType); ManaCost = spellEntry->manaCost; ManaCostPerlevel = spellEntry->manaCostPerlevel; ManaPerSecond = spellEntry->manaPerSecond; @@ -3162,7 +3162,7 @@ int32 SpellInfo::CalcPowerCost(WorldObject const* caster, SpellSchoolMask school return unitCaster->GetHealth(); // Else drain all power if (PowerType < MAX_POWERS) - return unitCaster->GetPower(Powers(PowerType)); + return unitCaster->GetPower(PowerType); TC_LOG_ERROR("spells", "SpellInfo::CalcPowerCost: Unknown power type '%d' in spell %d", PowerType, Id); return 0; } @@ -3185,7 +3185,7 @@ int32 SpellInfo::CalcPowerCost(WorldObject const* caster, SpellSchoolMask school case POWER_FOCUS: case POWER_ENERGY: case POWER_HAPPINESS: - powerCost += int32(CalculatePct(unitCaster->GetMaxPower(Powers(PowerType)), ManaCostPercentage)); + powerCost += int32(CalculatePct(unitCaster->GetMaxPower(PowerType), ManaCostPercentage)); break; case POWER_RUNE: case POWER_RUNIC_POWER: diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 5870d948f5c..601ccf59f36 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -366,7 +366,7 @@ class TC_GAME_API SpellInfo uint32 BaseLevel; uint32 SpellLevel; SpellDurationEntry const* DurationEntry; - uint32 PowerType; + Powers PowerType; uint32 ManaCost; uint32 ManaCostPerlevel; uint32 ManaPerSecond; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index fec2f78696b..a5a9f4d33e4 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3124,7 +3124,7 @@ void SpellMgr::LoadSpellInfoCorrections() // Detect Undead ApplySpellFix({ 11389 }, [](SpellInfo* spellInfo) { - spellInfo->PowerType = 0; + spellInfo->PowerType = POWER_MANA; spellInfo->ManaCost = 0; spellInfo->ManaPerSecond = 0; }); |