mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Scripts/Misc: Removed more UpdateEntry on InstanceScripts
This commit is contained in:
@@ -47,6 +47,7 @@ public:
|
||||
uiMovementDone = 0;
|
||||
uiGrandChampionsDeaths = 0;
|
||||
uiArgentSoldierDeaths = 0;
|
||||
teamInInstance = 0;
|
||||
|
||||
bDone = false;
|
||||
|
||||
@@ -55,6 +56,7 @@ public:
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
uint32 teamInInstance;
|
||||
uint16 uiMovementDone;
|
||||
uint16 uiGrandChampionsDeaths;
|
||||
uint8 uiArgentSoldierDeaths;
|
||||
@@ -87,46 +89,16 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
if (!teamInInstance)
|
||||
teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
uint32 TeamInInstance = 0;
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
TeamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
// Champions
|
||||
case VEHICLE_MOKRA_SKILLCRUSHER_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT);
|
||||
break;
|
||||
case VEHICLE_ERESSEA_DAWNSINGER_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_AMBROSE_BOLTSPARK_MOUNT);
|
||||
break;
|
||||
case VEHICLE_RUNOK_WILDMANE_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_COLOSOS_MOUNT);
|
||||
break;
|
||||
case VEHICLE_ZUL_TORE_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_EVENSONG_MOUNT);
|
||||
break;
|
||||
case VEHICLE_DEATHSTALKER_VESCERI_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_LANA_STOUTHAMMER_MOUNT);
|
||||
break;
|
||||
// Coliseum Announcer || Just NPC_JAEREN must be spawned.
|
||||
case NPC_JAEREN:
|
||||
uiAnnouncerGUID = creature->GetGUID();
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ARELAS);
|
||||
break;
|
||||
case VEHICLE_ARGENT_WARHORSE:
|
||||
case VEHICLE_ARGENT_BATTLEWORG:
|
||||
VehicleList.push_back(creature->GetGUID());
|
||||
@@ -135,6 +107,42 @@ public:
|
||||
case NPC_PALETRESS:
|
||||
uiArgentChampionGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_JAEREN:
|
||||
case NPC_ARELAS:
|
||||
uiAnnouncerGUID = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
case VEHICLE_ERESSEA_DAWNSINGER_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_AMBROSE_BOLTSPARK_MOUNT : VEHICLE_ERESSEA_DAWNSINGER_MOUNT;
|
||||
case VEHICLE_RUNOK_WILDMANE_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_COLOSOS_MOUNT : VEHICLE_RUNOK_WILDMANE_MOUNT;
|
||||
case VEHICLE_ZUL_TORE_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_EVENSONG_MOUNT : VEHICLE_ZUL_TORE_MOUNT;
|
||||
case VEHICLE_DEATHSTALKER_VESCERI_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_LANA_STOUTHAMMER_MOUNT : VEHICLE_DEATHSTALKER_VESCERI_MOUNT;
|
||||
case NPC_JAEREN:
|
||||
return teamInInstance == HORDE ? NPC_ARELAS : NPC_JAEREN;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,14 +54,6 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
|
||||
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_BRONJAHM:
|
||||
@@ -70,18 +62,30 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
case NPC_DEVOURER:
|
||||
devourerOfSouls = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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:
|
||||
if (teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_JAINA_PART1);
|
||||
break;
|
||||
return teamInInstance == ALLIANCE ? NPC_JAINA_PART1 : NPC_SYLVANAS_PART1;
|
||||
case NPC_LORALEN:
|
||||
if (teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ELANDRA);
|
||||
break;
|
||||
return teamInInstance == ALLIANCE ? NPC_ELANDRA : NPC_LORALEN;
|
||||
case NPC_KALIRA:
|
||||
if (teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_KORELN);
|
||||
break;
|
||||
return teamInInstance == ALLIANCE ? NPC_KORELN : NPC_KALIRA;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,84 +89,60 @@ class instance_pit_of_saron : public InstanceMapScript
|
||||
case NPC_TYRANNUS_EVENTS:
|
||||
_tyrannusEventGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SYLVANAS_PART1:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_JAINA_PART1);
|
||||
_jainaOrSylvanas1GUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SYLVANAS_PART2:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_JAINA_PART2);
|
||||
_jainaOrSylvanas2GUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_KILARA:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ELANDRA);
|
||||
break;
|
||||
case NPC_KORALEN:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_KORLAEN);
|
||||
break;
|
||||
case NPC_CHAMPION_1_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_CHAMPION_1_ALLIANCE);
|
||||
break;
|
||||
case NPC_CHAMPION_2_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_CHAMPION_2_ALLIANCE);
|
||||
break;
|
||||
case NPC_CHAMPION_3_HORDE: // No 3rd set for Alliance?
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_CHAMPION_2_ALLIANCE);
|
||||
break;
|
||||
case NPC_HORDE_SLAVE_1:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALLIANCE_SLAVE_1);
|
||||
break;
|
||||
case NPC_HORDE_SLAVE_2:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALLIANCE_SLAVE_2);
|
||||
break;
|
||||
case NPC_HORDE_SLAVE_3:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALLIANCE_SLAVE_3);
|
||||
break;
|
||||
case NPC_HORDE_SLAVE_4:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALLIANCE_SLAVE_4);
|
||||
break;
|
||||
case NPC_FREED_SLAVE_1_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_FREED_SLAVE_1_ALLIANCE);
|
||||
break;
|
||||
case NPC_FREED_SLAVE_2_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_FREED_SLAVE_2_ALLIANCE);
|
||||
break;
|
||||
case NPC_FREED_SLAVE_3_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_FREED_SLAVE_3_ALLIANCE);
|
||||
break;
|
||||
case NPC_RESCUED_SLAVE_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_RESCUED_SLAVE_ALLIANCE);
|
||||
break;
|
||||
case NPC_MARTIN_VICTUS_1:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_MARTIN_VICTUS_1);
|
||||
break;
|
||||
case NPC_MARTIN_VICTUS_2:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_MARTIN_VICTUS_2);
|
||||
break;
|
||||
case NPC_CAVERN_EVENT_TRIGGER:
|
||||
_cavernstriggersVector.push_back(creature->GetGUID());
|
||||
break;
|
||||
case NPC_SYLVANAS_PART1:
|
||||
case NPC_SYLVANAS_PART2:
|
||||
case NPC_JAINA_PART1:
|
||||
case NPC_JAINA_PART2:
|
||||
_jainaOrSylvanas1GUID = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
|
||||
{
|
||||
uint32 entry = data->id;
|
||||
switch (entry)
|
||||
{
|
||||
case NPC_SYLVANAS_PART1:
|
||||
return _teamInInstance == ALLIANCE ? NPC_JAINA_PART1 : NPC_SYLVANAS_PART1;
|
||||
case NPC_SYLVANAS_PART2:
|
||||
return _teamInInstance == ALLIANCE ? NPC_JAINA_PART2 : NPC_SYLVANAS_PART2;
|
||||
case NPC_KILARA:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ELANDRA : NPC_KILARA;
|
||||
case NPC_KORALEN:
|
||||
return _teamInInstance == ALLIANCE ? NPC_KORLAEN : NPC_KORALEN;
|
||||
case NPC_CHAMPION_1_HORDE:
|
||||
return _teamInInstance == 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;
|
||||
case NPC_CHAMPION_3_HORDE:
|
||||
return _teamInInstance == 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;
|
||||
case NPC_HORDE_SLAVE_2:
|
||||
return _teamInInstance == 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;
|
||||
case NPC_HORDE_SLAVE_4:
|
||||
return _teamInInstance == 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;
|
||||
case NPC_FREED_SLAVE_2_HORDE:
|
||||
return _teamInInstance == 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;
|
||||
case NPC_RESCUED_SLAVE_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_RESCUED_SLAVE_ALLIANCE : NPC_RESCUED_SLAVE_HORDE;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
|
||||
@@ -187,14 +187,6 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
|
||||
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_LORD_MARROWGAR:
|
||||
@@ -314,6 +306,14 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
// Weekly quest spawn prevention
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -54,42 +54,47 @@ class instance_nexus : public InstanceMapScript
|
||||
case NPC_KERISTRASZA:
|
||||
KeristraszaGUID = creature->GetGUID();
|
||||
break;
|
||||
// Alliance npcs are spawned by default, if you are alliance, you will fight against horde npcs.
|
||||
case NPC_ALLIANCE_BERSERKER:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_HORDE_BERSERKER);
|
||||
break;
|
||||
case NPC_ALLIANCE_RANGER:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_HORDE_RANGER);
|
||||
break;
|
||||
case NPC_ALLIANCE_CLERIC:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_HORDE_CLERIC);
|
||||
break;
|
||||
case NPC_ALLIANCE_COMMANDER:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_HORDE_COMMANDER);
|
||||
break;
|
||||
case NPC_COMMANDER_STOUTBEARD:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_COMMANDER_KOLURG);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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_ALLIANCE_BERSERKER:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_BERSERKER : NPC_ALLIANCE_BERSERKER;
|
||||
case NPC_ALLIANCE_RANGER:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_RANGER : NPC_ALLIANCE_RANGER;
|
||||
case NPC_ALLIANCE_CLERIC:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_CLERIC : NPC_ALLIANCE_CLERIC;
|
||||
case NPC_ALLIANCE_COMMANDER:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_COMMANDER : NPC_ALLIANCE_COMMANDER;
|
||||
case NPC_COMMANDER_STOUTBEARD:
|
||||
return _teamInInstance == ALLIANCE ? NPC_COMMANDER_KOLURG : NPC_COMMANDER_STOUTBEARD;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
|
||||
Reference in New Issue
Block a user