Skip to content

Commit 71a8e05

Browse files
authored
Scripts/Spells: Implement generic spell script to cancel aura by id from spell effect basepoints (#30908)
1 parent 5ed83ed commit 71a8e05

File tree

5 files changed

+36
-66
lines changed

5 files changed

+36
-66
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--
2+
UPDATE `spell_script_names` SET `ScriptName` = 'spell_gen_cancel_aura' WHERE `ScriptName` = 'spell_love_is_in_the_air_fragrant_air_analysis'; -- 70192
3+
UPDATE `spell_script_names` SET `ScriptName` = 'spell_gen_cancel_aura' WHERE `ScriptName` = 'spell_storm_peaks_remove_collapsing_cave_aura'; -- 55693
4+
UPDATE `spell_script_names` SET `ScriptName` = 'spell_gen_cancel_aura' WHERE `ScriptName` = 'spell_deathbringer_remove_marks'; -- 72257
5+
6+
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_cancel_aura' AND `spell_id` IN (45604,56923,59556,60654,69171,69298,70079,69098);
7+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
8+
(45604, 'spell_gen_cancel_aura'),
9+
(56923, 'spell_gen_cancel_aura'),
10+
(59556, 'spell_gen_cancel_aura'),
11+
(60654, 'spell_gen_cancel_aura'),
12+
(69171, 'spell_gen_cancel_aura'),
13+
(69298, 'spell_gen_cancel_aura'),
14+
(70079, 'spell_gen_cancel_aura'),
15+
(69098, 'spell_gen_cancel_aura');

src/server/scripts/Events/love_is_in_the_air.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -158,27 +158,6 @@ enum SomethingStinks
158158
SPELL_HEAVILY_PERFUMED = 71507
159159
};
160160

