mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 03:42:37 +01:00
Core/Spells: Immortal specialization series part 3 - fixed Warlock Mastery: Chaotic Energies damage taken portion
Closes #20195
This commit is contained in:
3
sql/updates/world/master/2017_09_01_00_world.sql
Normal file
3
sql/updates/world/master/2017_09_01_00_world.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_warl_chaotic_energies';
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(77220,'spell_warl_chaotic_energies');
|
||||
@@ -162,6 +162,34 @@ class spell_warl_conflagrate : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 77220 - Mastery: Chaotic Energies
|
||||
class spell_warl_chaotic_energies : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_chaotic_energies);
|
||||
|
||||
void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
AuraEffect const* effect1 = GetEffect(EFFECT_1);
|
||||
if (!effect1 || !GetTargetApplication()->HasEffect(EFFECT_1))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
return;
|
||||
}
|
||||
|
||||
// You take ${$s2/3}% reduced damage
|
||||
float damageReductionPct = float(effect1->GetAmount()) / 3;
|
||||
// plus a random amount of up to ${$s2/3}% additional reduced damage
|
||||
damageReductionPct += frand(0.0f, damageReductionPct);
|
||||
|
||||
absorbAmount = CalculatePct(dmgInfo.GetDamage(), damageReductionPct);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectAbsorb += AuraEffectAbsorbFn(spell_warl_chaotic_energies::HandleAbsorb, EFFECT_2);
|
||||
}
|
||||
};
|
||||
|
||||
// 6201 - Create Healthstone
|
||||
class spell_warl_create_healthstone : public SpellScriptLoader
|
||||
{
|
||||
@@ -1454,6 +1482,7 @@ void AddSC_warlock_spell_scripts()
|
||||
{
|
||||
new spell_warl_bane_of_doom();
|
||||
new spell_warl_banish();
|
||||
RegisterAuraScript(spell_warl_chaotic_energies);
|
||||
new spell_warl_conflagrate();
|
||||
new spell_warl_create_healthstone();
|
||||
new spell_warl_demonic_circle_summon();
|
||||
|
||||
Reference in New Issue
Block a user