diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellEffects.cpp | 12 | ||||
-rw-r--r-- | src/game/Unit.cpp | 25 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
3 files changed, 29 insertions, 9 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 011c69dcc27..70ec4b47ed4 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2352,13 +2352,15 @@ void Spell::EffectHeal( uint32 /*i*/ ) } //int32 tickheal = caster->SpellHealingBonus(targetAura->GetSpellProto(), targetAura->GetModifier()->m_amount, DOT, unitTarget); - int32 tickheal = targetAura->GetSpellProto()->EffectBasePoints[idx] + 1; + //int32 tickheal = targetAura->GetSpellProto()->EffectBasePoints[idx] + 1; + //It is said that talent bonus should not be included + int32 tickheal = targetAura->GetModifierValue(); int32 tickcount = GetSpellDuration(targetAura->GetSpellProto()) / targetAura->GetSpellProto()->EffectAmplitude[idx]; - //TODO: do not remove all auras - unitTarget->RemoveAurasDueToSpell(targetAura->GetId()); - addhealth += tickheal * tickcount; - addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget); + unitTarget->RemoveAurasDueToCasterSpell(targetAura->GetId(), targetAura->GetCasterGUID()); + + //addhealth += tickheal * tickcount; + //addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget); } else addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b7d805a437d..b5b54f063d7 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4522,6 +4522,25 @@ void Unit::RemoveAurasDueToSpell(uint32 spellId, Aura* except) RemoveAura(spellId,i,except); } +void Unit::RemoveAurasDueToCasterSpell(uint64 guid, uint32 spellId) +{ + for (int k=0; k < 3; ++k) + { + spellEffectPair spair = spellEffectPair(spellId, k); + for (AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair);) + { + if (iter->second->GetCasterGUID() == guid) + { + RemoveAura(iter); + break; + //iter = m_Auras.upper_bound(spair); // overwrite by more appropriate + } + else + ++iter; + } + } +} + void Unit::RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId) { for (int k=0; k < 3; ++k) @@ -12841,11 +12860,9 @@ void Unit::SetConfused(bool apply) else { RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - GetMotionMaster()->MovementExpired(false); - if( GetTypeId() != TYPEID_PLAYER && isAlive() ) + if(isAlive()) { - // restore appropriate movement generator - if(getVictim()) + if( GetTypeId() != TYPEID_PLAYER && getVictim()) GetMotionMaster()->MoveChase(getVictim()); else GetMotionMaster()->Initialize(); diff --git a/src/game/Unit.h b/src/game/Unit.h index 68da9a93730..1679439198c 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1107,6 +1107,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex); void RemoveAurasDueToSpell(uint32 spellId, Aura* except = NULL); void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId); + void RemoveAurasDueToCasterSpell(uint64 guid, uint32 spellId); void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler); void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer); void RemoveAurasDueToSpellByCancel(uint32 spellId); |