diff options
6 files changed, 654 insertions, 0 deletions
diff --git a/sql/updates/world/master/2024_05_05_00_world.sql b/sql/updates/world/master/2024_05_05_00_world.sql new file mode 100644 index 00000000000..1d11beb06b5 --- /dev/null +++ b/sql/updates/world/master/2024_05_05_00_world.sql @@ -0,0 +1,162 @@ +-- Template +UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'boss_armsmaster_harlan' WHERE `entry` = 58632; +UPDATE `creature_template` SET `unit_flags2`=2048 WHERE `entry`=58632; -- Armsmaster Harlan + +-- Template Addon +DELETE FROM `creature_template_addon` WHERE `entry`=58998; +INSERT INTO `creature_template_addon` (`entry`, `PathId`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES +(58998, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '113959'); -- 58998 (Scarlet Defender) - Heavy Armor + +-- Instance +DELETE FROM `instance_template` WHERE `map` = 1001; +INSERT INTO `instance_template` (`map`, `parent`, `script`) VALUES +(1001, 0, 'instance_scarlet_halls'); + +DELETE FROM `serverside_spell` WHERE `Id`=128930; +INSERT INTO `serverside_spell` (`Id`, `DifficultyID`, `CategoryId`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `AttributesEx8`, `AttributesEx9`, `AttributesEx10`, `AttributesEx11`, `AttributesEx12`, `AttributesEx13`, `AttributesEx14`, `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 +(128930, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, '[DNT] Eject Spirits of Redemption', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + +DELETE FROM `serverside_spell_effect` WHERE `SpellID`=128930; +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 +(128930, 0, 0, 3, 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, 0, 0, 1, 0); + +-- Script Names +DELETE FROM `spell_script_names` WHERE `spell_id` IN (111216, 111394, 112953, 113969, 111755, 111756, 128930); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(111216, 'spell_harlan_blades_of_light'), +(111394, 'spell_harlan_blades_of_light_selector'), +(112953, 'spell_harlan_leave_vehicle'), +(113959, 'spell_scarlet_defender_heavy_armor'), +(111755, 'spell_call_reinforcements_right'), +(111756, 'spell_call_reinforcements_left'), +(128930, 'spell_eject_spirits_of_redemption'); + +-- Conditions +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceEntry` IN (111394)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `Comment`) VALUES +(13, 1, 111394, 0, 0, 31, 0, 4, 0, 0, '', 0, 'Potential target of the spell is player'), +(13, 1, 111394, 0, 1, 31, 0, 3, 58998, 0, '', 0, 'Potential target of the spell is creature, entry is Scarlet Defender (58998)'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceEntry` IN (112955)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `Comment`) VALUES +(13, 1, 112955, 0, 0, 31, 0, 3, 58632, 0, '', 0, 'Potential target of the spell is creature, entry is Armsmaster Harlan (58632)'); + +-- Creature text +DELETE FROM `creature_text` WHERE `CreatureID` = 58632; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(58632, 0, 0, 'Ah-hah! Another chance to test my might.', 14, 0, 100, 0, 0, 29428, 65557, 0, 'Armsmaster Harlan'), -- BroadcastTextID: 65557 - 170997 +(58632, 1, 0, 'On your guard!', 14, 0, 100, 0, 0, 29426, 65559, 0, 'Armsmaster Harlan'), -- BroadcastTextID: 33752 - 33756 - 35825 - 65559 - 170996 +(58632, 2, 0, '|TInterface\\Icons\\ability_warrior_battleshout.blp:20|tArmsmaster Harlan calls on two of his allies to join the fight!', 41, 0, 100, 0, 0, 0, 65526, 0, 'Armsmaster Harlan'), +(58632, 3, 0, '|TInterface\\Icons\\inv_weapon_halberd_05.blp:20|tArmsmaster Harlan casts |cFFFF0000|Hspell:111216|h[Blades of Light]|h|r!', 41, 0, 100, 0, 0, 0, 65527, 0, 'Armsmaster Harlan'), +(58632, 4, 0, 'Bested... by the likes of...', 14, 0, 100, 0, 0, 29427, 65560, 0, 'Armsmaster Harlan to Player'); -- BroadcastTextID: 65560 - 170995 + +-- NPC spellclick +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` = 58632; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(58632, 112955, 0, 0); + +-- Difficulty +UPDATE `creature_template_difficulty` SET `ContentTuningID`=211, `StaticFlags1`=268435456, `VerifiedBuild`=54205 WHERE (`Entry`=58632 AND `DifficultyID`=1); -- Armsmaster Harlan + +DELETE FROM `creature_template_difficulty` WHERE (`DifficultyID`=2 AND `Entry` IN (66091,59372,59373,59150,59198,59240,59155,59209,59241,59293,58725,58726,65546,65547,58632,58756,58685,58676,58684,58683,59302,59299,59303,59309,59683,59191,59175,54030,60908,59163,64764,58898,65379,58727,58674,58701,58876)); +INSERT INTO `creature_template_difficulty` (`Entry`, `DifficultyID`, `LevelScalingDeltaMin`, `LevelScalingDeltaMax`, `ContentTuningID`, `StaticFlags1`, `StaticFlags2`, `StaticFlags3`, `StaticFlags4`, `StaticFlags5`, `StaticFlags6`, `StaticFlags7`, `StaticFlags8`, `VerifiedBuild`) VALUES +(66091, 2, 5, 5, 1186, 536871168, 0, 0, 0, 0, 0, 0, 0, 54205), -- Referee +(59372, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Scholar +(59373, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Pupil +(59150, 2, 2, 2, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Flameweaver Koegler +(59198, 2, 0, 0, 1186, 536870912, 0, 0, 0, 0, 0, 0, 0, 54205), -- Dragon Breath Target +(59240, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Hall Guardian +(59155, 2, 0, 0, 1186, 536871168, 0, 0, 0, 0, 0, 0, 0, 54205), -- Book Case +(59209, 2, 0, 0, 1186, 536871168, 0, 0, 0, 0, 0, 0, 0, 54205), -- Books +(59241, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Treasurer +(59293, 2, 0, 0, 1186, 805306624, 0, 33554432, 0, 0, 0, 0, 0, 54205), -- Scarlet Cannoneer +(58725, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Cannons +(58726, 2, 0, 0, 1186, 805306624, 0, 33554432, 0, 0, 0, 0, 0, 54205), -- Scarlet Cannon +(65546, 2, 0, 0, 996, 0, 0, 0, 0, 0, 0, 0, 0, 54205), -- Sekrit +(65547, 2, 0, 0, 996, 0, 0, 0, 0, 0, 0, 0, 0, 54205), -- Sekret +(58632, 2, 2, 2, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Armsmaster Harlan +(58756, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Evoker +(58685, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Evangelist +(58676, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Defender +(58684, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Scourge Hewer +(58683, 2, 0, 0, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Scarlet Myrmidon +(59302, 2, 0, 0, 1186, 536871168, 0, 33554432, 0, 0, 0, 0, 0, 54205), -- Sergeant Verdone +(59299, 2, 0, 0, 1186, 536871168, 0, 33554432, 0, 0, 0, 0, 0, 54205), -- Scarlet Guardian +(59303, 2, 2, 2, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Houndmaster Braun +(59309, 2, 0, 0, 1186, 536871168, 0, 0, 0, 0, 0, 0, 0, 54205), -- Obedient Hound +(59683, 2, 0, 0, 1186, 0, 0, 0, 0, 0, 0, 0, 0, 54205), -- Exploding Shot Stalker +(59191, 2, 1, 1, 1186, 536871168, 0, 0, 0, 0, 0, 0, 0, 54205), -- Commander Lindon +(59175, 2, 0, 0, 1186, 536871168, 0, 0, 0, 0, 0, 0, 0, 54205), -- Master Archer +(54030, 2, 0, 0, 181, 536870912, 0, 0, 0, 0, 0, 0, 0, 54205), -- Invisible Stalker +(60908, 2, 0, 0, 1186, 0, 0, 0, 0, 0, 0, 0, 0, 54205), -- Archery Target Base +(59163, 2, 0, 0, 1186, 0, 0, 33554432, 0, 0, 0, 0, 0, 54205), -- Reinforced Archery Target +(64764, 2, 1, 1, 1186, 268435456, 0, 0, 0, 0, 0, 0, 0, 54205), -- Hooded Crusader +(58898, 2, 0, 0, 1186, 0, 0, 0, 0, 0, 0, 0, 0, 54205), -- Vigilant Watchman +(65379, 2, 0, 0, 1186, 0, 0, 0, 0, 0, 0, 0, 0, 54205), -- Bucket of Meaty Dog Food +(58727, 2, 0, 0, 1186, 536871168, 0, 0, 0, 0, 0, 0, 0, 54205), -- Chained Dog Target +(58674, 2, 0, 0, 1186, 0, 0, 0, 0, 0, 0, 0, 0, 54205), -- Angry Hound +(58701, 2, 0, 0, 1186, 0, 0, 0, 0, 0, 0, 0, 0, 54205), -- Stake +(58876, 2, 0, 0, 1186, 0, 0, 0, 0, 0, 0, 0, 0, 54205); -- Starving Hound + +-- Path for Armsmaster Harlan +SET @ENTRY := 58632; +SET @PATHOFFSET := 0; +SET @PATH := @ENTRY * 100 + @PATHOFFSET; +DELETE FROM `waypoint_path` WHERE `PathId`= @PATH; +INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Comment`) VALUES +(@PATH, 1, 0, 'Armsmaster Harlan - Blades of Light Path Left'); + +DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH; +INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES +(@PATH, 0, 1210.14, 443.6163, 0.9878225, NULL, 0), +(@PATH, 1, 1205.706, 454.0305, 0.9878197, NULL, 0), +(@PATH, 2, 1208.05, 450.271, 0.9878197, NULL, 0), +(@PATH, 3, 1207.03, 452.5631, 1.087024, NULL, 0), +(@PATH, 4, 1206.861, 444.0269, 0.9878179, NULL, 0), +(@PATH, 5, 1193.708, 443.4705, 2.058222, NULL, 0), +(@PATH, 6, 1205.986, 431.2205, 2.101642, NULL, 0), +(@PATH, 7, 1214.609, 433.9097, 4.82716, NULL, 0), +(@PATH, 8, 1221.668, 443.4757, 7.08157, NULL, 0), +(@PATH, 9, 1215, 460.9097, 7.081536, NULL, 0), +(@PATH, 10, 1196.886, 461.2072, 9.18631, NULL, 0), +(@PATH, 11, 1186.648, 447.3125, 12.17532, NULL, 0), +(@PATH, 12, 1177.415, 443.8142, 13.98537, NULL, 0), +(@PATH, 13, 1186.889, 440.776, 12.09889, NULL, 0), +(@PATH, 14, 1197.804, 426.4445, 9.00577, NULL, 0), +(@PATH, 15, 1207.034, 424.562, 7.081643, NULL, 0), +(@PATH, 16, 1222.688, 439.9175, 7.081566, NULL, 0), +(@PATH, 17, 1219.642, 447.5649, 7.081594, NULL, 0), +(@PATH, 18, 1211.156, 455.7188, 3.721778, NULL, 0), +(@PATH, 19, 1200.948, 444.0017, 2.015597, NULL, 0); + +SET @ENTRY := 58632; +SET @PATHOFFSET := 1; +SET @PATH := @ENTRY * 100 + @PATHOFFSET; +DELETE FROM `waypoint_path` WHERE `PathId`= @PATH; +INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Comment`) VALUES +(@PATH, 1, 0, 'Armsmaster Harlan - Blades of Light Path Right'); + +DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH; +INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES +(@PATH, 0, 1201.622, 447.4277, 0.9878227, NULL, 0), +(@PATH, 1, 1198.307, 446.7369, 0.9878202, NULL, 0), +(@PATH, 2, 1200.896, 440.3603, 1.013452, NULL, 0), +(@PATH, 3, 1202.697, 432.1492, 1.07209, NULL, 0), +(@PATH, 4, 1201.674, 436.79, 0.9878197, NULL, 0), +(@PATH, 5, 1206.789, 443.8733, 0.9878235, NULL, 0), +(@PATH, 6, 1193.938, 443.8958, 2.053352, NULL, 0), +(@PATH, 7, 1205.161, 456.7049, 2.083267, NULL, 0), +(@PATH, 8, 1212.862, 454.9352, 4.150019, NULL, 0), +(@PATH, 9, 1224.649, 437.8368, 7.109349, NULL, 0), +(@PATH, 10, 1217.377, 427.7413, 7.081546, NULL, 0), +(@PATH, 11, 1199.389, 425.0538, 8.667348, NULL, 0), +(@PATH, 12, 1186.738, 439.9496, 12.10881, NULL, 0), +(@PATH, 13, 1177.432, 444.1267, 13.98004, NULL, 0), +(@PATH, 14, 1187.255, 447.8455, 12.17532, NULL, 0), +(@PATH, 15, 1191.906, 457.6354, 10.33337, NULL, 0), +(@PATH, 16, 1208.694, 463.2535, 7.081545, NULL, 0), +(@PATH, 17, 1219.986, 457.5608, 7.081551, NULL, 0), +(@PATH, 18, 1219.328, 441.2535, 7.081581, NULL, 0), +(@PATH, 19, 1205.826, 429.7535, 2.155848, NULL, 0), +(@PATH, 20, 1198.332, 440.2205, 1.98782, NULL, 0), +(@PATH, 21, 1200.79, 443.9236, 1.98782, NULL, 0); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index d689481661d..6bd0010f723 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -4643,6 +4643,34 @@ void SpellMgr::LoadSpellInfoCorrections() // ENDOF FIRELANDS // + // SCARLET HALLS SPELLS + // + + // 111755 - Call Reinforcement + ApplySpellFix({ 111755 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT; + + ApplySpellEffectFix(spellInfo, EFFECT_0, [](SpellEffectInfo* spellEffectInfo) + { + spellEffectInfo->TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB); + }); + }); + + // 111756 - Call Reinforcement + ApplySpellFix({ 111756 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT; + + ApplySpellEffectFix(spellInfo, EFFECT_0, [](SpellEffectInfo* spellEffectInfo) + { + spellEffectInfo->TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB); + }); + }); + + // ENDOF SCARLET HALLS SPELLS + + // // MARDUM SPELLS // diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/ScarletHalls/boss_armsmaster_harlan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/ScarletHalls/boss_armsmaster_harlan.cpp new file mode 100644 index 00000000000..7ebb5a47785 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/ScarletHalls/boss_armsmaster_harlan.cpp @@ -0,0 +1,334 @@ +/* + * 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 "CreatureAI.h" +#include "CreatureAIImpl.h" +#include "InstanceScript.h" +#include "MotionMaster.h" +#include "ObjectAccessor.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuras.h" +#include "SharedDefines.h" +#include "Vehicle.h" +#include "scarlet_halls.h" + +enum HarlanSpells +{ + // Armsmaster Harlan + SPELL_HARLAN_DRAGONS_REACH = 111217, + SPELL_HARLAN_CALL_REINFORCEMENT = 111755, + SPELL_HARLAN_HEROIC_LEAP_JUMP = 111219, + SPELL_HARLAN_BERSERKERS_RAGE = 111221, + SPELL_HARLAN_BLADES_OF_LIGHT_CAST = 111216, + SPELL_HARLAN_BLADES_OF_LIGHT_VEHICLE = 112955, + SPELL_HARLAN_BLADES_OF_LIGHT_DAMAGE = 111215, + SPELL_HARLAN_LEAVE_VEHICLE = 112953, + + // Scarlet Defender + SPELL_SCARLET_DEFENDER_UNARMORED = 113969 +}; + +enum HarlanEvents +{ + EVENT_HARLAN_DRAGONS_REACH = 1, + EVENT_HARLAN_CALL_FOR_HELP, + EVENT_HARLAN_HEROIC_LEAP, + EVENT_HARLAN_BERSERKER_RAGE, + EVENT_HARLAN_BLADES_OF_LIGHT, + EVENT_HARLAN_CALL_REINFORCEMENT, + EVENT_HARLAN_FINISH_BLADES_OF_LIGHT, +}; + +enum HarlanTexts +{ + SAY_HARLAN_AGGRO = 0, + SAY_HARLAN_CALL_FOR_HELP = 1, + ANNOUNCE_HARLAN_CALL_FOR_HELP = 2, + ANNOUNCE_HARLAN_BLADE_FOR_LIGHT = 3, + SAY_HARLAN_DEATH = 4 +}; + +enum HarlanPathIds +{ + PATH_HARLAN_BLADES_OF_LIGHT_LEFT = 5863200, + PATH_HARLAN_BLADES_OF_LIGHT_RIGHT = 5863201 +}; + +// 58632 - Armsmaster Harlan +struct boss_armsmaster_harlan : public BossAI +{ + boss_armsmaster_harlan(Creature* creature) : BossAI(creature, DATA_ARMSMASTER_HARLAN), _berserkerRage(false) { } + + void JustEngagedWith(Unit* who) override + { + BossAI::JustEngagedWith(who); + Talk(SAY_HARLAN_AGGRO); + events.ScheduleEvent(EVENT_HARLAN_DRAGONS_REACH, 7s); + events.ScheduleEvent(EVENT_HARLAN_CALL_FOR_HELP, 20s); + events.ScheduleEvent(EVENT_HARLAN_HEROIC_LEAP, 41s); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + summons.DespawnAll(); + _EnterEvadeMode(); + _DespawnAtEvade(); + } + + void Reset() override + { + _Reset(); + _berserkerRage = false; + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + Talk(SAY_HARLAN_DEATH); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + } + + void MovementInform(uint32 /*type*/, uint32 id) override + { + if (id == EVENT_JUMP) + { + me->SetReactState(REACT_PASSIVE); + Talk(ANNOUNCE_HARLAN_BLADE_FOR_LIGHT); + events.CancelEvent(EVENT_HARLAN_DRAGONS_REACH); + events.CancelEvent(EVENT_HARLAN_CALL_FOR_HELP); + events.CancelEvent(EVENT_HARLAN_HEROIC_LEAP); + DoCastSelf(SPELL_HARLAN_BLADES_OF_LIGHT_CAST); + } + } + + void DamageTaken(Unit* /*killer*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override + { + if (!_berserkerRage && me->HealthBelowPctDamaged(50, damage)) + { + _berserkerRage = true; + DoCastSelf(SPELL_HARLAN_BERSERKERS_RAGE); + } + } + + void WaypointPathEnded(uint32 /*nodeId*/, uint32 /*pathId*/) override + { + events.ScheduleEvent(EVENT_HARLAN_FINISH_BLADES_OF_LIGHT, 1s); + events.ScheduleEvent(EVENT_HARLAN_DRAGONS_REACH, 6s); + events.ScheduleEvent(EVENT_HARLAN_CALL_FOR_HELP, 19s); + events.ScheduleEvent(EVENT_HARLAN_HEROIC_LEAP, 29s); + } + + void UpdateAI(uint32 diff) override + { + scheduler.Update(diff); + + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_HARLAN_DRAGONS_REACH: + DoCastVictim(SPELL_HARLAN_DRAGONS_REACH); + events.ScheduleEvent(EVENT_HARLAN_DRAGONS_REACH, 7s); + break; + case EVENT_HARLAN_CALL_FOR_HELP: + Talk(SAY_HARLAN_CALL_FOR_HELP); + events.ScheduleEvent(EVENT_HARLAN_CALL_REINFORCEMENT, 4s); + break; + case EVENT_HARLAN_HEROIC_LEAP: + DoCast(SPELL_HARLAN_HEROIC_LEAP_JUMP); + break; + case EVENT_HARLAN_CALL_REINFORCEMENT: + Talk(ANNOUNCE_HARLAN_CALL_FOR_HELP); + DoCast(SPELL_HARLAN_CALL_REINFORCEMENT); + events.ScheduleEvent(EVENT_HARLAN_CALL_FOR_HELP, 20s); + break; + case EVENT_HARLAN_FINISH_BLADES_OF_LIGHT: + me->RemoveAurasDueToSpell(SPELL_HARLAN_BLADES_OF_LIGHT_CAST); + me->SetHover(false); + DoCastSelf(SPELL_HARLAN_LEAVE_VEHICLE); + me->SetReactState(REACT_AGGRESSIVE); + break; + default: + break; + } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + } + } +private: + bool _berserkerRage; +}; + +// 111216 - Blades of Light +class spell_harlan_blades_of_light : public SpellScript +{ + void HandleAfterCast() + { + Creature* caster = GetCaster()->ToCreature(); + if (!caster) + return; + + caster->GetMotionMaster()->Clear(); + caster->SetHover(true); + + if (urand(0, 1) == 0) + caster->GetMotionMaster()->MovePath(PATH_HARLAN_BLADES_OF_LIGHT_LEFT, false); + else + caster->GetMotionMaster()->MovePath(PATH_HARLAN_BLADES_OF_LIGHT_RIGHT, false); + } + + void Register() override + { + AfterCast += SpellCastFn(spell_harlan_blades_of_light::HandleAfterCast); + } +}; + +// 111394 - Blades of Light +class spell_harlan_blades_of_light_selector : public SpellScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HARLAN_BLADES_OF_LIGHT_CAST }); + } + + void HandleHit(SpellEffIndex /*effIndex*/) + { + if (GetHitUnit()->HasAuraType(AuraType::SPELL_AURA_SPIRIT_OF_REDEMPTION)) + return; + + GetHitUnit()->CastSpell(GetCaster(), SPELL_HARLAN_BLADES_OF_LIGHT_VEHICLE, true); + GetCaster()->CastSpell(GetHitUnit(), SPELL_HARLAN_BLADES_OF_LIGHT_DAMAGE, false); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_harlan_blades_of_light_selector::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 112953 - Leave Vehicle +class spell_harlan_leave_vehicle : public SpellScript +{ + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->ExitVehicle(); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_harlan_leave_vehicle::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 113959 - Heavy Armor +class spell_scarlet_defender_heavy_armor : public AuraScript +{ + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->CastSpell(GetTarget(), SPELL_SCARLET_DEFENDER_UNARMORED); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_scarlet_defender_heavy_armor::OnRemove, EFFECT_1, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL); + } +}; + +constexpr Position CallReinforcmentsRightPosition = { 1182.020f, 447.325f, 11.98933f }; +constexpr Position CallReinforcmentsLeftPosition = { 1181.833f, 440.649f, 11.98763f }; + +// 111755 - Call Reinforcements +class spell_call_reinforcements_right : public SpellScript +{ + void SetDest(SpellDestination& dest) + { + dest.Relocate(CallReinforcmentsRightPosition); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_call_reinforcements_right::SetDest, EFFECT_0, TARGET_DEST_NEARBY_ENTRY); + } +}; + +// 111756 - Call Reinforcements +class spell_call_reinforcements_left : public SpellScript +{ + void SetDest(SpellDestination& dest) + { + dest.Relocate(CallReinforcmentsLeftPosition); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_call_reinforcements_left::SetDest, EFFECT_0, TARGET_DEST_NEARBY_ENTRY); + } +}; + +// 128930 - Eject Spirits of Redemption +class spell_eject_spirits_of_redemption : public SpellScript +{ + void HandleHitTarget(SpellEffIndex /*effIndex*/) + { + Vehicle* veh = GetCaster()->GetVehicleKit(); + if (!veh) + return; + + for (auto const& [_, seat] : veh->Seats) + { + Unit* passenger = ObjectAccessor::GetUnit(*GetCaster(), seat.Passenger.Guid); + if (!passenger) + continue; + + if (passenger->HasAuraType(AuraType::SPELL_AURA_SPIRIT_OF_REDEMPTION)) + passenger->ExitVehicle(); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_eject_spirits_of_redemption::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +void AddSC_boss_armsmaster_harlan() +{ + // Creature + RegisterScarletHallsCreatureAI(boss_armsmaster_harlan); + + // Spells + RegisterSpellScript(spell_harlan_blades_of_light); + RegisterSpellScript(spell_harlan_blades_of_light_selector); + RegisterSpellScript(spell_harlan_leave_vehicle); + RegisterSpellScript(spell_scarlet_defender_heavy_armor); + RegisterSpellScript(spell_call_reinforcements_right); + RegisterSpellScript(spell_call_reinforcements_left); + RegisterSpellScript(spell_eject_spirits_of_redemption); +} diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/ScarletHalls/scarlet_halls.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/ScarletHalls/scarlet_halls.cpp new file mode 100644 index 00000000000..c3acef9db49 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/ScarletHalls/scarlet_halls.cpp @@ -0,0 +1,69 @@ +/* + * 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 "InstanceScript.h" +#include "ScriptMgr.h" +#include "scarlet_halls.h" + +ObjectData const creatureData[] = +{ + { BOSS_HOUNDMASTER_BRAUN, DATA_HOUNDMASTER_BRAUN }, + { BOSS_ARMSMASTER_HARLAN, DATA_ARMSMASTER_HARLAN }, + { BOSS_FLAMEWEAVER_KOEGLER, DATA_FLAMEWEAVER_KOEGLER }, + { 0, 0 } // END +}; + +DoorData const doorData[] = +{ + { GO_HERODS_DOOR_HARLAN_ENCOUNTER_ENTRANCE, DATA_ARMSMASTER_HARLAN, EncounterDoorBehavior::OpenWhenNotInProgress }, + { 0, 0, EncounterDoorBehavior::OpenWhenNotInProgress } //End +}; + +DungeonEncounterData const encounters[] = +{ + { DATA_HOUNDMASTER_BRAUN, {{ 1422 }} }, + { DATA_ARMSMASTER_HARLAN, {{ 1421 }} }, + { DATA_FLAMEWEAVER_KOEGLER, {{ 1420 }} }, +}; + +class instance_scarlet_halls : public InstanceMapScript +{ +public: + instance_scarlet_halls() : InstanceMapScript(ScarletHallsScriptName, 1001) { } + + struct instance_scarlet_halls_InstanceMapScript : public InstanceScript + { + instance_scarlet_halls_InstanceMapScript(InstanceMap* map) : InstanceScript(map) + { + SetHeaders(DataHeader); + SetBossNumber(EncounterCount); + LoadObjectData(creatureData, nullptr); + LoadDoorData(doorData); + LoadDungeonEncounterData(encounters); + } + }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const override + { + return new instance_scarlet_halls_InstanceMapScript(map); + } +}; + +void AddSC_instance_scarlet_halls() +{ + new instance_scarlet_halls(); +} diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/ScarletHalls/scarlet_halls.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/ScarletHalls/scarlet_halls.h new file mode 100644 index 00000000000..599895acdd2 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/ScarletHalls/scarlet_halls.h @@ -0,0 +1,57 @@ +/* + * 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/>. + */ + +#ifndef DEF_SCARLET_HALLS_H_ +#define DEF_SCARLET_HALLS_H_ + +#include "CreatureAIImpl.h" + +#define DataHeader "ScarletHalls" +#define ScarletHallsScriptName "instance_scarlet_halls" + +uint32 const EncounterCount = 3; + +enum ScarletHallsTypes +{ + // Encounters + DATA_HOUNDMASTER_BRAUN = 0, + DATA_ARMSMASTER_HARLAN = 1, + DATA_FLAMEWEAVER_KOEGLER = 2 +}; + +enum ScarletHallsCreatureIds +{ + // Bosses + BOSS_HOUNDMASTER_BRAUN = 59303, + BOSS_ARMSMASTER_HARLAN = 58632, + BOSS_FLAMEWEAVER_KOEGLER = 59150 +}; + +enum ScarletHallsGameObjectIds +{ + GO_HERODS_DOOR_HARLAN_ENCOUNTER_ENTRANCE = 210480 +}; + +template <class AI, class T> +inline AI* GetScarletHallsAI(T* obj) +{ + return GetInstanceAI<AI>(obj, ScarletHallsScriptName); +} + +#define RegisterScarletHallsCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetScarletHallsAI) + +#endif diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp index b818c1e6f10..8316eec13f4 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -112,6 +112,8 @@ void AddSC_boss_interrogator_vishas(); void AddSC_boss_scorn(); void AddSC_instance_scarlet_monastery(); void AddSC_boss_mograine_and_whitemane(); +void AddSC_instance_scarlet_halls(); // Scarlet Halls +void AddSC_boss_armsmaster_harlan(); void AddSC_boss_darkmaster_gandling(); //Scholomance void AddSC_boss_death_knight_darkreaver(); void AddSC_boss_theolenkrastinov(); @@ -301,6 +303,8 @@ void AddEasternKingdomsScripts() AddSC_boss_scorn(); AddSC_instance_scarlet_monastery(); AddSC_boss_mograine_and_whitemane(); + AddSC_instance_scarlet_halls(); // Scarlet Halls + AddSC_boss_armsmaster_harlan(); AddSC_boss_darkmaster_gandling(); //Scholomance AddSC_boss_death_knight_darkreaver(); AddSC_boss_theolenkrastinov(); |