*Use UpdateEntry instead of SetDisplayId. By manuel, closes #348

--HG--
branch : trunk
This commit is contained in:
maximius
2009-11-20 15:38:09 -08:00
parent 8706c0ccba
commit 5db87f8102
@@ -48,7 +48,7 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
Anomalus = 0; Anomalus = 0;
} }
void OnCreatureCreate(Creature* pCreature, bool add) void OnCreatureCreate(Creature *pCreature, bool bAdd)
{ {
Map::PlayerList const &players = instance->GetPlayers(); Map::PlayerList const &players = instance->GetPlayers();
uint32 TeamInInstance = 0; uint32 TeamInInstance = 0;
@@ -56,58 +56,56 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
if (!players.isEmpty()) if (!players.isEmpty())
{ {
if (Player* pPlayer = players.begin()->getSource()) if (Player* pPlayer = players.begin()->getSource())
{
TeamInInstance = pPlayer->GetTeam(); TeamInInstance = pPlayer->GetTeam();
} }
}
switch (pCreature->GetEntry()) switch (pCreature->GetEntry())
{ {
case 26763: Anomalus = pCreature->GetGUID(); break; case 26763:
case 26723: Keristrasza = pCreature->GetGUID(); break; 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: case 26800:
{ {
//26799
pCreature->setFaction(16); pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24358); pCreature->UpdateEntry(26799, HORDE);
break; break;
} }
case 26802: case 26802:
{ {
//26801
pCreature->setFaction(16); pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24354); pCreature->UpdateEntry(26801, HORDE);
break; break;
} }
case 26805: case 26805:
{ {
//26803
pCreature->setFaction(16); pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24357); pCreature->UpdateEntry(26803, HORDE);
break; break;
} }
case 27949: case 27949:
{ {
//27947
pCreature->setFaction(16); pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24352); pCreature->UpdateEntry(27947, HORDE);
break; break;
} }
case 26796: case 26796:
{ {
//26798
pCreature->setFaction(16); pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24352); pCreature->UpdateEntry(26798, HORDE);
break; break;
} }
} }
} }
void OnGameObjectCreate(GameObject* pGo, bool add) void OnGameObjectCreate(GameObject *pGo, bool bAdd)
{ {
switch (pGo->GetEntry()) switch (pGo->GetEntry())
{ {
@@ -166,8 +164,7 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
{ {
if (data == DONE) if (data == DONE)
{ {
GameObject *Sphere = instance->GetGameObject(AnomalusContainmentSphere); if (GameObject *Sphere = instance->GetGameObject(AnomalusContainmentSphere))
if (Sphere)
Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
} }
m_auiEncounter[1] = data; m_auiEncounter[1] = data;
@@ -177,14 +174,15 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
{ {
if (data == DONE) if (data == DONE)
{ {
GameObject *Sphere = instance->GetGameObject(OrmoroksContainmentSphere); if (GameObject *Sphere = instance->GetGameObject(OrmoroksContainmentSphere))
if (Sphere)
Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
} }
m_auiEncounter[2] = data; m_auiEncounter[2] = data;
break; break;
} }
case DATA_KERISTRASZA_EVENT: m_auiEncounter[3] = data; break; case DATA_KERISTRASZA_EVENT:
m_auiEncounter[3] = data;
break;
} }
if (data == DONE) 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]; loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];
for (uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; ++i) for (uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; ++i)
{
if (m_auiEncounter[i] == IN_PROGRESS) if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED; m_auiEncounter[i] = NOT_STARTED;
}
OUT_LOAD_INST_DATA_COMPLETE; OUT_LOAD_INST_DATA_COMPLETE;
} }