aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeji <alvaro.megias@outlook.com>2024-11-27 23:21:08 +0100
committerGitHub <noreply@github.com>2024-11-27 23:21:08 +0100
commitf1079ec271be697318ebf8d70c25ebd9c3fbd2d8 (patch)
tree48f31fbb8a19ec4e0ff43b39a63b3f763faf343c
parent65265f394d0aca57419133ca217d6a6a60b62263 (diff)
Scripts/StormwindCity: Implement quest "The King's Command" (29547) (#30459)
-rw-r--r--sql/updates/world/master/2024_11_27_03_world.sql43
-rw-r--r--src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp61
2 files changed, 104 insertions, 0 deletions
diff --git a/sql/updates/world/master/2024_11_27_03_world.sql b/sql/updates/world/master/2024_11_27_03_world.sql
new file mode 100644
index 00000000000..1c845cf4c69
--- /dev/null
+++ b/sql/updates/world/master/2024_11_27_03_world.sql
@@ -0,0 +1,43 @@
+SET @CONDREFID := 40004;
+
+-- Spells
+DELETE FROM `spell_target_position` WHERE (`EffectIndex`=2 AND `ID`=130805);
+INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `VerifiedBuild`) VALUES
+(130805, 2, 0, -8450.73046875, 343.7130126953125, 135.9799957275390625, 57534); -- Spell: 130805 (MoP: Alliance Intro Movie PLAY) Efffect: 252 (SPELL_EFFECT_TELEPORT_UNITS)
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_the_kings_command_movie_aura');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(130804, 'spell_the_kings_command_movie_aura');
+
+-- Smart scripts
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=1750;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=1750 AND `source_type`=0;
+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
+(1750,0,0,0,'',19,0,100,0,29547,0,0,0,0,'',134,130804,0x2,(0x20 | 0x40000),0,0,0,0,NULL,7,0,0,0,0,NULL,0,0,0,0,'Grand Admiral Jes-Tereth - On quest ''The King''s Command'' taken - Invoker casts ''The King''s Command Movie Aura''');
+
+DELETE FROM `areatrigger_scripts` WHERE `entry` IN (7045, 7046);
+INSERT INTO `areatrigger_scripts` VALUES
+(7045, 'SmartTrigger'),
+(7046, 'SmartTrigger');
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (7045, 7046) AND `source_type`=2;
+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
+(7045,2,0,0,'',46,0,100,0,0,0,0,0,0,'',134,130804,0x2,(0x20 | 0x40000),0,0,0,0,NULL,7,0,0,0,0,NULL,0,0,0,0,'Areatrigger 7045 - On trigger - Invoker casts ''The King''s Command Movie Aura'''),
+(7046,2,0,0,'',46,0,100,0,0,0,0,0,0,'',134,130804,0x2,(0x20 | 0x40000),0,0,0,0,NULL,7,0,0,0,0,NULL,0,0,0,0,'Areatrigger 7046 - On trigger - Invoker casts ''The King''s Command Movie Aura''');
+
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=30 AND `SourceEntry` IN (7045, 7046);
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=-@CONDREFID;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(30,0,7045,0,0,6,0,469,0,0,'',0,0,0,'','Areatrigger 7045 triggers if player is Alliance'),
+(30,0,7045,0,0,-@CONDREFID,0,0,0,0,'',0,0,0,'','Areatrigger 7045 triggers if condition reference 40004 is fulfilled'),
+(30,0,7046,0,0,6,0,469,0,0,'',0,0,0,'','Areatrigger 7046 triggers if player is Alliance'),
+(30,0,7046,0,0,-@CONDREFID,0,0,0,0,'',0,0,0,'','Areatrigger 7046 triggers if condition reference 40004 is fulfilled'),
+(-@CONDREFID,0,0,0,0,47,0,29547,8,0,'',0,0,0,'','Apply condition reference if quest 29547 is taken'),
+(-@CONDREFID,0,0,0,1,47,0,49556,8,0,'',0,0,0,'','Apply condition reference if quest 49556 is taken'),
+(-@CONDREFID,0,0,0,2,47,0,49866,8,0,'',0,0,0,'','Apply condition reference if quest 49866 is taken'),
+(-@CONDREFID,0,0,0,3,47,0,60125,8,0,'',0,0,0,'','Apply condition reference if quest 60125 is taken');
+
+UPDATE `conditions` SET `Comment`='Areatrigger 8463 triggers if player is Horde' WHERE `SourceTypeOrReferenceId`=30 AND `SourceEntry`=8463 AND `ConditionTypeOrReference`=6;
+UPDATE `conditions` SET `Comment`='Areatrigger 8463 triggers if condition reference 40001 is fulfilled' WHERE `SourceTypeOrReferenceId`=30 AND `SourceEntry`=8463 AND `ConditionTypeOrReference`=-40001;
diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
index 116a688ec51..e071fdf1f19 100644
--- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
@@ -27,9 +27,19 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
+#include "Spell.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
+namespace StormwindCity
+{
+ namespace Spells
+ {
+ static constexpr uint32 MOPAllianceIntroMoviePlay = 130805;
+ static constexpr uint32 FadeToBlack = 130411;
+ }
+}
+
enum TidesOfWarData
{
QUEST_TIDES_OF_WAR = 46727,
@@ -494,6 +504,56 @@ private:
EventMap _events;
};
+// 130804 - The King's Command Movie Aura
+class spell_the_kings_command_movie_aura : public SpellScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ StormwindCity::Spells::FadeToBlack
+ });
+ }
+
+ void HandleHitTarget(SpellEffIndex /*effIndex*/) const
+ {
+ Unit* hitUnit = GetHitUnit();
+
+ hitUnit->CastSpell(hitUnit, StormwindCity::Spells::FadeToBlack, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .OriginalCastId = GetSpell()->m_castId
+ });
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_the_kings_command_movie_aura::HandleHitTarget, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
+ }
+};
+
+class spell_the_kings_command_movie_aura_aura : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ StormwindCity::Spells::MOPAllianceIntroMoviePlay
+ });
+ }
+
+ void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
+ {
+ Unit* target = GetTarget();
+
+ target->CastSpell(target, StormwindCity::Spells::MOPAllianceIntroMoviePlay, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
+ });
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_the_kings_command_movie_aura_aura::HandleAfterEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
void AddSC_stormwind_city()
{
// Creature
@@ -515,4 +575,5 @@ void AddSC_stormwind_city()
// Spells
RegisterSpellScript(spell_despawn_sailor_memory);
RegisterSpellScript(spell_kultiras_skip_intro);
+ RegisterSpellAndAuraScriptPair(spell_the_kings_command_movie_aura, spell_the_kings_command_movie_aura_aura);
}