diff options
author | Sorikoff <46191832+Sorikoff@users.noreply.github.com> | 2020-02-28 21:29:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 20:29:08 +0100 |
commit | 2b14b720da2bc38c84f373cb3ff4bcc24c1ddcf0 (patch) | |
tree | 3bba9f807a69ddd05f71c4b323bbf8fc09a19fd7 | |
parent | ffede34ba9a33364a34932487c3024e6e67935d1 (diff) |
Scripts/Ebon Hold: Bloody Breakout (#24126)
* Scripts/Ebon Hold: Bloody Breakout
* Scripts/Ebon Hold: Bloody Breakout (part 2)
* Improvements
* Fail quest
* Spacing
* Update 9999_99_99_99_world.sql
* Update 9999_99_99_99_world.sql
* Rename 9999_99_99_99_world.sql to 2020_02_28_04_world.sql
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
-rw-r--r-- | sql/updates/world/3.3.5/2020_02_28_04_world.sql | 93 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp | 509 |
2 files changed, 350 insertions, 252 deletions
diff --git a/sql/updates/world/3.3.5/2020_02_28_04_world.sql b/sql/updates/world/3.3.5/2020_02_28_04_world.sql new file mode 100644 index 00000000000..0de36ce22dd --- /dev/null +++ b/sql/updates/world/3.3.5/2020_02_28_04_world.sql @@ -0,0 +1,93 @@ +-- Koltira Deathweaver +DELETE FROM `creature_text` WHERE `CreatureID`=28912; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(28912,0,0,'Damn the Crusade! I think my ribs are broken and I might be bleeding internally.',12,0,100,1,0,0,29197,0,'Koltira Deathweaver'), +(28912,1,0,'I''ll need to get my runeblade and armor... Just need a little more time.',12,0,100,0,0,0,29201,0,'Koltira Deathweaver'), +(28912,2,0,'I''m still weak, but I think I can get an anti-magic barrier up. Stay inside it or you''ll be destroyed by their spells.',12,0,100,0,0,0,29203,0,'Koltira Deathweaver'), +(28912,3,0,'Maintaining this barrier will require all of my concentration. Kill them all!',12,0,100,0,0,0,29205,0,'Koltira Deathweaver'), +(28912,4,0,'There are more coming. Defend yourself! Don''t fall out of the anti-magic field! They''ll tear you apart without its protection!',12,0,100,0,0,0,29207,0,'Koltira Deathweaver'), +(28912,5,0,'I can''t keep this barrier up much longer... Where is that coward?',12,0,100,0,0,0,29208,0,'Koltira Deathweaver'), +(28912,6,0,'The High Inquisitor comes! Be ready, death knight! Do not let him draw you out of the protective bounds of my anti-magic field! Kill him and take his head!',12,0,100,0,0,0,29210,0,'Koltira Deathweaver'), +(28912,7,0,'Stay in the anti-magic field! Make them come to you!',12,0,100,0,0,0,29225,0,'Koltira Deathweaver'), +(28912,7,1,'Stand your ground! Use my anti-magic barrier to dampen their spells!',12,0,100,0,0,0,29224,0,'Koltira Deathweaver'), +(28912,8,0,'The death of the High Inquisitor of New Avalon will not go unnoticed. You need to get out of here at once! Go, before more of them show up. I''ll be fine on my own.',12,0,100,1,0,0,29239,0,'Koltira Deathweaver'), +(28912,9,0,'I''ll draw their fire, you make your escape behind me.',12,0,100,1,0,0,29240,0,'Koltira Deathweaver'), +(28912,10,0,'Your High Inquisitor is nothing more than a pile of meat, Crusaders! There are none beyond the grasp of the Scourge!',14,0,100,22,0,0,29241,0,'Koltira Deathweaver'); + +DELETE FROM `creature_summon_groups` WHERE `summonerId`=28912; +INSERT INTO `creature_summon_groups` (`summonerId`,`summonerType`,`groupId`,`entry`,`position_x`,`position_y`,`position_z`,`orientation`,`summonType`,`summonTime`) VALUES +(28912,0,0,29007,1640.672,-6032.053,134.8221,4.679538,6,5000), +(28912,0,0,29007,1641.005,-6031.893,134.8221,0.4014257,6,5000), +(28912,0,0,29007,1639.705,-6031.737,134.8221,2.443461,6,5000), +(28912,0,1,29007,1640.404,-6032.289,134.7387,4.517092,6,5000), +(28912,0,1,29007,1641.73,-6030.751,134.8221,6.143559,6,5000), +(28912,0,1,29007,1639.466,-6030.404,134.8221,4.502949,6,5000), +(28912,0,2,29007,1640.286,-6033.075,134.6049,4.679538,6,5000), +(28912,0,2,29007,1642.04,-6030.384,134.8221,1.37881,6,5000), +(28912,0,2,29007,1640.116,-6029.782,134.8221,5.707227,6,5000), +(28912,0,2,29007,1640.995,-6029.803,134.8221,1.605703,6,5000), +(28912,0,3,29001,1640.766,-6032.984,134.5805,4.596632,5,0); + +DELETE FROM `waypoint_data` WHERE `id`=28912; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `delay`, `action`, `orientation`, `action_chance`, `move_type`) VALUES +(28912,1,1640.65,-6032.49,134.739,0,0,0,100,1), +(28912,2,1639.1,-6028.1,134.739,0,0,0,100,1), +(28912,3,1628.37,-6026.34,134.739,0,0,0,100,1), +(28912,4,1625.79,-6021.81,134.739,0,0,0,100,1), +(28912,5,1627.06,-6016.95,134.739,0,0,0,100,1), +(28912,6,1639.85,-6015.64,134.74,0,0,0,100,1), +(28912,7,1653.376,-5971.874,132.2567,0,0,0,100,1), +(28912,8,1653.61,-5927.44,121.345,0,0,0,100,1), +(28912,9,1656.07,-5905.5,116.21,0,0,0,100,1), +(28912,10,1681.736,-5888.621,116.257,0,1188,0,100,1); +UPDATE `creature_addon` SET `bytes1`=0,`auras`='' WHERE `guid`=130354; +UPDATE `creature` SET `spawntimesecs`=60 WHERE `guid`=130354; + +DELETE FROM `creature_equip_template` WHERE `CreatureID`=28912; +INSERT INTO `creature_equip_template` (`CreatureID`, `ID`, `ItemID1`, `ItemID2`, `ItemID3`, `VerifiedBuild`) VALUES +(28912,1,38633,0,0,0); + +-- High Inquisitor Valroth +DELETE FROM `creature_text` WHERE `CreatureID`=29011; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(29011,0,0,'Acolytes, chain them all up! Prepare them for questioning!',14,0,100,1,0,0,29202,0,'High Inquisitor Valroth'), +(29011,1,0,'Scourge filth! By the Light be cleansed!',14,0,100,0,0,0,29214,0,'High Inquisitor Valroth'), +(29011,2,0,'The Crusade will purge your kind from this world!',14,0,100,0,0,0,29215,0,'High Inquisitor Valroth'), +(29011,3,0,'It seems that I''ll need to deal with you myself. The High Inquisitor comes for you, Scourge!',14,0,100,0,0,0,29216,0,'High Inquisitor Valroth'); + +DELETE FROM `creature_text` WHERE `CreatureID`=29001; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(29001,0,0,'Coward!',12,0,100,0,0,0,29219,0,'High Inquisitor Valroth'), +(29001,0,1,'Come out and play.',12,0,100,0,0,0,29220,0,'High Inquisitor Valroth'), +(29001,0,2,'LIGHT PURGE YOU!',12,0,100,1,0,0,29221,0,'High Inquisitor Valroth'), +(29001,0,3,'You have come seeking deliverance? I have come to deliver!',12,0,100,1,0,0,29222,0,'High Inquisitor Valroth'), +(29001,1,0,'%s''s remains fall to the ground.',41,0,100,1,0,0,29223,0,'High Inquisitor Valroth'); + +DELETE FROM `waypoints` WHERE `entry`=29001; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(29001,1,1639.495,-6043.913,128.2694,'High Inquisitor Valroth'), +(29001,2,1639.186,-6046.568,127.9465,'High Inquisitor Valroth'), +(29001,3,1648.31,-6043.64,127.5836,'High Inquisitor Valroth'); +UPDATE `creature_template` SET `ScriptName`='',`AIName`='SmartAI' WHERE `entry`=29001; +DELETE FROM `smart_scripts` WHERE `entryorguid`=29001 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(29001,0,0,0,54,0,100,0,0,0,0,0,0,53,1,29001,0,0,0,2,1,0,0,0,0,0,0,0,0,'High Inquisitor Valroth - On just summoned - Start WP'), +(29001,0,1,2,58,0,100,0,0,0,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'High Inquisitor Valroth - On WP ended - Remove unit flags'), +(29001,0,2,0,61,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,21,10,0,0,0,0,0,0,0,'High Inquisitor Valroth - Linked event - Attack start'), +(29001,0,3,0,0,0,100,0,0,40,3400,4700,0,11,52926,64,0,0,0,0,2,0,0,0,0,0,0,0,0,'High Inquisitor Valroth - IC CMC - Cast \'Valroth''s Smite\''), +(29001,0,4,5,24,0,100,0,52894,0,7000,12000,0,11,52922,64,0,0,0,0,2,0,0,0,0,0,0,0,0,'High Inquisitor Valroth - On target has \'Anti-Magic Zone\' aura - Cast \'The Inquisitor''s Penance\''), +(29001,0,5,0,61,0,50,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'High Inquisitor Valroth - Linked event - Say line 0'), +(29001,0,6,0,2,0,100,1,0,50,0,0,0,11,38210,64,0,0,0,0,1,0,0,0,0,0,0,0,0,'High Inquisitor Valroth - Between 0-50% HP - Cast \'Renew\' (No Repeat)'), +(29001,0,7,8,6,0,100,0,0,0,0,0,0,11,52929,2,0,0,0,0,1,0,0,0,0,0,0,0,0,'High Inquisitor Valroth - On just died - Cast \'Summon Valroth''s Remains\''), +(29001,0,8,0,61,0,100,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'High Inquisitor Valroth - Linked event - Say line 1'); + +-- Crimson Acolyte +DELETE FROM `smart_scripts` WHERE `entryorguid`=29007 AND `source_type`=0 AND `id` IN (3,4,5); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2900700,2900701,2900702) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(29007,0,3,0,54,0,100,0,0,0,0,0,0,88,2900700,2900701,2900702,0,0,0,1,0,0,0,0,0,0,0,0,'Crimson Acolyte - On just summoned - Random action list'), +(29007,0,4,5,34,0,100,0,8,1,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Crimson Acolyte - On movement inform - Remove unit flags'), +(29007,0,5,0,61,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,21,10,0,0,0,0,0,0,0,'Crimson Acolyte - Linked event - Attack start'), +(2900700,9,0,0,0,0,100,0,0,0,0,0,0,69,1,0,0,0,0,0,8,0,0,0,0,1649.966,-6042.571,127.5833,0,'Crimson Acolyte - Action list 0 - Move to position'), +(2900701,9,0,0,0,0,100,0,0,0,0,0,0,69,1,0,0,0,0,0,8,0,0,0,0,1642.704,-6045.236,127.8326,0,'Crimson Acolyte - Action list 1 - Move to position'), +(2900702,9,0,0,0,0,100,0,0,0,0,0,0,69,1,0,0,0,0,0,8,0,0,0,0,1641.506,-6045.676,127.9491,0,'Crimson Acolyte - Action list 2 - Move to position'); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 74453afba24..f7761ab7eee 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -15,214 +15,315 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "ScriptedGossip.h" #include "ScriptMgr.h" -#include "CreatureTextMgr.h" #include "GameObject.h" #include "MotionMaster.h" #include "ObjectAccessor.h" #include "Player.h" #include "ScriptedEscortAI.h" -#include "SpellInfo.h" #include "SpellScript.h" -/*###### -## npc_koltira_deathweaver -######*/ +enum BloodyBreakoutTexts +{ + SAY_KOLTIRA_0 = 0, + SAY_KOLTIRA_1 = 1, + SAY_KOLTIRA_2 = 2, + SAY_KOLTIRA_3 = 3, + SAY_KOLTIRA_4 = 4, + SAY_KOLTIRA_5 = 5, + SAY_KOLTIRA_6 = 6, + SAY_KOLTIRA_7 = 7, + SAY_KOLTIRA_8 = 8, + SAY_KOLTIRA_9 = 9, + SAY_KOLTIRA_10 = 10, + + SAY_VALROTH_0 = 0, + SAY_VALROTH_1 = 1, + SAY_VALROTH_2 = 2, + SAY_VALROTH_3 = 3, + + TEXT_ID_EVENT = 13425 +}; -enum Koltira +enum BloodyBreakoutEvents { - SAY_BREAKOUT1 = 0, - SAY_BREAKOUT2 = 1, - SAY_BREAKOUT3 = 2, - SAY_BREAKOUT4 = 3, - SAY_BREAKOUT5 = 4, - SAY_BREAKOUT6 = 5, - SAY_BREAKOUT7 = 6, - SAY_BREAKOUT8 = 7, - SAY_BREAKOUT9 = 8, - SAY_BREAKOUT10 = 9, - - SPELL_KOLTIRA_TRANSFORM = 52899, - SPELL_ANTI_MAGIC_ZONE = 52894, - - QUEST_BREAKOUT = 12727, - - NPC_CRIMSON_ACOLYTE = 29007, - NPC_HIGH_INQUISITOR_VALROTH = 29001, - - //not sure about this id - //NPC_DEATH_KNIGHT_MOUNT = 29201, - MODEL_DEATH_KNIGHT_MOUNT = 25278 + EVENT_INTRO_0 = 1, + EVENT_INTRO_1 = 2, + EVENT_INTRO_2 = 3, + EVENT_INTRO_3 = 4, + EVENT_INTRO_4 = 5, + EVENT_INTRO_5 = 6, + EVENT_INTRO_6 = 7, + + EVENT_SPAWN_WAVE_1 = 8, + EVENT_SPAWN_WAVE_2 = 9, + EVENT_SPAWN_WAVE_3 = 10, + EVENT_SPAWN_VALROTH = 11, + + EVENT_KOLTIRA_ADVICE = 12, + EVENT_OUTRO_1 = 13, + EVENT_OUTRO_2 = 14, + EVENT_OUTRO_3 = 15, + EVENT_OUTRO_4 = 16, + + EVENT_CHECK_PLAYER = 17 }; -class npc_koltira_deathweaver : public CreatureScript +enum BloodyBreakout { -public: - npc_koltira_deathweaver() : CreatureScript("npc_koltira_deathweaver") { } + POINT_ID_1 = 1, + POINT_ID_2 = 2, + POINT_ID_6 = 6, + POINT_ID_10 = 10, + + SUMMON_ACOLYTES_0 = 0, + SUMMON_ACOLYTES_1 = 1, + SUMMON_ACOLYTES_2 = 2, + SUMMON_VALROTH = 3, + + QUEST_BLOODY_BREAKOUT = 12727, + + NPC_FAKE_VALROTH = 29011, + NPC_VALROTH = 29001, + NPC_ACOLYTE = 29007, + NPC_KOLTIRA = 28912, + NPC_KOLTIRA_MOUNT = 25445, + + SPELL_KOLTIRA_TRANSFORM = 52899, + SPELL_ANTI_MAGIC_ZONE = 52894, + SPELL_HERO_AGGRO = 53627 +}; + +Position const koltiraPos[3] = +{ + { 1653.36f, -6038.34f, 127.584f }, + { 1653.765f, -6035.075f, 127.5844f }, + { 1651.89f, -6037.101f, 127.5844f } +}; - struct npc_koltira_deathweaverAI : public EscortAI +struct npc_koltira_deathweaver : public ScriptedAI +{ + npc_koltira_deathweaver(Creature* creature) : ScriptedAI(creature), _summons(me) { - npc_koltira_deathweaverAI(Creature* creature) : EscortAI(creature) - { - Initialize(); - me->SetReactState(REACT_DEFENSIVE); - } + } - void Initialize() + bool GossipHello(Player* player) override + { + ObjectGuid const guid = me->GetGUID(); + _playerGUID = player->GetGUID(); + + if (me->IsQuestGiver()) + player->PrepareQuestMenu(guid); + + // override default gossip + if (_eventGossip) { - wave = 0; - waveTimer = 3000; - valrothGUID.Clear(); + SendGossipMenuFor(player, TEXT_ID_EVENT, guid); + return true; } - void Reset() override + return false; + } + + void QuestAccept(Player* /* player */, Quest const* quest) override + { + if (quest->GetQuestId() == QUEST_BLOODY_BREAKOUT) { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - { - Initialize(); - me->LoadEquipment(0, true); - me->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); - me->RemoveAurasDueToSpell(SPELL_KOLTIRA_TRANSFORM); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } + _events.ScheduleEvent(EVENT_INTRO_0, 500ms); + _events.ScheduleEvent(EVENT_CHECK_PLAYER, 5s); } + } + + void Reset() override + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_DEAD); + me->RemoveAllAuras(); + + _events.Reset(); + _summons.DespawnAll(); + _playerGUID.Clear(); + _eventGossip = false; + } - void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override + void FakeValrothTalk(uint32 id) + { + if (Creature* fakeValroth = me->FindNearestCreature(NPC_FAKE_VALROTH, INSPECT_DISTANCE * 2)) + fakeValroth->AI()->Talk(id); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) { - switch (waypointId) + switch (eventId) { - case 0: - Talk(SAY_BREAKOUT1); + case EVENT_INTRO_0: + me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_SIT); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Talk(SAY_KOLTIRA_0); + + _events.ScheduleEvent(EVENT_INTRO_1, 5s); + break; + case EVENT_INTRO_1: + me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_STAND); + Talk(SAY_KOLTIRA_1); + + _events.ScheduleEvent(EVENT_INTRO_2, 2s); break; - case 1: - me->SetStandState(UNIT_STAND_STATE_KNEEL); + case EVENT_INTRO_2: + me->GetMotionMaster()->MoveJump(koltiraPos[0], 25.0f, 15.0f); + + _events.ScheduleEvent(EVENT_INTRO_3, 2s); break; - case 2: - me->SetStandState(UNIT_STAND_STATE_STAND); - DoCast(me, SPELL_KOLTIRA_TRANSFORM); - me->LoadEquipment(); + + case EVENT_INTRO_3: + me->SetWalk(true); + me->GetMotionMaster()->MovePoint(POINT_ID_1, koltiraPos[1]); + break; - case 3: - SetEscortPaused(true); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - Talk(SAY_BREAKOUT2); - DoCast(me, SPELL_ANTI_MAGIC_ZONE); + case EVENT_INTRO_4: + DoCastSelf(SPELL_KOLTIRA_TRANSFORM); + me->LoadEquipment(POINT_ID_1); + me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_STAND); + me->GetMotionMaster()->MovePoint(POINT_ID_2, koltiraPos[2], true, 3.839724f); + break; - case 4: - SetRun(true); + case EVENT_INTRO_5: + Talk(SAY_KOLTIRA_2); + DoCastSelf(SPELL_ANTI_MAGIC_ZONE); + + _events.ScheduleEvent(EVENT_INTRO_6, 4s); break; - case 9: - me->Mount(MODEL_DEATH_KNIGHT_MOUNT); + case EVENT_INTRO_6: + Talk(SAY_KOLTIRA_3); + me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_KNEEL); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + _eventGossip = true; + break; - case 10: - me->Dismount(); + case EVENT_SPAWN_WAVE_1: + me->SummonCreatureGroup(SUMMON_ACOLYTES_0); + + _events.ScheduleEvent(EVENT_SPAWN_WAVE_2, 29s); break; - } - } + case EVENT_SPAWN_WAVE_2: + Talk(SAY_KOLTIRA_4); + FakeValrothTalk(SAY_VALROTH_1); + me->SummonCreatureGroup(SUMMON_ACOLYTES_1); - void JustSummoned(Creature* summoned) override - { - if (Player* player = GetPlayerForEscort()) - summoned->AI()->AttackStart(player); + _events.ScheduleEvent(EVENT_SPAWN_WAVE_3, 21s); + break; + case EVENT_SPAWN_WAVE_3: + Talk(SAY_KOLTIRA_5); + FakeValrothTalk(SAY_VALROTH_2); + me->SummonCreatureGroup(SUMMON_ACOLYTES_2); - if (summoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) - valrothGUID = summoned->GetGUID(); + _events.ScheduleEvent(EVENT_SPAWN_VALROTH, 24s); + break; + case EVENT_SPAWN_VALROTH: + Talk(SAY_KOLTIRA_6); + FakeValrothTalk(SAY_VALROTH_3); + me->SummonCreatureGroup(SUMMON_VALROTH); - summoned->SetImmuneToPC(false); - } + _events.ScheduleEvent(EVENT_KOLTIRA_ADVICE, 8s, 16s); + break; + case EVENT_KOLTIRA_ADVICE: + if (_summons.HasEntry(NPC_VALROTH)) + Talk(SAY_KOLTIRA_7); - void SummonAcolyte(uint32 uiAmount) - { - for (uint32 i = 0; i < uiAmount; ++i) - me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1642.329f, -6045.818f, 127.583f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - } + break; + case EVENT_OUTRO_1: + me->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); + me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_STAND); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Talk(SAY_KOLTIRA_8); + + _events.ScheduleEvent(EVENT_OUTRO_2, 7s); + _events.CancelEvent(EVENT_CHECK_PLAYER); + break; + case EVENT_OUTRO_2: + Talk(SAY_KOLTIRA_9); - void UpdateAI(uint32 uiDiff) override - { - EscortAI::UpdateAI(uiDiff); + _events.ScheduleEvent(EVENT_OUTRO_3, 4s); + break; + case EVENT_OUTRO_3: + Talk(SAY_KOLTIRA_10); - if (HasEscortState(STATE_ESCORT_PAUSED)) - { - if (waveTimer <= uiDiff) - { - switch (wave) + _events.ScheduleEvent(EVENT_OUTRO_4, 3s); + break; + case EVENT_OUTRO_4: + me->SetWalk(false); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); + DoCastSelf(SPELL_HERO_AGGRO); + me->GetMotionMaster()->MovePath(NPC_KOLTIRA, false); + + break; + case EVENT_CHECK_PLAYER: + if (!_playerGUID) + return; + + if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID)) { - case 0: - Talk(SAY_BREAKOUT3); - SummonAcolyte(3); - waveTimer = 20000; - break; - case 1: - Talk(SAY_BREAKOUT4); - SummonAcolyte(3); - waveTimer = 20000; - break; - case 2: - Talk(SAY_BREAKOUT5); - SummonAcolyte(4); - waveTimer = 20000; - break; - case 3: - Talk(SAY_BREAKOUT6); - me->SummonCreature(NPC_HIGH_INQUISITOR_VALROTH, 1642.329f, -6045.818f, 127.583f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - waveTimer = 1000; - break; - case 4: + if (!player->IsAlive() || !player->IsWithinDist(me, INTERACTION_DISTANCE * 6)) { - Creature* temp = ObjectAccessor::GetCreature(*me, valrothGUID); - - if (!temp || !temp->IsAlive()) - { - Talk(SAY_BREAKOUT8); - waveTimer = 5000; - } - else - { - waveTimer = 2500; - return; - } - break; + _summons.DespawnAll(); + me->DespawnOrUnsummon(1s); + player->FailQuest(QUEST_BLOODY_BREAKOUT); } - case 5: - Talk(SAY_BREAKOUT9); - me->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - waveTimer = 2500; - break; - case 6: - Talk(SAY_BREAKOUT10); - SetEscortPaused(false); - break; } - ++wave; - } - else - waveTimer -= uiDiff; + _events.ScheduleEvent(EVENT_CHECK_PLAYER, 5s); + break; } } + } - void QuestAccept(Player* player, Quest const* quest) override + void MovementInform(uint32 type, uint32 pointId) override + { + if (type == POINT_MOTION_TYPE) { - if (quest->GetQuestId() == QUEST_BREAKOUT) + if (pointId == POINT_ID_1) { - me->SetStandState(UNIT_STAND_STATE_STAND); - Start(false, false, player->GetGUID()); + me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_KNEEL); + FakeValrothTalk(SAY_VALROTH_0); + + _events.ScheduleEvent(EVENT_SPAWN_WAVE_1, 1s); + _events.ScheduleEvent(EVENT_INTRO_4, 3s); } + else if (pointId == POINT_ID_2) + _events.ScheduleEvent(EVENT_INTRO_5, 1s); } + else + { + if (pointId == POINT_ID_6) + me->Mount(NPC_KOLTIRA_MOUNT); + } + } - private: - uint8 wave; - uint32 waveTimer; - ObjectGuid valrothGUID; - - }; + void JustSummoned(Creature* summon) override + { + _summons.Summon(summon); + } - CreatureAI* GetAI(Creature* creature) const override + void SummonedCreatureDespawn(Creature* summon) override { - return new npc_koltira_deathweaverAI(creature); + if (summon->GetEntry() == NPC_VALROTH) + _events.ScheduleEvent(EVENT_OUTRO_1, 1s); + + _summons.Despawn(summon); } + +private: + EventMap _events; + SummonList _summons; + ObjectGuid _playerGUID; + + bool _eventGossip; }; //Scarlet courier @@ -321,101 +422,6 @@ public: }; -//Koltira & Valroth- Breakout - -enum valroth -{ - //SAY_VALROTH1 = 0, Unused - SAY_VALROTH_AGGRO = 1, - SAY_VALROTH_RAND = 2, - SAY_VALROTH_DEATH = 3, - SPELL_RENEW = 38210, - SPELL_INQUISITOR_PENANCE = 52922, - SPELL_VALROTH_SMITE = 52926, - SPELL_SUMMON_VALROTH_REMAINS = 52929 -}; - -class npc_high_inquisitor_valroth : public CreatureScript -{ -public: - npc_high_inquisitor_valroth() : CreatureScript("npc_high_inquisitor_valroth") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_high_inquisitor_valrothAI(creature); - } - - struct npc_high_inquisitor_valrothAI : public ScriptedAI - { - npc_high_inquisitor_valrothAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } - - void Initialize() - { - uiRenew_timer = 1000; - uiInquisitor_Penance_timer = 2000; - uiValroth_Smite_timer = 1000; - } - - uint32 uiRenew_timer; - uint32 uiInquisitor_Penance_timer; - uint32 uiValroth_Smite_timer; - - void Reset() override - { - Initialize(); - } - - void JustEngagedWith(Unit* who) override - { - Talk(SAY_VALROTH_AGGRO); - DoCast(who, SPELL_VALROTH_SMITE); - } - - void UpdateAI(uint32 diff) override - { - if (uiRenew_timer <= diff) - { - Shout(); - DoCast(me, SPELL_RENEW); - uiRenew_timer = urand(1000, 6000); - } else uiRenew_timer -= diff; - - if (uiInquisitor_Penance_timer <= diff) - { - Shout(); - DoCastVictim(SPELL_INQUISITOR_PENANCE); - uiInquisitor_Penance_timer = urand(2000, 7000); - } else uiInquisitor_Penance_timer -= diff; - - if (uiValroth_Smite_timer <= diff) - { - Shout(); - DoCastVictim(SPELL_VALROTH_SMITE); - uiValroth_Smite_timer = urand(1000, 6000); - } else uiValroth_Smite_timer -= diff; - - DoMeleeAttackIfReady(); - } - - void Shout() - { - if (rand32() % 100 < 15) - Talk(SAY_VALROTH_RAND); - } - - void JustDied(Unit* killer) override - { - Talk(SAY_VALROTH_DEATH); - if (killer) - killer->CastSpell(me, SPELL_SUMMON_VALROTH_REMAINS, true); - } - }; - -}; - /*###### ## npc_a_special_surprise ######*/ @@ -621,9 +627,8 @@ class spell_death_knight_devour_humanoid : public SpellScript void AddSC_the_scarlet_enclave_c2() { + RegisterCreatureAI(npc_koltira_deathweaver); new npc_scarlet_courier(); - new npc_koltira_deathweaver(); - new npc_high_inquisitor_valroth(); new npc_a_special_surprise(); RegisterSpellScript(spell_death_knight_devour_humanoid); } |