Scritps/ICC: Fixed resistance calculation for Mutated Transformation (Professor Putricide) (#23858)

More Info in: #23837

(cherry picked from commit 9f7b464a6a)
This commit is contained in:
Keader
2019-12-26 13:22:04 -03:00
committed by Shauren
parent 96ec8477f0
commit b9def15aa7
3 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
--
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_abomination_mutated_transformation';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(70402,'spell_abomination_mutated_transformation');

View File

@@ -4250,6 +4250,13 @@ void SpellMgr::LoadSpellInfoCorrections()
});
});
// Mutated Transformation (Professor Putricide)
ApplySpellFix({ 70402 }, [](SpellInfo* spellInfo)
{
// Resistance is calculated inside of SpellScript
spellInfo->AttributesEx4 |= SPELL_ATTR4_IGNORE_RESISTANCES;
});
// Empowered Flare (Blood Prince Council)
ApplySpellFix({ 71708 }, [](SpellInfo* spellInfo)
{

View File

@@ -1654,6 +1654,29 @@ class spell_stinky_precious_decimate : public SpellScriptLoader
}
};
// 70402, 72511, 72512, 72513 - Mutated Transformation
class spell_abomination_mutated_transformation : public SpellScript
{
PrepareSpellScript(spell_abomination_mutated_transformation);
/* Resist system always pick the min resist value for spells with multiple schools.
But following some combat logs of retail, this spell is a exception and need get the sum of both schools. */
void HandleResistance(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
uint32 damage = GetHitDamage();
Unit* target = GetHitUnit();
damage -= Unit::CalcSpellResistedDamage(caster, target, GetHitDamage(), SPELL_SCHOOL_MASK_SHADOW, nullptr);
damage -= Unit::CalcSpellResistedDamage(caster, target, GetHitDamage(), SPELL_SCHOOL_MASK_NATURE, nullptr);
SetHitDamage(damage);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_abomination_mutated_transformation::HandleResistance, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
void AddSC_boss_professor_putricide()
{
new boss_professor_putricide();
@@ -1677,4 +1700,5 @@ void AddSC_boss_professor_putricide()
new spell_putricide_regurgitated_ooze();
new spell_putricide_clear_aura_effect_value();
new spell_stinky_precious_decimate();
RegisterSpellScript(spell_abomination_mutated_transformation);
}