diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-08-31 10:26:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-31 10:26:25 +0200 |
commit | 4d73fcd56340db4a5924518bde8bf8c3527a9d84 (patch) | |
tree | 498c036d8733ef1d6c678c002285e6484da05cf3 | |
parent | de90cf03bd6b3aa4b0af52cee117a5c0882da48c (diff) |
Scripts/Draenor: Implement Establish your Garrison (34378) (#28219)
-rw-r--r-- | sql/updates/world/master/2025_08_31_03_world.sql | 17 | ||||
-rw-r--r-- | src/server/scripts/Draenor/draenor_script_loader.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Draenor/zone_frostfire_ridge.cpp | 63 |
3 files changed, 82 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_08_31_03_world.sql b/sql/updates/world/master/2025_08_31_03_world.sql new file mode 100644 index 00000000000..add5c66d31d --- /dev/null +++ b/sql/updates/world/master/2025_08_31_03_world.sql @@ -0,0 +1,17 @@ +UPDATE `gameobject_template` SET `scriptname` = 'go_master_surveyor' WHERE `entry` = 233664; + +-- Condition +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 25 AND `SourceGroup` = 0 AND `SourceEntry` = 1152; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +(25, 0, 1152, 0, 0, 47, 0, 36793, 66, 0, 0, 'TerrainSwap to 1152 if Quest: 36793 is complete/rewarded'); + +-- Spawntracking +DELETE FROM `spawn_tracking` WHERE `SpawnTrackingId`=920544; +INSERT INTO `spawn_tracking` (`SpawnTrackingId`, `SpawnType`, `SpawnId`, `QuestObjectiveIds`) VALUES +(920544, 1, 395673, '272928'); + +DELETE FROM `spawn_tracking_state` WHERE `SpawnType`=1 AND `SpawnId`=920544; +INSERT INTO `spawn_tracking_state` (`SpawnType`, `SpawnId`, `State`, `Visible`, `StateSpellVisualId`, `StateAnimId`, `StateAnimKitId`, `StateWorldEffects`) VALUES +(1, 920544, 0, 0, NULL, NULL, NULL, NULL), +(1, 920544, 1, 1, NULL, NULL, NULL, NULL), +(1, 920544, 2, 0, NULL, NULL, NULL, NULL); diff --git a/src/server/scripts/Draenor/draenor_script_loader.cpp b/src/server/scripts/Draenor/draenor_script_loader.cpp index a9ea6c61bd0..faeaa4cc662 100644 --- a/src/server/scripts/Draenor/draenor_script_loader.cpp +++ b/src/server/scripts/Draenor/draenor_script_loader.cpp @@ -18,6 +18,7 @@ // This is where scripts' loading functions should be declared: void AddSC_assault_on_the_dark_portal(); void AddSC_draenor_shadowmoon_valley(); +void AddSC_frostfire_ridge(); void AddSC_garrison_generic(); // Auchindoun @@ -30,6 +31,7 @@ void AddDraenorScripts() { AddSC_assault_on_the_dark_portal(); AddSC_draenor_shadowmoon_valley(); + AddSC_frostfire_ridge(); AddSC_garrison_generic(); // Auchindoun diff --git a/src/server/scripts/Draenor/zone_frostfire_ridge.cpp b/src/server/scripts/Draenor/zone_frostfire_ridge.cpp new file mode 100644 index 00000000000..c0213766d64 --- /dev/null +++ b/src/server/scripts/Draenor/zone_frostfire_ridge.cpp @@ -0,0 +1,63 @@ +/* + * 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 "GameObject.h" +#include "GameObjectAI.h" +#include "PhasingHandler.h" +#include "Player.h" +#include "QuestDef.h" +#include "ScriptMgr.h" + +// 233664 - Master Surveyor +enum MasterSurveyorMisc +{ + // Quest + QUEST_ESTABLISH_YOUR_GARRISON_HORDE = 34378, + + // Spells + SPELL_QUEST_34378_KILLCREDIT = 161033, + SPELL_CREATE_GARRISON_FROSTFIRE_RIDGE_HORDE = 160767 +}; + +Position const GarrisonLevelOneCreationPlayerPosition = { 5568.66f, 4635.45f, 146.61f, 5.079972743988037109f }; + +// 233664 - Master Surveyor +struct go_master_surveyor : public GameObjectAI +{ + go_master_surveyor(GameObject* go) : GameObjectAI(go) { } + + bool OnGossipHello(Player* player) override + { + if (player->GetQuestStatus(QUEST_ESTABLISH_YOUR_GARRISON_HORDE) == QUEST_STATUS_INCOMPLETE) + { + me->UseDoorOrButton(); + player->CastSpell(player, SPELL_QUEST_34378_KILLCREDIT, true); + player->CastSpell(player, SPELL_CREATE_GARRISON_FROSTFIRE_RIDGE_HORDE, true); + player->NearTeleportTo(GarrisonLevelOneCreationPlayerPosition); + PhasingHandler::OnConditionChange(player); + + return true; + } + + return false; + } +}; + +void AddSC_frostfire_ridge() +{ + RegisterGameObjectAI(go_master_surveyor); +}; |