diff options
3 files changed, 1030 insertions, 2 deletions
diff --git a/sql/updates/world/master/2022_09_21_00_world.sql b/sql/updates/world/master/2022_09_21_00_world.sql new file mode 100644 index 00000000000..184543a178f --- /dev/null +++ b/sql/updates/world/master/2022_09_21_00_world.sql @@ -0,0 +1,78 @@ +-- Grand Executor Mortuus +UPDATE `creature_template` SET `ScriptName`='npc_silverpine_grand_executor_mortuus' WHERE `entry`=44615; + +-- Lady Sylvanas Windrunner +DELETE FROM `creature_text` WHERE `CreatureID`= 44365; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `SoundPlayType`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(44365, 0, 0, 'Where is that ogre-headed buffoon?', 12, 0, 100, 6, 0, 20459, 0, 44695, 0, 'VO_QE_SP_Sylvanas_SPEvent01'), +(44365, 1, 0, 'Ah, speak of the devil...', 12, 0, 100, 1, 0, 20460, 0, 44696, 0, 'VO_QE_SP_Sylvanas_SPEvent02'), +(44365, 2, 0, 'Warchief, so glad you could make it.', 12, 0, 100, 1, 0, 20461, 0, 44701, 0, 'VO_QE_SP_Sylvanas_SPEvent03'), +(44365, 3, 0, 'With the death of the Lich King, many of the more intelligent Scourge became... unemployed. Those \'fiends,\' as you so delicately put it, are called val\'kyr. They are under my command now...', 12, 0, 100, 0, 0, 20462, 0, 44702, 0, 'VO_QE_SP_Sylvanas_SPEvent04'), +(44365, 4, 0, '...and they are part of the reason that I asked to see you.', 12, 0, 100, 1, 0, 20463, 0, 44703, 0, 'VO_QE_SP_Sylvanas_SPEvent05'), +(44365, 5, 0, 'Very well, Warchief. I have solved the plight of the Forsaken!', 12, 0, 100, 5, 0, 20464, 0, 44705, 0, 'VO_QE_SP_Sylvanas_SPEvent06'), +(44365, 6, 0, 'As a race, we Forsaken are unable to procreate.', 12, 0, 100, 274, 0, 20465, 0, 44706, 0, 'VO_QE_SP_Sylvanas_SPEvent07'), +(44365, 7, 0, 'With the aid of the val\'kyr, we are now able to take the corpses of the fallen and create new Forsaken.', 12, 0, 100, 0, 0, 20466, 0, 44707, 0, 'VO_QE_SP_Sylvanas_SPEvent08'), +(44365, 8, 0, 'Agatha, show the Warchief!', 12, 0, 100, 5, 0, 20467, 0, 44709, 0, 'VO_QE_SP_Sylvanas_SPEvent09'), +(44365, 9, 0, 'Warchief, without these new Forsaken my people would die out... Our hold upon Gilneas and northern Lordaeron would crumble.', 12, 0, 100, 0, 0, 20468, 0, 44715, 0, 'VO_QE_SP_Sylvanas_SPEvent10'), +(44365, 10, 0, 'Isn\'t it obvious, Warchief? I serve the Horde.', 12, 0, 100, 66, 0, 20469, 0, 44718, 0, 'VO_QE_SP_Sylvanas_SPEvent11'); + +-- Garrosh Hellscream +DELETE FROM `creature_text` WHERE `CreatureID` = 44629; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `SoundPlayType`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(44629, 0, 0, 'This better be important, Sylvanas. You know how I detest this place and its foul stench. Why have you called for me?', 12, 0, 100, 0, 0, 20496, 0, 44699, 0, 'VO_QE_Garrosh_SPEvent01'), +(44629, 1, 0, 'And more importantly, what are those Scourge fiends doing here?', 12, 0, 100, 25, 0, 20497, 0, 44700, 0, 'VO_QE_Garrosh_SPEvent02'), +(44629, 2, 0, 'Get on with it, Sylvanas.', 12, 0, 100, 1, 0, 20498, 0, 44704, 0, 'VO_QE_Garrosh_SPEvent03'), +(44629, 3, 0, 'What you have done here, Sylvanas... it goes against the laws of nature. Disgusting is the only word I have to describe it.', 12, 0, 100, 0, 0, 20499, 0, 44714, 0, 'VO_QE_Garrosh_SPEvent04'), +(44629, 4, 0, 'Have you given any thought to what this means, Sylvanas?', 12, 0, 100, 6, 0, 20500, 0, 44716, 0, 'VO_QE_Garrosh_SPEvent05'), +(44629, 5, 0, 'What difference is there between you and the Lich King now?', 12, 0, 100, 6, 0, 20501, 0, 44717, 0, 'VO_QE_Garrosh_SPEvent06'), +(44629, 6, 0, 'Watch your clever mouth.', 12, 0, 100, 397, 0, 20502, 0, 44719, 0, 'VO_QE_Garrosh_SPEvent07'), +(44629, 7, 0, 'Cromush, you stay behind and make sure the Banshee Queen is well "guarded." I will be expecting a full report when next we meet.', 12, 0, 100, 0, 0, 20503, 0, 44720, 0, 'VO_QE_Garrosh_SPEvent08'), +(44629, 8, 0, 'Remember, Sylvanas, eventually we all have to stand before our maker and face judgment. Your day may come sooner than others...', 12, 0, 100, 0, 0, 20504, 0, 44721, 0, 'VO_QE_Garrosh_SPEvent09'); + +DELETE FROM `waypoint_data` WHERE `id` = 446290; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(446290, 0, 1377.69, 1048.67, 53.4456, NULL, 0, 0, 0, 0, 0), +(446290, 1, 1373.69, 1052.17, 53.4456, NULL, 0, 0, 0, 0, 0), +(446290, 2, 1365.23, 1058.61, 53.0524, NULL, 0, 0, 0, 0, 0); + +-- High Warlord Cromush +DELETE FROM `creature_text` WHERE `CreatureID` = 44640; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `SoundPlayType`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(44640, 0, 0, 'ABBERATION!', 12, 0, 100, 5, 0, 0, 0, 44713, 0, 'VO_QE_SP_Crommush_SPEvent01'), +(44640, 1, 0, 'As you command, Warchief.', 12, 0, 100, 66, 0, 0, 0, 44738, 0, 'VO_QE_SP_Crommush_SPEvent01'); + +DELETE FROM `waypoint_data` WHERE `id` = 446402; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(446402, 0, 1412.05, 1089.42, 60.4771, NULL, 0, 1, 0, 0, 0), +(446402, 1, 1405.38, 1095.16, 60.4774, NULL, 0, 1, 0, 0, 0), +(446402, 2, 1392.62, 1093.5, 56.4067, NULL, 0, 1, 0, 0, 0), +(446402, 3, 1380.65, 1083.27, 52.6221, NULL, 0, 1, 0, 0, 0), +(446402, 4, 1372.86, 1062, 53.0398, NULL, 0, 1, 0, 0, 0), +(446402, 5, 1376.69, 1048.61, 53.3362, NULL, 0, 1, 0, 0, 0), +(446402, 6, 1375.32, 1046.38, 53.2336, NULL, 0, 1, 0, 0, 0); + +-- Fallen Human +UPDATE `creature_template` SET `ScriptName`='npc_silverpine_fallen_human' WHERE `entry` IN (44592, 44593); + +DELETE FROM `creature_template_movement` WHERE `CreatureId` IN (44592, 44593); +INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES +(44592, NULL, NULL, 1, NULL, NULL, NULL, NULL), +(44593, NULL, NULL, 1, NULL, NULL, NULL, NULL); + +-- Raise Forsaken (The Warchief Cometh) +DELETE FROM `spell_script_names` WHERE `spell_id` = 83173 AND `ScriptName` = 'spell_silverpine_raise_forsaken_83173'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(83173, 'spell_silverpine_raise_forsaken_83173'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=83173 AND `SourceId`=0 AND `ElseGroup`=0 AND `ConditionTypeOrReference`=31 AND `ConditionTarget`=0 AND `ConditionValue1`=3 AND `ConditionValue2`=44592 AND `ConditionValue3`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +(13, 1, 83173, 0, 0, 31, 0, 3, 44592, 0, 0, 'Raise Forsaken - Target Fallen Human (Male)'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=83173 AND `SourceId`=0 AND `ElseGroup`=1 AND `ConditionTypeOrReference`=31 AND `ConditionTarget`=0 AND `ConditionValue1`=3 AND `ConditionValue2`=44593 AND `ConditionValue3`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +(13, 1, 83173, 0, 1, 31, 0, 3, 44593, 0, 0, 'Raise Forsaken - Target Fallen Human (Female)'); + +-- Forsaken Trooper Masterscript (The Warchief Cometh) +DELETE FROM `spell_script_names` WHERE `spell_id` = 83149 AND `ScriptName` = 'spell_silverpine_forsaken_trooper_masterscript_high_command'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(83149, 'spell_silverpine_forsaken_trooper_masterscript_high_command'); diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp index 3ca0fba445b..7ae0ad9a165 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -195,7 +195,7 @@ void AddSC_elwynn_forest(); void AddSC_hinterlands(); void AddSC_isle_of_queldanas(); void AddSC_redridge_mountains(); -//void AddSC_silverpine_forest(); +void AddSC_silverpine_forest(); void AddSC_stormwind_city(); //void AddSC_swamp_of_sorrows(); void AddSC_tirisfal_glades(); @@ -387,7 +387,7 @@ void AddEasternKingdomsScripts() AddSC_hinterlands(); AddSC_isle_of_queldanas(); AddSC_redridge_mountains(); - //AddSC_silverpine_forest(); + AddSC_silverpine_forest(); AddSC_stormwind_city(); //AddSC_swamp_of_sorrows(); AddSC_tirisfal_glades(); diff --git a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp new file mode 100644 index 00000000000..34510d86bff --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp @@ -0,0 +1,950 @@ +/* + * 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 "CellImpl.h" +#include "CombatAI.h" +#include "CreatureAIImpl.h" +#include "GameObject.h" +#include "GameObjectAI.h" +#include "GridNotifiers.h" +#include "Group.h" +#include "MotionMaster.h" +#include "ObjectAccessor.h" +#include "ObjectMgr.h" +#include "Object.h" +#include "Player.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "SharedDefines.h" +#include "SpellAuras.h" +#include "SpellAuraEffects.h" +#include "SpellScript.h" +#include "SpellMgr.h" +#include "TemporarySummon.h" +#include "Unit.h" +#include "Vehicle.h" + +Position const OrgrimmarPortalPos[3] = +{ + { 1358.62f, 1054.72f, 53.1200f, 0.0f }, + { 1393.27f, 1021.20f, 53.2225f, 0.0f }, + { 1404.71f, 1063.73f, 60.5617f, 0.0f } +}; + +Position const HellscreamElitePos[16] = +{ + { 1387.90f, 1029.71f, 53.21853f, 2.827433f }, + { 1389.79f, 1024.51f, 53.20833f, 2.827433f }, + { 1388.05f, 1026.91f, 53.20833f, 2.827433f }, + { 1388.16f, 1020.88f, 53.25523f, 2.827433f }, + { 1385.79f, 1025.99f, 53.22593f, 2.827433f }, + { 1386.69f, 1023.26f, 53.24393f, 2.827433f }, + { 1384.33f, 1022.04f, 53.28123f, 2.827433f }, + { 1391.10f, 1027.73f, 53.20483f, 2.827433f }, + + { 1359.10f, 1046.55f, 52.97053f, 5.253441f }, + { 1360.89f, 1051.81f, 53.19793f, 5.253441f }, + { 1360.75f, 1048.84f, 53.12893f, 5.253441f }, + { 1364.43f, 1053.62f, 53.29343f, 5.253441f }, + { 1363.08f, 1048.15f, 53.22223f, 5.253441f }, + { 1364.08f, 1050.84f, 53.29163f, 5.253441f }, + { 1366.69f, 1050.31f, 53.34203f, 5.253441f }, + { 1357.85f, 1050.12f, 52.99823f, 5.253441f } +}; + +Position const GarroshPos = { 1402.45f, 1061.62f, 60.56173f, 3.926991f }; + +Position const GarroshJumpPos = { 1378.65f, 1044.23f, 53.8389f, 5.51524f }; + +Position const CromushPos = { 1404.71f, 1063.73f, 60.5617f, 2.827433f }; + +Position const AgathaPreRisePos = { 1364.02f, 1028.54f, 66.99143f }; + +Position const AgathaRisePos = { 1368.65f, 1032.19f, 63.3033f }; + +Position const AgathaPreResetPos = { 1364.02f, 1028.54f, 55.9914f }; + +Position const AgathaResetPos = { 1364.02f, 1028.54f, 58.1319f }; + +enum QuestTheWarchiefCometh +{ + QUEST_THE_WARCHIEF_COMETH = 26965, + + NPC_LADY_SYLVANAS_WINDRUNNER_COMETH = 44365, + NPC_AGATHA_COMETH = 44608, + NPC_GRAND_EXECUTOR_MORTUUS = 44615, + NPC_MALE_FALLEN_HUMAN = 44592, + NPC_FEMALE_FALLEN_HUMAN = 44593, + NPC_PORTAL_FROM_ORGRIMMAR = 44630, + NPC_GARROSH_HELLSCREAM = 44629, + NPC_HIGH_WARLORD_CROMUSH_COMETH = 44640, + NPC_HELLSCREAM_ELITE_COMETH = 44636, + NPC_QUEST_MONSTER_CREDIT = 44629, + NPC_FORSAKEN_WARHORSE_UNPHASED = 73595, + + SPELL_RAISE_FORSAKEN_COMETH = 83173, + SPELL_AIR_REVENANT_ENTRANCE = 55761, + SPELL_SIMPLE_TELEPORT = 12980, + SPELL_WELCOME_TO_SILVERPINE_CREDIT = 83384, + + EVENT_START_SCENE_COMETH = 1, + EVENT_SUMMON_PORTAL_COMETH = 2, + EVENT_SUMMON_GARROSH_COMETH = 3, + EVENT_AGATHA_RAISE_FORSAKEN = 4, // Note: 4-8 are used + EVENT_SCENE_TALK_COMETH = 9, // Note: 9-36 are used + + ACTION_START_SCENE_COMETH = 1, + + TALK_SYLVANAS_COMETH_0 = 0, + TALK_SYLVANAS_COMETH_1 = 1, + TALK_SYLVANAS_COMETH_2 = 2, + TALK_SYLVANAS_COMETH_3 = 3, + TALK_SYLVANAS_COMETH_4 = 4, + TALK_SYLVANAS_COMETH_5 = 5, + TALK_SYLVANAS_COMETH_6 = 6, + TALK_SYLVANAS_COMETH_7 = 7, + TALK_SYLVANAS_COMETH_8 = 8, + TALK_SYLVANAS_COMETH_9 = 9, + TALK_SYLVANAS_COMETH_10 = 10, + TALK_GARROSH_COMETH_0 = 0, + TALK_GARROSH_COMETH_1 = 1, + TALK_GARROSH_COMETH_2 = 2, + TALK_GARROSH_COMETH_3 = 3, + TALK_GARROSH_COMETH_4 = 4, + TALK_GARROSH_COMETH_5 = 5, + TALK_GARROSH_COMETH_6 = 6, + TALK_GARROSH_COMETH_7 = 7, + TALK_GARROSH_COMETH_8 = 8, + TALK_GARROSH_COMETH_9 = 9, + TALK_GARROSH_COMETH_10 = 10, + TALK_CROMUSH_COMETH_0 = 0, + TALK_CROMUSH_COMETH_1 = 1, + + PATH_CROMUSH = 446402, + PATH_GARROSH = 446290, + + POINT_AGATHA_PRE_RISE = 1, + POINT_AGATHA_RISE = 2, + POINT_AGATHA_PRE_RESET = 3, + POINT_AGATHA_RESET = 4, + + ANIMKIT_GENERAL_1 = 609, + ANIMKIT_SYLV_1 = 595, + ANIMKIT_SYLV_2 = 606, + ANIMKIT_GARROSH_1 = 662, + ANIMKIT_GARROSH_2 = 595 +}; + +// Grand Executor Mortuus - 44615 +struct npc_silverpine_grand_executor_mortuus : public ScriptedAI +{ + npc_silverpine_grand_executor_mortuus(Creature* creature) : ScriptedAI(creature), _summons(me), _eventInProgress(false) {} + + void OnQuestAccept(Player* /*player*/, Quest const* quest) override + { + if (quest->GetQuestId() == QUEST_THE_WARCHIEF_COMETH) + { + if (_eventInProgress) + return; + + DoAction(ACTION_START_SCENE_COMETH); + } + } + + void Reset() override + { + _events.Reset(); + _garroshGUID.Clear(); + _cromushGUID.Clear(); + _sylvanasGUID.Clear(); + _agathaGUID.Clear(); + _summons.clear(); + _eventInProgress = false; + } + + void JustSummoned(Creature* summon) override + { + _summons.Summon(summon); + + switch (summon->GetEntry()) + { + case NPC_GARROSH_HELLSCREAM: + summon->CastSpell(summon, SPELL_SIMPLE_TELEPORT); + _garroshGUID = summon->GetGUID(); + break; + + case NPC_HELLSCREAM_ELITE_COMETH: + summon->CastSpell(summon, SPELL_SIMPLE_TELEPORT); + break; + + default: + break; + } + } + + void DoAction(int32 param) override + { + switch (param) + { + case ACTION_START_SCENE_COMETH: + { + _eventInProgress = true; + + if (Creature* sylvanas = me->FindNearestCreature(NPC_LADY_SYLVANAS_WINDRUNNER_COMETH, 100.0f)) + { + _sylvanasGUID = sylvanas->GetGUID(); + + if (Creature* agatha = me->FindNearestCreature(NPC_AGATHA_COMETH, 100.0f)) + { + _agathaGUID = agatha->GetGUID(); + + _events.ScheduleEvent(EVENT_START_SCENE_COMETH, 250ms); + } + } + + break; + } + + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_START_SCENE_COMETH: + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH, 1s); + _events.ScheduleEvent(EVENT_SUMMON_PORTAL_COMETH, 4s); + _events.ScheduleEvent(EVENT_SUMMON_GARROSH_COMETH, 7s + 500ms); + break; + + case EVENT_SUMMON_PORTAL_COMETH: + SummonPortalsFromOrgrimmar(); + break; + + case EVENT_SUMMON_GARROSH_COMETH: + SummonGarroshAndHisEliteGuards(); + break; + + case EVENT_SCENE_TALK_COMETH: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_0); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 1, 4s + 500ms); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 1: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + sylvanas->SetFacingTo(0.808979f); + + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_1); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 2, 3s + 500ms); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 2: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + garrosh->GetMotionMaster()->MoveJump(GarroshJumpPos, 15.595897f, 15.595897f); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 3, 2s + 500ms); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 3: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + sylvanas->SetFacingTo(3.924652f); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 4, 1s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 4: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + garrosh->SetFacingToObject(sylvanas); + + garrosh->PlayOneShotAnimKitId(ANIMKIT_GARROSH_1); + + if (garrosh->IsAIEnabled()) + garrosh->AI()->Talk(TALK_GARROSH_COMETH_0); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 5, 12s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 5: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + garrosh->SetFacingTo(3.9444442f); + + if (garrosh->IsAIEnabled()) + garrosh->AI()->Talk(TALK_GARROSH_COMETH_1); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 6, 7s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 6: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + sylvanas->SetFacingTo(2.4260077f); + + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_2); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 7, 5s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 7: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + sylvanas->SetFacingTo(3.7350047f); + sylvanas->PlayOneShotAnimKitId(ANIMKIT_SYLV_1); + + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_3); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 8, 16s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 8: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_4); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 9, 4s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 9: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + if (garrosh->IsAIEnabled()) + garrosh->AI()->Talk(TALK_GARROSH_COMETH_2); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 10, 3s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 10: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_5); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 11, 6s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 11: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_6); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 12, 6s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 12: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + sylvanas->PlayOneShotAnimKitId(ANIMKIT_SYLV_2); + + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_7); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 13, 9s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 13: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_8); + + _events.ScheduleEvent(EVENT_AGATHA_RAISE_FORSAKEN, 3s); + } + break; + } + + case EVENT_AGATHA_RAISE_FORSAKEN: + { + if (Creature* agatha = ObjectAccessor::GetCreature(*me, _agathaGUID)) + { + agatha->GetMotionMaster()->MovePoint(POINT_AGATHA_PRE_RISE, AgathaPreRisePos, false); + + _events.ScheduleEvent(EVENT_AGATHA_RAISE_FORSAKEN + 1, 2s + 500ms); + } + break; + } + + case EVENT_AGATHA_RAISE_FORSAKEN + 1: + { + if (Creature* agatha = ObjectAccessor::GetCreature(*me, _agathaGUID)) + { + agatha->SetWalk(true); + agatha->GetMotionMaster()->MovePoint(POINT_AGATHA_RISE, AgathaRisePos, false); + + _events.ScheduleEvent(EVENT_AGATHA_RAISE_FORSAKEN + 2, 6s); + } + break; + } + + case EVENT_AGATHA_RAISE_FORSAKEN + 2: + { + if (Creature* agatha = ObjectAccessor::GetCreature(*me, _agathaGUID)) + { + agatha->CastSpell(agatha, SPELL_RAISE_FORSAKEN_COMETH); + + _events.ScheduleEvent(EVENT_AGATHA_RAISE_FORSAKEN + 3, 10s); + } + break; + } + + case EVENT_AGATHA_RAISE_FORSAKEN + 3: + { + if (Creature* agatha = ObjectAccessor::GetCreature(*me, _agathaGUID)) + { + agatha->GetMotionMaster()->MovePoint(POINT_AGATHA_PRE_RESET, AgathaPreResetPos, false, 0.855211f); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 14, 750ms); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 14: + { + if (Creature* cromush = ObjectAccessor::GetCreature(*me, _cromushGUID)) + { + if (cromush->IsAIEnabled()) + cromush->AI()->Talk(TALK_CROMUSH_COMETH_0); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 15, 3s + 500ms); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 15: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + garrosh->PlayOneShotAnimKitId(ANIMKIT_GENERAL_1); + + if (garrosh->IsAIEnabled()) + garrosh->AI()->Talk(TALK_GARROSH_COMETH_3); + + if (Creature* agatha = ObjectAccessor::GetCreature(*me, _agathaGUID)) + agatha->SetWalk(false); + + _events.ScheduleEvent(EVENT_AGATHA_RAISE_FORSAKEN + 4, 12s); + } + break; + } + + case EVENT_AGATHA_RAISE_FORSAKEN + 4: + { + if (Creature* agatha = ObjectAccessor::GetCreature(*me, _agathaGUID)) + { + agatha->GetMotionMaster()->MovePoint(POINT_AGATHA_RESET, AgathaResetPos, false, 0.7155f); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 16, 1s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 16: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + sylvanas->PlayOneShotAnimKitId(ANIMKIT_GENERAL_1); + + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_9); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 17, 10s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 17: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + if (garrosh->IsAIEnabled()) + garrosh->AI()->Talk(TALK_GARROSH_COMETH_4); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 18, 6s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 18: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + if (garrosh->IsAIEnabled()) + garrosh->AI()->Talk(TALK_GARROSH_COMETH_5); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 19, 6s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 19: + { + if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, _sylvanasGUID)) + { + if (sylvanas->IsAIEnabled()) + sylvanas->AI()->Talk(TALK_SYLVANAS_COMETH_10); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 20, 5s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 20: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + garrosh->SetFacingTo(5.51524f); + + if (garrosh->IsAIEnabled()) + garrosh->AI()->Talk(TALK_GARROSH_COMETH_6); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 21, 4s + 500ms); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 21: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + if (Creature* cromush = ObjectAccessor::GetCreature(*me, _cromushGUID)) + { + garrosh->SetFacingToObject(cromush); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 22, 500ms); + } + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 22: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + garrosh->PlayOneShotAnimKitId(ANIMKIT_GARROSH_2); + + if (garrosh->IsAIEnabled()) + garrosh->AI()->Talk(TALK_GARROSH_COMETH_7); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 23, 14s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 23: + { + if (Creature* cromush = ObjectAccessor::GetCreature(*me, _cromushGUID)) + { + if (cromush->IsAIEnabled()) + cromush->AI()->Talk(TALK_CROMUSH_COMETH_1); + + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + cromush->SetFacingToObject(garrosh); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 24, 2s + 500ms); + } + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 24: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + garrosh->SetFacingTo(5.6199603f); + garrosh->PlayOneShotAnimKitId(ANIMKIT_GARROSH_2); + + if (garrosh->IsAIEnabled()) + garrosh->AI()->Talk(TALK_GARROSH_COMETH_8); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 25, 8s + 500ms); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 25: + { + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID)) + { + garrosh->CastSpell(garrosh, SPELL_WELCOME_TO_SILVERPINE_CREDIT, true); + + garrosh->GetMotionMaster()->MovePath(PATH_GARROSH, false); + + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 26, 9s); + } + break; + } + + case EVENT_SCENE_TALK_COMETH + 26: + DespawnGarroshAndHisEliteGuards(); + _events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 27, 500ms); + break; + + case EVENT_SCENE_TALK_COMETH + 27: + _summons.DespawnAll(); + Reset(); + break; + + default: + break; + } + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void SummonPortalsFromOrgrimmar() + { + for (Position const& pos : OrgrimmarPortalPos) + me->SummonCreature(NPC_PORTAL_FROM_ORGRIMMAR, pos, TEMPSUMMON_TIMED_DESPAWN, 300s); + + std::list<Creature*> orgrimmarPortals; + GetCreatureListWithEntryInGrid(orgrimmarPortals, me, NPC_PORTAL_FROM_ORGRIMMAR, 100.0f); + + for (Creature* portal : orgrimmarPortals) + portal->CastSpell(portal, SPELL_AIR_REVENANT_ENTRANCE); + } + + void SummonGarroshAndHisEliteGuards() + { + for (Position const& pos : HellscreamElitePos) + me->SummonCreature(NPC_HELLSCREAM_ELITE_COMETH, pos, TEMPSUMMON_TIMED_DESPAWN, 300s); + + me->SummonCreature(NPC_GARROSH_HELLSCREAM, GarroshPos, TEMPSUMMON_TIMED_DESPAWN, 300s); + + if (Creature* cromush = me->SummonCreature(NPC_HIGH_WARLORD_CROMUSH_COMETH, CromushPos, TEMPSUMMON_TIMED_DESPAWN, 300s)) + { + _cromushGUID = cromush->GetGUID(); + + cromush->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); + cromush->GetMotionMaster()->MovePath(PATH_CROMUSH, false); + } + } + + void DespawnGarroshAndHisEliteGuards() + { + for (ObjectGuid const& summonedCreature : _summons) + { + if (Creature* summon = ObjectAccessor::GetCreature(*me, summonedCreature)) + summon->CastSpell(summon, SPELL_SIMPLE_TELEPORT); + } + } + +private: + EventMap _events; + ObjectGuid _garroshGUID; + ObjectGuid _cromushGUID; + ObjectGuid _sylvanasGUID; + ObjectGuid _agathaGUID; + SummonList _summons; + bool _eventInProgress; +}; + +enum RaiseForsakenCometh +{ + ACTION_RISE_DURING_RAISE = 1, + ACTION_DESCEND_AFTER_RAISE = 2, + + POINT_BEING_RISEN = 1, + + ANIMKIT_RESET = 0, + ANIMKIT_FALLEN_HUMAN = 721 +}; + +// Raise Forsaken - 83173 +class spell_silverpine_raise_forsaken_83173 : public AuraScript +{ + PrepareAuraScript(spell_silverpine_raise_forsaken_83173); + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + + if (Creature* fallenHuman = target->ToCreature()) + { + if (fallenHuman->IsAIEnabled()) + fallenHuman->AI()->DoAction(ACTION_RISE_DURING_RAISE); + } + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + + if (Creature* fallenHuman = target->ToCreature()) + { + if (fallenHuman->IsAIEnabled()) + fallenHuman->AI()->DoAction(ACTION_DESCEND_AFTER_RAISE); + } + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_silverpine_raise_forsaken_83173::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_silverpine_raise_forsaken_83173::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + +enum FallenHuman +{ + SPELL_FEIGNED = 80636, + SPELL_FORSAKEN_TROOPER_MS_COMETH = 83149, + + EVENT_ASCEND = 1, + EVENT_TRANSFORM_INTO_FORSAKEN = 2, + EVENT_FACE_TOWARDS_SYLVANAS = 3, + EVENT_EMOTE_TO_SYLVANAS = 4 +}; + +// Fallen Human - 44592, 44593 +struct npc_silverpine_fallen_human : public ScriptedAI +{ + npc_silverpine_fallen_human(Creature* creature) : ScriptedAI(creature), _transformDone(false) {} + + void Reset() override + { + _transformDone = false; + _events.Reset(); + } + + void DoAction(int32 action) override + { + switch (action) + { + case ACTION_RISE_DURING_RAISE: + me->SetAIAnimKitId(ANIMKIT_FALLEN_HUMAN); + _events.ScheduleEvent(EVENT_ASCEND, 1s); + break; + + case ACTION_DESCEND_AFTER_RAISE: + me->SetWalk(false); + me->SetAIAnimKitId(ANIMKIT_RESET); + me->GetMotionMaster()->MoveFall(); + _events.ScheduleEvent(EVENT_TRANSFORM_INTO_FORSAKEN, 1s); + break; + + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ASCEND: + me->SetWalk(true); + me->GetMotionMaster()->MovePoint(POINT_BEING_RISEN, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 3.5f, false); + break; + + case EVENT_TRANSFORM_INTO_FORSAKEN: + { + if (_transformDone) + return; + + DoCastSelf(SPELL_FORSAKEN_TROOPER_MS_COMETH); + + _transformDone = true; + + _events.ScheduleEvent(EVENT_FACE_TOWARDS_SYLVANAS, 1s + 500ms); + break; + } + + case EVENT_FACE_TOWARDS_SYLVANAS: + me->SetFacingTo(0.706837f); + _events.ScheduleEvent(EVENT_EMOTE_TO_SYLVANAS, 2s + 500ms); + break; + + case EVENT_EMOTE_TO_SYLVANAS: + me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + me->DespawnOrUnsummon(80s); + break; + + default: + break; + } + } + } + +private: + EventMap _events; + bool _transformDone; +}; + +enum SpellForsakenTrooperMasterScriptCometh +{ + SPELL_FORSAKEN_TROOPER_MALE_01_HC = 83150, + SPELL_FORSAKEN_TROOPER_MALE_02_HC = 83163, + SPELL_FORSAKEN_TROOPER_MALE_03_HC = 83164, + SPELL_FORSAKEN_TROOPER_MALE_04_HC = 83165, + SPELL_FORSAKEN_TROOPER_FEMALE_01_HC = 83152, + SPELL_FORSAKEN_TROOPER_FEMALE_02_HC = 83166, + SPELL_FORSAKEN_TROOPER_FEMALE_03_HC = 83167, + SPELL_FORSAKEN_TROOPER_FEMALE_04_HC = 83168, + + DISPLAY_MALE_01_HC = 33978, + DISPLAY_MALE_02_HC = 33980, + DISPLAY_MALE_03_HC = 33979, + DISPLAY_MALE_04_HC = 33981, + DISPLAY_FEMALE_01_HC = 33982, + DISPLAY_FEMALE_02_HC = 33983, + DISPLAY_FEMALE_03_HC = 33984, + DISPLAY_FEMALE_04_HC = 33985 +}; + +// Forsaken Trooper Master Script (Forsaken High Command) - 83149 +class spell_silverpine_forsaken_trooper_masterscript_high_command : public SpellScript +{ + PrepareSpellScript(spell_silverpine_forsaken_trooper_masterscript_high_command); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo + ({ + SPELL_FORSAKEN_TROOPER_MALE_01_HC, + SPELL_FORSAKEN_TROOPER_MALE_02_HC, + SPELL_FORSAKEN_TROOPER_MALE_03_HC, + SPELL_FORSAKEN_TROOPER_MALE_04_HC, + SPELL_FORSAKEN_TROOPER_FEMALE_01_HC, + SPELL_FORSAKEN_TROOPER_FEMALE_02_HC, + SPELL_FORSAKEN_TROOPER_FEMALE_03_HC, + SPELL_FORSAKEN_TROOPER_FEMALE_04_HC + }); + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + { + caster->RemoveAura(SPELL_FEIGNED); + + uint32 spellId = SPELL_FORSAKEN_TROOPER_MALE_01_HC; + switch (caster->GetDisplayId()) + { + case DISPLAY_MALE_01_HC: + spellId = SPELL_FORSAKEN_TROOPER_MALE_01_HC; + break; + case DISPLAY_MALE_02_HC: + spellId = SPELL_FORSAKEN_TROOPER_MALE_02_HC; + break; + case DISPLAY_MALE_03_HC: + spellId = SPELL_FORSAKEN_TROOPER_MALE_03_HC; + break; + case DISPLAY_MALE_04_HC: + spellId = SPELL_FORSAKEN_TROOPER_MALE_04_HC; + break; + case DISPLAY_FEMALE_01_HC: + spellId = SPELL_FORSAKEN_TROOPER_FEMALE_01_HC; + break; + case DISPLAY_FEMALE_02_HC: + spellId = SPELL_FORSAKEN_TROOPER_FEMALE_02_HC; + break; + case DISPLAY_FEMALE_03_HC: + spellId = SPELL_FORSAKEN_TROOPER_FEMALE_03_HC; + break; + case DISPLAY_FEMALE_04_HC: + spellId = SPELL_FORSAKEN_TROOPER_FEMALE_04_HC; + break; + default: + break; + } + caster->CastSpell(caster, spellId, true); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_silverpine_forsaken_trooper_masterscript_high_command::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +void AddSC_silverpine_forest() +{ + RegisterCreatureAI(npc_silverpine_grand_executor_mortuus); + RegisterSpellScript(spell_silverpine_raise_forsaken_83173); + RegisterCreatureAI(npc_silverpine_fallen_human); + RegisterSpellScript(spell_silverpine_forsaken_trooper_masterscript_high_command); +} |