aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/SpellAuras.cpp16
-rw-r--r--src/game/SpellAuras.h3
-rw-r--r--src/game/Unit.cpp9
3 files changed, 25 insertions, 3 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 7c3fc42f32a..f086175987e 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -512,6 +512,8 @@ m_target(parentAura->GetTarget()), m_tickNumber(0)
// Start periodic on next tick or at aura apply
if (!(m_spellProto->AttributesEx5 & SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY))
m_periodicTimer += m_amplitude;
+
+ m_isApplied = false;
}
AreaAuraEffect::AreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * currentBasePoints, Unit * caster, Item * castItem, Unit * source)
@@ -3229,8 +3231,15 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun
{
if(form == FORM_CAT && apply) // add dash if in cat-from
{
- if(AuraEffect * aurEff =m_target->GetAura(SPELL_AURA_MOD_INCREASE_SPEED, SPELLFAMILY_DRUID, 0, 0, 0x8))
- m_target->HandleAuraEffect(aurEff, true);
+ Unit::AuraMap & auras = m_target->GetAuras();
+ for (Unit::AuraMap::iterator iter = auras.begin(); iter != auras.end();++iter)
+ {
+ Aura * aur = iter->second;
+ if (aur->GetSpellProto()->SpellFamilyName==SPELLFAMILY_DRUID && aur->GetSpellProto()->SpellFamilyFlags[2] & 0x8)
+ {
+ m_target->HandleAuraEffect(aur->GetPartAura(0), true);
+ }
+ }
}
else // remove dash effect(not buff) if out of cat-from
{
@@ -4108,7 +4117,10 @@ void AuraEffect::HandleAuraModIncreaseSpeed(bool apply, bool Real, bool changeAm
if(apply) // Dash wont work if you are not in cat form
if(m_spellProto->SpellFamilyName==SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags[2] & 0x8 && m_target->m_form != FORM_CAT )
+ {
+ m_target->HandleAuraEffect(this, false);
return;
+ }
m_target->UpdateSpeed(MOVE_RUN, true);
}
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index 9deb25772d4..1a4d0590af7 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -350,6 +350,8 @@ class TRINITY_DLL_SPEC AuraEffect
bool IsAreaAura() const { return m_isAreaAura; }
bool IsPeriodic() const { return m_isPeriodic; }
bool IsPersistent() const { return m_isPersistent; }
+ bool IsApplied() const { return m_isApplied; }
+ void SetApplied (bool val) {m_isApplied = val; }
bool isAffectedOnSpell(SpellEntry const *spell) const;
void ApplyModifier(bool apply, bool Real = false, bool changeAmount=false);
@@ -392,6 +394,7 @@ class TRINITY_DLL_SPEC AuraEffect
bool m_isPeriodic:1;
bool m_isAreaAura:1;
bool m_isPersistent:1;
+ bool m_isApplied:1;
};
class TRINITY_DLL_SPEC AreaAuraEffect : public AuraEffect
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index aca3ea92ce5..da2b53aec72 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -13104,7 +13104,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( AuraEffect* triggeredByAura )
CastCustomSpell(target,spellProto->Id,&heal,NULL,NULL,true,NULL,triggeredByAura,caster->GetGUID());
if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID()))
aur->SetAuraCharges(jumps);
- //caster->SpellHealingBonus(this, spellProto, heal, HEAL);
+ caster->SpellHealingBonus(this, spellProto, heal, HEAL);
}
}
}
@@ -13857,11 +13857,18 @@ void Unit::HandleAuraEffect(AuraEffect * aureff, bool apply)
return;
if (apply)
{
+ if (aureff->IsApplied())
+ return;
+
+ aureff->SetApplied(true);
m_modAuras[aureff->GetAuraName()].push_back(aureff);
aureff->ApplyModifier(true, true);
}
else
{
+ if (!aureff->IsApplied())
+ return;
+ aureff->SetApplied(false);
// remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order)
m_modAuras[aureff->GetAuraName()].remove(aureff);
aureff->ApplyModifier(false, true);