161-
// 70192 - Fragrant Air Analysis
162-
class spell_love_is_in_the_air_fragrant_air_analysis : public SpellScript
163-
{
164-
PrepareSpellScript(spell_love_is_in_the_air_fragrant_air_analysis);
165-
166-
bool Validate(SpellInfo const* spellInfo) override
167-
{
168-
return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
169-
}
170-
171-
void HandleScript(SpellEffIndex /*effIndex*/)
172-
{
173-
GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
174-
}
175-
176-
void Register() override
177-
{
178-
OnEffectHitTarget += SpellEffectFn(spell_love_is_in_the_air_fragrant_air_analysis::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
179-
}
180-
};
181-
182161
// 71507 - Heavily Perfumed
183162
class spell_love_is_in_the_air_heavily_perfumed : public AuraScript
184163
{
@@ -346,7 +325,6 @@ void AddSC_event_love_is_in_the_air()
346325
{
347326
RegisterSpellScript(spell_love_is_in_the_air_romantic_picnic);
348327
RegisterSpellScript(spell_love_is_in_the_air_create_heart_candy);
349-
RegisterSpellScript(spell_love_is_in_the_air_fragrant_air_analysis);
350328
RegisterSpellScript(spell_love_is_in_the_air_heavily_perfumed);
351329
RegisterSpellScript(spell_love_is_in_the_air_recently_analyzed);
352330
RegisterSpellScript(spell_love_is_in_the_air_sample_satisfaction);

src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,23 +1222,6 @@ class spell_deathbringer_boiling_blood : public SpellScript
12221222
}
12231223
};
12241224

1225-
// 72257 - Remove Marks of the Fallen Champion
1226-
class spell_deathbringer_remove_marks : public SpellScript
1227-
{
1228-
PrepareSpellScript(spell_deathbringer_remove_marks);
1229-
1230-
void HandleScript(SpellEffIndex effIndex)
1231-
{
1232-
PreventHitDefaultEffect(effIndex);
1233-
GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
1234-
}
1235-
1236-
void Register() override
1237-
{
1238-
OnEffectHitTarget += SpellEffectFn(spell_deathbringer_remove_marks::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
1239-
}
1240-
};
1241-
12421225
class achievement_ive_gone_and_made_a_mess : public AchievementCriteriaScript
12431226
{
12441227
public:
@@ -1272,7 +1255,6 @@ void AddSC_boss_deathbringer_saurfang()
12721255
RegisterSpellScript(spell_deathbringer_blood_nova);
12731256
RegisterSpellScript(spell_deathbringer_blood_nova_targeting);
12741257
RegisterSpellScript(spell_deathbringer_boiling_blood);
1275-
RegisterSpellScript(spell_deathbringer_remove_marks);
12761258

12771259
// Achievements
12781260
new achievement_ive_gone_and_made_a_mess();

src/server/scripts/Northrend/zone_storm_peaks.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,31 +1047,6 @@ class spell_player_mount_wyrm : public AuraScript
10471047
}
10481048
};
10491049

1050-
/*######
1051-
## Quest 12823: A Flawless Plan
1052-
######*/
1053-
1054-
// 55693 - Remove Collapsing Cave Aura
1055-
class spell_storm_peaks_remove_collapsing_cave_aura : public SpellScript
1056-
{
1057-
PrepareSpellScript(spell_storm_peaks_remove_collapsing_cave_aura);
1058-
1059-
bool Validate(SpellInfo const* spellInfo) override
1060-
{
1061-
return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
1062-
}
1063-
1064-
void HandleScript(SpellEffIndex /*effIndex*/)
1065-
{
1066-
GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
1067-
}
1068-
1069-
void Register() override
1070-
{
1071-
OnEffectHitTarget += SpellEffectFn(spell_storm_peaks_remove_collapsing_cave_aura::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
1072-
}
1073-
};
1074-
10751050
/*######
10761051
## Quest 12987: Mounting Hodir's Helm
10771052
######*/
@@ -1293,7 +1268,6 @@ void AddSC_storm_peaks()
12931268
RegisterSpellScript(spell_claw_swipe_check);
12941269
RegisterSpellScript(spell_fatal_strike);
12951270
RegisterSpellScript(spell_player_mount_wyrm);
1296-
RegisterSpellScript(spell_storm_peaks_remove_collapsing_cave_aura);
12971271
RegisterSpellScript(spell_storm_peaks_read_pronouncement);
12981272
RegisterSpellScript(spell_storm_peaks_bear_flank_master);
12991273
RegisterSpellScript(spell_storm_peaks_bear_flank_fail);

src/server/scripts/Spells/spell_generic.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,26 @@ class spell_gen_burning_depths_necrolyte_image : public AuraScript
703703
}
704704
};
705705

706+
class spell_gen_cancel_aura : public SpellScript
707+
{
708+
PrepareSpellScript(spell_gen_cancel_aura);
709+
710+
bool Validate(SpellInfo const* spellInfo) override
711+
{
712+
return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
713+
}
714+
715+
void HandleScript(SpellEffIndex /*effIndex*/)
716+
{
717+
GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
718+
}
719+
720+
void Register() override
721+
{
722+
OnEffectHitTarget += SpellEffectFn(spell_gen_cancel_aura::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
723+
}
724+
};
725+
706726
enum CannibalizeSpells
707727
{
708728
SPELL_CANNIBALIZE_TRIGGERED = 20578
@@ -4585,6 +4605,7 @@ void AddSC_generic_spell_scripts()
45854605
RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_break_shield");
45864606
RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_tournament_counterattack");
45874607
RegisterSpellScript(spell_gen_burning_depths_necrolyte_image);
4608+
RegisterSpellScript(spell_gen_cancel_aura);
45884609
RegisterSpellScript(spell_gen_cannibalize);
45894610
RegisterSpellScript(spell_gen_chains_of_ice);
45904611
RegisterSpellScript(spell_gen_chaos_blast);

0 commit comments

Comments
 (0)