Skip to content

Commit 53daa08

Browse files
authored
Scripts/Spells: Migrate & update non-generic quest spell scripts to zone files (TrinityCore#31100)
1 parent a2a3c65 commit 53daa08

14 files changed

+1802
-1727
lines changed

sql/updates/world/3.3.5/2025_07_12_00_world.sql

Lines changed: 219 additions & 0 deletions
Large diffs are not rendered by default.

src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "Player.h"
3232
#include "ScriptedEscortAI.h"
3333
#include "ScriptedGossip.h"
34+
#include "SpellAuraEffects.h"
3435
#include "SpellInfo.h"
3536
#include "SpellScript.h"
3637
#include "TemporarySummon.h"
@@ -517,6 +518,92 @@ struct npc_eye_of_acherus : public ScriptedAI
517518
EventMap _events;
518519
};
519520

521+
enum DeathComesFromOnHigh
522+
{
523+
SPELL_FORGE_CREDIT = 51974,
524+
SPELL_TOWN_HALL_CREDIT = 51977,
525+
SPELL_SCARLET_HOLD_CREDIT = 51980,
526+
SPELL_CHAPEL_CREDIT = 51982,
527+
528+
NPC_NEW_AVALON_FORGE = 28525,
529+
NPC_NEW_AVALON_TOWN_HALL = 28543,
530+
NPC_SCARLET_HOLD = 28542,
531+
NPC_CHAPEL_OF_THE_CRIMSON_FLAME = 28544
532+
};
533+
534+
// 51858 - Siphon of Acherus
535+
class spell_chapter1_siphon_of_acherus : public SpellScript
536+
{
537+
PrepareSpellScript(spell_chapter1_siphon_of_acherus);
538+
539+
bool Validate(SpellInfo const* /*spellInfo*/) override
540+
{
541+
return ValidateSpellInfo(
542+
{
543+
SPELL_FORGE_CREDIT,
544+
SPELL_TOWN_HALL_CREDIT,
545+
SPELL_SCARLET_HOLD_CREDIT,
546+
SPELL_CHAPEL_CREDIT
547+
});
548+
}
549+
550+
void HandleDummy(SpellEffIndex /*effIndex*/)
551+
{
552+
uint32 spellId = 0;
553+
554+
switch (GetHitCreature()->GetEntry())
555+
{
556+
case NPC_NEW_AVALON_FORGE:
557+
spellId = SPELL_FORGE_CREDIT;
558+
break;
559+
case NPC_NEW_AVALON_TOWN_HALL:
560+
spellId = SPELL_TOWN_HALL_CREDIT;
561+
break;
562+
case NPC_SCARLET_HOLD:
563+
spellId = SPELL_SCARLET_HOLD_CREDIT;
564+
break;
565+
case NPC_CHAPEL_OF_THE_CRIMSON_FLAME:
566+
spellId = SPELL_CHAPEL_CREDIT;
567+
break;
568+
default:
569+
return;
570+
}
571+
572+
GetCaster()->CastSpell(nullptr, spellId, true);
573+
}
574+
575+
void Register() override
576+
{
577+
OnEffectHitTarget += SpellEffectFn(spell_chapter1_siphon_of_acherus::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
578+
}
579+
};
580+
581+
// 52694 - Recall Eye of Acherus
582+
class spell_chapter1_recall_eye_of_acherus : public SpellScript
583+
{
584+
PrepareSpellScript(spell_chapter1_recall_eye_of_acherus);
585+
586+
bool Validate(SpellInfo const* /*spell*/) override
587+
{
588+
return ValidateSpellInfo({ SPELL_THE_EYE_OF_ACHERUS });
589+
}
590+
591+
void HandleDummy(SpellEffIndex /*effIndex*/)
592+
{
593+
if (Player* player = Object::ToPlayer(GetCaster()->GetCharmerOrOwner()))
594+
{
595+
player->StopCastingCharm();
596+
player->StopCastingBindSight();
597+
player->RemoveAura(SPELL_THE_EYE_OF_ACHERUS);
598+
}
599+
}
600+
601+
void Register() override
602+
{
603+
OnEffectHitTarget += SpellEffectFn(spell_chapter1_recall_eye_of_acherus::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
604+
}
605+
};
606+
520607
/*######
521608
## npc_death_knight_initiate
522609
######*/
@@ -1169,13 +1256,58 @@ class spell_chapter1_sky_darkener_assault : public SpellScript
11691256
}
11701257
};
11711258

