From 1e7b825a83e69a6d260319ea042ec357de8230e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Mon, 26 Sep 2022 10:44:32 -0600 Subject: [PATCH] Fix Naxx40 Ziggurat, threatMgr updates --- sql/world/base/naxx40.sql | 27 ++-------------- src/naxx40Scripts/boss_gothik_40.cpp | 2 +- src/naxx40Scripts/boss_kelthuzad_40.cpp | 2 +- src/naxx40Scripts/boss_patchwerk_40.cpp | 4 +-- src/naxx40Scripts/boss_sapphiron_40.cpp | 4 +-- src/naxx40Scripts/boss_thaddius_40.cpp | 8 ++--- src/naxx40Scripts/instance_naxxramas.cpp | 41 ++++++++++++++++++++++++ src/vanillaScripts/boss_drakkisath.cpp | 6 ++-- 8 files changed, 56 insertions(+), 38 deletions(-) diff --git a/sql/world/base/naxx40.sql b/sql/world/base/naxx40.sql index 9605b9c..8b4405c 100644 --- a/sql/world/base/naxx40.sql +++ b/sql/world/base/naxx40.sql @@ -58,7 +58,6 @@ REPLACE INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, -- Add Entrance transporter object. Necromantic Runestone (id: 189314, displayID: 7786) SET @TRANSPORTER_ENTRY:= 9000; SET @TRANSPORTER_COOLDOWN:= 5; -SET @DEATH_KNIGHT_PORTAL_EFFECT:= 28444; SET @TRANSPORTER_X:= 3123.26; SET @TRANSPORTER_Y:= -3869.36; SET @TRANSPORTER_Z:= 138.34; @@ -72,8 +71,8 @@ INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `VerifiedBuild`) VALUES (@TRANSPORTER_ENTRY, 10, 7786, 'Teleport To Naxxramas', '', '', '', 1, 0, 0, 0, - 0, @TRANSPORTER_COOLDOWN, 0, 0, 0, 0, 0, @DEATH_KNIGHT_PORTAL_EFFECT, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, '', '', 12340); + 0, @TRANSPORTER_COOLDOWN, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, '', 'gobject_naxx40_tele', 12340); DELETE FROM `gameobject` WHERE `id`=@TRANSPORTER_ENTRY AND `map`=0 AND `zoneId`=0 AND `areaID`=0; INSERT INTO `gameobject` (`id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, @@ -85,28 +84,6 @@ VALUES @TRANSPORTER_Z, @TRANSPORTER_O, 0, 0, -0.063658, -1, 1, 0, 1, '', 0); --- Add condition Attunement to teleport spell --- Shows when not attuned Error Message 107: That spell is not available to you -DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 17) AND -(`SourceGroup` = 0) AND (`SourceEntry` = @DEATH_KNIGHT_PORTAL_EFFECT) AND -(`SourceId` = 0) AND (`ElseGroup` IN (0)) AND (`ConditionTypeOrReference` = -8) AND (`ConditionTarget` = 1) AND (`ConditionValue1` IN (9121, 9122, 9123)) AND -(`ConditionValue2` = 0) AND (`ConditionValue3` = 0); -INSERT INTO `conditions` -(`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, -`ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, -`ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, -`ErrorTextId`, `ScriptName`, `Comment`) - VALUES -(17, 0, @DEATH_KNIGHT_PORTAL_EFFECT, 0, 0, 8, 1, 9378, 0, 0, 0, 107, 0, '', 'Entered Naxxramas Flag'); - --- Update Teleport Positions of spells used by Naxxramas Portal -SET @DEATH_KNIGHT_PORTAL_EFFECT:= 28444; -DELETE FROM `spell_target_position` WHERE `ID` IN (@DEATH_KNIGHT_PORTAL_EFFECT); -INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) -VALUES (@DEATH_KNIGHT_PORTAL_EFFECT, 0, 533, 3005.51, -3434.64, 304.195, 6.2831, 0); - - -- Add Floating Naxx Object (id: 181056) -- Node 0 of PathID 436 in taxiPathNode -- https://wow.tools/dbc/?dbc=taxipathnode&build=3.3.5.12340#page=1&colFilter%5B1%5D=436 diff --git a/src/naxx40Scripts/boss_gothik_40.cpp b/src/naxx40Scripts/boss_gothik_40.cpp index 4d040be..de9535a 100644 --- a/src/naxx40Scripts/boss_gothik_40.cpp +++ b/src/naxx40Scripts/boss_gothik_40.cpp @@ -455,7 +455,7 @@ public: me->GetThreatMgr().resetAggro(NotOnSameSide(me)); if (Unit* pTarget = SelectTarget(SelectTargetMethod::MaxDistance, 0)) { - me->GetThreatMgr().addThreat(pTarget, 100.0f); + me->GetThreatMgr().AddThreat(pTarget, 100.0f); AttackStart(pTarget); } events.RepeatEvent(20000); diff --git a/src/naxx40Scripts/boss_kelthuzad_40.cpp b/src/naxx40Scripts/boss_kelthuzad_40.cpp index 2fcfe53..3a7369f 100644 --- a/src/naxx40Scripts/boss_kelthuzad_40.cpp +++ b/src/naxx40Scripts/boss_kelthuzad_40.cpp @@ -436,7 +436,7 @@ public: case EVENT_DETONATE_MANA: { std::vector unitList; - ThreatContainer::StorageType const& threatList = me->GetThreatMgr().getThreatList(); + ThreatContainer::StorageType const& threatList = me->GetThreatMgr().GetThreatList(); for (auto itr : threatList) { if (itr->getTarget()->GetTypeId() == TYPEID_PLAYER diff --git a/src/naxx40Scripts/boss_patchwerk_40.cpp b/src/naxx40Scripts/boss_patchwerk_40.cpp index 6ceded2..78b02e3 100644 --- a/src/naxx40Scripts/boss_patchwerk_40.cpp +++ b/src/naxx40Scripts/boss_patchwerk_40.cpp @@ -118,8 +118,8 @@ public: std::list meleeRangeTargets; Unit* finalTarget = nullptr; uint8 counter = 0; - auto i = me->GetThreatMgr().getThreatList().begin(); - for (; i != me->GetThreatMgr().getThreatList().end(); ++i, ++counter) + auto i = me->GetThreatMgr().GetThreatList().begin(); + for (; i != me->GetThreatMgr().GetThreatList().end(); ++i, ++counter) { // Gather all units with melee range Unit* target = (*i)->getTarget(); diff --git a/src/naxx40Scripts/boss_sapphiron_40.cpp b/src/naxx40Scripts/boss_sapphiron_40.cpp index 79ae7b8..9cacdb8 100644 --- a/src/naxx40Scripts/boss_sapphiron_40.cpp +++ b/src/naxx40Scripts/boss_sapphiron_40.cpp @@ -369,8 +369,8 @@ public: } std::vector targets; - auto i = me->GetThreatMgr().getThreatList().begin(); - for (; i != me->GetThreatMgr().getThreatList().end(); ++i) + auto i = me->GetThreatMgr().GetThreatList().begin(); + for (; i != me->GetThreatMgr().GetThreatList().end(); ++i) { if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER) { diff --git a/src/naxx40Scripts/boss_thaddius_40.cpp b/src/naxx40Scripts/boss_thaddius_40.cpp index d1010c2..fdaef01 100644 --- a/src/naxx40Scripts/boss_thaddius_40.cpp +++ b/src/naxx40Scripts/boss_thaddius_40.cpp @@ -550,17 +550,17 @@ public: if (!feugen->IsAlive() || !feugen->GetVictim() || !me->GetVictim()) return; - float threatFeugen = feugen->GetThreatMgr().getThreat(feugen->GetVictim()); - float threatStalagg = me->GetThreatMgr().getThreat(me->GetVictim()); + float threatFeugen = feugen->GetThreatMgr().GetThreat(feugen->GetVictim()); + float threatStalagg = me->GetThreatMgr().GetThreat(me->GetVictim()); Unit* tankFeugen = feugen->GetVictim(); Unit* tankStalagg = me->GetVictim(); - feugen->GetThreatMgr().modifyThreatPercent(tankFeugen, -100); + feugen->GetThreatMgr().ModifyThreatByPercent(tankFeugen, -100); feugen->AddThreat(tankStalagg, threatFeugen); feugen->CastSpell(tankStalagg, SPELL_MAGNETIC_PULL, true); feugen->AI()->DoAction(ACTION_MAGNETIC_PULL); - me->GetThreatMgr().modifyThreatPercent(tankStalagg, -100); + me->GetThreatMgr().ModifyThreatByPercent(tankStalagg, -100); me->AddThreat(tankFeugen, threatStalagg); me->CastSpell(tankFeugen, SPELL_MAGNETIC_PULL, true); DoAction(ACTION_MAGNETIC_PULL); diff --git a/src/naxx40Scripts/instance_naxxramas.cpp b/src/naxx40Scripts/instance_naxxramas.cpp index b036217..2b75993 100644 --- a/src/naxx40Scripts/instance_naxxramas.cpp +++ b/src/naxx40Scripts/instance_naxxramas.cpp @@ -23,6 +23,7 @@ #include "ScriptedCreature.h" #include "DBCEnums.h" #include "ObjectMgr.h" +#include "GameObjectAI.h" #include "naxxramas.h" const float HeiganPos[2] = {2796, -3707}; @@ -1364,6 +1365,45 @@ public: } }; +class gobject_naxx40_tele : public GameObjectScript +{ +private: + static bool isAttuned(Player* player) + { + if (player->GetQuestStatus(NAXX40_ATTUNEMENT_1) == QUEST_STATUS_REWARDED) + return true; + if (player->GetQuestStatus(NAXX40_ATTUNEMENT_2) == QUEST_STATUS_REWARDED) + return true; + if (player->GetQuestStatus(NAXX40_ATTUNEMENT_3) == QUEST_STATUS_REWARDED) + return true; + return false; + } + +public: + gobject_naxx40_tele() : GameObjectScript("gobject_naxx40_tele") { } + + struct gobject_naxx40_teleAI: GameObjectAI + { + explicit gobject_naxx40_teleAI(GameObject* object) : GameObjectAI(object) { }; + + }; + + GameObjectAI* GetAI(GameObject* object) const override + { + return new gobject_naxx40_teleAI(object); + } + + bool OnGossipHello(Player* player, GameObject* go) override + { + if (player->GetQuestStatus(NAXX40_ENTRANCE_FLAG) == QUEST_STATUS_REWARDED && isAttuned(player)) + { + player->SetRaidDifficulty(RAID_DIFFICULTY_10MAN_HEROIC); + player->TeleportTo(533, 3005.51f, -3434.64f, 304.195f, 6.2831f); + } + return true; + } +}; + class NaxxPlayerScript : public PlayerScript { public: @@ -1517,5 +1557,6 @@ void AddSC_instance_naxxramas_combined() new naxx_northrend_entrance(); new naxx_hub_portal(); new NaxxEntryFlag_AllMapScript(); + new gobject_naxx40_tele(); // new boss_naxxramas_misc(); } diff --git a/src/vanillaScripts/boss_drakkisath.cpp b/src/vanillaScripts/boss_drakkisath.cpp index cb795b0..c4314ae 100644 --- a/src/vanillaScripts/boss_drakkisath.cpp +++ b/src/vanillaScripts/boss_drakkisath.cpp @@ -94,8 +94,8 @@ public: if (Unit* target = me->GetVictim()) { _conflagrateTarget = me->GetVictim()->GetGUID(); - _conflagrateThreat = me->GetThreatMgr().getThreat(me->GetVictim()); - me->GetThreatMgr().modifyThreatPercent(target, -100); + _conflagrateThreat = me->GetThreatMgr().GetThreat(me->GetVictim()); + me->GetThreatMgr().ModifyThreatByPercent(target, -100); } events.ScheduleEvent(EVENT_CONFLAGRATION, 18000); events.ScheduleEvent(EVENT_CHECK_CONFLAGRATION_TARGET, 10000); @@ -115,7 +115,7 @@ public: case EVENT_CHECK_CONFLAGRATION_TARGET: if (Unit* target = ObjectAccessor::GetUnit(*me, _conflagrateTarget)) { - me->GetThreatMgr().addThreat(target, _conflagrateThreat); + me->GetThreatMgr().AddThreat(target, _conflagrateThreat); } break; }