diff options
-rw-r--r-- | sql/updates/auth/2014_12_21_00_auth.sql (renamed from sql/updates/auth/2014_12_16_00_auth.sql) | 0 | ||||
-rw-r--r-- | sql/updates/world/2014_12_16_00_world.sql | 60 | ||||
-rw-r--r-- | sql/updates/world/2014_12_17_00_world.sql | 23 | ||||
-rw-r--r-- | sql/updates/world/2014_12_18_00_world.sql | 2 | ||||
-rw-r--r-- | src/server/game/Handlers/TradeHandler.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp | 104 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp | 45 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Naxxramas/naxxramas.h | 32 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp | 1 |
10 files changed, 214 insertions, 61 deletions
diff --git a/sql/updates/auth/2014_12_16_00_auth.sql b/sql/updates/auth/2014_12_21_00_auth.sql index ddea3d335ff..ddea3d335ff 100644 --- a/sql/updates/auth/2014_12_16_00_auth.sql +++ b/sql/updates/auth/2014_12_21_00_auth.sql diff --git a/sql/updates/world/2014_12_16_00_world.sql b/sql/updates/world/2014_12_16_00_world.sql new file mode 100644 index 00000000000..b67691cee8d --- /dev/null +++ b/sql/updates/world/2014_12_16_00_world.sql @@ -0,0 +1,60 @@ +DELETE FROM `creature_text` WHERE `entry` IN(33662,33701,33626,33686,33696); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES +(33662, 0, 0, 'Any luck?', 12, 0, 100, 0, 0, 0, 34184, 'Kirin Tor Battle-Mage to Player'), +(33662, 1, 0, 'Keep at it. If our suspicions are right and this is a transporter, it could prove extremely useful in our assault.', 12, 0, 100, 0, 0, 0, 34186, 'Kirin Tor Battle-Mage to Player'), +(33701, 0, 0, 'I heard a story or two of a Lore Keeper in Uldaman that fit your description. Do you serve a similar purpose?', 12, 0, 100, 0, 0, 0, 33702, 'High Explorer Dellorah to Player'), +(33701, 1, 0, 'Frontal defense systems? Is there something I should let Brann know before he has anyone attempt to enter the complex?', 12, 0, 100, 0, 0, 0, 33704, 'High Explorer Dellorah to Player'), +(33701, 2, 0, 'Can you detail the nature of these defense systems?', 12, 0, 100, 0, 0, 0, 33706, 'High Explorer Dellorah to Player'), +(33701, 3, 0, 'Got it. At least we don''t have to deal with those orbital emplacements.', 12, 0, 100, 0, 0, 0, 33708, 'High Explorer Dellorah to Player'), +(33701, 4, 0, 'Rhydian, make sure you let Brann and Archmage Pentarus know about those defenses immediately.', 12, 0, 100, 0, 0, 0, 33709, 'High Explorer Dellorah to Player'), +(33701, 5, 0, 'And you mentioned an imprisoned entity? What is the nature of this entity and what is its status?', 12, 0, 100, 0, 0, 0, 33710, 'High Explorer Dellorah to Player'), +(33701, 6, 0, 'Yogg-Saron is here? It sounds like we really will have our hands full then.', 12, 0, 100, 0, 0, 0, 33713, 'High Explorer Dellorah to Player'), +(33626, 0, 0, 'Not a bit. For the life of me, I can''t figure out how this thing works.', 12, 0, 100, 0, 0, 0, 34183, 'Hired Engineer to Player'), +(33626, 1, 0, 'I know, I know... I haven''t given up yet. Don''t get your hopes up though, this technology is way beyond me.', 12, 0, 100, 0, 0, 0, 34187, 'Hired Engineer to Player'), +(33686, 0, 0, 'I was constructed to serve as a repository for essential information regarding this complex. My primary functions include communicating the status of the frontal defense systems and assessing the status of the entity that this complex was built to imprison.', 12, 0, 100, 0, 0, 0, 33703, 'Lore Keeper of Norgannon to Player'), +(33686, 1, 0, 'Compromise of complex detected, security override enabled - query permitted.', 12, 0, 100, 0, 0, 0, 33707, 'Lore Keeper of Norgannon to Player'), +(33686, 2, 0, 'Primary defensive emplacements consist of iron constructs and Storm Beacons, which will generate additional constructs as necessary. Secondary systems consist of orbital defense emplacements.', 12, 0, 100, 0, 0, 0, 33712, 'Lore Keeper of Norgannon to Player'), +(33686, 3, 0, 'Entity designate: Yogg-Saron. Security has been compromised. Prison operational status unknown. Unable to contact Watchers for notification purposes.', 12, 0, 100, 0, 0, 0, 33711, 'Lore Keeper of Norgannon to Player'), +(33696, 0, 0, '%s nods.', 16, 0, 100, 0, 0, 0, 33715, 'Archmage Rhydian to Player'), +(33696, 1, 0, '%s whispers something to Brann.', 16, 0, 100, 0, 0, 0, 33716, 'Archmage Rhydian to Player'); + +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(33662,33701,33696); +DELETE FROM `smart_scripts` WHERE `entryorguid`IN(33696,33701,-136527) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`IN(3369600,3370100) 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`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(-136527,0,0,0,10,0,100,0,1,40,90000,120000,80,3369600,2,0,0,0,0,1,0,0,0,0,0,0,0,'Kirin Tor Battle-Mage - OOC Los - Run Script'), +(33701,0,0,0,10,0,100,1,1,40,30000,60000,80,3370100,2,0,0,0,0,1,0,0,0,0,0,0,0,'High Explorer Dellorah - OOC Los - Run Script (No repeat)'), +(33696,0,0,0,38,0,100,0,1,1,0,0,1,0,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Archmage Rhydian - On Data Set - Say Line 0'), +(33696,0,1,0,52,0,100,0,0,33696,0,0,53,1,33696,0,0,0,0,1,0,0,0,0,0,0,0,'Archmage Rhydian - On Text Over (Line 0) - Start WP'), +(33696,0,2,3,40,0,100,0,8,33696,0,0,54,8000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archmage Rhydian - On Reached WP8 - Pause WP'), +(33696,0,3,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archmage Rhydian - On Reached WP8 - Say Line 1'), +(33696,0,4,0,40,0,100,0,10,33696,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.916666,'Archmage Rhydian - On Reached WP10 - Set Orientation'), +(3369600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kirin Tor Battle-Mage - Script - Say Line 0'), +(3369600, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 33626, 0, 0, 0, 0, 0, 0, 'Kirin Tor Battle-Mage - Script - Say Line 0 (Hired Engineer)'), +(3369600, 9, 2, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kirin Tor Battle-Mage - Script - Say Line 1'), +(3369600, 9, 3, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 33626, 0, 0, 0, 0, 0, 0, 'Kirin Tor Battle-Mage - Script - Say Line 1 (Hired Engineer)'), +(3370100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 0'), +(3370100, 9, 1, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 33686, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 0 (Lore Keeper of Norgannon)'), +(3370100, 9, 2, 0, 0, 0, 100, 0, 13000, 13000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 1'), +(3370100, 9, 3, 0, 0, 0, 100, 0, 11000, 11000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 2'), +(3370100, 9, 4, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, 33686, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 1 (Lore Keeper of Norgannon)'), +(3370100, 9, 5, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, 33686, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 2 (Lore Keeper of Norgannon)'), +(3370100, 9, 6, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 3'), +(3370100, 9, 7, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 4'), +(3370100, 9, 8, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 5'), +(3370100, 9, 9, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 33696, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Set Data to Archmage Rhydian'), +(3370100, 9, 10, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 19, 33686 , 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 3 (Lore Keeper of Norgannon)'), +(3370100, 9, 11, 0, 0, 0, 100, 0, 13000, 13000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Explorer Dellorah - Script - Say Line 6'); + +DELETE FROM `waypoints` WHERE `entry`=33696; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(33696, 1, -769.512 ,-120.8109 ,429.5509, 'Archmage Rhydian'), +(33696, 2, -769.1432 ,-104.0848 ,429.8661, 'Archmage Rhydian'), +(33696, 3, -763.0945 ,-86.176 ,429.9557, 'Archmage Rhydian'), +(33696, 4, -755.0403 ,-68.30566 ,429.9557, 'Archmage Rhydian'), +(33696, 5, -746.3733 ,-54.03885 ,429.9657, 'Archmage Rhydian'), +(33696, 6, -738.9852 ,-49.87864 ,429.9657, 'Archmage Rhydian'), +(33696, 7, -729.1484 ,-49.88547 ,429.9657, 'Archmage Rhydian'), +(33696, 8, -718.4777 ,-52.54433 ,429.8407, 'Archmage Rhydian'), +(33696, 9, -768.5124 ,-112.0747 ,429.8398, 'Archmage Rhydian'), +(33696, 10, -773.566 ,-144.6838 ,429.9191, 'Archmage Rhydian'); diff --git a/sql/updates/world/2014_12_17_00_world.sql b/sql/updates/world/2014_12_17_00_world.sql new file mode 100644 index 00000000000..fd1e88f9c1a --- /dev/null +++ b/sql/updates/world/2014_12_17_00_world.sql @@ -0,0 +1,23 @@ +-- +UPDATE `creature_text` SET `TextRange` = 3 WHERE `entry` = 15990 AND `groupid` IN (0, 2, 4); +DELETE FROM `creature_text` WHERE `entry` = 15990 AND `groupid` IN (13, 20); +DELETE FROM `creature_text` WHERE `entry` = 16980 AND `groupid` IN (1, 2, 3); +DELETE FROM `creature_text` WHERE `entry` = 15384 AND `groupid` = 0; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `TextRange`, `comment`) VALUES +(15990, 20, 0, 'Come, heroes... By the will of the Lich King, you shall be destroyed.', 14, 0, 100, 0, 0, 0, 12993, 3, 'Kel''Thuzad SAY_DIALOGUE_SAPPHIRON_KELTHUZAD4'), +(15990, 13, 0, 'Kel''Thuzad strikes!', 41, 0, 100, 0, 0, 0, 32803, 0, 'Kel''Thuzad EMOTE_PHASE_TWO'), +(16980, 1, 0, 'Soon we will eradicate the Alliance and Horde. Then the rest of Azeroth will fall before the might of my army.', 14, 0, 100, 0, 0, 14768, 12988, 3, 'The Lich King SAY_DIALOGUE_SAPPHIRON_LICHKING'), +(16980, 2, 0, 'Invaders... here?! DESTROY them, Kel''Thuzad! Naxxramas must not fall!', 14, 0, 100, 0, 0, 14769, 12989, 3, 'The Lich King SAY_DIALOGUE_SAPPHIRON_LICHKING2'), +(16980, 3, 0, 'Very well. Warriors of the frozen wastes, rise up! I command you to fight, kill and die for your master! Let none survive!', 14, 0, 100, 0, 0, 14770, 12994, 3, 'The Lich King SAY_ANSWER_REQUEST'), +(15384, 0, 0, 'A Guardian of Icecrown enters the fight!', 41, 0, 100, 0, 0, 0, 32804, 0, 'OLDWorld Trigger (DO NOT DELETE)'); + +-- Spawn some missing triggers and the Lich King dummy. Triggers are used to emote when a Guardian of Icecrown is spawned, currently not implemented. +SET @CGUID = 75082; +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+5; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@CGUID+0, 16980, 533, 3, 1, 3762.382, -5115.862, 143.9382, 0.1919862, 7200, 0, 0), -- 16980 (Area: -1) +(@CGUID+1, 15384, 533, 3, 1, 3759.62, -5172.786, 143.8345, 5.148721, 7200, 0, 0), -- 15384 (Area: -1) +(@CGUID+2, 15384, 533, 3, 1, 3716.097, -5106.208, 141.373, 4.939282, 7200, 0, 0), -- 15384 (Area: -1) +(@CGUID+3, 15384, 533, 3, 1, 3777.213, -5066.177, 143.6412, 1.53589, 7200, 0, 0), -- 15384 (Area: -1) +(@CGUID+4, 15384, 533, 3, 1, 3732.598, -5028.03, 144.0342, 5.951573, 7200, 0, 0), -- 15384 (Area: -1) +(@CGUID+5, 15384, 533, 3, 1, 3700.7, -5182.372, 143.9172, 3.525565, 7200, 0, 0); -- 15384 (Area: -1) diff --git a/sql/updates/world/2014_12_18_00_world.sql b/sql/updates/world/2014_12_18_00_world.sql new file mode 100644 index 00000000000..18ab9f47256 --- /dev/null +++ b/sql/updates/world/2014_12_18_00_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `unit_flags`=0 WHERE `entry`=21004; diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 140c961bc03..8949b161e7b 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -678,7 +678,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) if (pOther->GetTeam() != _player->GetTeam() && (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) && - !GetPlayer()->GetSession()->HasPermission(rbac::RBAC_PERM_ALLOW_TWO_SIDE_TRADE))) + !GetPlayer()->GetSession()->HasPermission(rbac::RBAC_PERM_ALLOW_TWO_SIDE_TRADE))) { info.Status = TRADE_STATUS_WRONG_FACTION; SendTradeStatus(info); diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 2e859a7a56f..33d93ee1384 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -56,12 +56,12 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature) Trinity::NormalizeMapCoord(destX); Trinity::NormalizeMapCoord(destY); - travelDistZ = distanceX*distanceX + distanceY*distanceY; + travelDistZ = range; // sin^2+cos^2=1, so travelDistZ=range^2; no need for sqrt below if (is_air_ok) // 3D system above ground and above water (flying mode) { // Limit height change - const float distanceZ = float(rand_norm()) * std::sqrt(travelDistZ)/2.0f; + const float distanceZ = float(rand_norm()) * travelDistZ/2.0f; destZ = respZ + distanceZ; float levelZ = map->GetWaterOrGroundLevel(destX, destY, destZ-2.0f); @@ -73,7 +73,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature) else // 2D only { // 10.0 is the max that vmap high can check (MAX_CAN_FALL_DISTANCE) - travelDistZ = travelDistZ >= 100.0f ? 10.0f : std::sqrt(travelDistZ); + travelDistZ = travelDistZ >= 10.0f ? 10.0f : travelDistZ; // The fastest way to get an accurate result 90% of the time. // Better result can be obtained like 99% accuracy with a ray light, but the cost is too high and the code is too long. diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 6ceeb92a687..7292850bef1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -30,24 +30,23 @@ EndScriptData */ #include "naxxramas.h" #include "Player.h" -enum Yells +enum Texts { - //when shappiron dies. dialog between kel and lich king (in this order) - SAY_SAPP_DIALOG1 = 0, //not used - SAY_SAPP_DIALOG2_LICH = 1, //not used - SAY_SAPP_DIALOG3 = 2, //not used - SAY_SAPP_DIALOG4_LICH = 3, //not used - SAY_SAPP_DIALOG5 = 4, //not used - SAY_AGGRO = 7, SAY_SLAY = 8, SAY_DEATH = 9, SAY_CHAIN = 10, SAY_FROST_BLAST = 11, SAY_REQUEST_AID = 12, //start of phase 3 - SAY_ANSWER_REQUEST = 13, //lich king answer + EMOTE_PHASE_TWO = 13, SAY_SUMMON_MINIONS = 14, //start of phase 1 - SAY_SPECIAL = 15 + SAY_SPECIAL = 15, + + // The Lich King + SAY_ANSWER_REQUEST = 3, + + // Old World Trigger + SAY_GUARDIAN_SPAWNED = 0 }; enum Events @@ -68,7 +67,10 @@ enum Events EVENT_TRIGGER, EVENT_PHASE, - EVENT_MORTAL_WOUND + EVENT_MORTAL_WOUND, + + EVENT_ANSWER_REQUEST, + EVENT_SUMMON_GUARDIANS }; enum Spells @@ -121,6 +123,13 @@ enum Spells SPELL_MORTAL_WOUND = 28467 }; +enum Phases +{ + PHASE_ONE = 1, // Players move in the circle and Kel'Thuzad spawns his minions. + PHASE_TWO = 2, // Starts on a timer. + PHASE_THREE = 3 // At 45% health. +}; + enum Creatures { NPC_WASTE = 16427, // Soldiers of the Frozen Wastes @@ -268,15 +277,11 @@ public: void Initialize() { nGuardiansOfIcecrownCount = 0; - uiGuardiansOfIcecrownTimer = 5000; // 5 seconds for summoning each Guardian of Icecrown in phase 3 - Phase = 0; nAbomination = 0; nWeaver = 0; } - uint32 Phase; - uint32 uiGuardiansOfIcecrownTimer; uint32 uiFaction; uint8 nGuardiansOfIcecrownCount; @@ -343,7 +348,6 @@ public: void EnterCombat(Unit* /*who*/) override { me->setFaction(uiFaction); - _EnterCombat(); for (uint8 i = 0; i <= 3; ++i) { @@ -352,10 +356,10 @@ public: } DoCast(me, SPELL_KELTHUZAD_CHANNEL, false); Talk(SAY_SUMMON_MINIONS); - Phase = 1; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE); me->SetFloatValue(UNIT_FIELD_COMBATREACH, 4); me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 4); + events.SetPhase(PHASE_ONE); events.ScheduleEvent(EVENT_TRIGGER, 5000); events.ScheduleEvent(EVENT_WASTE, 15000); events.ScheduleEvent(EVENT_ABOMIN, 30000); @@ -363,6 +367,23 @@ public: events.ScheduleEvent(EVENT_PHASE, 228000); } + void DamageTaken(Unit* /*attacker*/, uint32& damage) override + { + if (events.IsInPhase(PHASE_TWO) && me->HealthBelowPctDamaged(45, damage)) + { + Talk(SAY_REQUEST_AID); + events.SetPhase(PHASE_THREE); + events.ScheduleEvent(EVENT_ANSWER_REQUEST, 4000); + + for (uint8 i = 0; i <= 3; ++i) + { + if (GameObject* portal = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_KELTHUZAD_PORTAL01 + i))) + if (portal->getLootState() == GO_READY) + portal->UseDoorOrButton(); + } + } + } + void UpdateAI(uint32 diff) override { if (!UpdateVictim()) @@ -370,7 +391,7 @@ public: events.Update(diff); - if (Phase == 1) + if (events.IsInPhase(PHASE_ONE)) { while (uint32 eventId = events.ExecuteEvent()) { @@ -403,6 +424,7 @@ public: case EVENT_PHASE: events.Reset(); Talk(SAY_AGGRO); + Talk(EMOTE_PHASE_TWO); spawns.DespawnAll(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE); me->CastStop(); @@ -415,7 +437,7 @@ public: events.ScheduleEvent(EVENT_BLAST, urand(60000, 120000)); if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) events.ScheduleEvent(EVENT_CHAIN, urand(30000, 60000)); - Phase = 2; + events.SetPhase(PHASE_TWO); break; default: break; @@ -424,38 +446,6 @@ public: } else { - //start phase 3 when we are 45% health - if (Phase != 3) - { - if (HealthBelowPct(45)) - { - Phase = 3; - Talk(SAY_REQUEST_AID); - //here Lich King should respond to KelThuzad but I don't know which Creature to make talk - //so for now just make Kelthuzad says it. - Talk(SAY_ANSWER_REQUEST); - - for (uint8 i = 0; i <= 3; ++i) - { - if (GameObject* portal = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_KELTHUZAD_PORTAL01 + i))) - if (portal->getLootState() == GO_READY) - portal->UseDoorOrButton(); - } - } - } - else if (nGuardiansOfIcecrownCount < RAID_MODE(2, 4)) - { - if (uiGuardiansOfIcecrownTimer <= diff) - { - /// @todo Add missing text - if (Creature* guardian = DoSummon(NPC_ICECROWN, Pos[RAND(2, 5, 8, 11)])) - guardian->SetFloatValue(UNIT_FIELD_COMBATREACH, 2); - ++nGuardiansOfIcecrownCount; - uiGuardiansOfIcecrownTimer = 5000; - } - else uiGuardiansOfIcecrownTimer -= diff; - } - if (me->HasUnitState(UNIT_STATE_CASTING)) return; @@ -607,6 +597,18 @@ public: Talk(SAY_FROST_BLAST); events.Repeat(30000, 90000); break; + case EVENT_ANSWER_REQUEST: + if (Creature* lichKing = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_LICH_KING))) + lichKing->AI()->Talk(SAY_ANSWER_REQUEST); + events.ScheduleEvent(EVENT_SUMMON_GUARDIANS, 5000); + break; + case EVENT_SUMMON_GUARDIANS: + if (Creature* guardian = DoSummon(NPC_ICECROWN, Pos[RAND(2, 5, 8, 11)])) + guardian->SetFloatValue(UNIT_FIELD_COMBATREACH, 2); + ++nGuardiansOfIcecrownCount; + if (nGuardiansOfIcecrownCount < RAID_MODE(2, 4)) + events.ScheduleEvent(EVENT_SUMMON_GUARDIANS, 5000); + break; default: break; } diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index 06a2547951d..100668979e8 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -157,6 +157,9 @@ class instance_naxxramas : public InstanceMapScript case NPC_KEL_THUZAD: KelthuzadGUID = creature->GetGUID(); break; + case NPC_LICH_KING: + LichKingGUID = creature->GetGUID(); + break; default: break; } @@ -202,6 +205,9 @@ class instance_naxxramas : public InstanceMapScript case GO_KELTHUZAD_TRIGGER: KelthuzadTriggerGUID = go->GetGUID(); break; + case GO_ROOM_KELTHUZAD: + KelthuzadDoorGUID = go->GetGUID(); + break; default: break; } @@ -337,6 +343,8 @@ class instance_naxxramas : public InstanceMapScript return PortalsGUID[3]; case DATA_KELTHUZAD_TRIGGER: return KelthuzadTriggerGUID; + case DATA_LICH_KING: + return LichKingGUID; } return ObjectGuid::Empty; @@ -370,6 +378,10 @@ class instance_naxxramas : public InstanceMapScript events.ScheduleEvent(EVENT_KELTHUZAD_WING_TAUNT, 6000); } break; + case BOSS_SAPPHIRON: + if (state == DONE) + events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD, 6000); + break; default: break; } @@ -431,6 +443,37 @@ class instance_naxxramas : public InstanceMapScript kelthuzad->AI()->Talk(CurrentWingTaunt); ++CurrentWingTaunt; break; + case EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD: + if (Creature* kelthuzad = instance->GetCreature(KelthuzadGUID)) + kelthuzad->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_KELTHUZAD); + HandleGameObject(KelthuzadDoorGUID, false); + events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_LICHKING, 6000); + break; + case EVENT_DIALOGUE_SAPPHIRON_LICHKING: + if (Creature* lichKing = instance->GetCreature(LichKingGUID)) + lichKing->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_LICH_KING); + events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD2, 16000); + break; + case EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD2: + if (Creature* kelthuzad = instance->GetCreature(KelthuzadGUID)) + kelthuzad->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_KELTHUZAD2); + events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_LICHKING2, 9000); + break; + case EVENT_DIALOGUE_SAPPHIRON_LICHKING2: + if (Creature* lichKing = instance->GetCreature(LichKingGUID)) + lichKing->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_LICH_KING2); + events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD3, 12000); + break; + case EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD3: + if (Creature* kelthuzad = instance->GetCreature(KelthuzadGUID)) + kelthuzad->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_KELTHUZAD3); + events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD4, 6000); + break; + case EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD4: + if (Creature* kelthuzad = instance->GetCreature(KelthuzadGUID)) + kelthuzad->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_KELTHUZAD4); + HandleGameObject(KelthuzadDoorGUID, true); + break; default: break; } @@ -538,6 +581,8 @@ class instance_naxxramas : public InstanceMapScript ObjectGuid KelthuzadGUID; ObjectGuid KelthuzadTriggerGUID; ObjectGuid PortalsGUID[4]; + ObjectGuid KelthuzadDoorGUID; + ObjectGuid LichKingGUID; uint8 AbominationCount; uint8 CurrentWingTaunt; diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h index a1c8a1c79d4..eb77980f3ba 100644 --- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h +++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h @@ -71,6 +71,7 @@ enum Data64 DATA_KELTHUZAD_PORTAL03, DATA_KELTHUZAD_PORTAL04, DATA_KELTHUZAD_TRIGGER, + DATA_LICH_KING }; enum CreaturesIds @@ -90,7 +91,9 @@ enum CreaturesIds NPC_NAXXRAMAS_FOLLOWER = 16505, NPC_FOLLOWER_WORSHIPPER = 16506, NPC_DK_UNDERSTUDY = 16803, - NPC_BIGGLESWORTH = 16998 + NPC_BIGGLESWORTH = 16998, + NPC_LICH_KING = 16980, + NPC_OLD_WORLD_TRIGGER = 15384 }; enum GameObjectsIds @@ -156,18 +159,35 @@ enum InstanceEvents EVENT_DIALOGUE_GOTHIK_RIVENDARE2, // Dialogue that happens after each wing. - EVENT_KELTHUZAD_WING_TAUNT + EVENT_KELTHUZAD_WING_TAUNT, + + // Dialogue that happens after Sapphiron's death. + EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD, + EVENT_DIALOGUE_SAPPHIRON_LICHKING, + EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD2, + EVENT_DIALOGUE_SAPPHIRON_LICHKING2, + EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD3, + EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD4 }; enum InstanceTexts { // The Four Horsemen - SAY_DIALOGUE_GOTHIK_HORSEMAN = 5, - SAY_DIALOGUE_GOTHIK_HORSEMAN2 = 6, + SAY_DIALOGUE_GOTHIK_HORSEMAN = 5, + SAY_DIALOGUE_GOTHIK_HORSEMAN2 = 6, // Kel'Thuzad - SAY_KELTHUZAD_CAT_DIED = 5, - SAY_KELTHUZAD_FIRST_WING_TAUNT = 16 + SAY_DIALOGUE_SAPPHIRON_KELTHUZAD = 0, + SAY_DIALOGUE_SAPPHIRON_KELTHUZAD2 = 2, + SAY_DIALOGUE_SAPPHIRON_KELTHUZAD3 = 4, + SAY_DIALOGUE_SAPPHIRON_KELTHUZAD4 = 20, + + SAY_KELTHUZAD_CAT_DIED = 5, + SAY_KELTHUZAD_FIRST_WING_TAUNT = 16, + + // Lich King + SAY_DIALOGUE_SAPPHIRON_LICH_KING = 1, + SAY_DIALOGUE_SAPPHIRON_LICH_KING2 = 2 }; /* diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index e8da81a669f..8c7d0c2797f 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -115,6 +115,7 @@ public: { Talk(SAY_DEATH); _JustDied(); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PULSING_SHOCKWAVE_AURA); } void KilledUnit(Unit* who) override |