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

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