aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2022-02-01 16:01:34 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-26 00:21:13 +0100
commita2236616ccf6c5cb778933e7bf808b387e29fded (patch)
treee6f457791a7676266d135c7e9d2b097f7c85b032 /src/server/scripts/Spells
parentc60c5455d2b813ee481f49a752d2b7d434fd47dd (diff)
Scripts/Quest: Rework Mystery of the Infinite & Mystery of the Infinite, Redux (#27677)
(cherry picked from commit f205e25b337ceb10a9bec111a46406f4af9dc3e2)
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp42
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp28
2 files changed, 43 insertions, 27 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 288b513384a..7f56fce52af 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3678,6 +3678,45 @@ class spell_gen_whisper_to_controller : public SpellScript
}
};
+enum WhisperToControllerTexts
+{
+ WHISPER_FUTURE_YOU = 2,
+ WHISPER_DEFENDER = 1,
+ WHISPER_PAST_YOU = 2
+};
+
+// BasePoints of spells is ID of npc_text used to group texts, it's not implemented so texts are grouped the old way
+// 50037 - Mystery of the Infinite: Future You's Whisper to Controller - Random
+// 50287 - Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random
+// 60709 - MOTI, Redux: Past You's Whisper to Controller - Random
+class spell_gen_whisper_to_controller_random : public SpellScript
+{
+ PrepareSpellScript(spell_gen_whisper_to_controller_random);
+
+public:
+ spell_gen_whisper_to_controller_random(uint32 text) : SpellScript(), _text(text) { }
+
+private:
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ // Same for all spells
+ if (!roll_chance_i(20))
+ return;
+
+ if (Creature* target = GetHitCreature())
+ if (TempSummon* targetSummon = target->ToTempSummon())
+ if (Player* player = targetSummon->GetSummonerUnit()->ToPlayer())
+ targetSummon->AI()->Talk(_text, player);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_whisper_to_controller_random::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+
+ uint32 _text;
+};
+
class spell_gen_eject_all_passengers : public SpellScript
{
PrepareSpellScript(spell_gen_eject_all_passengers);
@@ -4911,6 +4950,9 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_wg_water);
RegisterSpellScript(spell_gen_whisper_gulch_yogg_saron_whisper);
RegisterSpellScript(spell_gen_whisper_to_controller);
+ RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_future_you_whisper_to_controller_random", WHISPER_FUTURE_YOU);
+ RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_wyrmrest_defender_whisper_to_controller_random", WHISPER_DEFENDER);
+ RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_past_you_whisper_to_controller_random", WHISPER_PAST_YOU);
RegisterSpellScript(spell_gen_eject_all_passengers);
RegisterSpellScript(spell_gen_eject_passenger);
RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_1", 0);
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index dd64a369fb8..6c6dcd891a5 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -1071,9 +1071,7 @@ class spell_q12372_cast_from_gossip_trigger : public SpellScript
enum Quest12372Data
{
// NPCs
- NPC_WYRMREST_TEMPLE_CREDIT = 27698,
- // Spells
- WHISPER_ON_HIT_BY_FORCE_WHISPER = 1
+ NPC_WYRMREST_TEMPLE_CREDIT = 27698
};
// 49370 - Wyrmrest Defender: Destabilize Azure Dragonshrine Effect
@@ -1097,29 +1095,6 @@ class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScript
}
};
-enum q12372Creatures
-{
- NPC_WYRMREST_DEFENDER = 27629
-};
-
-// 50287 - Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random (cast from Azure Dragons and Azure Drakes on death)
-class spell_q12372_azure_on_death_force_whisper : public SpellScript
-{
- PrepareSpellScript(spell_q12372_azure_on_death_force_whisper);
-
- void HandleScript(SpellEffIndex /*effIndex*/)
- {
- Creature* defender = GetHitCreature();
- if (defender && defender->GetEntry() == NPC_WYRMREST_DEFENDER)
- defender->AI()->Talk(WHISPER_ON_HIT_BY_FORCE_WHISPER, defender->GetCharmerOrOwner());
- }
-
- void Register() override
- {
- OnEffectHitTarget += SpellEffectFn(spell_q12372_azure_on_death_force_whisper::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
- }
-};
-
// "Bombing Run" and "Bomb Them Again!"
enum Quest11010_11102_11023Data
{
@@ -2493,7 +2468,6 @@ void AddSC_quest_spell_scripts()
RegisterSpellScript(spell_q11010_q11102_q11023_choose_loc);
RegisterSpellScript(spell_q11010_q11102_q11023_q11008_check_fly_mount);
RegisterSpellScript(spell_q11140salvage_wreckage);
- RegisterSpellScript(spell_q12372_azure_on_death_force_whisper);
RegisterSpellScript(spell_q12527_zuldrak_rat);
RegisterSpellScript(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan);
RegisterSpellScript(spell_q12730_quenching_mist);