diff options
author | Teleqraph <nyrdeveloper@gmail.com> | 2022-02-14 12:02:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 12:02:29 +0100 |
commit | a6dd3a1946be27acab80b78b71eecae7dbad82e6 (patch) | |
tree | b690d4e757fca39e1eba3a0b5874e8009f851076 | |
parent | 3798de4b391ee74550083fd376faf69852f28e7e (diff) |
Scripts/Spells: Fixed Cold Snap (#27734)
-rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 6b2b28f50f4..ff13accd597 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -447,33 +447,24 @@ class spell_mage_cold_snap : public SpellScript { PrepareSpellScript(spell_mage_cold_snap); + static uint32 constexpr SpellsToReset[] = + { + SPELL_MAGE_CONE_OF_COLD, + SPELL_MAGE_ICE_BARRIER, + SPELL_MAGE_ICE_BLOCK, + }; + bool Validate(SpellInfo const* /*spellInfo*/) override { - return ValidateSpellInfo - ({ - SPELL_MAGE_CONE_OF_COLD, - SPELL_MAGE_FROST_NOVA, - SPELL_MAGE_ICE_BARRIER, - SPELL_MAGE_ICE_BLOCK - }); + return ValidateSpellInfo(SpellsToReset) && ValidateSpellInfo({ SPELL_MAGE_FROST_NOVA }); } void HandleDummy(SpellEffIndex /*effIndex*/) { - GetCaster()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) - { - switch (itr->first) - { - case SPELL_MAGE_CONE_OF_COLD: - case SPELL_MAGE_FROST_NOVA: - case SPELL_MAGE_ICE_BARRIER: - case SPELL_MAGE_ICE_BLOCK: - return true; - default: - break; - } - return false; - }, true); + for (uint32 spellId : SpellsToReset) + GetCaster()->GetSpellHistory()->ResetCooldown(spellId, true); + + GetCaster()->GetSpellHistory()->RestoreCharge(sSpellMgr->AssertSpellInfo(SPELL_MAGE_FROST_NOVA, GetCastDifficulty())->ChargeCategoryId); } void Register() override |