diff --git a/sql/updates/world/custom/custom_2019_01_21_00_world.sql b/sql/updates/world/custom/custom_2019_01_21_00_world.sql new file mode 100644 index 00000000000..7e6589e0196 --- /dev/null +++ b/sql/updates/world/custom/custom_2019_01_21_00_world.sql @@ -0,0 +1,126 @@ +-- Pathing for Entry: 40935 'TDB FORMAT' +SET @NPC := 40935; +SET @PATH := @NPC * 10 + 0; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-307.976,685.569,279.2921,0,0,1,0,100,0), +(@PATH,2,-309.986,707.476,277.1083,0,0,1,0,100,0), +(@PATH,3,-308.396,736.365,274.4832,0,0,1,0,100,0); +-- 0x20307C506027F9C00033C700004F2085 .go xyz -309.986 707.476 277.1083 + +-- Pathing for Entry: 40935 'TDB FORMAT' +SET @NPC := 40935; +SET @PATH := @NPC * 10 + 1; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-310.2972,683.6573,279.4153,0,0,1,0,100,0), +(@PATH,2,-312.6634,703.8225,277.1032,0,0,1,0,100,0), +(@PATH,3,-312.12,723.2926,275.1376,0,0,1,0,100,0), +(@PATH,4,-311.3914,736.5298,274.4193,0,0,1,0,100,0); +-- 0x20307C506027F9C00033C70000CF2085 .go xyz -312.6634 703.8225 277.1032 + +-- Pathing for Entry: 40935 'TDB FORMAT' +SET @NPC := 40935; +SET @PATH := @NPC * 10 + 2; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-305.4292,687.1641,279.2308,0,0,1,0,100,0), +(@PATH,2,-306.6885,704.3707,277.979,0,0,1,0,100,0), +(@PATH,3,-306.1291,722.9629,276.1883,0,0,1,0,100,0), +(@PATH,4,-305.4005,736.2001,274.547,0,0,1,0,100,0); +-- 0x20307C506027F9C00033C700014F2085 .go xyz -306.6885 704.3707 277.979 + +-- Pathing for Entry: 40935 'TDB FORMAT' +SET @NPC := 40935; +SET @PATH := @NPC * 10 + 3; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-312.7645,681.9494,279.5093,0,0,1,0,100,0), +(@PATH,2,-315.6508,703.5484,276.8904,0,0,1,0,100,0), +(@PATH,3,-315.1155,723.4575,274.9303,0,0,1,0,100,0), +(@PATH,4,-314.3869,736.6947,274.4437,0,0,1,0,100,0); +-- 0x20307C506027F9C00033C70001CF2085 .go xyz -315.6508 703.5484 276.8904 + +-- Pathing for Entry: 40935 'TDB FORMAT' +SET @NPC := 40935; +SET @PATH := @NPC * 10 + 4; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-307.976,685.569,279.2921,0,0,1,0,100,0), +(@PATH,2,-309.986,707.476,277.1083,0,0,1,0,100,0), +(@PATH,3,-309.071,735.37,274.5955,0,0,1,0,100,0), +(@PATH,4,-309.009,757.309,263.934,0,0,1,0,100,0), +(@PATH,5,-308.55,781.698,260.8929,0,0,1,0,100,0); +-- 0x20307C506027F9C00033C700024F2085 .go xyz -309.986 707.476 277.1083 + +-- Pathing for Entry: 40935 'TDB FORMAT' +SET @NPC := 40935; +SET @PATH := @NPC * 10 + 5; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-311.2418,683.2592,279.4289,0,0,1,0,100,0), +(@PATH,2,-313.9257,706.6353,276.6516,0,0,1,0,100,0), +(@PATH,3,-313.3742,726.1921,274.9247,0,0,1,0,100,0), +(@PATH,4,-313.0463,744.1206,270.568,0,0,1,0,100,0), +(@PATH,5,-312.9208,762.0318,263.3555,0,0,1,0,100,0), +(@PATH,6,-312.5598,781.2148,261.09,0,0,1,0,100,0), +(@PATH,7,-312.5493,781.7733,261.0433,0,0,1,0,100,0); +-- 0x20307C506027F9C00033C70002CF2085 .go xyz -313.9257 706.6353 276.6516 + + +-- Pathing for Entry: 40943 'TDB FORMAT' +SET @NPC := 40943; +SET @PATH := @NPC * 10 + 0; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-302.9841, 688.9024,279.2318,0,0,1,0,100,0), +(@PATH,2,-303.6833,704.5848,278.4157,0,0,1,0,100,0), +(@PATH,3,-303.1336,722.798,276.6592,0,0,1,0,100,0), +(@PATH,4,-302.4051,736.0353,274.7777,0,0,1,0,100,0); +-- 0x20307C506027FBC00033C700004F2085 .go xyz -303.6833 704.5848 278.4157 + +-- Pathing for Entry: 40943 'TDB FORMAT' +SET @NPC := 40943; +SET @PATH := @NPC * 10 + 1; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-315.2096,680.2112,279.512,0,0,1,0,100,0), +(@PATH,2,-318.6383,703.2744,276.7856,0,0,1,0,100,0), +(@PATH,3,-318.1109,723.6223,274.7229,0,0,1,0,100,0), +(@PATH,4,-317.3824,736.8595,274.1223,0,0,1,0,100,0); +-- 0x20307C506027FBC00033C70000CF2085 .go xyz -318.6383 703.2744 276.7856 + + +-- Pathing for Entry: 40936 'TDB FORMAT' +SET @NPC := 40936; +SET @PATH := @NPC * 10 + 0; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-309.076,`position_y`=704.163,`position_z`=277.6152 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-307.078,686.042,279.2762,0,0,1,0,100,0), +(@PATH,2,-309.076,704.163,277.6152,0,0,1,0,100,0), +(@PATH,3,-309.234,731.38,275.0259,0,0,1,0,100,0); +-- 0x20307C506027FA000033C700004F2085 .go xyz -309.076 704.163 277.6152 + +-- Pathing for Entry: 40936 'TDB FORMAT' +SET @NPC := 40936; +SET @PATH := @NPC * 10 + 1; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-308.257,692.484,278.5874,0,0,0,0,100,0), +(@PATH,2,-309.76,733.429,274.8205,0,0,0,0,100,0), +(@PATH,3,-309.712,700.297,277.756,0,0,0,0,100,0), +(@PATH,4,-306.3205,686.41,279.2822,0,0,0,0,100,0), +(@PATH,5,-298.974,670.188,280.3882,0,0,0,0,100,0), +(@PATH,6,-285.635,657.54,282.6055,0,0,0,0,100,0), +(@PATH,7,-270.333,647.406,284.3848,0,0,0,0,100,0), +(@PATH,8,-259.951,644.174,285.0887,0,0,0,0,100,0), +(@PATH,9,-277.727,651.707,283.6149,0,0,0,0,100,0), +(@PATH,10,-292.729,663.596,281.6521,0,0,0,0,100,0), +(@PATH,11,-303.755,676.913,279.7778,0,0,0,0,100,0); +-- 0x20307C506027FA000033C700004F2085 .go xyz -308.257 692.484 278.5874 + +DELETE FROM `creature` WHERE `guid` IN (255066, 255071, 255073, 255064, 255065, 255070, 255069, 255072, 255067); +DELETE FROM `creature_addon` WHERE `guid` IN (255066, 255071, 255073, 255064, 255065, 255070, 255069, 255072, 255067); diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp index c39d78c1d7b..922b5deb880 100644 --- a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp @@ -65,6 +65,7 @@ enum Events EVENT_BREAK_CORAL, EVENT_MOVE_COMMANDER_ULTHOK_TO_HOME_POS, EVENT_CHECK_DEAD_PLAYERS, + EVENT_SUMMON_GHURSHA_FLOOR_ADDS }; Position const fallingRocksDummyPos = { -144.283f, 983.316f, 230.4773f }; @@ -117,6 +118,39 @@ class JumpThroughWindowEvent : public BasicEvent Position const _jumpPos; }; +class DelayedPathEvent : public BasicEvent +{ + public: + DelayedPathEvent(Creature* owner) : _owner(owner) { } + + bool Execute(uint64 /*time*/, uint32 /*diff*/) override + { + _owner->GetMotionMaster()->MovePath(_owner->GetEntry() * 10 + 1, true); + return true; + } + + private: + Creature* _owner; +}; + +class EmoteStateEvent : public BasicEvent +{ + public: + EmoteStateEvent(Creature* owner) : _owner(owner) { } + + bool Execute(uint64 /*time*/, uint32 /*diff*/) override + { + if (_owner->GetEntry() == NPC_GILGOBLIN_HUNTER) + _owner->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_HOLD_THROWN); + else + _owner->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2HL); + return true; + } + + private: + Creature* _owner; +}; + class instance_throne_of_the_tides : public InstanceMapScript { public: @@ -350,6 +384,9 @@ class instance_throne_of_the_tides : public InstanceMapScript if (GameObject* tentacle2 = GetGameObject(DATA_LEVIATHAN_TENTACLE_2)) tentacle2->DespawnOrUnsummon(15s); + + events.ScheduleEvent(EVENT_SUMMON_GHURSHA_FLOOR_ADDS, 17s); + break; case EVENT_INDEX_ULTHOK_ARRIVED: if (Creature* ulthok = instance->SummonCreature(BOSS_COMMANDER_ULTHOK, commanderUlthokIntroPos)) @@ -447,6 +484,31 @@ class instance_throne_of_the_tides : public InstanceMapScript } break; } + case EVENT_SUMMON_GHURSHA_FLOOR_ADDS: + for (uint8 i = 0; i < 6; i++) + { + if (Creature* hunter = instance->SummonCreature(NPC_GILGOBLIN_HUNTER, TotTGilgoblinHunterPositions[i])) + { + hunter->GetMotionMaster()->MovePath(hunter->GetEntry() * 10 + i, false); + hunter->m_Events.AddEventAtOffset(new EmoteStateEvent(hunter), 5s); + } + } + + for (uint8 i = 0; i < 2; i++) + { + if (Creature* aquamage = instance->SummonCreature(NPC_GILGOBLIN_AQUAMAGE, TotTGilgoblinAquamagePositions[i])) + { + aquamage->GetMotionMaster()->MovePath(aquamage->GetEntry() * 10 + i, false); + aquamage->m_Events.AddEventAtOffset(new EmoteStateEvent(aquamage), 5s); + } + } + + if (Creature* watcher = instance->SummonCreature(NPC_FACELESS_WATCHER, TotTFacelessWatcherPosition)) + { + watcher->GetMotionMaster()->MovePath(watcher->GetEntry() * 10, false); + watcher->m_Events.AddEventAtOffset(new DelayedPathEvent(watcher), 16s); + } + break; default: break; } diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h index 4acc5f9630d..7888b82df0a 100644 --- a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h @@ -91,7 +91,10 @@ enum TotTCreatureIds NPC_LADY_NAZJAR = 39959, // Generic Creatures - NPC_GEYSER_DUMMY = 48983 + NPC_GEYSER_DUMMY = 48983, + NPC_GILGOBLIN_HUNTER = 40935, + NPC_FACELESS_WATCHER = 40936, + NPC_GILGOBLIN_AQUAMAGE = 40943 }; enum TotTGameObjectIds @@ -204,6 +207,24 @@ Position const TotTLadyNazjarInvaderJumpPositions[] = { -101.955f, 806.373f, 796.964f, 3.071779f } }; +Position const TotTGilgoblinHunterPositions[] = +{ + { -296.0759f, 668.8297f, 280.8867f, 2.188809f }, + { -295.146f, 662.971f, 281.3593f, 2.202956f }, + { -291.068f, 665.408f, 281.9814f, 2.15424f }, + { -296.477f, 661.01f, 281.4153f, 2.23188f }, + { -297.7917f, 671.1694f, 280.5178f, 2.186387f }, + { -296.523f, 665.198f, 281.0583f, 2.25458f } +}; + +Position const TotTGilgoblinAquamagePositions[] = +{ + { -288.911f, 667.142f, 282.2543f, 2.14487f }, + { -297.938f, 659.363f, 281.7794f, 2.262644f } +}; + +Position const TotTFacelessWatcherPosition = { -292.3462f, 664.1631f, 281.7034f, 2.1634f }; + template inline AI* GetThroneOfTheTodesAI(T* obj) {