diff options
5 files changed, 290 insertions, 138 deletions
diff --git a/sql/updates/world/master/2025_09_28_00_world.sql b/sql/updates/world/master/2025_09_28_00_world.sql new file mode 100644 index 00000000000..10c49fafbe0 --- /dev/null +++ b/sql/updates/world/master/2025_09_28_00_world.sql @@ -0,0 +1,5 @@ +DELETE FROM `world_safe_locs` WHERE `ID` IN (100099, 100100, 100101, 100102); +UPDATE `battleground_template` SET `AllianceStartLoc` = 5816, `HordeStartLoc` = 5817 WHERE `ID` = 844; +UPDATE `battleground_template` SET `AllianceStartLoc` = 6616, `HordeStartLoc` = 6617 WHERE `ID` = 903; + +UPDATE `gameobject` SET `spawntimesecs` = 360 WHERE `guid` IN (167081, 167082); diff --git a/sql/updates/world/master/2025_09_28_01_world.sql b/sql/updates/world/master/2025_09_28_01_world.sql new file mode 100644 index 00000000000..bf2602f6461 --- /dev/null +++ b/sql/updates/world/master/2025_09_28_01_world.sql @@ -0,0 +1,75 @@ +SET @OGUID := 2000000; +SET @CGUID := 2000000; +SET @SPAWN_GROUP := 1270; + +SET @AT_WIDTH := 10; +SET @AT_LENGTH := 35; +SET @AT_HEIGHT := 15; +SET @AT_ID := 167; +SET @AT_PROP_ID := 161; +SET @AT_SPAWN_ID = 263; + +DELETE FROM `spawn_group_template` WHERE `groupId` = @SPAWN_GROUP; +INSERT INTO `spawn_group_template` (`groupId`, `groupName`, `groupFlags`) VALUES +(@SPAWN_GROUP, 'Dalaran Arena - Shadow Sight', 0x20); + +DELETE FROM `spawn_group` WHERE `groupId` = @SPAWN_GROUP; +INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) VALUES +(@SPAWN_GROUP, 1, @OGUID+4), +(@SPAWN_GROUP, 1, @OGUID+5); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 33 AND `SourceEntry` = @SPAWN_GROUP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceEntry`, `SourceGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ScriptName`) VALUES +(33, @SPAWN_GROUP, 0, 22, 617, 'condition_is_shadow_sight_enabled'); + +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+5; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES +(@OGUID+0, 192643, 617, 4378, 4378, 0, 0, 0, 1232.58544921875, 764.8028564453125, 21.58008766174316406, 0, 0, 0, 0, 1, 7200, 255, 1, 61967), -- Doodad_Dalaran_SewerDoor_02 (Area: Dalaran Arena - Difficulty: 0) CreateObject1 +(@OGUID+1, 192642, 617, 4378, 4378, 0, 0, 0, 1350.7603759765625, 817.2127685546875, 21.58003997802734375, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 1, 61967), -- Doodad_Dalaran_SewerDoor_01 (Area: Dalaran Arena - Difficulty: 0) CreateObject1 +(@OGUID+2, 194395, 617, 4378, 4378, 0, 0, 0, 1291.6668701171875, 791.046875, 7.114629268646240234, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 0, 61967), -- Doodad_DalaranSewer_ArenaWaterFall_Collision01 (Area: Dalaran Arena - Difficulty: 0) CreateObject1 +(@OGUID+3, 191877, 617, 4378, 4378, 0, 0, 0, 1291.6728515625, 791.00775146484375, 6.824081897735595703, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 0, 61967), -- Doodad_DalaranSewer01 (Area: Dalaran Arena - Difficulty: 0) CreateObject1 +(@OGUID+4, 184663, 617, 4378, 4378, 0, 0, 0, 1292.517333984375, 746.78302001953125, 3.159699678421020507, 1.466075778007507324, 0, 0, 0.669130325317382812, 0.74314504861831665, 360, 255, 1, 61967), +(@OGUID+5, 184664, 617, 4378, 4378, 0, 0, 0, 1290.4132080078125, 835.8367919921875, 3.159699440002441406, 5.270895957946777343, 0, 0, -0.48480892181396484, 0.87462007999420166, 360, 255, 1, 61967); + +DELETE FROM `gameobject_addon` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+3; +INSERT INTO `gameobject_addon` (`guid`, `parent_rotation0`, `parent_rotation1`, `parent_rotation2`, `parent_rotation3`, `WorldEffectID`, `AIAnimKitID`) VALUES +(@OGUID+0, 0, 0, 1, -0.00000004371138828, 0, 0), -- Doodad_Dalaran_SewerDoor_02 +(@OGUID+1, 0, 0, 1, -0.00000004371138828, 0, 0), -- Doodad_Dalaran_SewerDoor_01 +(@OGUID+2, 0, 0, 1, -0.00000004371138828, 0, 0), -- Doodad_DalaranSewer_ArenaWaterFall_Collision01 +(@OGUID+3, 0, 0, 1, -0.00000004371138828, 0, 0); -- Doodad_DalaranSewer01 + +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+5; +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `MovementType`, `npcflag`, `unit_flags`, `unit_flags2`, `unit_flags3`, `VerifiedBuild`) VALUES +(@CGUID+0, 23472, 617, 4378, 4378, 0, 0, 0, 0, 0, 1270.6146240234375, 763.39410400390625, 22.04797744750976562, 0.942477762699127197, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 61967), -- World Trigger (Large AOI, Not Immune PC/NPC) (Area: Dalaran Arena - Difficulty: 0) CreateObject1 +(@CGUID+1, 15214, 617, 4378, 4378, 0, 0, 0, 0, 0, 1275.892333984375, 777.625, 7.197959423065185546, 0.523598790168762207, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 61967), -- Invisible Stalker (Area: Dalaran Arena - Difficulty: 0) CreateObject1 +(@CGUID+2, 28567, 617, 4378, 4378, 0, 0, 0, 0, 0, 1369.9774169921875, 817.2882080078125, 16.08717727661132812, 3.106686115264892578, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 61967), -- Water Spout (Area: Dalaran Arena - Difficulty: 0) CreateObject1 (Auras: 96539 - Pipe Flush Knockback Search Trigger) +(@CGUID+3, 23472, 617, 4378, 4378, 0, 0, 0, 0, 0, 1322.05908203125, 817.20831298828125, 19.52143287658691406, 3.455751895904541015, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 61967), -- World Trigger (Large AOI, Not Immune PC/NPC) (Area: Dalaran Arena - Difficulty: 0) CreateObject1 +(@CGUID+4, 28567, 617, 4378, 4378, 0, 0, 0, 0, 0, 1292.5867919921875, 790.22052001953125, 7.197960376739501953, 3.054326057434082031, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 61967), -- Water Spout (Area: Dalaran Arena - Difficulty: 0) CreateObject1 +(@CGUID+5, 28567, 617, 4378, 4378, 0, 0, 0, 0, 0, 1212.8333740234375, 765.38714599609375, 16.09483909606933593, 0, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 61967); -- Water Spout (Area: Dalaran Arena - Difficulty: 0) CreateObject1 (Auras: 96539 - Pipe Flush Knockback Search Trigger) + +UPDATE `creature` SET `StringId` = 'arena_dalaran_sewers_water_spout_pipe' WHERE `guid` IN (@CGUID+2, @CGUID+5); +UPDATE `creature` SET `StringId` = 'arena_dalaran_sewers_water_spout_center' WHERE `guid` = @CGUID+4; + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_arena_dalaran_sewers_pipe_flush_knockback_search', 'spell_arena_dalaran_sewers_flush_knock_back_effect'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(96538, 'spell_arena_dalaran_sewers_pipe_flush_knockback_search'), +(61698, 'spell_arena_dalaran_sewers_flush_knock_back_effect'); + +UPDATE `serverside_spell` SET `RangeIndex` = 5 WHERE `Id` = 61698; + +DELETE FROM `areatrigger_template` WHERE `Id` = @AT_ID AND `IsCustom` = 1; +INSERT INTO `areatrigger_template` (`Id`, `IsCustom`) VALUES +(@AT_ID, 1); + +DELETE FROM `areatrigger_create_properties` WHERE `Id` = @AT_PROP_ID AND `IsCustom` = 1; +INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`) VALUES +(@AT_PROP_ID, 1, @AT_ID, 1, 1, @AT_LENGTH, @AT_WIDTH, @AT_HEIGHT, @AT_LENGTH, @AT_WIDTH, @AT_HEIGHT, 0, 0); + +DELETE FROM `areatrigger_template_actions` WHERE `AreaTriggerId` = @AT_ID AND `IsCustom` = 1; +INSERT INTO `areatrigger_template_actions` (`AreaTriggerId`, `IsCustom`, `ActionType`, `ActionParam`, `TargetType`) VALUES +(@AT_ID, 1, 0, 228212, 0); -- Arena Starting Area Marker + +DELETE FROM `areatrigger` WHERE `SpawnId` BETWEEN @AT_SPAWN_ID+0 AND @AT_SPAWN_ID+1; +INSERT INTO `areatrigger` (`SpawnId`, `AreaTriggerCreatePropertiesId`, `IsCustom`, `MapId`, `PosX`, `PosY`, `PosZ`, `Orientation`, `Comment`) VALUES +(@AT_SPAWN_ID+0, @AT_PROP_ID, 1, 617, 1218.01, 764.795, 19.5, 0, 'Dalaran Sewers Entrance A'), +(@AT_SPAWN_ID+1, @AT_PROP_ID, 1, 617, 1361.76, 817.337, 19.5, 0, 'Dalaran Sewers Entrance B'); diff --git a/sql/updates/world/master/2025_09_28_02_world.sql b/sql/updates/world/master/2025_09_28_02_world.sql new file mode 100644 index 00000000000..ac1cc367828 --- /dev/null +++ b/sql/updates/world/master/2025_09_28_02_world.sql @@ -0,0 +1,31 @@ +-- Quest +DELETE FROM `quest_greeting` WHERE (`ID`=42308 AND `Type`=0); +INSERT INTO `quest_greeting` (`ID`, `Type`, `GreetEmoteType`, `GreetEmoteDelay`, `Greeting`, `VerifiedBuild`) VALUES +(42308, 0, 396, 0, 'Watch your footing, rookie.', 63305); -- 42308 + +DELETE FROM `quest_details` WHERE `ID` IN (26257 /*It's Alive!*/, 26252 /*Heart of the Watcher*/, 26241 /*Westfall Stew*/, 26237 /*Times are Tough*/, 26236 /*Shakedown at the Saldean's*/, 26232 /*Lou's Parting Thoughts*/, 26230 /*Feast or Famine*/, 26229 /*"I TAKE Candle!"*/, 26228 /*Livin' the Life*/, 26215 /*Meet Two-Shoed Lou*/, 26214 /*Hot On the Trail: Murlocs*/, 26213 /*Hot On the Trail: The Riverpaw Clan*/); +INSERT INTO `quest_details` (`ID`, `Emote1`, `Emote2`, `Emote3`, `Emote4`, `EmoteDelay1`, `EmoteDelay2`, `EmoteDelay3`, `EmoteDelay4`, `VerifiedBuild`) VALUES +(26257, 0, 0, 0, 0, 0, 0, 0, 0, 63305), -- It's Alive! +(26252, 0, 0, 0, 0, 0, 0, 0, 0, 63305), -- Heart of the Watcher +(26241, 1, 1, 1, 0, 0, 0, 0, 0, 63305), -- Westfall Stew +(26237, 1, 1, 5, 20, 0, 0, 0, 0, 63305), -- Times are Tough +(26236, 6, 1, 1, 0, 0, 0, 0, 0, 63305), -- Shakedown at the Saldean's +(26232, 1, 1, 1, 0, 0, 0, 0, 0, 63305), -- Lou's Parting Thoughts +(26230, 396, 396, 396, 0, 0, 0, 0, 0, 63305), -- Feast or Famine +(26229, 1, 1, 0, 0, 0, 0, 0, 0, 63305), -- "I TAKE Candle!" +(26228, 1, 1, 1, 0, 0, 0, 0, 0, 63305), -- Livin' the Life +(26215, 1, 1, 0, 0, 0, 0, 0, 0, 63305), -- Meet Two-Shoed Lou +(26214, 1, 1, 0, 0, 0, 0, 0, 0, 63305), -- Hot On the Trail: Murlocs +(26213, 1, 1, 1, 0, 0, 0, 0, 0, 63305); -- Hot On the Trail: The Riverpaw Clan + +DELETE FROM `quest_request_items` WHERE `ID` IN (26229 /*"I TAKE Candle!"*/, 26228 /*Livin' the Life*/, 26257 /*It's Alive!*/, 26209 /*Murder Was The Case That They Gave Me*/, 26237 /*Times are Tough*/); +INSERT INTO `quest_request_items` (`ID`, `EmoteOnComplete`, `EmoteOnIncomplete`, `EmoteOnCompleteDelay`, `EmoteOnIncompleteDelay`, `CompletionText`, `VerifiedBuild`) VALUES +(26229, 0, 5, 0, 0, 'I just want those kobolds dead. Dead!', 63305), -- "I TAKE Candle!" +(26228, 0, 0, 0, 0, 'Be careful with my old house. I plan to hand that off to my kids when they move out.', 63305), -- Livin' the Life +(26257, 0, 6, 0, 0, 'Did you find the golems?', 63305), -- It's Alive! +(26209, 0, 6, 0, 0, 'Anything yet?', 63305), -- Murder Was The Case That They Gave Me +(26237, 0, 0, 0, 0, 'Did you destroy the harvest watchers?', 63305); -- Times are Tough + +UPDATE `quest_request_items` SET `EmoteOnIncomplete`=396, `VerifiedBuild`=63305 WHERE `ID`=26230; -- Feast or Famine +UPDATE `quest_request_items` SET `EmoteOnIncomplete`=6, `VerifiedBuild`=63305 WHERE `ID`=26214; -- Hot On the Trail: Murlocs +UPDATE `quest_request_items` SET `EmoteOnIncomplete`=6, `VerifiedBuild`=63305 WHERE `ID`=26213; -- Hot On the Trail: The Riverpaw Clan diff --git a/src/server/scripts/Battlegrounds/DalaranSewers/arena_dalaran_sewers.cpp b/src/server/scripts/Battlegrounds/DalaranSewers/arena_dalaran_sewers.cpp index bbdf5d4ab3b..24b16f3b904 100644 --- a/src/server/scripts/Battlegrounds/DalaranSewers/arena_dalaran_sewers.cpp +++ b/src/server/scripts/Battlegrounds/DalaranSewers/arena_dalaran_sewers.cpp @@ -25,64 +25,74 @@ #include "ObjectAccessor.h" #include "Player.h" #include "ScriptMgr.h" +#include "SpellAuraEffects.h" +#include "SpellInfo.h" +#include "SpellMgr.h" +#include "SpellScript.h" #include "TaskScheduler.h" -struct arena_dalaran_sewers : ArenaScript +namespace DalaranSewers { - enum GameObjects + namespace Creatures { - BG_DS_OBJECT_TYPE_DOOR_1 = 192642, - BG_DS_OBJECT_TYPE_DOOR_2 = 192643, - BG_DS_OBJECT_TYPE_WATER_1 = 194395, // Collision - BG_DS_OBJECT_TYPE_WATER_2 = 191877, - BG_DS_OBJECT_TYPE_BUFF_1 = 184663, - BG_DS_OBJECT_TYPE_BUFF_2 = 184664 - }; - - enum Events + static constexpr uint32 WaterSpout = 28567; + } + + namespace Events + { + static constexpr uint32 WaterfallWarning = 1; + static constexpr uint32 WaterfallOn = 2; + static constexpr uint32 WaterfallOff = 3; + static constexpr uint32 WaterfallKnockBack = 4; + } + + namespace GameObjects { - BG_DS_EVENT_WATERFALL_WARNING = 1, // Water starting to fall, but no LoS Blocking nor movement blocking - BG_DS_EVENT_WATERFALL_ON = 2, // LoS and Movement blocking active - BG_DS_EVENT_WATERFALL_OFF = 3, - BG_DS_EVENT_WATERFALL_KNOCKBACK = 4, + static constexpr uint32 Door01 = 192642; + static constexpr uint32 Door02 = 192643; - BG_DS_EVENT_PIPE_KNOCKBACK = 5 - }; + static constexpr uint32 WaterCollision = 194395; + static constexpr uint32 Waterfall = 191877; + } - enum Creatures + namespace MapIds { - BG_DS_NPC_TYPE_WATER_SPOUT = 28567 - }; + static constexpr uint32 DalaranSewers = 617; + } - enum Spells + namespace Spells { - BG_DS_SPELL_FLUSH = 57405, // Visual and target selector for the starting knockback from the pipe - BG_DS_SPELL_FLUSH_KNOCKBACK = 61698, // Knockback effect for previous spell (triggered, not needed to be cast) - BG_DS_SPELL_WATER_SPOUT = 58873, // Knockback effect of the central waterfall + static constexpr uint32 PipeFlushKnockbackSearchTrigger = 96539; + static constexpr uint32 DalaranSewersPetTeleport = 254013; + static constexpr uint32 WaterSpout = 58873; // Knock back + static constexpr uint32 Flush = 57405; + + static constexpr uint32 WarlockDemonicCircle = 48018; + } - SPELL_WARL_DEMONIC_CIRCLE = 48018 // Demonic Circle Summon - }; + namespace StringIds + { + static constexpr std::string_view WaterSpoutPipe = "arena_dalaran_sewers_water_spout_pipe"; + static constexpr std::string_view WaterSpoutCenter = "arena_dalaran_sewers_water_spout_center"; + } - enum Data + namespace Timers { - // These values are NOT blizzlike... need the correct data! - BG_DS_PIPE_KNOCKBACK_FIRST_DELAY = 5000, - BG_DS_PIPE_KNOCKBACK_DELAY = 3000 - }; - - // These values are NOT blizzlike... need the correct data! - static constexpr Seconds BG_DS_WATERFALL_TIMER_MIN = 30s; - static constexpr Seconds BG_DS_WATERFALL_TIMER_MAX = 60s; - static constexpr Seconds BG_DS_WATERFALL_WARNING_DURATION = 5s; - static constexpr Seconds BG_DS_WATERFALL_DURATION = 30s; - static constexpr Milliseconds BG_DS_WATERFALL_KNOCKBACK_TIMER = 1500ms; - static constexpr uint32 BG_DS_DATA_PIPE_KNOCKBACK_COUNT = 1; - static constexpr uint32 BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT = 2; - - explicit arena_dalaran_sewers(BattlegroundMap* map) : ArenaScript(map), _pipeKnockBackTimer(BG_DS_PIPE_KNOCKBACK_FIRST_DELAY), _pipeKnockBackCount(0) { } + static constexpr Seconds Waterfall = 30s; + static constexpr Seconds WaterfallWarningDuration = 5s; + static constexpr Seconds WaterfallDuration = 30s; + static constexpr Milliseconds WaterfallKnockBack = 1500ms; + } +} + +struct arena_dalaran_sewers : ArenaScript +{ + explicit arena_dalaran_sewers(BattlegroundMap* map) : ArenaScript(map) { } void OnUpdate(uint32 diff) override { + ArenaScript::OnUpdate(diff); + if (battleground->GetStatus() != STATUS_IN_PROGRESS) return; @@ -93,75 +103,44 @@ struct arena_dalaran_sewers : ArenaScript { switch (eventId) { - case BG_DS_EVENT_WATERFALL_WARNING: + case DalaranSewers::Events::WaterfallWarning: // Add the water - if (GameObject* go = battlegroundMap->GetGameObject(_water2GUID)) - go->ResetDoorOrButton(); - _events.ScheduleEvent(BG_DS_EVENT_WATERFALL_ON, BG_DS_WATERFALL_WARNING_DURATION); + if (GameObject* go = battlegroundMap->GetGameObject(_waterfallGUID)) + go->UseDoorOrButton(); + _events.ScheduleEvent(DalaranSewers::Events::WaterfallOn, DalaranSewers::Timers::WaterfallWarningDuration); break; - case BG_DS_EVENT_WATERFALL_ON: + case DalaranSewers::Events::WaterfallOn: // Active collision and start knockback timer - if (GameObject* go = battlegroundMap->GetGameObject(_water1GUID)) - go->ResetDoorOrButton(); - _events.ScheduleEvent(BG_DS_EVENT_WATERFALL_OFF, BG_DS_WATERFALL_DURATION); - _events.ScheduleEvent(BG_DS_EVENT_WATERFALL_KNOCKBACK, BG_DS_WATERFALL_KNOCKBACK_TIMER); - break; - case BG_DS_EVENT_WATERFALL_OFF: - // Remove collision and water - if (GameObject* go = battlegroundMap->GetGameObject(_water1GUID)) + if (GameObject* go = battlegroundMap->GetGameObject(_waterCollisionGUID)) go->UseDoorOrButton(); - if (GameObject* go = battlegroundMap->GetGameObject(_water2GUID)) - go->UseDoorOrButton(); - _events.CancelEvent(BG_DS_EVENT_WATERFALL_KNOCKBACK); - _events.ScheduleEvent(BG_DS_EVENT_WATERFALL_WARNING, BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX); + _events.ScheduleEvent(DalaranSewers::Events::WaterfallOff, DalaranSewers::Timers::WaterfallDuration); + _events.ScheduleEvent(DalaranSewers::Events::WaterfallKnockBack, DalaranSewers::Timers::WaterfallKnockBack); break; - case BG_DS_EVENT_WATERFALL_KNOCKBACK: - // Repeat knockback while the waterfall still active - if (Creature* waterSpout = battlegroundMap->GetCreature(_waterfallCreatureGUID)) - waterSpout->CastSpell(waterSpout, BG_DS_SPELL_WATER_SPOUT, true); - _events.ScheduleEvent(eventId, BG_DS_WATERFALL_KNOCKBACK_TIMER); + case DalaranSewers::Events::WaterfallOff: + // Remove collision and water + if (GameObject* go = battlegroundMap->GetGameObject(_waterCollisionGUID)) + go->ResetDoorOrButton(); + if (GameObject* go = battlegroundMap->GetGameObject(_waterfallGUID)) + go->ResetDoorOrButton(); + _events.CancelEvent(DalaranSewers::Events::WaterfallKnockBack); + _events.ScheduleEvent(DalaranSewers::Events::WaterfallWarning, DalaranSewers::Timers::Waterfall); break; - case BG_DS_EVENT_PIPE_KNOCKBACK: - for (ObjectGuid const& guid : _pipeCreatureGUIDs) - if (Creature* waterSpout = battlegroundMap->GetCreature(guid)) - waterSpout->CastSpell(waterSpout, BG_DS_SPELL_FLUSH, true); + case DalaranSewers::Events::WaterfallKnockBack: + // Repeat knock back while the waterfall still active + if (Creature* waterSpout = battlegroundMap->GetCreature(_waterSpoutCenterGUID)) + waterSpout->CastSpell(waterSpout, DalaranSewers::Spells::WaterSpout, true); + _events.ScheduleEvent(eventId, DalaranSewers::Timers::WaterfallKnockBack); break; default: break; } } - - if (_pipeKnockBackCount < BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT) - { - if (_pipeKnockBackTimer < diff) - { - for (ObjectGuid const& guid : _pipeCreatureGUIDs) - if (Creature* waterSpout = battlegroundMap->GetCreature(guid)) - waterSpout->CastSpell(waterSpout, BG_DS_SPELL_FLUSH, true); - - ++_pipeKnockBackCount; - _pipeKnockBackTimer = BG_DS_PIPE_KNOCKBACK_DELAY; - } - else - _pipeKnockBackTimer -= diff; - } - - } - - void OnInit() override - { - AddObject(BG_DS_OBJECT_TYPE_DOOR_1, 1350.95f, 817.2f, 20.8096f, 3.15f, 0, 0, 0.99627f, 0.0862864f, GO_STATE_READY, _doorGUIDs); - AddObject(BG_DS_OBJECT_TYPE_DOOR_2, 1232.65f, 764.913f, 20.0729f, 6.3f, 0, 0, 0.0310211f, -0.999519f, GO_STATE_READY, _doorGUIDs); - - if (GameObject const* go = CreateObject(BG_DS_OBJECT_TYPE_WATER_1, 1291.56f, 790.837f, 7.1f, 3.14238f, 0, 0, 0.694215f, -0.719768f, GO_STATE_READY)) - _water1GUID = go->GetGUID(); - - if (GameObject const* go = CreateObject(BG_DS_OBJECT_TYPE_WATER_2, 1291.56f, 790.837f, 7.1f, 3.14238f, 0, 0, 0.694215f, -0.719768f, GO_STATE_READY)) - _water2GUID = go->GetGUID(); } void OnStart() override { + ArenaScript::OnStart(); + for (ObjectGuid const& guid : _doorGUIDs) { if (GameObject* door = battlegroundMap->GetGameObject(guid)) @@ -171,57 +150,79 @@ struct arena_dalaran_sewers : ArenaScript } } - _scheduler.Schedule(1min, [&](TaskContext) - { - CreateObject(BG_DS_OBJECT_TYPE_BUFF_1, 1291.7f, 813.424f, 7.11472f, 4.64562f, 0, 0, 0.730314f, -0.683111f); - CreateObject(BG_DS_OBJECT_TYPE_BUFF_2, 1291.7f, 768.911f, 7.11472f, 1.55194f, 0, 0, 0.700409f, 0.713742f); - }); - _events.ScheduleEvent(BG_DS_EVENT_WATERFALL_WARNING, BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX); - _pipeKnockBackTimer = BG_DS_PIPE_KNOCKBACK_FIRST_DELAY; + _events.ScheduleEvent(DalaranSewers::Events::WaterfallWarning, DalaranSewers::Timers::Waterfall); // Remove collision and water - if (GameObject* go = battlegroundMap->GetGameObject(_water1GUID)) - go->UseDoorOrButton(); - if (GameObject* go = battlegroundMap->GetGameObject(_water2GUID)) - go->UseDoorOrButton(); + if (GameObject* go = battlegroundMap->GetGameObject(_waterCollisionGUID)) + go->ResetDoorOrButton(); + if (GameObject* go = battlegroundMap->GetGameObject(_waterfallGUID)) + go->ResetDoorOrButton(); for (const auto& [playerGuid, _] : battleground->GetPlayers()) if (Player* player = ObjectAccessor::FindPlayer(playerGuid)) - player->RemoveAurasDueToSpell(SPELL_WARL_DEMONIC_CIRCLE); - } + player->RemoveAurasDueToSpell(DalaranSewers::Spells::WarlockDemonicCircle); - void AddObject(uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, GOState goState, GuidVector guidVector) const - { - if (GameObject const* go = CreateObject(entry, x, y, z, o, rotation0, rotation1, rotation2, rotation3, goState)) - guidVector.emplace_back(go->GetGUID()); + _scheduler.Schedule(6s, [&](TaskContext) + { + for (ObjectGuid const& guid : _waterSpoutEntranceGUIDs) + { + if (Creature* creature = battlegroundMap->GetCreature(guid)) + { + creature->CastSpell(nullptr, DalaranSewers::Spells::Flush, CastSpellExtraArgsInit{ + .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR + }); + creature->CastSpell(creature, DalaranSewers::Spells::PipeFlushKnockbackSearchTrigger, CastSpellExtraArgsInit{ + .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR + }); + } + } + }); } - void SetData(uint32 dataId, uint32 value) override + void OnCreatureCreate(Creature* creature) override { - ArenaScript::SetData(dataId, value); - if (dataId == BG_DS_DATA_PIPE_KNOCKBACK_COUNT) - _pipeKnockBackCount = value; + switch (creature->GetEntry()) + { + case DalaranSewers::Creatures::WaterSpout: + if (creature->HasStringId(DalaranSewers::StringIds::WaterSpoutPipe)) + _waterSpoutEntranceGUIDs.push_back(creature->GetGUID()); + else if (creature->HasStringId(DalaranSewers::StringIds::WaterSpoutCenter)) + _waterSpoutCenterGUID = creature->GetGUID(); + break; + default: + break; + } } - uint32 GetData(uint32 dataId) const override + void OnGameObjectCreate(GameObject* gameobject) override { - if (dataId == BG_DS_DATA_PIPE_KNOCKBACK_COUNT) - return _pipeKnockBackCount; - - return ArenaScript::GetData(dataId); + switch (gameobject->GetEntry()) + { + case DalaranSewers::GameObjects::Door01: + case DalaranSewers::GameObjects::Door02: + _doorGUIDs.push_back(gameobject->GetGUID()); + break; + case DalaranSewers::GameObjects::WaterCollision: + _waterCollisionGUID = gameobject->GetGUID(); + break; + case DalaranSewers::GameObjects::Waterfall: + _waterfallGUID = gameobject->GetGUID(); + break; + default: + break; + } } private: GuidVector _doorGUIDs; - ObjectGuid _water1GUID; - ObjectGuid _water2GUID; - ObjectGuid _waterfallCreatureGUID; - GuidVector _pipeCreatureGUIDs; - TaskScheduler _scheduler; + ObjectGuid _waterCollisionGUID; + ObjectGuid _waterfallGUID; EventMap _events; - uint32 _pipeKnockBackTimer; - uint8 _pipeKnockBackCount; + GuidVector _waterSpoutEntranceGUIDs; + ObjectGuid _waterSpoutCenterGUID; + + TaskScheduler _scheduler; }; class at_ds_pipe_knockback : public AreaTriggerScript @@ -229,7 +230,7 @@ class at_ds_pipe_knockback : public AreaTriggerScript public: at_ds_pipe_knockback() : AreaTriggerScript("at_ds_pipe_knockback") { } - void Trigger(Player* player) const + static void Trigger(Player* player) { if (Battleground const* battleground = player->GetBattleground()) { @@ -237,12 +238,8 @@ public: return; // Remove effects of Demonic Circle Summon - player->RemoveAurasDueToSpell(arena_dalaran_sewers::SPELL_WARL_DEMONIC_CIRCLE); - - // Someone has get back into the pipes and the knockback has already been performed, - // so we reset the knockback count for kicking the player again into the arena. - if (battleground->GetBgMap()->GetBattlegroundScript()->GetData(arena_dalaran_sewers::BG_DS_DATA_PIPE_KNOCKBACK_COUNT) >= arena_dalaran_sewers::BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT) - battleground->GetBgMap()->GetBattlegroundScript()->SetData(arena_dalaran_sewers::BG_DS_DATA_PIPE_KNOCKBACK_COUNT, 0); + player->RemoveAurasDueToSpell(DalaranSewers::Spells::WarlockDemonicCircle); + player->CastSpell(nullptr, DalaranSewers::Spells::DalaranSewersPetTeleport); } } @@ -259,8 +256,52 @@ public: } }; +// 96538 - Pipe Flush Knockback Search Effect +class spell_arena_dalaran_sewers_pipe_flush_knockback_search_trigger : public SpellScript +{ + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ + static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).CalcValue()) + }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) const + { + GetCaster()->CastSpell(nullptr, GetSpellInfo()->GetEffect(EFFECT_0).CalcValue(), CastSpellExtraArgsInit + { + .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR + }); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_arena_dalaran_sewers_pipe_flush_knockback_search_trigger::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 61698 - Flush - Knockback effect (SERVERSIDE) +class spell_arena_dalaran_sewers_flush_knock_back_effect : public SpellScript +{ + void HandleDummy(SpellEffIndex /*effIndex*/) const + { + static constexpr float SpeedXY = 30.0f; + static constexpr float SpeedZ = 19.0f; + + Unit* caster = GetCaster(); + Unit const* target = GetHitUnit(); + caster->KnockbackFrom(target->GetPosition(), SpeedXY, SpeedZ); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_arena_dalaran_sewers_flush_knock_back_effect::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + void AddSC_arena_dalaran_sewers() { - RegisterBattlegroundMapScript(arena_dalaran_sewers, 617); + RegisterBattlegroundMapScript(arena_dalaran_sewers, DalaranSewers::MapIds::DalaranSewers); new at_ds_pipe_knockback(); + RegisterSpellScript(spell_arena_dalaran_sewers_flush_knock_back_effect); } diff --git a/src/server/scripts/Battlegrounds/Mugambala/arena_mugambala.cpp b/src/server/scripts/Battlegrounds/Mugambala/arena_mugambala.cpp index c18b1c5b796..54215afbe43 100644 --- a/src/server/scripts/Battlegrounds/Mugambala/arena_mugambala.cpp +++ b/src/server/scripts/Battlegrounds/Mugambala/arena_mugambala.cpp @@ -221,7 +221,7 @@ class spell_zandalar_arena_reaction_trigger : public AuraScript { bool Load() override { - return GetTarget()->GetMapId() == Mugambala::MapIds::Mugambala; + return GetOwner()->GetMapId() == Mugambala::MapIds::Mugambala; } void HandleProc(ProcEventInfo const& eventInfo) const |