Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Spell::EffectRemoveCurrentSpellCooldown(SpellEffIndex effIndex)
- {
- if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
- return;
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
- SpellInfo const* spellInfo = GetSpellInfo();
- flag96 spellMask = spellInfo->Effects[effIndex].SpellClassMask;
- int32 ignoreSpellMask = spellInfo->Effects[effIndex].MiscValue;
- int32 ignoreSpellFamily = spellInfo->Effects[effIndex].MiscValueB;
- Player* player = m_caster->ToPlayer();
- SpellCooldowns const spellCDs = player->GetSpellCooldowns();
- for (SpellCooldowns::const_iterator itr = spellCDs.begin(); itr != spellCDs.end(); ++itr)
- {
- SpellInfo const* cdSpell = sSpellMgr->GetSpellInfo(itr->first);
- if (cdSpell && cdSpell->SpellFamilyName == spellInfo->SpellFamilyName && (cdSpell->SpellFamilyFlags & spellMask) && !ignoreSpellMask && !ignoreSpellFamily)
- player->RemoveSpellCooldown(cdSpell->Id, true);
- else if (cdSpell && cdSpell->SpellFamilyName == spellInfo->SpellFamilyName && ignoreSpellMask && !ignoreSpellFamily)
- player->RemoveSpellCooldown(cdSpell->Id, true);
- else if (cdSpell && ignoreSpellFamily)
- player->RemoveSpellCooldown(cdSpell->Id, true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment