Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint8 count = 0;
- while (count < chargesRemoved)
- {
- Aura* auraToDispel = nullptr;
- AuraMapBoundsNonConst range = m_ownedAuras.equal_range(spellId);
- for (AuraMap::iterator iter = range.first; iter != range.second, count < chargesRemoved; ++iter)
- {
- Aura* aura = iter->second;
- if (aura)
- {
- auraToDispel = aura;
- break;
- }
- }
- if (auraToDispel)
- {
- DispelInfo dispelInfo(dispeller, dispellerSpellId, chargesRemoved);
- // Call OnDispel hook on AuraScript
- auraToDispel->CallScriptDispel(&dispelInfo);
- if (auraToDispel->GetSpellInfo()->HasAttribute(SPELL_ATTR7_DISPEL_CHARGES))
- auraToDispel->ModCharges(-dispelInfo.GetRemovedCharges(), AURA_REMOVE_BY_ENEMY_SPELL);
- else
- auraToDispel->ModStackAmount(-dispelInfo.GetRemovedCharges(), AURA_REMOVE_BY_ENEMY_SPELL);
- // Call AfterDispel hook on AuraScript
- auraToDispel->CallScriptAfterDispel(&dispelInfo);
- FREAKZ::Hooks::Units::RemoveAurasDueToSpellByDispel(this, spellId, casterGUID, dispeller);
- }
- count++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement