mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Spells: Script 'Hate To' spells (#28129)
This commit is contained in:
15
sql/updates/world/3.3.5/2022_07_17_00_world.sql
Normal file
15
sql/updates/world/3.3.5/2022_07_17_00_world.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
--
|
||||
UPDATE `spell_script_names` SET `ScriptName` = 'spell_gen_hate_to_zero_caster_target' WHERE `ScriptName` = 'spell_yogg_saron_hate_to_zero';
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN (
|
||||
'spell_gen_hate_to_zero',
|
||||
'spell_gen_hate_to_50',
|
||||
'spell_gen_hate_to_75');
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(9204,'spell_gen_hate_to_zero'),
|
||||
(20538,'spell_gen_hate_to_zero'),
|
||||
(26569,'spell_gen_hate_to_zero'),
|
||||
(26637,'spell_gen_hate_to_zero'),
|
||||
(37326,'spell_gen_hate_to_zero'),
|
||||
(19707,'spell_gen_hate_to_50'),
|
||||
(26886,'spell_gen_hate_to_75');
|
||||
@@ -3073,35 +3073,6 @@ class spell_yogg_saron_keeper_aura : public SpellScriptLoader // 62650, 6267
|
||||
}
|
||||
};
|
||||
|
||||
// 63984 - Hate to Zero
|
||||
class spell_yogg_saron_hate_to_zero : public SpellScriptLoader // 63984
|
||||
{
|
||||
public:
|
||||
spell_yogg_saron_hate_to_zero() : SpellScriptLoader("spell_yogg_saron_hate_to_zero") { }
|
||||
|
||||
class spell_yogg_saron_hate_to_zero_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_yogg_saron_hate_to_zero_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (target->CanHaveThreatList())
|
||||
target->GetThreatManager().ModifyThreatByPercent(GetCaster(), -100);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_yogg_saron_hate_to_zero_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_yogg_saron_hate_to_zero_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 64184 - In the Maws of the Old God
|
||||
class spell_yogg_saron_in_the_maws_of_the_old_god : public SpellScriptLoader // 64184
|
||||
{
|
||||
@@ -3265,7 +3236,6 @@ void AddSC_boss_yogg_saron()
|
||||
new spell_yogg_saron_insane_periodic();
|
||||
new spell_yogg_saron_lunatic_gaze();
|
||||
new spell_yogg_saron_keeper_aura();
|
||||
new spell_yogg_saron_hate_to_zero();
|
||||
new spell_yogg_saron_in_the_maws_of_the_old_god();
|
||||
new spell_yogg_saron_titanic_storm();
|
||||
new spell_yogg_saron_hodirs_protective_gaze();
|
||||
|
||||
@@ -1992,6 +1992,83 @@ class spell_gen_gryphon_wyvern_mount_check : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
/* 9204 - Hate to Zero (Melee)
|
||||
20538 - Hate to Zero (AoE)
|
||||
26569 - Hate to Zero (AoE)
|
||||
26637 - Hate to Zero (AoE, Unique)
|
||||
37326 - Hate to Zero (AoE)
|
||||
40410 - Hate to Zero (Should be added, AoE)
|
||||
40467 - Hate to Zero (Should be added, AoE)
|
||||
41582 - Hate to Zero (Should be added, Melee) */
|
||||
class spell_gen_hate_to_zero : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_hate_to_zero);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetCaster()->CanHaveThreatList())
|
||||
GetCaster()->GetThreatManager().ModifyThreatByPercent(GetHitUnit(), -100);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_hate_to_zero::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// This spell is used by both player and creature, but currently works only if used by player
|
||||
// 63984 - Hate to Zero
|
||||
class spell_gen_hate_to_zero_caster_target : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_hate_to_zero_caster_target);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (target->CanHaveThreatList())
|
||||
target->GetThreatManager().ModifyThreatByPercent(GetCaster(), -100);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_hate_to_zero_caster_target::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 19707 - Hate to 50%
|
||||
class spell_gen_hate_to_50 : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_hate_to_50);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetCaster()->CanHaveThreatList())
|
||||
GetCaster()->GetThreatManager().ModifyThreatByPercent(GetHitUnit(), -50);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_hate_to_50::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 26886 - Hate to 75%
|
||||
class spell_gen_hate_to_75 : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_hate_to_75);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetCaster()->CanHaveThreatList())
|
||||
GetCaster()->GetThreatManager().ModifyThreatByPercent(GetHitUnit(), -25);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_hate_to_75::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_injured : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_injured);
|
||||
@@ -4545,6 +4622,10 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScript(spell_gen_gift_of_naaru);
|
||||
RegisterSpellScript(spell_gen_gnomish_transporter);
|
||||
RegisterSpellScript(spell_gen_gryphon_wyvern_mount_check);
|
||||
RegisterSpellScript(spell_gen_hate_to_zero);
|
||||
RegisterSpellScript(spell_gen_hate_to_zero_caster_target);
|
||||
RegisterSpellScript(spell_gen_hate_to_50);
|
||||
RegisterSpellScript(spell_gen_hate_to_75);
|
||||
RegisterSpellScript(spell_gen_injured);
|
||||
RegisterSpellScript(spell_gen_lifeblood);
|
||||
RegisterSpellScriptWithArgs(spell_gen_lifebloom, "spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL);
|
||||
|
||||
Reference in New Issue
Block a user