mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Players: Slightly improve neutral player faction support
This commit is contained in:
@@ -28,7 +28,6 @@ EndScriptData */
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "Player.h"
|
||||
#include "trial_of_the_champion.h"
|
||||
|
||||
constexpr uint32 ToCEncounterCount = 4;
|
||||
@@ -60,12 +59,10 @@ public:
|
||||
SetBossNumber(ToCEncounterCount);
|
||||
LoadDungeonEncounterData(encounters);
|
||||
uiArgentSoldierDeaths = 0;
|
||||
teamInInstance = 0;
|
||||
|
||||
bDone = false;
|
||||
}
|
||||
|
||||
uint32 teamInInstance;
|
||||
PersistentInstanceScriptValue<uint16> uiMovementDone;
|
||||
PersistentInstanceScriptValue<uint16> uiGrandChampionsDeaths;
|
||||
uint8 uiArgentSoldierDeaths;
|
||||
@@ -85,12 +82,6 @@ public:
|
||||
|
||||
bool bDone;
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
if (!teamInInstance)
|
||||
teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
@@ -114,29 +105,21 @@ public:
|
||||
|
||||
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)
|
||||
{
|
||||
case VEHICLE_MOKRA_SKILLCRUSHER_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT : VEHICLE_MOKRA_SKILLCRUSHER_MOUNT;
|
||||
return instance->GetTeamInInstance() == HORDE ? VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT : VEHICLE_MOKRA_SKILLCRUSHER_MOUNT;
|
||||
case VEHICLE_ERESSEA_DAWNSINGER_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_AMBROSE_BOLTSPARK_MOUNT : VEHICLE_ERESSEA_DAWNSINGER_MOUNT;
|
||||
return instance->GetTeamInInstance() == HORDE ? VEHICLE_AMBROSE_BOLTSPARK_MOUNT : VEHICLE_ERESSEA_DAWNSINGER_MOUNT;
|
||||
case VEHICLE_RUNOK_WILDMANE_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_COLOSOS_MOUNT : VEHICLE_RUNOK_WILDMANE_MOUNT;
|
||||
return instance->GetTeamInInstance() == HORDE ? VEHICLE_COLOSOS_MOUNT : VEHICLE_RUNOK_WILDMANE_MOUNT;
|
||||
case VEHICLE_ZUL_TORE_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_EVENSONG_MOUNT : VEHICLE_ZUL_TORE_MOUNT;
|
||||
return instance->GetTeamInInstance() == HORDE ? VEHICLE_EVENSONG_MOUNT : VEHICLE_ZUL_TORE_MOUNT;
|
||||
case VEHICLE_DEATHSTALKER_VESCERI_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_LANA_STOUTHAMMER_MOUNT : VEHICLE_DEATHSTALKER_VESCERI_MOUNT;
|
||||
return instance->GetTeamInInstance() == HORDE ? VEHICLE_LANA_STOUTHAMMER_MOUNT : VEHICLE_DEATHSTALKER_VESCERI_MOUNT;
|
||||
case NPC_JAEREN:
|
||||
return teamInInstance == HORDE ? NPC_ARELAS : NPC_JAEREN;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_ARELAS : NPC_JAEREN;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,6 @@ class instance_trial_of_the_crusader : public InstanceMapScript
|
||||
EventStage = 0;
|
||||
NorthrendBeasts = NOT_STARTED;
|
||||
NorthrendBeastsCount = 4;
|
||||
Team = TEAM_OTHER;
|
||||
EventTimer = 1000;
|
||||
NotOneButTwoJormungarsTimer = 0;
|
||||
ResilienceWillFixItTimer = 0;
|
||||
@@ -133,9 +132,6 @@ class instance_trial_of_the_crusader : public InstanceMapScript
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
if (Team == TEAM_OTHER)
|
||||
Team = player->GetTeam();
|
||||
|
||||
if (NorthrendBeasts == GORMOK_IN_PROGRESS)
|
||||
player->CreateVehicleKit(PLAYER_VEHICLE_ID, 0);
|
||||
}
|
||||
@@ -524,7 +520,6 @@ class instance_trial_of_the_crusader : public InstanceMapScript
|
||||
uint32 EventStage;
|
||||
uint32 EventTimer;
|
||||
uint32 NorthrendBeasts;
|
||||
uint32 Team;
|
||||
bool CrusadersSpecialState;
|
||||
GuidVector snoboldGUIDS;
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "forge_of_souls.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
|
||||
BossBoundaryData const boundaries =
|
||||
{
|
||||
@@ -48,14 +47,6 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadBossBoundaries(boundaries);
|
||||
LoadDungeonEncounterData(encounters);
|
||||
|
||||
teamInInstance = 0;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
if (!teamInInstance)
|
||||
teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
@@ -73,23 +64,15 @@ class instance_forge_of_souls : 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)
|
||||
{
|
||||
case NPC_SYLVANAS_PART1:
|
||||
return teamInInstance == ALLIANCE ? NPC_JAINA_PART1 : NPC_SYLVANAS_PART1;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_JAINA_PART1 : NPC_SYLVANAS_PART1;
|
||||
case NPC_LORALEN:
|
||||
return teamInInstance == ALLIANCE ? NPC_ELANDRA : NPC_LORALEN;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_ELANDRA : NPC_LORALEN;
|
||||
case NPC_KALIRA:
|
||||
return teamInInstance == ALLIANCE ? NPC_KORELN : NPC_KALIRA;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_KORELN : NPC_KALIRA;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
@@ -100,7 +83,7 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
switch (type)
|
||||
{
|
||||
case DATA_TEAM_IN_INSTANCE:
|
||||
return teamInInstance;
|
||||
return instance->GetTeamInInstance();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -126,8 +109,6 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
private:
|
||||
ObjectGuid bronjahm;
|
||||
ObjectGuid devourerOfSouls;
|
||||
|
||||
uint32 teamInInstance;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
@@ -2739,7 +2739,7 @@ class spell_hor_start_halls_of_reflection_quest_ae : public SpellScriptLoader
|
||||
// CanTakeQuest and CanAddQuest checks done in spell effect execution
|
||||
if (target->GetTeam() == ALLIANCE)
|
||||
target->CastSpell(target, SPELL_START_HALLS_OF_REFLECTION_QUEST_A, true);
|
||||
else
|
||||
else if (target->GetTeam() == HORDE)
|
||||
target->CastSpell(target, SPELL_START_HALLS_OF_REFLECTION_QUEST_H, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "TemporarySummon.h"
|
||||
@@ -98,7 +97,6 @@ class instance_halls_of_reflection : public InstanceMapScript
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadDungeonEncounterData(encounters);
|
||||
|
||||
_teamInInstance = 0;
|
||||
_waveCount = 0;
|
||||
_introState = NOT_STARTED;
|
||||
_frostswornGeneralState = NOT_STARTED;
|
||||
@@ -107,11 +105,8 @@ class instance_halls_of_reflection : public InstanceMapScript
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
void OnPlayerEnter(Player* /*player*/) override
|
||||
{
|
||||
if (!_teamInInstance)
|
||||
_teamInInstance = player->GetTeam();
|
||||
|
||||
if (GetBossState(DATA_MARWYN) == DONE)
|
||||
{
|
||||
SpawnGunship();
|
||||
@@ -211,26 +206,18 @@ class instance_halls_of_reflection : public InstanceMapScript
|
||||
|
||||
uint32 GetGameObjectEntry(ObjectGuid::LowType /*guidLow*/, uint32 entry) override
|
||||
{
|
||||
if (!_teamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
_teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
switch (entry)
|
||||
{
|
||||
case GO_THE_CAPTAIN_CHEST_ALLIANCE_NORMAL:
|
||||
case GO_THE_CAPTAIN_CHEST_ALLIANCE_HEROIC:
|
||||
case GO_THE_SKYBREAKER_STAIRS:
|
||||
if (_teamInInstance == HORDE)
|
||||
if (instance->GetTeamInInstance() == HORDE)
|
||||
return 0;
|
||||
break;
|
||||
case GO_THE_CAPTAIN_CHEST_HORDE_NORMAL:
|
||||
case GO_THE_CAPTAIN_CHEST_HORDE_HEROIC:
|
||||
case GO_ORGRIMS_HAMMER_STAIRS:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
if (instance->GetTeamInInstance() == ALLIANCE)
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
@@ -384,29 +371,13 @@ class instance_halls_of_reflection : public InstanceMapScript
|
||||
if (!GunshipGUID.IsEmpty())
|
||||
return;
|
||||
|
||||
if (!_teamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
_teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
if (Transport* gunship = sTransportMgr->CreateTransport(_teamInInstance == HORDE ? GO_ORGRIMS_HAMMER : GO_THE_SKYBREAKER, instance))
|
||||
if (Transport* gunship = sTransportMgr->CreateTransport(instance->GetTeamInInstance() == HORDE ? GO_ORGRIMS_HAMMER : GO_THE_SKYBREAKER, instance))
|
||||
gunship->EnableMovement(GetBossState(DATA_THE_LICH_KING_ESCAPE) == DONE);
|
||||
}
|
||||
|
||||
void SpawnEscapeEvent()
|
||||
{
|
||||
if (!_teamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
_teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
if (instance->GetTeamInInstance() == ALLIANCE)
|
||||
{
|
||||
instance->SummonCreature(NPC_JAINA_ESCAPE, JainaSpawnPos2);
|
||||
instance->SummonCreature(NPC_THE_LICH_KING_ESCAPE, TheLichKingEscapePosition[1]);
|
||||
@@ -427,7 +398,7 @@ class instance_halls_of_reflection : public InstanceMapScript
|
||||
{
|
||||
if (_introState == NOT_STARTED)
|
||||
{
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
if (instance->GetTeamInInstance() == ALLIANCE)
|
||||
{
|
||||
instance->SummonCreature(NPC_JAINA_INTRO, JainaSpawnPos);
|
||||
instance->SummonCreature(NPC_KORELN, KorelnOrLoralenSpawnPos);
|
||||
@@ -649,7 +620,7 @@ class instance_halls_of_reflection : public InstanceMapScript
|
||||
for (ObjectGuid guid : GunshipCannonGUIDs)
|
||||
{
|
||||
uint32 entry = guid.GetEntry();
|
||||
if ((entry == NPC_WORLD_TRIGGER && _teamInInstance == ALLIANCE) || (entry == NPC_GUNSHIP_CANNON_HORDE && _teamInInstance == HORDE))
|
||||
if ((entry == NPC_WORLD_TRIGGER && instance->GetTeamInInstance() == ALLIANCE) || (entry == NPC_GUNSHIP_CANNON_HORDE && instance->GetTeamInInstance() == HORDE))
|
||||
if (Creature* cannon = instance->GetCreature(guid))
|
||||
cannon->CastSpell(cannon, SPELL_GUNSHIP_CANNON_FIRE, true);
|
||||
}
|
||||
@@ -681,7 +652,7 @@ class instance_halls_of_reflection : public InstanceMapScript
|
||||
case DATA_WAVE_COUNT:
|
||||
return _waveCount;
|
||||
case DATA_TEAM_IN_INSTANCE:
|
||||
return _teamInInstance;
|
||||
return instance->GetTeamInInstance();
|
||||
case DATA_INTRO_EVENT:
|
||||
return _introState;
|
||||
case DATA_FROSTSWORN_GENERAL:
|
||||
@@ -763,7 +734,6 @@ class instance_halls_of_reflection : public InstanceMapScript
|
||||
ObjectGuid ShadowThroneDoorGUID;
|
||||
ObjectGuid CaveInGUID;
|
||||
|
||||
uint32 _teamInInstance;
|
||||
uint32 _waveCount;
|
||||
uint32 _introState;
|
||||
uint32 _frostswornGeneralState;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "pit_of_saron.h"
|
||||
#include "Player.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
// positions for Martin Victus (37591) and Gorkun Ironskull (37592)
|
||||
@@ -56,27 +55,12 @@ class instance_pit_of_saron : public InstanceMapScript
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadDoorData(Doors);
|
||||
LoadDungeonEncounterData(encounters);
|
||||
_teamInInstance = 0;
|
||||
_cavernActive = 0;
|
||||
_shardsHit = 0;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
if (!_teamInInstance)
|
||||
_teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
if (!_teamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
_teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_GARFROST:
|
||||
@@ -117,39 +101,39 @@ class instance_pit_of_saron : public InstanceMapScript
|
||||
switch (entry)
|
||||
{
|
||||
case NPC_SYLVANAS_PART1:
|
||||
return _teamInInstance == ALLIANCE ? NPC_JAINA_PART1 : NPC_SYLVANAS_PART1;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_JAINA_PART1 : NPC_SYLVANAS_PART1;
|
||||
case NPC_SYLVANAS_PART2:
|
||||
return _teamInInstance == ALLIANCE ? NPC_JAINA_PART2 : NPC_SYLVANAS_PART2;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_JAINA_PART2 : NPC_SYLVANAS_PART2;
|
||||
case NPC_KILARA:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ELANDRA : NPC_KILARA;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_ELANDRA : NPC_KILARA;
|
||||
case NPC_KORALEN:
|
||||
return _teamInInstance == ALLIANCE ? NPC_KORLAEN : NPC_KORALEN;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_KORLAEN : NPC_KORALEN;
|
||||
case NPC_CHAMPION_1_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_CHAMPION_1_ALLIANCE : NPC_CHAMPION_1_HORDE;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_CHAMPION_1_ALLIANCE : NPC_CHAMPION_1_HORDE;
|
||||
case NPC_CHAMPION_2_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_CHAMPION_2_ALLIANCE : NPC_CHAMPION_2_HORDE;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_CHAMPION_2_ALLIANCE : NPC_CHAMPION_2_HORDE;
|
||||
case NPC_CHAMPION_3_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_CHAMPION_2_ALLIANCE : NPC_CHAMPION_3_HORDE;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_CHAMPION_2_ALLIANCE : NPC_CHAMPION_3_HORDE;
|
||||
case NPC_HORDE_SLAVE_1:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ALLIANCE_SLAVE_1 : NPC_HORDE_SLAVE_1;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_ALLIANCE_SLAVE_1 : NPC_HORDE_SLAVE_1;
|
||||
case NPC_HORDE_SLAVE_2:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ALLIANCE_SLAVE_2 : NPC_HORDE_SLAVE_2;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_ALLIANCE_SLAVE_2 : NPC_HORDE_SLAVE_2;
|
||||
case NPC_HORDE_SLAVE_3:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ALLIANCE_SLAVE_3 : NPC_HORDE_SLAVE_3;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_ALLIANCE_SLAVE_3 : NPC_HORDE_SLAVE_3;
|
||||
case NPC_HORDE_SLAVE_4:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ALLIANCE_SLAVE_4 : NPC_HORDE_SLAVE_4;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_ALLIANCE_SLAVE_4 : NPC_HORDE_SLAVE_4;
|
||||
case NPC_FREED_SLAVE_1_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_FREED_SLAVE_1_ALLIANCE : NPC_FREED_SLAVE_1_HORDE;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_FREED_SLAVE_1_ALLIANCE : NPC_FREED_SLAVE_1_HORDE;
|
||||
case NPC_FREED_SLAVE_2_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_FREED_SLAVE_2_ALLIANCE : NPC_FREED_SLAVE_2_HORDE;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_FREED_SLAVE_2_ALLIANCE : NPC_FREED_SLAVE_2_HORDE;
|
||||
case NPC_FREED_SLAVE_3_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_FREED_SLAVE_3_ALLIANCE : NPC_FREED_SLAVE_3_HORDE;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_FREED_SLAVE_3_ALLIANCE : NPC_FREED_SLAVE_3_HORDE;
|
||||
case NPC_RESCUED_SLAVE_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_RESCUED_SLAVE_ALLIANCE : NPC_RESCUED_SLAVE_HORDE;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_RESCUED_SLAVE_ALLIANCE : NPC_RESCUED_SLAVE_HORDE;
|
||||
case NPC_GORKUN_IRONSKULL_1:
|
||||
return _teamInInstance == ALLIANCE ? NPC_MARTIN_VICTUS_1 : NPC_GORKUN_IRONSKULL_1;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_MARTIN_VICTUS_1 : NPC_GORKUN_IRONSKULL_1;
|
||||
case NPC_GORKUN_IRONSKULL_2:
|
||||
return _teamInInstance == ALLIANCE ? NPC_MARTIN_VICTUS_2 : NPC_GORKUN_IRONSKULL_2;
|
||||
return instance->GetTeamInInstance() == ALLIANCE ? NPC_MARTIN_VICTUS_2 : NPC_GORKUN_IRONSKULL_2;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
@@ -167,7 +151,7 @@ class instance_pit_of_saron : public InstanceMapScript
|
||||
{
|
||||
if (instance->GetCreature(_garfrostGUID))
|
||||
{
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
if (instance->GetTeamInInstance() == ALLIANCE)
|
||||
{
|
||||
if (TempSummon* summon = instance->SummonCreature(NPC_MARTIN_VICTUS_1, SlaveLeaderPos))
|
||||
summon->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
|
||||
@@ -185,7 +169,7 @@ class instance_pit_of_saron : public InstanceMapScript
|
||||
{
|
||||
if (instance->GetCreature(_tyrannusGUID))
|
||||
{
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
if (instance->GetTeamInInstance() == ALLIANCE)
|
||||
{
|
||||
if (TempSummon * summon = instance->SummonCreature(NPC_JAINA_PART2, EventLeaderPos2))
|
||||
summon->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
|
||||
@@ -210,7 +194,7 @@ class instance_pit_of_saron : public InstanceMapScript
|
||||
switch (type)
|
||||
{
|
||||
case DATA_TEAM_IN_INSTANCE:
|
||||
return _teamInInstance;
|
||||
return instance->GetTeamInInstance();
|
||||
case DATA_ICE_SHARDS_HIT:
|
||||
return _shardsHit;
|
||||
case DATA_CAVERN_ACTIVE:
|
||||
@@ -294,7 +278,6 @@ class instance_pit_of_saron : public InstanceMapScript
|
||||
ObjectGuid _jainaOrSylvanas2GUID;
|
||||
GuidVector _cavernstriggersVector;
|
||||
|
||||
uint32 _teamInInstance;
|
||||
uint8 _shardsHit;
|
||||
uint8 _cavernActive;
|
||||
};
|
||||
|
||||
@@ -191,7 +191,6 @@ class instance_ulduar : public InstanceMapScript
|
||||
|
||||
_maxArmorItemLevel = 0;
|
||||
_maxWeaponItemLevel = 0;
|
||||
TeamInInstance = 0;
|
||||
HodirRareCacheData = 0;
|
||||
ColossusData = 0;
|
||||
elderCount = 0;
|
||||
@@ -234,7 +233,6 @@ class instance_ulduar : public InstanceMapScript
|
||||
ObjectGuid BrainRoomDoorGUIDs[3];
|
||||
|
||||
// Miscellaneous
|
||||
uint32 TeamInInstance;
|
||||
uint32 HodirRareCacheData;
|
||||
uint32 ColossusData;
|
||||
uint8 elderCount;
|
||||
@@ -245,11 +243,8 @@ class instance_ulduar : public InstanceMapScript
|
||||
bool Unbroken;
|
||||
bool IsDriveMeCrazyEligible;
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
void OnPlayerEnter(Player* /*player*/) override
|
||||
{
|
||||
if (!TeamInInstance)
|
||||
TeamInInstance = player->GetTeam();
|
||||
|
||||
if (_summonAlgalon)
|
||||
{
|
||||
_summonAlgalon = false;
|
||||
@@ -412,37 +407,29 @@ class instance_ulduar : 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)
|
||||
{
|
||||
case NPC_EIVI_NIGHTFEATHER:
|
||||
return TeamInInstance == HORDE ? NPC_TOR_GREYCLOUD : NPC_EIVI_NIGHTFEATHER;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_TOR_GREYCLOUD : NPC_EIVI_NIGHTFEATHER;
|
||||
case NPC_ELLIE_NIGHTFEATHER:
|
||||
return TeamInInstance == HORDE ? NPC_KAR_GREYCLOUD : NPC_ELLIE_NIGHTFEATHER;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_KAR_GREYCLOUD : NPC_ELLIE_NIGHTFEATHER;
|
||||
case NPC_ELEMENTALIST_MAHFUUN:
|
||||
return TeamInInstance == HORDE ? NPC_SPIRITWALKER_TARA : NPC_ELEMENTALIST_MAHFUUN;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_SPIRITWALKER_TARA : NPC_ELEMENTALIST_MAHFUUN;
|
||||
case NPC_ELEMENTALIST_AVUUN:
|
||||
return TeamInInstance == HORDE ? NPC_SPIRITWALKER_YONA : NPC_ELEMENTALIST_AVUUN;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_SPIRITWALKER_YONA : NPC_ELEMENTALIST_AVUUN;
|
||||
case NPC_MISSY_FLAMECUFFS:
|
||||
return TeamInInstance == HORDE ? NPC_AMIRA_BLAZEWEAVER : NPC_MISSY_FLAMECUFFS;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_AMIRA_BLAZEWEAVER : NPC_MISSY_FLAMECUFFS;
|
||||
case NPC_SISSY_FLAMECUFFS:
|
||||
return TeamInInstance == HORDE ? NPC_VEESHA_BLAZEWEAVER : NPC_SISSY_FLAMECUFFS;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_VEESHA_BLAZEWEAVER : NPC_SISSY_FLAMECUFFS;
|
||||
case NPC_FIELD_MEDIC_PENNY:
|
||||
return TeamInInstance == HORDE ? NPC_BATTLE_PRIEST_ELIZA : NPC_FIELD_MEDIC_PENNY;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_BATTLE_PRIEST_ELIZA : NPC_FIELD_MEDIC_PENNY;
|
||||
case NPC_FIELD_MEDIC_JESSI:
|
||||
return TeamInInstance == HORDE ? NPC_BATTLE_PRIEST_GINA : NPC_FIELD_MEDIC_JESSI;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_BATTLE_PRIEST_GINA : NPC_FIELD_MEDIC_JESSI;
|
||||
case NPC_MERCENARY_CAPTAIN_H:
|
||||
return TeamInInstance == HORDE ? NPC_MERCENARY_CAPTAIN_A : NPC_MERCENARY_CAPTAIN_H;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_MERCENARY_CAPTAIN_A : NPC_MERCENARY_CAPTAIN_H;
|
||||
case NPC_MERCENARY_SOLDIER_H:
|
||||
return TeamInInstance == HORDE ? NPC_MERCENARY_SOLDIER_A : NPC_MERCENARY_SOLDIER_H;
|
||||
return instance->GetTeamInInstance() == HORDE ? NPC_MERCENARY_SOLDIER_A : NPC_MERCENARY_SOLDIER_H;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void OutdoorPvPHP::HandlePlayerEnterZone(Player* player, uint32 zone)
|
||||
if (m_AllianceTowersControlled >=3)
|
||||
player->CastSpell(player, AllianceBuff, true);
|
||||
}
|
||||
else
|
||||
else if (player->GetTeam() == HORDE)
|
||||
{
|
||||
if (m_HordeTowersControlled >=3)
|
||||
player->CastSpell(player, HordeBuff, true);
|
||||
@@ -124,7 +124,7 @@ void OutdoorPvPHP::HandlePlayerLeaveZone(Player* player, uint32 zone)
|
||||
{
|
||||
player->RemoveAurasDueToSpell(AllianceBuff);
|
||||
}
|
||||
else
|
||||
else if (player->GetTeam() == HORDE)
|
||||
{
|
||||
player->RemoveAurasDueToSpell(HordeBuff);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed)
|
||||
player->KilledMonsterCredit(NA_CREDIT_MARKER); // 0 guid, btw it isn't even used in killedmonster function :S
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
player->CastSpell(player, NA_KILL_TOKEN_ALLIANCE, true);
|
||||
else
|
||||
else if (player->GetTeam() == HORDE)
|
||||
player->CastSpell(player, NA_KILL_TOKEN_HORDE, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ void OutdoorPvPTF::HandlePlayerEnterZone(Player* player, uint32 zone)
|
||||
if (m_AllianceTowersControlled >= TF_TOWER_NUM)
|
||||
player->CastSpell(player, TF_CAPTURE_BUFF, true);
|
||||
}
|
||||
else
|
||||
else if (player->GetTeam() == HORDE)
|
||||
{
|
||||
if (m_HordeTowersControlled >= TF_TOWER_NUM)
|
||||
player->CastSpell(player, TF_CAPTURE_BUFF, true);
|
||||
|
||||
@@ -119,7 +119,7 @@ void OutdoorPvPZM::HandlePlayerEnterZone(Player* player, uint32 zone)
|
||||
if (m_Graveyard->GetGraveyardState() & ZM_GRAVEYARD_A)
|
||||
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
|
||||
}
|
||||
else
|
||||
else if (player->GetTeam() == HORDE)
|
||||
{
|
||||
if (m_Graveyard->GetGraveyardState() & ZM_GRAVEYARD_H)
|
||||
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
|
||||
|
||||
@@ -66,16 +66,12 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
LoadDungeonEncounterData(encounters);
|
||||
executionTimer = 0;
|
||||
executed = 0;
|
||||
_team = 0;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
Aura* ex = nullptr;
|
||||
|
||||
if (!_team)
|
||||
_team = player->GetTeam();
|
||||
|
||||
player->CastSpell(player, SPELL_REMOVE_KARGATH_EXECUTIONER, true);
|
||||
|
||||
if (!executionTimer || executionerGUID.IsEmpty())
|
||||
@@ -102,14 +98,6 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
if (!_team)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
_team = player->GetTeam();
|
||||
}
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_GRAND_WARLOCK_NETHEKURSE:
|
||||
@@ -119,7 +107,7 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
kargathGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_RANDY_WHIZZLESPROCKET:
|
||||
if (_team == HORDE)
|
||||
if (instance->GetTeamInInstance() == HORDE)
|
||||
creature->UpdateEntry(NPC_DRISELLA);
|
||||
break;
|
||||
case NPC_SHATTERED_EXECUTIONER:
|
||||
@@ -205,7 +193,7 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
case DATA_PRISONERS_EXECUTED:
|
||||
return executed;
|
||||
case DATA_TEAM_IN_INSTANCE:
|
||||
return _team;
|
||||
return instance->GetTeamInInstance();
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -249,7 +237,6 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
|
||||
uint8 executed;
|
||||
uint32 executionTimer;
|
||||
uint32 _team;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1093,7 +1093,7 @@ class spell_gen_create_lance : public SpellScript
|
||||
{
|
||||
if (target->GetTeam() == ALLIANCE)
|
||||
GetCaster()->CastSpell(target, SPELL_CREATE_LANCE_ALLIANCE, true);
|
||||
else
|
||||
else if (target->GetTeam() == HORDE)
|
||||
GetCaster()->CastSpell(target, SPELL_CREATE_LANCE_HORDE, true);
|
||||
}
|
||||
}
|
||||
@@ -4704,7 +4704,7 @@ class spell_defender_of_azeroth_death_gate_selector : public SpellScript
|
||||
if (player->GetQuestStatus(QUEST_DEFENDER_OF_AZEROTH_ALLIANCE) == QUEST_STATUS_NONE && player->GetQuestStatus(QUEST_DEFENDER_OF_AZEROTH_HORDE) == QUEST_STATUS_NONE)
|
||||
return;
|
||||
|
||||
BindLocation bindLoc = player->GetTeam() == ALLIANCE ? StormwindInnLoc : OrgrimmarInnLoc;
|
||||
BindLocation const& bindLoc = player->GetTeam() == ALLIANCE ? StormwindInnLoc : OrgrimmarInnLoc;
|
||||
player->SetHomebind(bindLoc.Loc, bindLoc.AreaId);
|
||||
player->SendBindPointUpdate();
|
||||
player->SendPlayerBound(player->GetGUID(), bindLoc.AreaId);
|
||||
@@ -5018,7 +5018,7 @@ class spell_gen_skinning : public SpellScript
|
||||
case SKILL_CATACLYSM_SKINNING: return SPELL_CATACLYSM_SKINNING;
|
||||
case SKILL_PANDARIA_SKINNING: return SPELL_PANDARIA_SKINNING;
|
||||
case SKILL_DRAENOR_SKINNING: return SPELL_DRAENOR_SKINNING;
|
||||
case SKILL_KUL_TIRAN_SKINNING: return player->GetTeam() == ALLIANCE ? SPELL_KUL_TIRAN_SKINNING : SPELL_ZANDALARI_SKINNING;
|
||||
case SKILL_KUL_TIRAN_SKINNING: return player->GetTeam() == ALLIANCE ? SPELL_KUL_TIRAN_SKINNING : (player->GetTeam() == HORDE ? SPELL_ZANDALARI_SKINNING : 0);
|
||||
case SKILL_SHADOWLANDS_SKINNING: return SPELL_SHADOWLANDS_SKINNING;
|
||||
case SKILL_DRAGON_ISLES_SKINNING: return SPELL_DRAGON_ISLES_SKINNING;
|
||||
case SKILL_CLASSIC_SKINNING: // Trainer only
|
||||
|
||||
Reference in New Issue
Block a user