1259+
/*######
1260+
## Quest 12619: The Emblazoned Runeblade
1261+
######*/
1262+
1263+
// 51769 - Emblazon Runeblade
1264+
class spell_chapter1_emblazon_runeblade : public AuraScript
1265+
{
1266+
PrepareAuraScript(spell_chapter1_emblazon_runeblade);
1267+
1268+
void HandleEffectPeriodic(AuraEffect const* aurEff)
1269+
{
1270+
PreventDefaultAction();
1271+
if (Unit* caster = GetCaster())
1272+
caster->CastSpell(caster, aurEff->GetSpellEffectInfo().TriggerSpell, aurEff);
1273+
}
1274+
1275+
void Register() override
1276+
{
1277+
OnEffectPeriodic += AuraEffectPeriodicFn(spell_chapter1_emblazon_runeblade::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
1278+
}
1279+
};
1280+
1281+
// 51770 - Emblazon Runeblade
1282+
class spell_chapter1_emblazon_runeblade_effect : public SpellScript
1283+
{
1284+
PrepareSpellScript(spell_chapter1_emblazon_runeblade_effect);
1285+
1286+
bool Validate(SpellInfo const* spellInfo) override
1287+
{
1288+
return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
1289+
}
1290+
1291+
void HandleScript(SpellEffIndex /*effIndex*/)
1292+
{
1293+
GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), false);
1294+
}
1295+
1296+
void Register() override
1297+
{
1298+
OnEffectHit += SpellEffectFn(spell_chapter1_emblazon_runeblade_effect::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
1299+
}
1300+
};
1301+
11721302
void AddSC_the_scarlet_enclave_c1()
11731303
{
11741304
new npc_unworthy_initiate();
11751305
new npc_unworthy_initiate_anchor();
11761306
new go_acherus_soul_prison();
11771307
RegisterSpellScript(spell_death_knight_initiate_visual);
11781308
RegisterCreatureAI(npc_eye_of_acherus);
1309+
RegisterSpellScript(spell_chapter1_siphon_of_acherus);
1310+
RegisterSpellScript(spell_chapter1_recall_eye_of_acherus);
11791311
new npc_death_knight_initiate();
11801312
RegisterCreatureAI(npc_dark_rider_of_acherus);
11811313
new npc_salanar_the_horseman();
@@ -1187,4 +1319,6 @@ void AddSC_the_scarlet_enclave_c1()
11871319
RegisterSpellScript(spell_gift_of_the_harvester);
11881320
RegisterSpellScript(spell_chapter1_runeforging_credit);
11891321
RegisterSpellScript(spell_chapter1_sky_darkener_assault);
1322+
RegisterSpellScript(spell_chapter1_emblazon_runeblade);
1323+
RegisterSpellScript(spell_chapter1_emblazon_runeblade_effect);
11901324
}

src/server/scripts/EasternKingdoms/eastern_kingdoms.cpp

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "SpellScript.h"
2121
#include "Unit.h"
2222

23-
enum Translocation
23+
enum EasternKingdomsTranslocation
2424
{
2525
SPELL_TRANSLOCATION_DUSKWITHER_SPIRE_UP = 26566,
2626
SPELL_TRANSLOCATION_DUSKWITHER_SPIRE_DOWN = 26572,
@@ -112,6 +112,10 @@ class spell_eastern_kingdoms_undercity_to_silvermoon : public SpellScript
112112
}
113113
};
114114

115+
/*######
116+
## Quest 11532: Distraction at the Dead Scar / 11533: The Air Strikes Must Continue
117+
######*/
118+
115119
enum DeadScarBombingRun
116120
{
117121
SOUND_ID_BOMBING_RUN = 12318
@@ -164,6 +168,38 @@ class spell_eastern_kingdoms_dawnblade_attack : public SpellScript
164168
}
165169
};
166170

