*Fix dash bonus not working in some cases.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-06-06 13:45:17 +02:00
parent e6941a4f41
commit aa468c964a
3 changed files with 25 additions and 3 deletions
+14 -2
View File
@@ -512,6 +512,8 @@ m_target(parentAura->GetTarget()), m_tickNumber(0)
// Start periodic on next tick or at aura apply // Start periodic on next tick or at aura apply
if (!(m_spellProto->AttributesEx5 & SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY)) if (!(m_spellProto->AttributesEx5 & SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY))
m_periodicTimer += m_amplitude; m_periodicTimer += m_amplitude;
m_isApplied = false;
} }
AreaAuraEffect::AreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * currentBasePoints, Unit * caster, Item * castItem, Unit * source) 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(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)) Unit::AuraMap & auras = m_target->GetAuras();
m_target->HandleAuraEffect(aurEff, true); 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 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(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 ) if(m_spellProto->SpellFamilyName==SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags[2] & 0x8 && m_target->m_form != FORM_CAT )
{
m_target->HandleAuraEffect(this, false);
return; return;
}
m_target->UpdateSpeed(MOVE_RUN, true); m_target->UpdateSpeed(MOVE_RUN, true);
} }
+3
View File
@@ -350,6 +350,8 @@ class TRINITY_DLL_SPEC AuraEffect
bool IsAreaAura() const { return m_isAreaAura; } bool IsAreaAura() const { return m_isAreaAura; }
bool IsPeriodic() const { return m_isPeriodic; } bool IsPeriodic() const { return m_isPeriodic; }
bool IsPersistent() const { return m_isPersistent; } 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; bool isAffectedOnSpell(SpellEntry const *spell) const;
void ApplyModifier(bool apply, bool Real = false, bool changeAmount=false); 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_isPeriodic:1;
bool m_isAreaAura:1; bool m_isAreaAura:1;
bool m_isPersistent:1; bool m_isPersistent:1;
bool m_isApplied:1;
}; };
class TRINITY_DLL_SPEC AreaAuraEffect : public AuraEffect class TRINITY_DLL_SPEC AreaAuraEffect : public AuraEffect
+8 -1
View File
@@ -13104,7 +13104,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( AuraEffect* triggeredByAura )
CastCustomSpell(target,spellProto->Id,&heal,NULL,NULL,true,NULL,triggeredByAura,caster->GetGUID()); CastCustomSpell(target,spellProto->Id,&heal,NULL,NULL,true,NULL,triggeredByAura,caster->GetGUID());
if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID())) if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID()))
aur->SetAuraCharges(jumps); 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; return;
if (apply) if (apply)
{ {
if (aureff->IsApplied())
return;
aureff->SetApplied(true);
m_modAuras[aureff->GetAuraName()].push_back(aureff); m_modAuras[aureff->GetAuraName()].push_back(aureff);
aureff->ApplyModifier(true, true); aureff->ApplyModifier(true, true);
} }
else 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) // 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); m_modAuras[aureff->GetAuraName()].remove(aureff);
aureff->ApplyModifier(false, true); aureff->ApplyModifier(false, true);