*Change some instance functions to TC functions.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-09 16:55:24 -05:00
parent deb9dd1543
commit 6b038c7d85
36 changed files with 84 additions and 100 deletions
@@ -37,7 +37,7 @@ struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance
IkissDoor = NULL;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -69,7 +69,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
return false;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -193,7 +193,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -69,9 +69,9 @@ struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature_entry)
switch(creature->GetEntry())
{
case 29309: Elder_Nadox = creature->GetGUID(); break;
case 29308: Prince_Taldaram = creature->GetGUID(); break;
@@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -64,9 +64,9 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature_entry)
switch(creature->GetEntry())
{
case 28684: Krikthir = creature->GetGUID(); break;
case 28921: Hadronox = creature->GetGUID(); break;
@@ -130,7 +130,7 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -148,7 +148,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -305,7 +305,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -267,7 +267,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -149,7 +149,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
player->SendUpdateWorldState(WORLD_STATE_BM,0);
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
if (creature->GetEntry() == C_MEDIVH)
MedivhGUID = creature->GetGUID();
@@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
return false;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -120,7 +120,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
HandleGameObject(DoorGUID, open, NULL);
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -281,7 +281,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -96,7 +96,7 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
debug_log("TSCR: Instance Old Hillsbrad: UpdateOHWorldState, but PlayerList is empty!");
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
return false;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -105,7 +105,7 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -115,7 +115,7 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -141,7 +141,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
DoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4);
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
return false;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance
Sewer2GUID = 0;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -42,12 +42,12 @@ struct TRINITY_DLL_DECL instance_ramparts : public ScriptedInstance
}
void OnObjectCreate(GameObject* pGo)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(pGo->GetEntry())
switch(go->GetEntry())
{
case 185168: m_uiChestNGUID = pGo->GetGUID(); break;
case 185169: m_uiChestHGUID = pGo->GetGUID(); break;
case 185168: m_uiChestNGUID = go->GetGUID(); break;
case 185169: m_uiChestHGUID = go->GetGUID(); break;
}
}
@@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance
return false;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -84,7 +84,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance
Encounter[i] = NOT_STARTED;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch( go->GetEntry() )
{
@@ -53,9 +53,9 @@ struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch( creature_entry )
switch(creature->GetEntry())
{
case 16807: nethekurseGUID = creature->GetGUID(); break;
}
@@ -126,7 +126,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
return 0;
}
void OnCreatureCreate(Creature *creature, uint32 entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature->GetEntry())
{
@@ -210,7 +210,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -249,7 +249,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -113,7 +113,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -123,7 +123,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance
};
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -124,9 +124,9 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature_entry)
switch (creature->GetEntry())
{
case ID_LUCIFRON:
Lucifron = creature->GetGUID();
@@ -41,7 +41,7 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
Encounters[i] = NOT_STARTED;
}
void OnCreatureCreate(Creature* pCreature)
void OnCreatureCreate(Creature* pCreature, bool add)
{
Map::PlayerList const& players = instance->GetPlayers();
uint32 TeamInInstance;
@@ -146,7 +146,7 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
}
}
const char* Save()
std::string GetSaveData()
{
return strInstData.c_str();
}
@@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
Encounter[i] = NOT_STARTED;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -73,9 +73,9 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature_entry)
switch(creature->GetEntry())
{
case ENTRY_HORSEMAN: HorsemanGUID = creature->GetGUID(); break;
case ENTRY_HEAD: HeadGUID = creature->GetGUID(); break;
@@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance
Encounter[i] = NOT_STARTED;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -82,7 +82,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature* pCreature, uint32 uiCreature)
void OnCreatureCreate(Creature* pCreature, bool add)
{
switch(pCreature->GetEntry())
{
@@ -91,7 +91,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -188,7 +188,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -150,7 +150,7 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -162,7 +162,7 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -119,9 +119,9 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature* creature, uint32 entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(entry)
switch(creature->GetEntry())
{
case 24850: Kalecgos_Dragon = creature->GetGUID(); break;
case 24891: Kalecgos_Human = creature->GetGUID(); break;
@@ -139,17 +139,17 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* gobj)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(gobj->GetEntry())
switch(go->GetEntry())
{
case 188421: ForceField = gobj->GetGUID(); break;
case 188075: FireBarrier = gobj->GetGUID(); break;
case 187979: Gate[0] = gobj->GetGUID(); break;
case 187770: Gate[1] = gobj->GetGUID(); break;
case 187896: Gate[2] = gobj->GetGUID(); break;
case 187990: Gate[3] = gobj->GetGUID(); break;
case 188118: Gate[4] = gobj->GetGUID(); break;
case 188421: ForceField = go->GetGUID(); break;
case 188075: FireBarrier = go->GetGUID(); break;
case 187979: Gate[0] = go->GetGUID(); break;
case 187770: Gate[1] = go->GetGUID(); break;
case 187896: Gate[2] = go->GetGUID(); break;
case 187990: Gate[3] = go->GetGUID(); break;
case 188118: Gate[4] = go->GetGUID(); break;
}
}
@@ -91,7 +91,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance
return false;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -107,7 +107,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
if (creature->GetEntry() == MELLICHAR)
MellicharGUID = creature->GetGUID();
@@ -75,7 +75,7 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance
return false;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -33,10 +33,6 @@ struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance
uint32 Encounters[ENCOUNTERS];
void OnCreatureCreate (Creature *creature, uint32 creature_entry)
{
}
void Initialize()
{
for(uint8 i = 0; i < ENCOUNTERS; ++i)
@@ -59,9 +59,9 @@ struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance
CthunPhase = 0;
}
void OnCreatureCreate (Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature_entry)
switch (creature->GetEntry())
{
case 15263: SkeramGUID = creature->GetGUID(); break;
case 15544: VemGUID = creature->GetGUID(); break;
@@ -57,7 +57,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance
std::vector<uint64> earthenGuardian;
std::vector<uint64> archaedasWallMinions; // minions lined up around the wall
void OnObjectCreate (GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch (go->GetEntry())
{
@@ -238,9 +238,9 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance
}
void OnCreatureCreate (Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature_entry) {
switch (creature->GetEntry()) {
case 4857: // Stone Keeper
SetFrozenState (creature);
stoneKeeper.push_back(creature->GetGUID());
@@ -105,9 +105,9 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature_entry)
switch(creature->GetEntry())
{
case 23953: Keleseth = creature->GetGUID(); break;
case 24201: Dalronn = creature->GetGUID(); break;
@@ -116,7 +116,7 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -242,7 +242,7 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance
return false;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -37,9 +37,9 @@ struct TRINITY_DLL_DECL instance_zulgurub : public ScriptedInstance
uint64 ThekalGUID;
uint64 JindoGUID;
void OnCreatureCreate (Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature_entry)
switch (creature->GetEntry())
{
case 11347:
LorKhanGUID = creature->GetGUID();