Core/Spells: ported spellMod handling from master branch

This commit is contained in:
Ovahlord committed 2025-03-09 13:20:40 +01:00
1 parent b390f0fec9
commit 83958342d9
16 files changed
+374 -177

No files matched your search

+4 -4
View File
@@ -552,17 +552,17 @@ private:
// 60779 - Idol of Lush Moss
class spell_dru_idol_lifebloom : public AuraScript
{
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellModifier)
{
if (!spellMod)
if (!spellModifier)
{
spellMod = new SpellModifier(GetAura());
SpellModifierByClassMask* spellMod = new SpellModifierByClassMask(GetAura());
spellMod->op = SpellModOp::PeriodicHealingAndDamage;
spellMod->type = SPELLMOD_FLAT;
spellMod->spellId = GetId();
spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask;
}
spellMod->value = aurEff->GetAmount() / 7;
static_cast<SpellModifierByClassMask*>(spellModifier)->value = aurEff->GetAmount() / 7;
}
void Register() override
+7 -6
View File
@@ -426,18 +426,19 @@ private:
// 33695 - Exorcism and Holy Wrath Damage
class spell_pal_exorcism_and_holy_wrath_damage : public AuraScript
{
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellModifier)
{
if (!spellMod)
if (!spellModifier)
{
spellMod = new SpellModifier(aurEff->GetBase());
SpellModifierByClassMask* spellMod = new SpellModifierByClassMask(aurEff->GetBase());
spellMod->op = SpellModOp::HealingAndDamage;
spellMod->type = SPELLMOD_FLAT;
spellMod->spellId = GetId();
spellMod->mask[1] = 0x200002;
spellModifier = spellMod;
}
spellMod->value = aurEff->GetAmount();
static_cast<SpellModifierByClassMask*>(spellModifier)->value = aurEff->GetAmount();
}
void Register() override
@@ -1400,7 +1401,7 @@ class spell_pal_guardian_of_ancient_kings : public SpellScript
class spell_pal_ancient_healer : public AuraScript
{
bool Load() override
{
{
_procCount = 0;
return true;
}
@@ -1815,7 +1816,7 @@ class spell_pal_speed_of_light : public AuraScript
}
};
// -53695 - Judgements of the Just
// -53695 - Judgements of the Just
class spell_pal_judgements_of_the_just : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
+7 -5
View File
@@ -367,18 +367,20 @@ class spell_pri_glyph_of_prayer_of_healing : public AuraScript
class spell_pri_improved_power_word_shield : public AuraScript
{
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellModifier)
{
if (!spellMod)
if (!spellModifier)
{
spellMod = new SpellModifier(GetAura());
SpellModifierByClassMask* spellMod = new SpellModifierByClassMask(GetAura());
spellMod->op = SpellModOp(aurEff->GetMiscValue());
spellMod->type = SPELLMOD_PCT;
spellMod->spellId = GetId();
spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask;
spellModifier = spellMod;
}
spellMod->value = aurEff->GetAmount();
static_cast<SpellModifierByClassMask*>(spellModifier)->value = aurEff->GetAmount();
}
void Register() override
@@ -1780,7 +1782,7 @@ class spell_pri_harnessed_shadows : public AuraScript
}
};
// 2944 - Devouring Plague
// 2944 - Devouring Plague
class spell_pri_devouring_plague : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
+7 -5
View File
@@ -619,7 +619,7 @@ class spell_warl_health_funnel : public AuraScript
uint32 damage = caster->CountPctFromMaxHealth(aurEff->GetBaseAmount());
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(GetId(), SpellModOp::PowerCost0, damage);
modOwner->ApplySpellMod(GetSpellInfo(), SpellModOp::PowerCost0, damage);
SpellNonMeleeDamage damageInfo(caster, caster, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask);
damageInfo.damage = damage;
@@ -1684,17 +1684,19 @@ class spell_warl_fear : public SpellScript
// 56244 - Glyph of Fear
class spell_warl_glyph_of_fear : public AuraScript
{
void HandleCooldownMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
void HandleCooldownMod(AuraEffect const* aurEff, SpellModifier*& spellModifier)
{
if (!spellMod)
if (!spellModifier)
{
spellMod = new SpellModifier(GetAura());
SpellModifierByClassMask* spellMod = new SpellModifierByClassMask(GetAura());
spellMod->op = SpellModOp::Cooldown;
spellMod->type = SPELLMOD_FLAT;
spellMod->spellId = GetId();
spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask;
spellModifier = spellMod;
}
spellMod->value = aurEff->GetAmount() * IN_MILLISECONDS;
static_cast<SpellModifierByClassMask*>(spellModifier)->value = aurEff->GetAmount() * IN_MILLISECONDS;
}
void Register() override
+6 -5
View File
@@ -279,18 +279,19 @@ class spell_warr_execute : public SpellScript
// 58387 - Glyph of Sunder Armor
class spell_warr_glyph_of_sunder_armor : public AuraScript
{
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellModifier)
{
if (!spellMod)
if (!spellModifier)
{
spellMod = new SpellModifier(aurEff->GetBase());
SpellModifierByClassMask* spellMod = new SpellModifierByClassMask(aurEff->GetBase());
spellMod->op = SpellModOp(aurEff->GetMiscValue());
spellMod->type = SPELLMOD_FLAT;
spellMod->spellId = GetId();
spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask;
spellModifier = spellMod;
}
spellMod->value = aurEff->GetAmount();
static_cast<SpellModifierByClassMask*>(spellModifier)->value = aurEff->GetAmount();
}
void Register() override
@@ -734,7 +735,7 @@ class spell_warr_victory_rush : public SpellScript
// Glyph: Victory Rush
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_scriptSpellId, SpellModOp::PointsIndex2, damage);
modOwner->ApplySpellMod(GetSpellInfo(), SpellModOp::PointsIndex2, damage);
SetEffectValue(damage);
}