Fix Naxx40 Ziggurat, threatMgr updates

This commit is contained in:
郑佩茹
2022-09-26 10:44:32 -06:00
parent 10718220a3
commit 1e7b825a83
8 changed files with 56 additions and 38 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -436,7 +436,7 @@ public:
case EVENT_DETONATE_MANA:
{
std::vector<Unit*> 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

View File

@@ -118,8 +118,8 @@ public:
std::list<Unit*> 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();

View File

@@ -369,8 +369,8 @@ public:
}
std::vector<Unit*> 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)
{

View File

@@ -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);

View File

@@ -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();
}

View File

@@ -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;
}