mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Fix Naxx40 Ziggurat, threatMgr updates
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user