*Use UpdateEntry instead of SetDisplayId. By manuel, closes #348
--HG-- branch : trunk
This commit is contained in:
@@ -48,7 +48,7 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
|
||||
Anomalus = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool add)
|
||||
void OnCreatureCreate(Creature *pCreature, bool bAdd)
|
||||
{
|
||||
Map::PlayerList const &players = instance->GetPlayers();
|
||||
uint32 TeamInInstance = 0;
|
||||
@@ -56,58 +56,56 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
if (Player* pPlayer = players.begin()->getSource())
|
||||
{
|
||||
TeamInInstance = pPlayer->GetTeam();
|
||||
}
|
||||
}
|
||||
switch (pCreature->GetEntry())
|
||||
{
|
||||
case 26763: Anomalus = pCreature->GetGUID(); break;
|
||||
case 26723: Keristrasza = pCreature->GetGUID(); break;
|
||||
case 26763:
|
||||
Anomalus = pCreature->GetGUID();
|
||||
break;
|
||||
case 26723:
|
||||
Keristrasza = pCreature->GetGUID();
|
||||
break;
|
||||
// Alliance npcs are spawned by default, if you are alliance, you will fight against horde npcs.
|
||||
case 26800:
|
||||
{
|
||||
//26799
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24358);
|
||||
pCreature->UpdateEntry(26799, HORDE);
|
||||
break;
|
||||
}
|
||||
case 26802:
|
||||
{
|
||||
//26801
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24354);
|
||||
pCreature->UpdateEntry(26801, HORDE);
|
||||
break;
|
||||
}
|
||||
case 26805:
|
||||
{
|
||||
//26803
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24357);
|
||||
pCreature->UpdateEntry(26803, HORDE);
|
||||
break;
|
||||
}
|
||||
case 27949:
|
||||
{
|
||||
//27947
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24352);
|
||||
pCreature->UpdateEntry(27947, HORDE);
|
||||
break;
|
||||
}
|
||||
case 26796:
|
||||
{
|
||||
//26798
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24352);
|
||||
pCreature->UpdateEntry(26798, HORDE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
void OnGameObjectCreate(GameObject *pGo, bool bAdd)
|
||||
{
|
||||
switch (pGo->GetEntry())
|
||||
{
|
||||
@@ -166,8 +164,7 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
|
||||
{
|
||||
if (data == DONE)
|
||||
{
|
||||
GameObject *Sphere = instance->GetGameObject(AnomalusContainmentSphere);
|
||||
if (Sphere)
|
||||
if (GameObject *Sphere = instance->GetGameObject(AnomalusContainmentSphere))
|
||||
Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
}
|
||||
m_auiEncounter[1] = data;
|
||||
@@ -177,14 +174,15 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
|
||||
{
|
||||
if (data == DONE)
|
||||
{
|
||||
GameObject *Sphere = instance->GetGameObject(OrmoroksContainmentSphere);
|
||||
if (Sphere)
|
||||
if (GameObject *Sphere = instance->GetGameObject(OrmoroksContainmentSphere))
|
||||
Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
}
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
}
|
||||
case DATA_KERISTRASZA_EVENT: m_auiEncounter[3] = data; break;
|
||||
case DATA_KERISTRASZA_EVENT:
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
@@ -234,10 +232,8 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
|
||||
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];
|
||||
|
||||
for (uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; ++i)
|
||||
{
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user