diff options
author | QAston <none@none> | 2009-03-22 17:10:01 +0100 |
---|---|---|
committer | QAston <none@none> | 2009-03-22 17:10:01 +0100 |
commit | 7303f9db8b601c7f816534132cb0b6d6665702a7 (patch) | |
tree | 7ab84f8c9185f875cf67689f6de6dcc0d1d782df /src/game/Unit.cpp | |
parent | 075b7d38ea340d9649de30f92f46958c86bc19e4 (diff) |
*Backport blood frenzy fix from TC2.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 2c2d38f8f19..159ce634a2d 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4497,6 +4497,37 @@ void Unit::RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID) } } +void Unit::SetAurasDurationByCasterSpell(uint32 spellId, uint64 casterGUID, int32 duration) +{ + for(uint8 i = 0; i < 3; ++i) + { + spellEffectPair spair = spellEffectPair(spellId, i); + for(AuraMap::const_iterator itr = GetAuras().lower_bound(spair); itr != GetAuras().upper_bound(spair); ++itr) + { + if(itr->second->GetCasterGUID()==casterGUID) + { + itr->second->SetAuraDuration(duration); + break; + } + } + } +} + +Aura* Unit::GetAuraByCasterSpell(uint32 spellId, uint64 casterGUID) +{ + // Returns first found aura from spell-use only in cases where effindex of spell doesn't matter! + for(uint8 i = 0; i < 3; ++i) + { + spellEffectPair spair = spellEffectPair(spellId, i); + for(AuraMap::const_iterator itr = GetAuras().lower_bound(spair); itr != GetAuras().upper_bound(spair); ++itr) + { + if(itr->second->GetCasterGUID()==casterGUID) + return itr->second; + } + } + return NULL; +} + void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler) { for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ) |