aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2024_11_27_02_world.sql66
-rw-r--r--src/server/scripts/Kalimdor/zone_durotar.cpp63
-rw-r--r--src/server/scripts/Kalimdor/zone_orgrimmar.cpp46
-rw-r--r--src/server/scripts/Pandaria/pandaria_scripts_loader.cpp2
-rw-r--r--src/server/scripts/Pandaria/zone_the_jade_forest.cpp120
5 files changed, 276 insertions, 21 deletions
diff --git a/sql/updates/world/master/2024_11_27_02_world.sql b/sql/updates/world/master/2024_11_27_02_world.sql
new file mode 100644
index 00000000000..3aff2bf626f
--- /dev/null
+++ b/sql/updates/world/master/2024_11_27_02_world.sql
@@ -0,0 +1,66 @@
+-- Gossips
+UPDATE `gossip_menu` SET `VerifiedBuild`=57388 WHERE (`MenuID`=14988 AND `TextID`=21186) OR (`MenuID`=4342 AND `TextID`=5516);
+
+DELETE FROM `gossip_menu_option` WHERE (`MenuID`=14988 AND `OptionID`=0);
+INSERT INTO `gossip_menu_option` (`MenuID`, `GossipOptionID`, `OptionID`, `OptionNpc`, `OptionText`, `OptionBroadcastTextID`, `Language`, `Flags`, `ActionMenuID`, `ActionPoiID`, `GossipNpcOptionID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `SpellID`, `OverrideIconID`, `VerifiedBuild`) VALUES
+(14988, 41023, 0, 0, 'I''m ready to go, General.', 67518, 0, 0, 0, 0, NULL, 0, 0, NULL, 0, NULL, NULL, 57388);
+
+UPDATE `gossip_menu_option` SET `VerifiedBuild`=57388 WHERE (`MenuID`=4342 AND `OptionID`=0);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=14988 AND `SourceEntry`=0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(15,14988,0,0,0,47,0,29690,8,0,'',0,0,0,'','Show gossip option if quest 29690 is taken');
+
+-- Quests
+UPDATE `quest_poi` SET `VerifiedBuild`=57388 WHERE (`QuestID`=29690 AND `BlobIndex`=0 AND `Idx1`=1) OR (`QuestID`=29690 AND `BlobIndex`=0 AND `Idx1`=0);
+UPDATE `quest_poi_points` SET `VerifiedBuild`=57388 WHERE (`QuestID`=29690 AND `Idx1`=1 AND `Idx2`=0) OR (`QuestID`=29690 AND `Idx1`=0 AND `Idx2`=0);
+
+UPDATE `quest_details` SET `VerifiedBuild`=57388 WHERE `ID`=29690;
+
+DELETE FROM `quest_request_items` WHERE `ID`=29690;
+INSERT INTO `quest_request_items` (`ID`, `EmoteOnComplete`, `EmoteOnIncomplete`, `EmoteOnCompleteDelay`, `EmoteOnIncompleteDelay`, `CompletionText`, `VerifiedBuild`) VALUES
+(29690, 0, 0, 0, 0, '', 57388); -- Into the Mists
+
+UPDATE `creature_queststarter` SET `VerifiedBuild`=57388 WHERE (`id`=55054 AND `quest`=29690);
+
+UPDATE `creature_questender` SET `VerifiedBuild`=57388 WHERE (`id`=55135 AND `quest`=29690) OR (`id`=55054 AND `quest`=31853);
+
+-- Spells
+DELETE FROM `spell_target_position` WHERE (`EffectIndex`=0 AND `ID`=102930);
+INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `VerifiedBuild`) VALUES
+(102930, 0, 870, 3138.8701171875, -721.25, 325, 57388); -- Spell: 102930 (Teleport Player to Crash Site) Effect: 252 (SPELL_EFFECT_TELEPORT_UNITS)
+
+UPDATE `spell_target_position` SET `PositionX`=1445.2099609375, `PositionY`=-4499.56005859375, `PositionZ`=18.30999946594238281, `VerifiedBuild`=57388 WHERE (`ID`=123073 AND `EffectIndex`=0); -- Spell: 123073 (Portal: Orgrimmar) Efffect: 252 (SPELL_EFFECT_TELEPORT_UNITS)
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_teleport_prep', 'spell_teleport_timer', 'spell_into_the_mists_scene_jf', 'spell_cancel_blackout', 'spell_into_the_mists_scene_end');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(130810, 'spell_teleport_prep'),
+(132034, 'spell_teleport_timer'),
+(121545, 'spell_into_the_mists_scene_jf'),
+(130812, 'spell_cancel_blackout'),
+(130723, 'spell_into_the_mists_scene_end');
+
+-- Smart scripts
+DELETE FROM `scene_template` WHERE `SceneId`=87;
+INSERT INTO `scene_template` (`SceneId`, `Flags`, `ScriptPackageID`, `Encrypted`, `ScriptName`) VALUES
+(87, 11, 228, 0, 'SmartScene');
+
+DELETE FROM `areatrigger_scripts` WHERE `entry`=8045;
+INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
+(8045, 'SmartTrigger');
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=55054 AND `source_type`=0 AND `id` IN (3, 4);
+DELETE FROM `smart_scripts` WHERE `entryorguid`=8045 AND `source_type`=2;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=87 AND `source_type`=10;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `Difficulties`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param_string`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `action_param7`, `action_param_string`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_param_string`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(55054,0,3,4,'',62,0,100,0,14988,0,0,0,0,'',134,130810,0x2,(0x20 | 0x40000),0,0,0,0,NULL,7,0,0,0,0,NULL,0,0,0,0,'General Nazgrim - On gossip option 0 selected - Invoker casts ''Teleport Prep'''),
+(55054,0,4,0,'',61,0,100,0,0,0,0,0,0,'',72,0,0,0,0,0,0,0,NULL,7,0,0,0,0,NULL,0,0,0,0,'General Nazgrim - Event linked - Close gossip'),
+
+(8045,2,0,0,'',46,0,100,0,0,0,0,0,0,'',134,121545,0x2,(0x20 | 0x40000),0,0,0,0,NULL,7,0,0,0,0,NULL,0,0,0,0,'Areatrigger 8045 - On trigger - Invoker casts ''Into the Mists Scene - JF'''),
+
+(87,10,0,0,'',81,0,100,0,0,0,0,0,0,'',134,130723,0x2,(0x20 | 0x40000),0,0,0,0,NULL,7,0,0,0,0,NULL,0,0,0,0,'Scene 87 - On scene complete - Invoker casts ''Into the Mists Scene End'''),
+(87,10,1,0,'',80,0,100,0,0,0,0,0,0,'',134,130723,0x2,(0x20 | 0x40000),0,0,0,0,NULL,7,0,0,0,0,NULL,0,0,0,0,'Scene 87 - On scene cancel - Invoker casts ''Into the Mists Scene End''');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=30 AND `SourceEntry`=8045;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(30,0,8045,0,0,47,0,29690,8,0,'',0,0,0,'','Areatrigger 8045 triggers if quest 29690 is taken');
diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp
index 181151a15a7..9e69f784319 100644
--- a/src/server/scripts/Kalimdor/zone_durotar.cpp
+++ b/src/server/scripts/Kalimdor/zone_durotar.cpp
@@ -21,6 +21,8 @@
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "Spell.h"
+#include "SpellAuraEffects.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "ScriptedGossip.h"
@@ -31,7 +33,9 @@ namespace Durotar
{
namespace Spells
{
- static constexpr uint32 PhasePlayer = 130750;
+ static constexpr uint32 PhasePlayer = 130750;
+ static constexpr uint32 TeleportTimer = 132034;
+ static constexpr uint32 TeleportPlayerToCrashSite = 102930;
}
}
@@ -1240,6 +1244,57 @@ public:
}
};
+// 130810 - Teleport Prep
+class spell_teleport_prep : public SpellScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ Durotar::Spells::TeleportTimer
+ });
+ }
+
+ void HandleHitTarget(SpellEffIndex /*effIndex*/) const
+ {
+ Unit* hitUnit = GetHitUnit();
+
+ hitUnit->CastSpell(hitUnit, Durotar::Spells::TeleportTimer, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .OriginalCastId = GetSpell()->m_castId
+ });
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_teleport_prep::HandleHitTarget, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
+ }
+};
+
+// 132034 - Teleport Timer
+class spell_teleport_timer : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ Durotar::Spells::TeleportPlayerToCrashSite
+ });
+ }
+
+ void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
+ {
+ Unit* target = GetTarget();
+
+ target->CastSpell(target, Durotar::Spells::TeleportPlayerToCrashSite, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
+ });
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_teleport_timer::HandleAfterEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
void AddSC_durotar()
{
new npc_lazy_peon();
@@ -1281,6 +1336,10 @@ void AddSC_durotar()
RegisterCreatureAI(npc_voljin_garrosh_vision);
RegisterCreatureAI(npc_voljin_thrall_vision);
- // Hellscream's Fist
+ // AreaTriggers
new at_hellscreams_fist_gunship();
+
+ // Spells
+ RegisterSpellScript(spell_teleport_prep);
+ RegisterSpellScript(spell_teleport_timer);
}
diff --git a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
index 31ddbac6e11..83c2e6711b6 100644
--- a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
+++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
@@ -17,9 +17,8 @@
#include "Define.h"
#include "ScriptMgr.h"
-#include "SpellAuraDefines.h"
+#include "Spell.h"
#include "SpellAuraEffects.h"
-#include "SpellDefines.h"
#include "SpellScript.h"
#include "Unit.h"
@@ -33,48 +32,57 @@ namespace Orgrimmar
}
// 130412 - Art of War Movie Aura
-class spell_art_of_war_movie_aura : public AuraScript
+class spell_art_of_war_movie_aura : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({
- Orgrimmar::Spells::MOPHordeIntroMoviePlay,
Orgrimmar::Spells::FadeToBlack
});
}
- void HandleAfterEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
+ void HandleHitTarget(SpellEffIndex /*effIndex*/) const
{
- Unit* caster = GetCaster();
- if (!caster)
- return;
+ Unit* hitUnit = GetHitUnit();
- caster->CastSpell(GetTarget(), Orgrimmar::Spells::FadeToBlack, CastSpellExtraArgsInit{
+ hitUnit->CastSpell(hitUnit, Orgrimmar::Spells::FadeToBlack, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .TriggeringAura = aurEff
+ .OriginalCastId = GetSpell()->m_castId
});
}
- void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_art_of_war_movie_aura::HandleHitTarget, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
+ }
+};
+
+class spell_art_of_war_movie_aura_aura : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ Orgrimmar::Spells::MOPHordeIntroMoviePlay
+ });
+ }
+
+ void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
{
- Unit* caster = GetCaster();
- if (!caster)
- return;
+ Unit* target = GetTarget();
- caster->CastSpell(GetTarget(), Orgrimmar::Spells::MOPHordeIntroMoviePlay, CastSpellExtraArgsInit{
+ target->CastSpell(target, Orgrimmar::Spells::MOPHordeIntroMoviePlay, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
});
}
void Register() override
{
- AfterEffectApply += AuraEffectApplyFn(spell_art_of_war_movie_aura::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
- AfterEffectRemove += AuraEffectRemoveFn(spell_art_of_war_movie_aura::HandleAfterEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_art_of_war_movie_aura_aura::HandleAfterEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
void AddSC_orgrimmar()
{
- // Grommash Hold
- RegisterSpellScript(spell_art_of_war_movie_aura);
+ // Spells
+ RegisterSpellAndAuraScriptPair(spell_art_of_war_movie_aura, spell_art_of_war_movie_aura_aura);
}
diff --git a/src/server/scripts/Pandaria/pandaria_scripts_loader.cpp b/src/server/scripts/Pandaria/pandaria_scripts_loader.cpp
index e84ea05039c..39dac4bf71e 100644
--- a/src/server/scripts/Pandaria/pandaria_scripts_loader.cpp
+++ b/src/server/scripts/Pandaria/pandaria_scripts_loader.cpp
@@ -16,11 +16,13 @@
*/
// This is where scripts loading function should be declared:
+void AddSC_zone_the_jade_forest();
void AddSC_zone_the_wandering_isle();
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
void AddPandariaScripts()
{
+ AddSC_zone_the_jade_forest();
AddSC_zone_the_wandering_isle();
}
diff --git a/src/server/scripts/Pandaria/zone_the_jade_forest.cpp b/src/server/scripts/Pandaria/zone_the_jade_forest.cpp
new file mode 100644
index 00000000000..834c27926ab
--- /dev/null
+++ b/src/server/scripts/Pandaria/zone_the_jade_forest.cpp
@@ -0,0 +1,120 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptMgr.h"
+#include "Spell.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
+#include "Unit.h"
+
+namespace TheJadeForest
+{
+ namespace Spells
+ {
+ static constexpr uint32 CancelBlackout = 130812;
+ static constexpr uint32 TeleportPrep = 130810;
+ static constexpr uint32 TeleportPlayerToCrashSite = 102930;
+ static constexpr uint32 CutToBlack = 122343;
+ static constexpr uint32 WakeUpDead = 122344;
+ }
+}
+
+// 121545 - Into the Mists Scene - JF
+class spell_into_the_mists_scene_jf : public SpellScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ TheJadeForest::Spells::CancelBlackout
+ });
+ }
+
+ void HandleHitTarget(SpellEffIndex /*effIndex*/) const
+ {
+ Unit* hitUnit = GetHitUnit();
+
+ hitUnit->CastSpell(hitUnit, TheJadeForest::Spells::CancelBlackout, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .OriginalCastId = GetSpell()->m_castId
+ });
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_into_the_mists_scene_jf::HandleHitTarget, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
+// 130812 - Cancel Blackout
+class spell_cancel_blackout : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ TheJadeForest::Spells::TeleportPrep
+ });
+ }
+
+ void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
+ {
+ GetTarget()->RemoveAurasDueToSpell(TheJadeForest::Spells::TeleportPrep);
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_cancel_blackout::HandleAfterEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+// 130723 - Into the Mists Scene End
+class spell_into_the_mists_scene_end : public SpellScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ TheJadeForest::Spells::TeleportPlayerToCrashSite,
+ TheJadeForest::Spells::CutToBlack,
+ TheJadeForest::Spells::WakeUpDead
+ });
+ }
+
+ void HandleHitTarget(SpellEffIndex /*effIndex*/) const
+ {
+ Unit* hitUnit = GetHitUnit();
+
+ CastSpellExtraArgs const& castSpellExtraArgs = CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .OriginalCastId = GetSpell()->m_castId
+ };
+ hitUnit->CastSpell(hitUnit, TheJadeForest::Spells::TeleportPlayerToCrashSite, castSpellExtraArgs);
+ hitUnit->CastSpell(hitUnit, TheJadeForest::Spells::CutToBlack, castSpellExtraArgs);
+ hitUnit->CastSpell(hitUnit, TheJadeForest::Spells::WakeUpDead, castSpellExtraArgs);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_into_the_mists_scene_end::HandleHitTarget, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
+void AddSC_zone_the_jade_forest()
+{
+ // Spells
+ RegisterSpellScript(spell_into_the_mists_scene_jf);
+ RegisterSpellScript(spell_cancel_blackout);
+ RegisterSpellScript(spell_into_the_mists_scene_end);
+}