[8217] Implement proper priority in effect selection at talent 17962 cast.

This commit is contained in:
VladimirMangos 2009-07-20 08:15:26 +04:00
parent 680ab810e0
commit d2dadbcb99
3 changed files with 31 additions and 17 deletions

View file

@ -216,8 +216,9 @@ class MANGOS_DLL_SPEC Aura
void SetModifier(AuraType t, int32 a, uint32 pt, int32 miscValue);
Modifier* GetModifier() { return &m_modifier; }
int32 GetMiscValue() {return m_spellProto->EffectMiscValue[m_effIndex];}
int32 GetMiscBValue() {return m_spellProto->EffectMiscValueB[m_effIndex];}
Modifier const* GetModifier() const { return &m_modifier; }
int32 GetMiscValue() const { return m_spellProto->EffectMiscValue[m_effIndex]; }
int32 GetMiscBValue() const { return m_spellProto->EffectMiscValueB[m_effIndex]; }
SpellEntry const* GetSpellProto() const { return m_spellProto; }
uint32 GetId() const{ return m_spellProto->Id; }

View file

@ -437,27 +437,40 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
// Conflagrate - consumes Immolate or Shadowflame
else if (m_spellInfo->TargetAuraState == AURA_STATE_CONFLAGRATE)
{
// for caster applied auras only
Aura const* aura = NULL; // found req. aura for damage calculation
Unit::AuraList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
{
if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK &&
(*i)->GetCasterGUID()==m_caster->GetGUID() &&
// for caster applied auras only
if ((*i)->GetSpellProto()->SpellFamilyName != SPELLFAMILY_WARLOCK ||
(*i)->GetCasterGUID()!=m_caster->GetGUID())
continue;
// Immolate
((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004) ||
// Shadowflame
(*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002))
if ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004))
{
int32 damagetick = m_caster->SpellDamageBonus(unitTarget, (*i)->GetSpellProto(), (*i)->GetModifier()->m_amount, DOT);
aura = *i; // it selected always if exist
break;
}
// Shadowflame
if ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002)
aura = *i; // remember but wait possible Immolate as primary priority
}
// found Immolate or Shadowflame
if (aura)
{
int32 damagetick = m_caster->SpellDamageBonus(unitTarget, aura->GetSpellProto(), aura->GetModifier()->m_amount, DOT);
damage += damagetick * 4;
// Glyph of Conflagrate
if (!m_caster->HasAura(56235))
unitTarget->RemoveAurasByCasterSpell((*i)->GetId(), m_caster->GetGUID());
unitTarget->RemoveAurasByCasterSpell(aura->GetId(), m_caster->GetGUID());
break;
}
}
}
break;
}
case SPELLFAMILY_PRIEST:

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8216"
#define REVISION_NR "8217"
#endif // __REVISION_NR_H__