mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: Fixed PROC_HIT_DISPEL and PROC_HIT_INTERRUPT on procs using PROC_SPELL_PHASE_HIT phase
This commit is contained in:
@@ -2813,7 +2813,6 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
|
||||
ProcFlagsInit procAttacker = spell->m_procAttacker;
|
||||
ProcFlagsInit procVictim = spell->m_procVictim;
|
||||
ProcFlagsSpellType procSpellType = PROC_SPELL_TYPE_NONE;
|
||||
ProcFlagsHit hitMask = PROC_HIT_NONE;
|
||||
|
||||
// Spells with this flag cannot trigger if effect is cast on self
|
||||
bool const canEffectTrigger = spell->unitTarget->CanProc();
|
||||
@@ -2898,11 +2897,11 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
|
||||
uint32 addhealth = spell->m_healing;
|
||||
if (IsCrit)
|
||||
{
|
||||
hitMask |= PROC_HIT_CRITICAL;
|
||||
ProcHitMask |= PROC_HIT_CRITICAL;
|
||||
addhealth = Unit::SpellCriticalHealingBonus(caster, spell->m_spellInfo, addhealth, nullptr);
|
||||
}
|
||||
else
|
||||
hitMask |= PROC_HIT_NORMAL;
|
||||
ProcHitMask |= PROC_HIT_NORMAL;
|
||||
|
||||
healInfo = std::make_unique<HealInfo>(caster, spell->unitTarget, addhealth, spell->m_spellInfo, spell->m_spellInfo->GetSchoolMask());
|
||||
caster->HealBySpell(*healInfo, IsCrit);
|
||||
@@ -2922,7 +2921,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
|
||||
// Check damage immunity
|
||||
if (spell->unitTarget->IsImmunedToDamage(caster, spell->m_spellInfo))
|
||||
{
|
||||
hitMask = PROC_HIT_IMMUNE;
|
||||
ProcHitMask = PROC_HIT_IMMUNE;
|
||||
spell->m_damage = 0;
|
||||
|
||||
// no packet found in sniffs
|
||||
@@ -2935,7 +2934,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
|
||||
caster->CalculateSpellDamageTaken(&damageInfo, spell->m_damage, spell->m_spellInfo, spell->m_attackType, IsCrit, MissCondition == SPELL_MISS_BLOCK, spell);
|
||||
Unit::DealDamageMods(damageInfo.attacker, damageInfo.target, damageInfo.damage, &damageInfo.absorb);
|
||||
|
||||
hitMask |= createProcHitMask(&damageInfo, MissCondition);
|
||||
ProcHitMask |= createProcHitMask(&damageInfo, MissCondition);
|
||||
procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
|
||||
|
||||
// sparring
|
||||
@@ -2955,7 +2954,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
|
||||
// Do triggers for unit
|
||||
if (canEffectTrigger)
|
||||
{
|
||||
spellDamageInfo = std::make_unique<DamageInfo>(damageInfo, SPELL_DIRECT_DAMAGE, spell->m_attackType, hitMask);
|
||||
spellDamageInfo = std::make_unique<DamageInfo>(damageInfo, SPELL_DIRECT_DAMAGE, spell->m_attackType, ProcHitMask);
|
||||
procSpellType |= PROC_SPELL_TYPE_DAMAGE;
|
||||
}
|
||||
}
|
||||
@@ -2965,11 +2964,11 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
|
||||
{
|
||||
// Fill base damage struct (unitTarget - is real spell target)
|
||||
SpellNonMeleeDamage damageInfo(caster, spell->unitTarget, spell->m_spellInfo, spell->m_SpellVisual, spell->m_spellSchoolMask);
|
||||
hitMask |= createProcHitMask(&damageInfo, MissCondition);
|
||||
ProcHitMask |= createProcHitMask(&damageInfo, MissCondition);
|
||||
// Do triggers for unit
|
||||
if (canEffectTrigger)
|
||||
{
|
||||
spellDamageInfo = std::make_unique<DamageInfo>(damageInfo, NODAMAGE, spell->m_attackType, hitMask);
|
||||
spellDamageInfo = std::make_unique<DamageInfo>(damageInfo, NODAMAGE, spell->m_attackType, ProcHitMask);
|
||||
procSpellType |= PROC_SPELL_TYPE_NO_DMG_HEAL;
|
||||
}
|
||||
|
||||
@@ -2985,7 +2984,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
|
||||
// Do triggers for unit
|
||||
if (canEffectTrigger)
|
||||
{
|
||||
Unit::ProcSkillsAndAuras(caster, spell->unitTarget, procAttacker, procVictim, procSpellType, PROC_SPELL_PHASE_HIT, hitMask, spell, spellDamageInfo.get(), healInfo.get());
|
||||
Unit::ProcSkillsAndAuras(caster, spell->unitTarget, procAttacker, procVictim, procSpellType, PROC_SPELL_PHASE_HIT, ProcHitMask, spell, spellDamageInfo.get(), healInfo.get());
|
||||
|
||||
// item spells (spell hit of non-damage spell may also activate items, for example seal of corruption hidden hit)
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER && (procSpellType & (PROC_SPELL_TYPE_DAMAGE | PROC_SPELL_TYPE_NO_DMG_HEAL)))
|
||||
@@ -2997,7 +2996,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
|
||||
}
|
||||
|
||||
// set hitmask for finish procs
|
||||
spell->m_hitMask |= hitMask;
|
||||
spell->m_hitMask |= ProcHitMask;
|
||||
spell->m_procSpellType |= procSpellType;
|
||||
|
||||
// _spellHitTarget can be null if spell is missed in DoSpellHitOnUnit
|
||||
|
||||
Reference in New Issue
Block a user