aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 3647ee87fae..b349182ecfc 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3959,7 +3959,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
for(AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- Aura * aur= iter->second;
+ Aura * aur = iter->second;
if (casterGUID == aur->GetCasterGUID())
{
int32 damage[MAX_SPELL_EFFECTS];
@@ -4133,6 +4133,18 @@ void Unit::RemoveAllAuras()
RemoveAura(iter);
}
+void Unit::RemoveAllAuras(uint64 casterGUID, Aura * except /*=NULL*/, bool negative /*=true*/, bool positive /*=true*/)
+{
+ AuraMap::iterator iter = m_Auras.begin();
+ while (!m_Auras.empty())
+ {
+ Aura * aur = (*iter)->GetParentAura();
+ if (aur != except && (!casterGUID || aur->GetCasterGUID()==casterGUID)
+ && ((negative && !aur->IsPositive()) || (positive && aur->IsPositive())))
+ RemoveAura(aur);
+ }
+}
+
void Unit::RemoveArenaAuras(bool onleave)
{
// in join, remove positive buffs, on end, remove negative
@@ -4179,17 +4191,13 @@ void Unit::DelayAura(uint32 spellId, uint64 caster, int32 delaytime)
void Unit::_RemoveAllAuraMods()
{
for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i)
- {
(*i).second->ApplyAllModifiers(false);
- }
}
void Unit::_ApplyAllAuraMods()
{
for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i)
- {
(*i).second->ApplyAllModifiers(true);
- }
}
bool Unit::HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const
@@ -12073,9 +12081,7 @@ void Unit::SetPower(Powers power, uint32 val)
// Update the pet's character sheet with happiness damage bonus
if(pet->getPetType() == HUNTER_PET && power == POWER_HAPPINESS)
- {
pet->UpdateDamagePhysical(BASE_ATTACK);
- }
}
}