171+
/*######
172+
## Quest 2203: Badlands Reagent Run II
173+
######*/
174+
175+
enum BadlandsReagentRun
176+
{
177+
SPELL_THAUMATURGY_CHANNEL = 21029
178+
};
179+
180+
// 9712 - Thaumaturgy Channel
181+
class spell_eastern_kingdoms_thaumaturgy_channel : public AuraScript
182+
{
183+
PrepareAuraScript(spell_eastern_kingdoms_thaumaturgy_channel);
184+
185+
bool Validate(SpellInfo const* /*spellInfo*/) override
186+
{
187+
return ValidateSpellInfo({ SPELL_THAUMATURGY_CHANNEL });
188+
}
189+
190+
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
191+
{
192+
PreventDefaultAction();
193+
if (Unit* caster = GetCaster())
194+
caster->CastSpell(caster, SPELL_THAUMATURGY_CHANNEL, false);
195+
}
196+
197+
void Register() override
198+
{
199+
OnEffectPeriodic += AuraEffectPeriodicFn(spell_eastern_kingdoms_thaumaturgy_channel::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
200+
}
201+
};
202+
167203
void AddSC_eastern_kingdoms()
168204
{
169205
RegisterSpellScript(spell_eastern_kingdoms_duskwither_spire_up);
@@ -172,4 +208,5 @@ void AddSC_eastern_kingdoms()
172208
RegisterSpellScript(spell_eastern_kingdoms_undercity_to_silvermoon);
173209
RegisterSpellScript(spell_eastern_kingdoms_dead_scar_bombing_run);
174210
RegisterSpellScript(spell_eastern_kingdoms_dawnblade_attack);
211+
RegisterSpellScript(spell_eastern_kingdoms_thaumaturgy_channel);
175212
}

src/server/scripts/Northrend/zone_borean_tundra.cpp

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,50 @@ class spell_borean_tundra_arcane_prisoner_rescue : public SpellScript
17351735

17361736
enum WeaknessToLightning
17371737
{
1738-
SPELL_POWER_OF_THE_STORM = 46424
1738+
SPELL_POWER_OF_THE_STORM_ITEM = 46432,
1739+
SPELL_POWER_OF_THE_STORM = 46424
1740+
};
1741+
1742+
// 46444 - Weakness to Lightning: Cast on Master Script Effect
1743+
class spell_borean_tundra_weakness_to_lightning_cast_on_master : public SpellScript
1744+
{
1745+
PrepareSpellScript(spell_borean_tundra_weakness_to_lightning_cast_on_master);
1746+
1747+
bool Validate(SpellInfo const* spellInfo) override
1748+
{
1749+
return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
1750+
}
1751+
1752+
void HandleScript(SpellEffIndex /*effIndex*/)
1753+
{
1754+
GetHitUnit()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
1755+
}
1756+
1757+
void Register() override
1758+
{
1759+
OnEffectHitTarget += SpellEffectFn(spell_borean_tundra_weakness_to_lightning_cast_on_master::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
1760+
}
1761+
};
1762+
1763+
// 46446 - Weakness to Lightning: Cancel Power of the Storm Aura
1764+
class spell_borean_tundra_weakness_to_lightning_cancel_aura : public SpellScript
1765+
{
1766+
PrepareSpellScript(spell_borean_tundra_weakness_to_lightning_cancel_aura);
1767+
1768+
bool Validate(SpellInfo const* /*spellInfo*/) override
1769+
{
1770+
return ValidateSpellInfo({ SPELL_POWER_OF_THE_STORM_ITEM });
1771+
}
1772+
1773+
void HandleScript(SpellEffIndex /*effIndex*/)
1774+
{
1775+
GetCaster()->RemoveAurasDueToSpell(SPELL_POWER_OF_THE_STORM_ITEM);
1776+
}
1777+
1778+
void Register() override
1779+
{
1780+
OnEffectHit += SpellEffectFn(spell_borean_tundra_weakness_to_lightning_cancel_aura::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
1781+
}
17391782
};
17401783

17411784
// 46550 - Weakness to Lightning: On Quest Complete
@@ -1790,6 +1833,77 @@ class spell_borean_tundra_signal_alliance : public SpellScript
17901833
}
17911834
};
17921835

1836+
/*######
1837+
## Quest 11730: Master and Servant
1838+
######*/
1839+
1840+
enum MasterAndServant
1841+
{
1842+
SPELL_SUMMON_SCAVENGEBOT_004A8 = 46063,
1843+
SPELL_SUMMON_SENTRYBOT_57K = 46068,
1844+
SPELL_SUMMON_DEFENDOTANK_66D = 46058,
1845+
SPELL_SUMMON_SCAVENGEBOT_005B6 = 46066,
1846+
SPELL_SUMMON_55D_COLLECTATRON = 46034,
1847+
SPELL_ROBOT_KILL_CREDIT = 46027,
1848+
NPC_SCAVENGEBOT_004A8 = 25752,
1849+
NPC_SENTRYBOT_57K = 25753,
1850+
NPC_DEFENDOTANK_66D = 25758,
1851+
NPC_SCAVENGEBOT_005B6 = 25792,
1852+
NPC_55D_COLLECTATRON = 25793
1853+
};
1854+
1855+
// 46023 - The Ultrasonic Screwdriver
1856+
class spell_borean_tundra_ultrasonic_screwdriver : public SpellScript
1857+
{
1858+
PrepareSpellScript(spell_borean_tundra_ultrasonic_screwdriver);
1859+
1860+
bool Load() override
1861+
{
1862+
return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem();
1863+
}
1864+
1865+
bool Validate(SpellInfo const* /*spellEntry*/) override
1866+
{
1867+
return ValidateSpellInfo(
1868+
{
1869+
SPELL_SUMMON_SCAVENGEBOT_004A8,
1870+
SPELL_SUMMON_SENTRYBOT_57K,
1871+
SPELL_SUMMON_DEFENDOTANK_66D,
1872+
SPELL_SUMMON_SCAVENGEBOT_005B6,
1873+
SPELL_SUMMON_55D_COLLECTATRON,
1874+
SPELL_ROBOT_KILL_CREDIT
1875+
});
1876+
}
1877+
1878+
void HandleDummy(SpellEffIndex /*effIndex*/)
1879+
{
1880+
Item* castItem = GetCastItem();
1881+
Unit* caster = GetCaster();
1882+
if (Creature* target = GetHitCreature())
1883+
{
1884+
uint32 spellId = 0;
1885+
switch (target->GetEntry())
1886+
{
1887+
case NPC_SCAVENGEBOT_004A8: spellId = SPELL_SUMMON_SCAVENGEBOT_004A8; break;
1888+
case NPC_SENTRYBOT_57K: spellId = SPELL_SUMMON_SENTRYBOT_57K; break;
1889+
case NPC_DEFENDOTANK_66D: spellId = SPELL_SUMMON_DEFENDOTANK_66D; break;
1890+
case NPC_SCAVENGEBOT_005B6: spellId = SPELL_SUMMON_SCAVENGEBOT_005B6; break;
1891+
case NPC_55D_COLLECTATRON: spellId = SPELL_SUMMON_55D_COLLECTATRON; break;
1892+
default:
1893+
return;
1894+
}
1895+
caster->CastSpell(caster, spellId, castItem);
1896+
caster->CastSpell(caster, SPELL_ROBOT_KILL_CREDIT, true);
1897+
target->DespawnOrUnsummon();
1898+
}
1899+
}
1900+
1901+
void Register() override
1902+
{
1903+
OnEffectHitTarget += SpellEffectFn(spell_borean_tundra_ultrasonic_screwdriver::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
1904+
}
1905+
};
1906+
17931907
void AddSC_borean_tundra()
17941908
{
17951909
RegisterCreatureAI(npc_beryl_sorcerer);
@@ -1817,6 +1931,9 @@ void AddSC_borean_tundra()
18171931
RegisterSpellScript(spell_borean_tundra_neural_needle);
18181932
RegisterSpellScript(spell_borean_tundra_prototype_neural_needle);
18191933
RegisterSpellScript(spell_borean_tundra_arcane_prisoner_rescue);
1934+
RegisterSpellScript(spell_borean_tundra_weakness_to_lightning_cast_on_master);
1935+
RegisterSpellScript(spell_borean_tundra_weakness_to_lightning_cancel_aura);
18201936
RegisterSpellScript(spell_borean_tundra_weakness_to_lightning_on_quest_complete);
18211937
RegisterSpellScript(spell_borean_tundra_signal_alliance);
1938+
RegisterSpellScript(spell_borean_tundra_ultrasonic_screwdriver);
18221939
}

0 commit comments

Comments
 (0)