From e93bf44a225bc6c873b7d738e51cb8c655b02aba Mon Sep 17 00:00:00 2001 From: Aqua Deus <95978183+aquadeus@users.noreply.github.com> Date: Mon, 22 Sep 2025 23:26:38 +0200 Subject: Scripts/ShrineOfTheStorm: Implement Tidesage Council encounter (#31187) --- sql/updates/world/master/2025_09_22_00_world.sql | 91 ++++ .../ShrineOfTheStorm/boss_tidesage_council.cpp | 526 +++++++++++++++++++++ .../instance_shrine_of_the_storm.cpp | 3 +- .../scripts/KulTiras/kultiras_script_loader.cpp | 2 + 4 files changed, 621 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/master/2025_09_22_00_world.sql create mode 100644 src/server/scripts/KulTiras/ShrineOfTheStorm/boss_tidesage_council.cpp diff --git a/sql/updates/world/master/2025_09_22_00_world.sql b/sql/updates/world/master/2025_09_22_00_world.sql new file mode 100644 index 00000000000..60414a29a10 --- /dev/null +++ b/sql/updates/world/master/2025_09_22_00_world.sql @@ -0,0 +1,91 @@ +DELETE FROM `creature_template_difficulty` WHERE `Entry` IN (134058, 134063, 136314); +INSERT INTO `creature_template_difficulty` (`Entry`, `DifficultyID`, `LevelScalingDeltaMin`, `LevelScalingDeltaMax`, `ContentTuningID`, `HealthScalingExpansion`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `DamageModifier`, `CreatureDifficultyID`, `TypeFlags`, `TypeFlags2`, `LootID`, `PickPocketLootID`, `SkinLootID`, `GoldMin`, `GoldMax`, `StaticFlags1`, `StaticFlags2`, `StaticFlags3`, `StaticFlags4`, `StaticFlags5`, `StaticFlags6`, `StaticFlags7`, `StaticFlags8`, `VerifiedBuild`) VALUES +(136314, 0, 0, 0, 500, 7, 1, 1, 1, 1, 156993, 1610612752, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61967), +(136314, 1, 0, 0, 500, 7, 1, 1, 1, 1, 156993, 1610612752, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61967), +(136314, 2, 0, 0, 501, 7, 1, 1, 1, 1, 156993, 1610612752, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61967), +(136314, 23, 0, 0, 502, 7, 1, 1, 1, 1, 156993, 1610612752, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61967), +(134058, 0, 2, 2, 500, 0, 26.25, 0.338862, 1, 1, 140108, 2097224, 129, 0, 0, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 0, 0, 61967), +(134058, 1, 2, 2, 500, 7, 26.25, 0.338862, 1, 1, 140108, 2097224, 129, 0, 0, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 0, 0, 61967), +(134058, 2, 2, 2, 501, 7, 26.25, 0.338862, 1, 1, 144306, 2097224, 129, 0, 0, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 0, 0, 61967), +(134058, 23, 2, 2, 502, 7, 26.25, 0.338862, 1, 1, 144307, 2097224, 129, 0, 0, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 0, 0, 61967), +(134063, 0, 2, 2, 500, 0, 26.25, 0.338862, 1, 1, 140108, 2097224, 129, 0, 0, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 0, 0, 61967), +(134063, 1, 2, 2, 500, 7, 26.25, 0.338862, 1, 1, 140108, 2097224, 129, 0, 0, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 0, 0, 61967), +(134063, 2, 2, 2, 501, 7, 26.25, 0.338862, 1, 1, 144306, 2097224, 129, 0, 0, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 0, 0, 61967), +(134063, 23, 2, 2, 502, 7, 26.25, 0.338862, 1, 1, 144307, 2097224, 129, 0, 0, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 0, 0, 61967); + +UPDATE `creature_template` SET `faction`=14, `speed_walk`=1.20000004768371582, `speed_run`=0.428571432828903198, `BaseAttackTime`=2000, `unit_flags`=0x2000000, `unit_flags2`=0x4000800, `unit_flags3`=0x1080001, `AIName`='SmartAI' WHERE `entry`=136314; -- Blowback +UPDATE `creature_template` SET `ScriptName` = 'boss_brother_ironhull' WHERE `entry`=134063; +UPDATE `creature_template` SET `ScriptName` = 'boss_galecaller_faye' WHERE `entry`=134058; + +DELETE FROM `areatrigger_template` WHERE (`IsCustom`=0 AND `Id` IN (17771,17760,17768,17766)); +INSERT INTO `areatrigger_template` (`Id`, `IsCustom`, `Flags`, `VerifiedBuild`) VALUES +(17771, 0, 0, 34601), +(17760, 0, 0, 34601), +(17768, 0, 0, 34601), +(17766, 0, 0, 34601); + +DELETE FROM `areatrigger_create_properties` WHERE (`IsCustom`=0 AND `Id` IN (13147,13160,13154,13157)); +INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Flags`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `SpellForVisuals`, `TimeToTargetScale`, `Speed`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES +(13147, 0, 17760, 0, 6, 0, 6336, 0, 0, -1, 0, 0, NULL, 120000, 0, 4, 2, 2, 4, 4, 0.300000011920928955, 0.300000011920928955, 0, 0, 'at_tidesage_council_blowback', 61967), -- Spell: 267836 (Blowback) +(13160, 0, 17771, 0, 0, 0, 0, 0, 0, -1, 0, 0, NULL, 8000, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 'at_tidesage_council_reinforcing_ward', 61967), -- Spell: 267905 (Reinforcing Ward) +(13154, 0, 17766, 0, 0, 0, 0, 0, 0, -1, 0, 0, 267891, 8000, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 'at_tidesage_council_swiftness_ward_boss', 61967), -- SpellForVisuals: 267891 (Swiftness Ward) +(13157, 0, 17768, 0, 0, 0, 0, 0, 0, -1, 0, 0, 267891, 8000, 0, 0, 11, 11, 0, 0, 0, 0, 0, 0, 'at_tidesage_council_swiftness_ward_player', 61967); -- SpellForVisuals: 267891 (Swiftness Ward) + +DELETE FROM `spell_proc` WHERE `SpellId` IN (267830); +INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES +(267830,0x00,0,0x00000000,0x00000000,0x00000000,0x00000000,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0,0,0,0); -- Blessing of the Tempest + +DELETE FROM `smart_scripts` WHERE `entryorguid`=136314 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 +(136314, 0, 0, 1, '', 63, 0, 100, 0, 0, 0, 0, 0, 0, '', 85, 267836, 0, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 'Blowback - On Just Created - Cast Self: Spell 267836'), +(136314, 0, 1, 2, '', 61, 0, 100, 0, 0, 0, 0, 0, 0, '', 8, 0, 0, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 'Blowback - On Linked - Set ReactState Passive'), +(136314, 0, 2, 0, '', 61, 0, 100, 0, 0, 0, 0, 0, 0, '', 89, 20, 0, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 'Blowback - On Linked - Set Random Move within 20 radius'); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_tidesage_council_ward_selector', 'spell_tidesage_council_blessing_of_the_tempest'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(267902, 'spell_tidesage_council_ward_selector'), +(267903, 'spell_tidesage_council_ward_selector'), +(267830, 'spell_tidesage_council_blessing_of_the_tempest'); + +DELETE FROM `serverside_spell` WHERE `Id` IN (267916, 267894); +INSERT INTO `serverside_spell` (`Id`, `DifficultyID`, `CategoryId`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `AttributesEx8`, `AttributesEx9`, `AttributesEx10`, `AttributesEx11`, `AttributesEx12`, `AttributesEx13`, `AttributesEx14`, `AttributesEx15`, `Stances`, `StancesNot`, `Targets`, `TargetCreatureType`, `RequiresSpellFocus`, `FacingCasterFlags`, `CasterAuraState`, `TargetAuraState`, `ExcludeCasterAuraState`, `ExcludeTargetAuraState`, `CasterAuraSpell`, `TargetAuraSpell`, `ExcludeCasterAuraSpell`, `ExcludeTargetAuraSpell`, `CasterAuraType`, `TargetAuraType`, `ExcludeCasterAuraType`, `ExcludeTargetAuraType`, `CastingTimeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `StartRecoveryCategory`, `StartRecoveryTime`, `InterruptFlags`, `AuraInterruptFlags1`, `AuraInterruptFlags2`, `ChannelInterruptFlags1`, `ChannelInterruptFlags2`, `ProcFlags`, `ProcFlags2`, `ProcChance`, `ProcCharges`, `ProcCooldown`, `ProcBasePPM`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `Speed`, `LaunchDelay`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `ContentTuningId`, `SpellName`, `ConeAngle`, `ConeWidth`, `MaxTargetLevel`, `MaxAffectedTargets`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `SpellFamilyFlags4`, `DmgClass`, `PreventionType`, `AreaGroupId`, `SchoolMask`, `ChargeCategoryId`) VALUES +(267916, 0, 0, 0, 0, 0x29240180, 0x000004A8, 0x10484004, 0x00070000, 0x00800080, 0x00060008, 0x00001000, 0x00000040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 21, 1, 0, 0, 0, -1, -1, 0, 0, 'Brother Ironhull Gain Energy', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), +(267894, 0, 0, 0, 0, 0x29240180, 0x000004A8, 0x10484004, 0x00070000, 0x00800080, 0x00060008, 0x00001000, 0x00000040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 21, 1, 0, 0, 0, -1, -1, 0, 0, 'Galecaller Faye Gain Energy', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0); + +DELETE FROM `serverside_spell_effect` WHERE `SpellID` IN (267916, 267894); +INSERT INTO `serverside_spell_effect` (`SpellID`, `EffectIndex`, `DifficultyID`, `Effect`, `EffectAura`, `EffectAmplitude`, `EffectAttributes`, `EffectAuraPeriod`, `EffectBonusCoefficient`, `EffectChainAmplitude`, `EffectChainTargets`, `EffectItemType`, `EffectMechanic`, `EffectPointsPerResource`, `EffectPosFacing`, `EffectRealPointsPerLevel`, `EffectTriggerSpell`, `BonusCoefficientFromAP`, `PvpMultiplier`, `Coefficient`, `Variance`, `ResourceCoefficient`, `GroupSizeBasePointsCoefficient`, `EffectBasePoints`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectSpellClassMask1`, `EffectSpellClassMask2`, `EffectSpellClassMask3`, `EffectSpellClassMask4`, `ImplicitTarget1`, `ImplicitTarget2`) VALUES +(267916, 0, 0, 6, 21, 0, 0, 1000, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), +(267894, 0, 0, 6, 21, 0, 0, 1000, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0); + +DELETE FROM `creature_text` WHERE `CreatureID` IN (134058, 134063); +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +-- Aggro +(134063, 0, 0, 'The tides shall take you!', 14, 0, 50, 0, 0, 102945, 150512, 0, 'Brother Ironhull'), +(134058, 0, 0, 'None shall stand against the storm!', 14, 0, 100, 0, 0, 102934, 150502, 0, 'Galecaller Faye'), + +-- Slay +(134058, 3, 0, 'Blown away!', 14, 0, 50, 0, 0, 102936, 150508, 0, 'Galecaller Faye'), +(134058, 3, 1, 'Cleansed by the storm!', 14, 0, 50, 0, 0, 102937, 150509, 0, 'Galecaller Faye'), +(134063, 3, 0, 'You should\'ve stayed ashore!', 14, 0, 50, 0, 0, 102947, 150516, 0, 'Brother Ironhull'), +(134063, 3, 1, 'Enjoy your watery grave!', 14, 0, 50, 0, 0, 102948, 150519, 0, 'Brother Ironhull'), + +-- Wipe +(134058, 4, 0, 'Together, my love, we are a force of nature.', 14, 0, 50, 0, 0, 102938, 150510, 0, 'Galecaller Faye'), +(134063, 4, 0, 'I\'ll cast you to the depths for that!', 14, 0, 50, 0, 0, 102944, 150514, 0, 'Brother Ironhull'), + +-- Dead +(134058, 5, 0, 'The clouds... break...', 14, 0, 100, 0, 0, 102935, 150506, 0, 'Galecaller Faye'), +(134063, 5, 0, 'Return me... to the sea...', 14, 0, 100, 0, 0, 102946, 150515, 0, 'Brother Ironhull to Brother Ironhull'), + +-- Galecaller Faye +(134058, 1, 0, '|TInterface\\Icons\\70_inscription_vantus_rune_azure:20|t%s creates a |cFFFF0000|Hspell:267891|h[Swiftness Ward]|h|r!', 41, 0, 100, 0, 0, 102933, 151969, 0, 'Galecaller Faye'), +(134058, 2, 0, 'The breeze is ever at our backs!', 14, 0, 100, 0, 0, 102933, 151288, 0, 'Galecaller Faye'), +(134058, 6, 0, 'Winds, protect me!', 14, 0, 100, 0, 0, 102930, 151290, 0, 'Galecaller Faye'), +(134058, 7, 0, 'Beloved! No!', 14, 0, 50, 0, 0, 102931, 150504, 0, 'Galecaller Faye'), +(134058, 7, 1, 'The winds will blast the flesh from your bones!', 14, 0, 50, 0, 0, 102932, 150505, 0, 'Galecaller Faye'), + +-- Brother Ironhull +(134063, 1, 0, 'My hull is impenetrable!', 14, 0, 100, 0, 0, 102943, 151286, 0, 'Brother Ironhull'), +(134063, 2, 0, '|TInterface\\Icons\\70_inscription_vantus_rune_light:20|t%s creates a |cFFFF0000|Hspell:267905|h[Reinforcing Ward]|h|r!', 41, 0, 100, 0, 0, 102943, 160664, 0, 'Brother Ironhull'), +(134063, 6, 0, 'I\'ll break you to splinters!', 14, 0, 50, 0, 0, 102939, 151287, 0, 'Brother Ironhull'), +(134063, 6, 1, 'NO!', 14, 0, 50, 0, 0, 102940, 150513, 0, 'Brother Ironhull'); diff --git a/src/server/scripts/KulTiras/ShrineOfTheStorm/boss_tidesage_council.cpp b/src/server/scripts/KulTiras/ShrineOfTheStorm/boss_tidesage_council.cpp new file mode 100644 index 00000000000..131aba7bcda --- /dev/null +++ b/src/server/scripts/KulTiras/ShrineOfTheStorm/boss_tidesage_council.cpp @@ -0,0 +1,526 @@ +/* + * 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 . + */ + +#include "AreaTrigger.h" +#include "AreaTriggerAI.h" +#include "Creature.h" +#include "GridNotifiers.h" +#include "InstanceScript.h" +#include "Map.h" +#include "ObjectAccessor.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellAuraEffects.h" +#include "SpellScript.h" +#include "TaskScheduler.h" +#include "shrine_of_the_storm.h" + +enum TidesageCouncilSpells +{ + // Brother Ironhull + SPELL_BLESSING_OF_IRONSIDES = 267901, + SPELL_HINDERING_CLEAVE = 267899, + SPELL_REINFORCING_WARD_AREATRIGGER = 267905, + SPELL_REINFORCING_WARD_DAMAGE_TAKEN_PLAYER = 267904, // Pets can get buff too + SPELL_REINFORCING_WARD_DAMAGE_TAKEN_BOSS = 268186, + SPELL_REINFORCING_WARD_DISPEL_BOSS = 272001, + SPELL_REINFORCING_WARD_DISPEL_PLAYER = 272002, + SPELL_REINFORCING_WARD_SELECTOR = 267903, + SPELL_COSMETIC_REINFORCING_WARD = 274690, + SPELL_BROTHER_IRONHULL_GAIN_ENERGY = 267916, // Serverside + + // Galecaller Faye + SPELL_BLESSING_OF_THE_TEMPEST = 267830, + SPELL_SLICING_BLAST = 267818, + SPELL_BLOWBACK_MISSILE = 267842, + SPELL_BLOWBACK_DAMAGE = 267838, + SPELL_BLOWBACK_AREATRIGGER = 267836, + SPELL_SWIFTNESS_WARD_SELECTOR = 267902, + SPELL_SWIFTNESS_WARD_AREATRIGGER = 267891, + SPELL_SWIFTNESS_WARD_HASTE_BOSS = 267890, + SPELL_SWIFTNESS_WARD_HASTE_PLAYER = 267888, // Pets can get buff too + SPELL_COSMETIC_SWIFTNESS_WARD = 274689, + SPELL_GALECALLER_FAYE_GAIN_ENERGY = 267894 // Serverside +}; + +enum TidesageCouncilEvents +{ + EVENT_BLESSING_OF_IRONSIDES = 1, + EVENT_HINDERING_CLEAVE, + EVENT_REINFORCING_WARD, + + EVENT_BLESSING_OF_THE_TEMPEST, + EVENT_SLICING_BLAST, + EVENT_SWIFTNESS_WARD, + + EVENT_CHECK_MANA +}; + +enum TidesageCouncilTexts +{ + SAY_AGGRO = 0, + SAY_SLAY = 3, + SAY_WIPE = 4, + SAY_DEAD = 5, + + // Galecaller Faye + SAY_SWIFTING_WARD_WARNING = 1, + SAY_SWIFTING_WARD = 2, + SAY_BLESSING_OF_THE_TEMPEST = 6, + SAY_BROTHER_DIES = 7, + + // Brother Ironhull + SAY_REINFORCING_WARD = 1, + SAY_REINFORCING_WARD_WARNING = 2, + SAY_FAYE_DIES = 6 +}; + +uint32 const TidesageData[2] = +{ + DATA_BROTHER_IRONHULL, + DATA_GALECALLER_FAYE +}; + +namespace +{ +void DespawnTidesageCouncil(InstanceScript* instance, EvadeReason why) +{ + if (instance->GetBossState(DATA_TIDESAGE_COUNCIL) == FAIL) + return; + + instance->SetBossState(DATA_TIDESAGE_COUNCIL, FAIL); + + for (uint32 bossesData : TidesageData) + { + if (Creature* council = instance->GetCreature(bossesData)) + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, council); + council->AI()->EnterEvadeMode(why); + } + } +} + +void TidesageCouncilEncounterDone(InstanceScript* instance) +{ + if (instance->GetBossState(DATA_TIDESAGE_COUNCIL) == DONE) + return; + + for (uint32 bossesData : TidesageData) + { + if (Creature* council = instance->GetCreature(bossesData)) + { + if (council->IsAlive()) + return; + } + } + + instance->SetBossState(DATA_TIDESAGE_COUNCIL, DONE); +} +} + +struct TidesageCouncilSharedAI : public BossAI +{ + TidesageCouncilSharedAI(Creature* creature, uint32 bossId) : BossAI(creature, bossId) + { + SetBoundary(instance->GetBossBoundary(DATA_TIDESAGE_COUNCIL)); + } + + void EnterEvadeMode(EvadeReason why) override + { + DespawnTidesageCouncil(instance, why); + + Talk(SAY_WIPE); + + events.Reset(); + _EnterEvadeMode(); + _DespawnAtEvade(); + } + + void JustEngagedWith(Unit* /*who*/) override + { + for (uint32 bossesData : TidesageData) + { + if (Creature* council = instance->GetCreature(bossesData)) + { + if (!council->IsAlive() || council->IsInCombat()) + continue; + + council->AI()->DoZoneInCombat(); + } + } + + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1); + + Talk(SAY_AGGRO); + + ScheduleEvents(); + } + + virtual void ScheduleEvents() = 0; + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + + Talk(SAY_DEAD); + + TidesageCouncilEncounterDone(instance); + } + + void KilledUnit(Unit* victim) override + { + if (!victim->IsPlayer()) + return; + + Talk(SAY_SLAY); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + ExecuteEvent(eventId); + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + } + } +}; + +// 134063 - Brother Ironhull +struct boss_brother_ironhull : public TidesageCouncilSharedAI +{ + boss_brother_ironhull(Creature* creature) : TidesageCouncilSharedAI(creature, DATA_BROTHER_IRONHULL) { } + + void JustAppeared() override + { + DoCastSelf(SPELL_COSMETIC_REINFORCING_WARD); + me->SetPowerType(POWER_MANA); + me->SetPower(POWER_MANA, 0); + } + + void JustDied(Unit* killer) override + { + TidesageCouncilSharedAI::JustDied(killer); + + if (Creature* faye = instance->GetCreature(DATA_GALECALLER_FAYE)) + faye->AI()->Talk(SAY_BROTHER_DIES); + } + + void JustEngagedWith(Unit* who) override + { + TidesageCouncilSharedAI::JustEngagedWith(who); + DoCastSelf(SPELL_BROTHER_IRONHULL_GAIN_ENERGY); + } + + void ScheduleEvents() override + { + events.ScheduleEvent(EVENT_HINDERING_CLEAVE, 8500ms); + events.ScheduleEvent(EVENT_CHECK_MANA, 500ms); + + if (IsHeroicOrHigher()) + events.ScheduleEvent(EVENT_BLESSING_OF_IRONSIDES, 6100ms); + } + + void ExecuteEvent(uint32 eventId) override + { + switch (eventId) + { + case EVENT_BLESSING_OF_IRONSIDES: + { + DoCastSelf(SPELL_BLESSING_OF_IRONSIDES); + events.Repeat(33s); + break; + } + case EVENT_HINDERING_CLEAVE: + { + DoCastVictim(SPELL_HINDERING_CLEAVE); + events.Repeat(17s); + break; + } + case EVENT_CHECK_MANA: + { + if (me->GetPowerPct(POWER_MANA) >= 100) + { + Talk(SAY_REINFORCING_WARD); + Talk(SAY_REINFORCING_WARD_WARNING); + DoCastSelf(SPELL_REINFORCING_WARD_SELECTOR, TRIGGERED_IGNORE_POWER_COST | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + events.Repeat(500ms); + break; + } + default: + break; + } + } +}; + +// 134058 - Galecaller Faye +struct boss_galecaller_faye : public TidesageCouncilSharedAI +{ + boss_galecaller_faye(Creature* creature) : TidesageCouncilSharedAI(creature, DATA_GALECALLER_FAYE) { } + + void JustAppeared() override + { + DoCastSelf(SPELL_COSMETIC_SWIFTNESS_WARD); + me->SetPowerType(POWER_MANA); + me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA) / 2); + } + + void JustDied(Unit* killer) override + { + TidesageCouncilSharedAI::JustDied(killer); + + if (Creature* brother = instance->GetCreature(DATA_BROTHER_IRONHULL)) + brother->AI()->Talk(SAY_FAYE_DIES); + } + + void JustEngagedWith(Unit* who) override + { + TidesageCouncilSharedAI::JustEngagedWith(who); + DoCastSelf(SPELL_GALECALLER_FAYE_GAIN_ENERGY); + } + + void ScheduleEvents() override + { + events.ScheduleEvent(EVENT_SLICING_BLAST, 1s); + events.ScheduleEvent(EVENT_CHECK_MANA, 500ms); + + if (IsHeroicOrHigher()) + events.ScheduleEvent(EVENT_BLESSING_OF_THE_TEMPEST, 26700ms); + } + + void ExecuteEvent(uint32 eventId) override + { + switch (eventId) + { + case EVENT_BLESSING_OF_THE_TEMPEST: + { + Talk(SAY_BLESSING_OF_THE_TEMPEST); + DoCastSelf(SPELL_BLESSING_OF_THE_TEMPEST); + events.Repeat(20s); + break; + } + case EVENT_SLICING_BLAST: + { + DoCastVictim(SPELL_SLICING_BLAST); + events.Repeat(2500ms); + break; + } + case EVENT_CHECK_MANA: + { + if (me->GetPowerPct(POWER_MANA) >= 100) + { + Talk(SAY_SWIFTING_WARD_WARNING); + Talk(SAY_SWIFTING_WARD); + DoCastSelf(SPELL_SWIFTNESS_WARD_SELECTOR, TRIGGERED_IGNORE_POWER_COST | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + events.Repeat(500ms); + break; + } + default: + break; + } + } +}; + +// 267902 - Swiftness Ward +// 267903 - Reinforcing Ward +class spell_tidesage_council_ward_selector : public SpellScript +{ + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ static_cast(spellInfo->GetEffect(EFFECT_0).CalcValue()) }); + } + + void HandleHitTarget(SpellEffIndex /*effIndex*/) const + { + GetCaster()->CastSpell(GetHitUnit()->GetPosition(), GetEffectValue(), CastSpellExtraArgsInit{ + .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR, + .TriggeringSpell = GetSpell() + }); + } + + void HandleAfterCast() const + { + GetCaster()->SetPower(POWER_MANA, 0); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_tidesage_council_ward_selector::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY); + AfterCast += SpellCastFn(spell_tidesage_council_ward_selector::HandleAfterCast); + } +}; + +// 267830 - Blessing of the Tempest +class spell_tidesage_council_blessing_of_the_tempest : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_BLOWBACK_MISSILE }); + } + + void HandleProc(ProcEventInfo const& /*eventInfo*/) const + { + GetTarget()->CastSpell(GetTarget(), SPELL_BLOWBACK_MISSILE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + + void Register() override + { + OnProc += AuraProcFn(spell_tidesage_council_blessing_of_the_tempest::HandleProc); + } +}; + +// 267905 - Reinforcing Ward +struct at_tidesage_council_reinforcing_ward : AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnUnitEnter(Unit* unit) override + { + if (unit->GetEntry() == BOSS_BROTHER_IRONHULL || unit->GetEntry() == BOSS_GALECALLER_FAYE) + { + unit->CastSpell(unit, SPELL_REINFORCING_WARD_DAMAGE_TAKEN_BOSS, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + unit->CastSpell(unit, SPELL_REINFORCING_WARD_DISPEL_BOSS, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + else + { + unit->CastSpell(unit, SPELL_REINFORCING_WARD_DAMAGE_TAKEN_PLAYER, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + unit->CastSpell(unit, SPELL_REINFORCING_WARD_DISPEL_PLAYER, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + } + + void OnUnitExit(Unit* unit, AreaTriggerExitReason /*reason*/) override + { + unit->RemoveAurasDueToSpell(SPELL_REINFORCING_WARD_DAMAGE_TAKEN_BOSS); + unit->RemoveAurasDueToSpell(SPELL_REINFORCING_WARD_DAMAGE_TAKEN_PLAYER); + } + + void OnCreate(Spell const* /*creatingSpell*/) override + { + _scheduler.Schedule(1s, [this](TaskContext task) + { + for (ObjectGuid const& guid : at->GetInsideUnits()) + { + Unit* unit = ObjectAccessor::GetUnit(*at, guid); + if (!unit) + continue; + + if (unit->isDead()) + continue; + + if (unit->GetEntry() == BOSS_BROTHER_IRONHULL || unit->GetEntry() == BOSS_GALECALLER_FAYE) + unit->CastSpell(unit, SPELL_REINFORCING_WARD_DISPEL_BOSS, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + else + unit->CastSpell(unit, SPELL_REINFORCING_WARD_DISPEL_PLAYER, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + task.Repeat(1s); + }); + } + + void OnUpdate(uint32 diff) override + { + _scheduler.Update(diff); + } + +private: + TaskScheduler _scheduler; +}; + +// 267891 - Swiftness Ward +// Id - 13154 +struct at_tidesage_council_swiftness_ward_boss : AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnUnitEnter(Unit* unit) override + { + if (unit->GetEntry() != BOSS_BROTHER_IRONHULL && unit->GetEntry() != BOSS_GALECALLER_FAYE) + return; + + Unit* caster = at->GetCaster(); + if (!caster) + return; + + caster->CastSpell(unit, SPELL_SWIFTNESS_WARD_HASTE_BOSS, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + + void OnUnitExit(Unit* unit, AreaTriggerExitReason /*reason*/) override + { + unit->RemoveAurasDueToSpell(SPELL_SWIFTNESS_WARD_HASTE_BOSS); + } +}; + +// 267891 - Swiftness Ward +// Id - 13157 +struct at_tidesage_council_swiftness_ward_player : AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnUnitEnter(Unit* unit) override + { + if (unit->GetEntry() == BOSS_BROTHER_IRONHULL || unit->GetEntry() == BOSS_GALECALLER_FAYE) + return; + + unit->CastSpell(unit, SPELL_SWIFTNESS_WARD_HASTE_PLAYER, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + + void OnUnitExit(Unit* unit, AreaTriggerExitReason /*reason*/) override + { + unit->RemoveAurasDueToSpell(SPELL_SWIFTNESS_WARD_HASTE_PLAYER); + } +}; + +// 267836 - Blowback +struct at_tidesage_council_blowback : AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnUnitEnter(Unit* unit) override + { + if (!unit->IsPlayer()) + return; + + Unit* caster = at->GetCaster(); + if (!caster) + return; + + caster->CastSpell(unit, SPELL_BLOWBACK_DAMAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } +}; + +void AddSC_boss_tidesage_council() +{ + RegisterShrineOfTheStormCreatureAI(boss_brother_ironhull); + RegisterShrineOfTheStormCreatureAI(boss_galecaller_faye); + + RegisterSpellScript(spell_tidesage_council_ward_selector); + RegisterSpellScript(spell_tidesage_council_blessing_of_the_tempest); + + RegisterAreaTriggerAI(at_tidesage_council_reinforcing_ward); + RegisterAreaTriggerAI(at_tidesage_council_swiftness_ward_boss); + RegisterAreaTriggerAI(at_tidesage_council_swiftness_ward_player); + RegisterAreaTriggerAI(at_tidesage_council_blowback); +} diff --git a/src/server/scripts/KulTiras/ShrineOfTheStorm/instance_shrine_of_the_storm.cpp b/src/server/scripts/KulTiras/ShrineOfTheStorm/instance_shrine_of_the_storm.cpp index 211cfb51292..d384ae6a85e 100644 --- a/src/server/scripts/KulTiras/ShrineOfTheStorm/instance_shrine_of_the_storm.cpp +++ b/src/server/scripts/KulTiras/ShrineOfTheStorm/instance_shrine_of_the_storm.cpp @@ -22,7 +22,8 @@ static BossBoundaryData const boundaries = { - { DATA_AQUSIRR, new ZRangeBoundary(119.89f, 132.9f) } + { DATA_AQUSIRR, new ZRangeBoundary(119.89f, 132.9f) }, + { DATA_TIDESAGE_COUNCIL, new CircleBoundary({ 3939.6357f, -1007.4829f, 109.2227f }, 60.0f)} }; ObjectData const creatureData[] = diff --git a/src/server/scripts/KulTiras/kultiras_script_loader.cpp b/src/server/scripts/KulTiras/kultiras_script_loader.cpp index 89ea3b0bd19..3934b6cebe0 100644 --- a/src/server/scripts/KulTiras/kultiras_script_loader.cpp +++ b/src/server/scripts/KulTiras/kultiras_script_loader.cpp @@ -27,6 +27,7 @@ void AddSC_drustvar_chapter_3_an_airtight_alibi(); // Shrine of the Storm void AddSC_boss_aqusirr(); +void AddSC_boss_tidesage_council(); void AddSC_instance_shrine_of_the_storm(); // Waycrest Manor @@ -50,6 +51,7 @@ void AddKulTirasScripts() // Shrine of the Storm AddSC_boss_aqusirr(); + AddSC_boss_tidesage_council(); AddSC_instance_shrine_of_the_storm(); // Waycrest Manor -- cgit v1.2.3