mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
Fix some typos in SPELL_AURA_ADD_TARGET_TRIGGER aura work
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
e0b59c21ec
commit
6c51a318fd
1 changed files with 7 additions and 9 deletions
|
|
@ -2740,29 +2740,27 @@ void Spell::finish(bool ok)
|
||||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
((Player*)m_caster)->RemoveSpellMods(this);
|
((Player*)m_caster)->RemoveSpellMods(this);
|
||||||
|
|
||||||
//handle SPELL_AURA_ADD_TARGET_TRIGGER auras
|
// handle SPELL_AURA_ADD_TARGET_TRIGGER auras
|
||||||
Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER);
|
Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER);
|
||||||
for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
|
for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
|
||||||
{
|
{
|
||||||
SpellEntry const *auraSpellInfo = (*i)->GetSpellProto();
|
if (!(*i)->isAffectedOnSpell(m_spellInfo))
|
||||||
uint32 auraSpellIdx = (*i)->GetEffIndex();
|
continue;
|
||||||
if (IsAffectedByAura((*i)))
|
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
|
||||||
{
|
if( ihit->missCondition == SPELL_MISS_NONE )
|
||||||
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
|
|
||||||
if( ihit->effectMask & (1<<auraSpellIdx) )
|
|
||||||
{
|
{
|
||||||
// check m_caster->GetGUID() let load auras at login and speedup most often case
|
// check m_caster->GetGUID() let load auras at login and speedup most often case
|
||||||
Unit *unit = m_caster->GetGUID()== ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID);
|
Unit *unit = m_caster->GetGUID()== ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID);
|
||||||
if (unit && unit->isAlive())
|
if (unit && unit->isAlive())
|
||||||
{
|
{
|
||||||
|
SpellEntry const *auraSpellInfo = (*i)->GetSpellProto();
|
||||||
|
uint32 auraSpellIdx = (*i)->GetEffIndex();
|
||||||
// Calculate chance at that moment (can be depend for example from combo points)
|
// Calculate chance at that moment (can be depend for example from combo points)
|
||||||
int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(),unit);
|
int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(),unit);
|
||||||
|
|
||||||
if(roll_chance_i(chance))
|
if(roll_chance_i(chance))
|
||||||
m_caster->CastSpell(unit, auraSpellInfo->EffectTriggerSpell[auraSpellIdx], true, NULL, (*i));
|
m_caster->CastSpell(unit, auraSpellInfo->EffectTriggerSpell[auraSpellIdx], true, NULL, (*i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Heal caster for all health leech from all targets
|
// Heal caster for all health leech from all targets
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue