Skip to content

Instantly share code, notes, and snippets.

@Langerz82
Last active January 29, 2019 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Langerz82/affff92db9f0634d3a9099c157650ec6 to your computer and use it in GitHub Desktop.
Save Langerz82/affff92db9f0634d3a9099c157650ec6 to your computer and use it in GitHub Desktop.
diff --git a/src/game/WorldHandlers/SpellEffects.cpp b/src/game/WorldHandlers/SpellEffects.cpp
index 73b58bf..0ede320 100644
--- a/src/game/WorldHandlers/SpellEffects.cpp
+++ b/src/game/WorldHandlers/SpellEffects.cpp
@@ -926,6 +926,39 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
m_caster->CastCustomSpell(m_caster, 23783, &basepoints, NULL, NULL, true, NULL);
return;
}
+ case 24531: // Refocus
+ {
+ // Remove cooldowns for certain spells.
+ if (m_caster->GetTypeId() != TYPEID_PLAYER)
+ {
+ return;
+ }
+
+ std::vector<const char*> spellNames;
+ spellNames.push_back("Aimed Shot");
+ spellNames.push_back("Multishot");
+ spellNames.push_back("Volley");
+ spellNames.push_back("Arcane Shot");
+
+ // immediately finishes the cooldown on certain Hunter abilities
+ const SpellCooldowns& cm = ((Player*)m_caster)->GetSpellCooldownMap();
+ for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
+ {
+ SpellEntry const* spellInfo = sSpellStore.LookupEntry(itr->first);
+ std::string spellName = (const char*) spellInfo->SpellName[0];
+ bool found = (std::find(spellNames.begin(), spellNames.end(), spellName) != spellNames.end());
+ if (spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && found &&
+ GetSpellRecoveryTime(spellInfo) > 0)
+ {
+ ((Player*)m_caster)->RemoveSpellCooldown((itr++)->first, true);
+ }
+ else
+ {
+ ++itr;
+ }
+ }
+ return;
+ }
case 24781: // Dream Fog
{
if (m_caster->GetTypeId() != TYPEID_UNIT || !unitTarget)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment