mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
Move pestilence to spellscripts
Fixes crash and warnings introduced in d4bbc26261
Fixes a bug that allowed dks to spread diseases using another dks diseases
Closes: https://github.com/TrinityCore/TrinityCore/issues/12245
This commit is contained in:
@@ -4049,51 +4049,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
{
|
||||
// Pestilence
|
||||
if (m_spellInfo->SpellFamilyFlags[1]&0x10000)
|
||||
{
|
||||
// Get diseases on target of spell
|
||||
if (m_targets.GetUnitTarget() && // Glyph of Disease - cast on unit target too to refresh aura
|
||||
(m_targets.GetUnitTarget() != unitTarget || m_caster->HasAura(63334)))
|
||||
{
|
||||
// And spread them on target
|
||||
// Blood Plague
|
||||
if (m_targets.GetUnitTarget()->HasAura(55078))
|
||||
{
|
||||
AuraEffect* aurEffOld = m_targets.GetUnitTarget()->GetAura(55078)->GetEffect(0);
|
||||
float donePct = aurEffOld->GetDonePct();
|
||||
float critChance = aurEffOld->GetCritChance();
|
||||
|
||||
m_caster->CastSpell(unitTarget, 55078, true);
|
||||
|
||||
if (unitTarget->HasAura(55078))
|
||||
if (AuraEffect* aurEffNew = unitTarget->GetAura(55078)->GetEffect(0))
|
||||
{
|
||||
aurEffNew->SetCritChance(critChance); // Blood Plague can crit if caster has T9.
|
||||
aurEffNew->SetDonePct(donePct);
|
||||
aurEffNew->SetDamage(m_caster->SpellDamageBonusDone(unitTarget, aurEffNew->GetSpellInfo(), std::max(aurEffNew->GetAmount(), 0), DOT) * donePct);
|
||||
}
|
||||
}
|
||||
// Frost Fever
|
||||
if (m_targets.GetUnitTarget()->HasAura(55095))
|
||||
{
|
||||
float donePct = m_targets.GetUnitTarget()->GetAura(55095)->GetEffect(0)->GetDonePct();
|
||||
|
||||
m_caster->CastSpell(unitTarget, 55095, true);
|
||||
|
||||
if (unitTarget->HasAura(55095))
|
||||
if (AuraEffect* aurEffNew = unitTarget->GetAura(55095)->GetEffect(0))
|
||||
{
|
||||
aurEffNew->SetDonePct(donePct);
|
||||
aurEffNew->SetDamage(m_caster->SpellDamageBonusDone(unitTarget, aurEffNew->GetSpellInfo(), std::max(aurEffNew->GetAmount(), 0), DOT) * donePct);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// normal DB scripted effect
|
||||
|
||||
Reference in New Issue
Block a user