mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Nexus: Removed old code to get team in instance
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "nexus.h"
|
||||
#include "Player.h"
|
||||
|
||||
DungeonEncounterData const encounters[] =
|
||||
{
|
||||
@@ -44,13 +43,6 @@ class instance_nexus : public InstanceMapScript
|
||||
SetHeaders(DataHeader);
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadDungeonEncounterData(encounters);
|
||||
_teamInInstance = 0;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
if (!_teamInInstance)
|
||||
_teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
@@ -78,29 +70,20 @@ class instance_nexus : public InstanceMapScript
|
||||
|
||||
uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
|
||||
{
|
||||
if (!_teamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
_teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
uint32 entry = data->id;
|
||||
switch (entry)
|
||||
switch (data->id)
|
||||
{
|
||||
case NPC_ALLIANCE_BERSERKER:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_BERSERKER : NPC_ALLIANCE_BERSERKER;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_HORDE_BERSERKER : NPC_ALLIANCE_BERSERKER;
|
||||
case NPC_ALLIANCE_RANGER:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_RANGER : NPC_ALLIANCE_RANGER;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_HORDE_RANGER : NPC_ALLIANCE_RANGER;
|
||||
case NPC_ALLIANCE_CLERIC:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_CLERIC : NPC_ALLIANCE_CLERIC;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_HORDE_CLERIC : NPC_ALLIANCE_CLERIC;
|
||||
case NPC_ALLIANCE_COMMANDER:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_COMMANDER : NPC_ALLIANCE_COMMANDER;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_HORDE_COMMANDER : NPC_ALLIANCE_COMMANDER;
|
||||
case NPC_COMMANDER_STOUTBEARD:
|
||||
return _teamInInstance == ALLIANCE ? NPC_COMMANDER_KOLURG : NPC_COMMANDER_STOUTBEARD;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_COMMANDER_KOLURG : NPC_COMMANDER_STOUTBEARD;
|
||||
default:
|
||||
return entry;
|
||||
return data->id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +173,6 @@ class instance_nexus : public InstanceMapScript
|
||||
ObjectGuid AnomalusContainmentSphere;
|
||||
ObjectGuid OrmoroksContainmentSphere;
|
||||
ObjectGuid TelestrasContainmentSphere;
|
||||
uint32 _teamInInstance;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
Reference in New Issue
Block a user