Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. uint8 count = 0;
  2. while (count < chargesRemoved)
  3. {
  4. Aura* auraToDispel = nullptr;
  5. AuraMapBoundsNonConst range = m_ownedAuras.equal_range(spellId);
  6. for (AuraMap::iterator iter = range.first; iter != range.second, count < chargesRemoved; ++iter)
  7. {
  8. Aura* aura = iter->second;
  9. if (aura)
  10. {
  11. auraToDispel = aura;
  12. break;
  13. }
  14. }
  15.  
  16. if (auraToDispel)
  17. {
  18. DispelInfo dispelInfo(dispeller, dispellerSpellId, chargesRemoved);
  19.  
  20. // Call OnDispel hook on AuraScript
  21. auraToDispel->CallScriptDispel(&dispelInfo);
  22.  
  23. if (auraToDispel->GetSpellInfo()->HasAttribute(SPELL_ATTR7_DISPEL_CHARGES))
  24. auraToDispel->ModCharges(-dispelInfo.GetRemovedCharges(), AURA_REMOVE_BY_ENEMY_SPELL);
  25. else
  26. auraToDispel->ModStackAmount(-dispelInfo.GetRemovedCharges(), AURA_REMOVE_BY_ENEMY_SPELL);
  27.  
  28. // Call AfterDispel hook on AuraScript
  29. auraToDispel->CallScriptAfterDispel(&dispelInfo);
  30.  
  31. FREAKZ::Hooks::Units::RemoveAurasDueToSpellByDispel(this, spellId, casterGUID, dispeller);
  32. }
  33.  
  34. count++;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement