本文整理汇总了C++中HandleGameObject函数的典型用法代码示例。如果您正苦于以下问题:C++ HandleGameObject函数的具体用法?C++ HandleGameObject怎么用?C++ HandleGameObject使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HandleGameObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGameObjectCreate
void OnGameObjectCreate(GameObject* pGo, bool /*add*/) {
switch (pGo->GetEntry()) {
//door and object id
case ENTRY_BELLOW_1:
forge_bellow[0] = pGo->GetGUID();
if (forge_event[0] != NOT_STARTED)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_BELLOW_2:
forge_bellow[1] = pGo->GetGUID();
if (forge_event[1] != NOT_STARTED)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_BELLOW_3:
forge_bellow[2] = pGo->GetGUID();
if (forge_event[2] != NOT_STARTED)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_FORGEFIRE_1:
forge_fire[0] = pGo->GetGUID();
if (forge_event[0] != NOT_STARTED)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_FORGEFIRE_2:
forge_fire[1] = pGo->GetGUID();
if (forge_event[1] != NOT_STARTED)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_FORGEFIRE_3:
forge_fire[2] = pGo->GetGUID();
if (forge_event[2] != NOT_STARTED)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_GLOWING_ANVIL_1:
forge_anvil[0] = pGo->GetGUID();
if (forge_event[0] != NOT_STARTED)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_GLOWING_ANVIL_2:
forge_anvil[1] = pGo->GetGUID();
if (forge_event[1] != NOT_STARTED)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_GLOWING_ANVIL_3:
forge_anvil[2] = pGo->GetGUID();
if (forge_event[2] != NOT_STARTED)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_GIANT_PORTCULLIS_1:
portcullis[0] = pGo->GetGUID();
if (m_auiEncounter[2] == DONE)
HandleGameObject(NULL, true, pGo);
break;
case ENTRY_GIANT_PORTCULLIS_2:
portcullis[1] = pGo->GetGUID();
if (m_auiEncounter[2] == DONE)
HandleGameObject(NULL, true, pGo);
break;
}
}
示例2: SetData
void SetData(uint32 type, uint32 data)
{
switch (type)
{
case DATA_HIGHWARLORDNAJENTUSEVENT:
if (data == DONE)
HandleGameObject(NajentusGate, true);
m_auiEncounter[0] = data;
break;
case DATA_SUPREMUSEVENT:
if (data == DONE)
HandleGameObject(NajentusGate, true);
m_auiEncounter[1] = data;
break;
case DATA_SHADEOFAKAMAEVENT:
if (data == IN_PROGRESS)
HandleGameObject(ShadeOfAkamaDoor, false);
else
HandleGameObject(ShadeOfAkamaDoor, true);
m_auiEncounter[2] = data;
break;
case DATA_TERONGOREFIENDEVENT:
if (data == IN_PROGRESS)
{
HandleGameObject(TeronDoor, false);
HandleGameObject(CommonDoor, false);
}
else
{
HandleGameObject(TeronDoor, true);
HandleGameObject(CommonDoor, true);
}
m_auiEncounter[3] = data;
break;
case DATA_GURTOGGBLOODBOILEVENT:
if (data == DONE)
HandleGameObject(GuurtogDoor, true);
m_auiEncounter[4] = data;
break;
case DATA_RELIQUARYOFSOULSEVENT:
if (data == DONE)
HandleGameObject(TempleDoor, true);
m_auiEncounter[5] = data;
break;
case DATA_MOTHERSHAHRAZEVENT:
if (data == DONE)
HandleGameObject(MotherDoor, true);
m_auiEncounter[6] = data;
break;
case DATA_ILLIDARICOUNCILEVENT:
if (data == IN_PROGRESS)
{
HandleGameObject(CouncilDoor, false);
HandleGameObject(SimpleDoor, false);
}
else
{
HandleGameObject(CouncilDoor, true);
HandleGameObject(SimpleDoor, true);
}
m_auiEncounter[7] = data;
break;
case DATA_ILLIDANSTORMRAGEEVENT:
m_auiEncounter[8] = data;
break;
}
if (m_auiEncounter[5] == DONE && m_auiEncounter[4] == DONE && m_auiEncounter[3] == DONE && m_auiEncounter[2] == DONE)
{
HandleGameObject(TempleDoor, true);
}
if (data == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4]
<< ' ' << m_auiEncounter[5] << ' ' << m_auiEncounter[6] << ' ' << m_auiEncounter[7]
<< ' ' << m_auiEncounter[8];
str_data = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
示例3: OpenDoor
void OpenDoor(uint64 DoorGUID, bool open)
{
HandleGameObject(DoorGUID, open, NULL);
}
示例4: SetData
void SetData(uint32 type, uint32 data)
{
switch (type)
{
case TYPE_GELIHAST:
encounter[0] = data;
if (data == DONE)
if (GameObject* go = instance->GetGameObject(shrineOfGelihastGUID))
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
break;
case TYPE_AKU_MAI:
encounter[3] = data;
if (data == DONE)
if (GameObject* go = instance->GetGameObject(altarOfTheDeepsGUID))
{
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
go->SummonCreature(NPC_MORRIDUNE, SpawnsLocation[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case DATA_FIRE:
countFires = data;
switch (countFires)
{
case 1:
if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case 2:
if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
for (uint8 i = 0; i < 2; ++i)
{
go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
}
break;
case 3:
if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case 4:
if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
}
break;
case DATA_EVENT:
deathTimes = data;
if (deathTimes == 18)
HandleGameObject(mainDoorGUID, true);
break;
}
}
示例5: TombOfSevenStart
void TombOfSevenStart()
{
HandleGameObject(GoTombExitGUID, false);//event started, close exit door
HandleGameObject(GoTombEnterGUID, false);//event started, close entrance door
SetData(TYPE_TOMB_OF_SEVEN, IN_PROGRESS);
}
示例6: OnGameObjectCreate
void OnGameObjectCreate(GameObject* go)
{
// TODO: init state depending on encounters
switch (go->GetEntry())
{
case GO_FROSTMOURNE:
uiFrostmourne = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
HandleGameObject(0, false, go);
break;
case GO_FROSTMOURNE_ALTAR:
uiFrostmourneAltar = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
HandleGameObject(0, true, go);
break;
case GO_FRONT_DOOR:
uiFrontDoor = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
OpenDoor(uiFrontDoor);
break;
case GO_FROSTSWORN_DOOR:
uiFrostswornDoor = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
if (uiEncounter[1] == DONE)
OpenDoor(uiFrostswornDoor);
else
CloseDoor(uiFrostswornDoor);
break;
case GO_RUN_DOOR:
uiRunDoor = go->GetGUID();
break;
case GO_ARTHAS_DOOR:
uiArthasDoor = go->GetGUID();
break;
case GO_ICE_WALL_1:
uiWallID[0] = go->GetGUID();
break;
case GO_ICE_WALL_2:
uiWallID[1] = go->GetGUID();
break;
case GO_ICE_WALL_3:
uiWallID[2] = go->GetGUID();
break;
case GO_ICE_WALL_4:
uiWallID[3] = go->GetGUID();
break;
case GO_CAVE:
uiCaveDoor = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_1:
go->SetPhaseMask(2, true);
if (!instance->IsHeroic() && uiTeamInInstance == HORDE)
uiChest = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_3:
go->SetPhaseMask(2, true);
if (instance->IsHeroic() && uiTeamInInstance == HORDE)
uiChest = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_2:
go->SetPhaseMask(2, true);
if (!instance->IsHeroic() && uiTeamInInstance == ALLIANCE)
uiChest = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_4:
go->SetPhaseMask(2, true);
if (instance->IsHeroic() && uiTeamInInstance == ALLIANCE)
uiChest = go->GetGUID();
break;
case GO_SKYBREAKER:
go->SetPhaseMask(2, true);
if (uiTeamInInstance == ALLIANCE)
uiGunship = go->GetGUID();
break;
case GO_ORGRIM_HAMMER:
go->SetPhaseMask(2, true);
if (uiTeamInInstance == HORDE)
uiGunship = go->GetGUID();
break;
case GO_PORTAL:
go->SetPhaseMask(2, true);
uiPortal = go->GetGUID();
break;
}
}
示例7: OnObjectCreate
void OnObjectCreate(GameObject* pGo)
{
switch(pGo->GetEntry())
{
case 192518:
uiSladRanAltar = pGo->GetGUID();
// Make sure that they start out as unusuable
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
if (m_auiEncounter[0] == DONE)
{
if (uiSladRanStatueState == GO_STATE_ACTIVE)
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
else
{
++phase;
pGo->SetGoState(GO_STATE_ACTIVE);
}
}
break;
case 192519:
uiMoorabiAltar = pGo->GetGUID();
// Make sure that they start out as unusuable
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
if (m_auiEncounter[0] == DONE)
{
if (uiMoorabiStatueState == GO_STATE_ACTIVE)
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
else
{
++phase;
pGo->SetGoState(GO_STATE_ACTIVE);
}
}
break;
case 192520:
uiDrakkariColossusAltar = pGo->GetGUID();
// Make sure that they start out as unusuable
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
if (m_auiEncounter[0] == DONE)
{
if (uiDrakkariColossusStatueState == GO_STATE_ACTIVE)
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
else
{
++phase;
pGo->SetGoState(GO_STATE_ACTIVE);
}
}
break;
case 192564:
uiSladRanStatue = pGo->GetGUID();
pGo->SetGoState(uiSladRanStatueState);
break;
case 192565:
uiMoorabiStatue = pGo->GetGUID();
pGo->SetGoState(uiMoorabiStatueState);
break;
case 192566:
uiGalDarahStatue = pGo->GetGUID();
pGo->SetGoState(uiGalDarahStatueState);
break;
case 192567:
uiDrakkariColossusStatue = pGo->GetGUID();
pGo->SetGoState(uiDrakkariColossusStatueState);
break;
case 192632:
uiEckTheFerociousDoor = pGo->GetGUID();
if (bHeroicMode && m_auiEncounter[1] == DONE)
HandleGameObject(NULL,true,pGo);
break;
case 192569:
uiEckTheFerociousDoorBehind = pGo->GetGUID();
if (bHeroicMode && m_auiEncounter[4] == DONE)
HandleGameObject(NULL,true,pGo);
case 193208:
uiGalDarahDoor1 = pGo->GetGUID();
if (m_auiEncounter[3] == DONE)
HandleGameObject(NULL,true,pGo);
break;
case 193209:
uiGalDarahDoor2 = pGo->GetGUID();
if (m_auiEncounter[3] == DONE)
HandleGameObject(NULL,true,pGo);
break;
}
}
示例8: SetData
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_PRINCEKELESETH_EVENT:
if(data == DONE)
{
//HandleGameObject(doorname, 0);
}
Encounters[0] = data;
break;
case DATA_SKARVALD_DALRONN_EVENT:
if(data == DONE)
{
//HandleGameObject(doorname, 0);
}
Encounters[1] = data;
break;
case DATA_INGVAR_EVENT:
if(data == DONE)
{
//HandleGameObject(doorname, 0);
}
Encounters[2] = data;
break;
case EVENT_FORGE_1:
if(data == NOT_STARTED)
{
HandleGameObject(forge_bellow[0],false);
HandleGameObject(forge_fire[0],false);
HandleGameObject(forge_anvil[0],false);
}else
{
HandleGameObject(forge_bellow[0],true);
HandleGameObject(forge_fire[0],true);
HandleGameObject(forge_anvil[0],true);
}
break;
case EVENT_FORGE_2:
if(data == NOT_STARTED)
{
HandleGameObject(forge_bellow[1],false);
HandleGameObject(forge_fire[1],false);
HandleGameObject(forge_anvil[1],false);
}else
{
HandleGameObject(forge_bellow[1],true);
HandleGameObject(forge_fire[1],true);
HandleGameObject(forge_anvil[1],true);
}
break;
case EVENT_FORGE_3:
if(data == NOT_STARTED)
{
HandleGameObject(forge_bellow[2],false);
HandleGameObject(forge_fire[2],false);
HandleGameObject(forge_anvil[2],false);
}else
{
HandleGameObject(forge_bellow[2],true);
HandleGameObject(forge_fire[2],true);
HandleGameObject(forge_anvil[2],true);
}
break;
}
if (data == DONE)
{
SaveToDB();
}
}
示例9: SetBossState
bool SetBossState(uint32 type, EncounterState state)
{
if (!InstanceScript::SetBossState(type, state))
return false;
if (uiEncounter[type] != DONE)
uiEncounter[type] = state;
if (state == DONE)
SaveToDB();
switch (type)
{
case TYPE_LEVIATHAN:
for (std::list<uint64>::iterator i = uiLeviathanDoorGUIDList.begin(); i != uiLeviathanDoorGUIDList.end(); i++)
{
if (GameObject* obj = instance->GetGameObject(*i))
obj->SetGoState(state == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE );
}
if (state == DONE)
HandleGameObject(uiXT002DoorGUID, true);
break;
case TYPE_IGNIS:
case TYPE_RAZORSCALE:
case TYPE_XT002:
HandleGameObject(uiXT002DoorGUID, state != IN_PROGRESS);
break;
case TYPE_ASSEMBLY:
HandleGameObject(IronCouncilEntranceGUID, state != IN_PROGRESS);
if (state == DONE)
HandleGameObject(ArchivumDoorGUID, true);
break;
case TYPE_AURIAYA:
break;
case TYPE_MIMIRON:
for (std::list<uint64>::iterator i = uiMimironDoorGUIDList.begin(); i != uiMimironDoorGUIDList.end(); i++)
{
if (GameObject* obj = instance->GetGameObject(*i))
obj->SetGoState(state == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE );
}
break;
case TYPE_VEZAX:
if (state == DONE)
HandleGameObject(uiVezaxDoorGUID, true);
break;
case TYPE_YOGGSARON:
if (state == IN_PROGRESS)
HandleGameObject(uiYoggSaronDoorGUID, false);
else
HandleGameObject(uiYoggSaronDoorGUID, true);
break;
case TYPE_KOLOGARN:
if (state == DONE)
{
if (GameObject* go = instance->GetGameObject(uiKologarnChestGUID))
go->SetRespawnTime(go->GetRespawnDelay());
HandleGameObject(uiKologarnBridgeGUID, false);
}
break;
case TYPE_HODIR:
if (state == DONE)
{
HandleGameObject(uiHodirIceDoorGUID, true);
HandleGameObject(uiHodirStoneDoorGUID, true);
if (GameObject* HodirRareCache = instance->GetGameObject(HodirRareCacheGUID))
if (GetData(DATA_HODIR_RARE_CHEST) == 1)
HodirRareCache->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
if (GameObject* go = instance->GetGameObject(uiHodirChestGUID))
go->SetRespawnTime(go->GetRespawnDelay());
}
HandleGameObject(uiHodirEntranceDoorGUID, state != IN_PROGRESS);
break;
case TYPE_THORIM:
//if (state == DONE)
// if (GameObject* go = instance->GetGameObject(uiThorimChestGUID))
// go->SetRespawnTime(go->GetRespawnDelay());
if (GameObject* obj = instance->GetGameObject(uiThorimDoorGUID))
obj->SetGoState(state == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE);
break;
case TYPE_FREYA:
//if (state == DONE)
// if (GameObject* go = instance->GetGameObject(uiFreyaChestGUID))
// go->SetRespawnTime(go->GetRespawnDelay());
break;
case TYPE_ALGALON:
if (state == IN_PROGRESS)
{
HandleGameObject(AlgalonDoorGUID, false); // Close Door
HandleGameObject(AlgalonFloorOOCGUID, true); // Makes bridge disappear
HandleGameObject(AlgalonFloorCOMGUID, false); // Makes round combat floor appear
HandleGameObject(AlgalonBridgeGUID, true); // Removes collision from bridge
HandleGameObject(AlgalonGlobeGUID,true); // "Roomchanging"
HandleGameObject(AlgalonForceFieldGUID,false);// Invisible Forcefield, prevents escape
}
else
{
HandleGameObject(AlgalonDoorGUID, true);
//.........这里部分代码省略.........
示例10: OnGameObjectCreate
void OnGameObjectCreate(GameObject * go)
{
// TODO: init state depending on encounters
switch (go->GetEntry())
{
case GO_FROSTMOURNE:
FrostmourneGUID = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
HandleGameObject(0, false, go);
break;
case GO_FROSTMOURNE_ALTAR:
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
HandleGameObject(0, true, go);
break;
case GO_FRONT_DOOR:
FrontDoorGUID = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
OpenDoor(FrontDoorGUID);
break;
case GO_FROSTWORN_DOOR:
FrostwornDoorGUID = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
if (Encounter[1] == DONE)
OpenDoor(FrostwornDoorGUID);
else
CloseDoor(FrostwornDoorGUID);
break;
case GO_RUN_DOOR:
RunDoorGUID = go->GetGUID();
break;
case GO_ARTHAS_DOOR:
ArthasDoorGUID = go->GetGUID();
break;
case GO_ICE_WALL_1:
WallGUID[0] = go->GetGUID();
break;
case GO_ICE_WALL_2:
WallGUID[1] = go->GetGUID();
break;
case GO_ICE_WALL_3:
WallGUID[2] = go->GetGUID();
break;
case GO_ICE_WALL_4:
WallGUID[3] = go->GetGUID();
break;
case GO_CAVE:
CaveDoorGUID = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_1:
go->SetPhaseMask(2, true);
if (!instance->IsHeroic() && Team == HORDE)
ChestGUID = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_3:
go->SetPhaseMask(2, true);
if (instance->IsHeroic() && Team == HORDE)
ChestGUID = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_2:
go->SetPhaseMask(2, true);
if (!instance->IsHeroic() && Team == ALLIANCE)
ChestGUID = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_4:
go->SetPhaseMask(2, true);
if (instance->IsHeroic() && Team == ALLIANCE)
ChestGUID = go->GetGUID();
break;
case GO_SKYBREAKER:
go->SetPhaseMask(2, true);
if (Team == ALLIANCE)
GunshipGUID = go->GetGUID();
break;
case GO_ORGRIM_HAMMER:
go->SetPhaseMask(2, true);
if (Team == HORDE)
GunshipGUID = go->GetGUID();
break;
case GO_PORTAL:
go->SetPhaseMask(2, true);
PortalGUID = go->GetGUID();
break;
}
}
示例11: SetData
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_MAKEREVENT:
if (data == IN_PROGRESS)
{
HandleGameObject(Maker1GUID, false);
}
else HandleGameObject(Maker1GUID, true);
if (data == DONE)
{
HandleGameObject(Maker2GUID, true);
}
if (Encounter[0] != DONE)
Encounter[0] = data;
break;
case DATA_BROGGOKEVENT:
if (data == IN_PROGRESS)
{
if (Creature* pBroggok = instance->GetCreature(BroggokGUID))
DoScriptText(SAY_BROGGOK_INTRO, pBroggok);
HandleGameObject(Brog1GUID, false);
if (BroggokEventPhase <= MAX_ORC_WAVES)
{
DoSortBroggokOrcs();
DoNextBroggokEventPhase();
}
}
else
{
HandleGameObject(Brog1GUID, true);
}
if (data == FAIL)
{
if (BroggokEventPhase <= MAX_BROGGOK_WAVES)
{
for (uint8 i = 0; i < MAX_ORC_WAVES; ++i)
{
if (!BroggokEvent[i].IsCellOpened)
continue;
BroggokEvent[i].KilledOrcCount = 0;
for (std::set<uint64>::const_iterator itr = BroggokEvent[i].SortedOrcGuids.begin(); itr != BroggokEvent[i].SortedOrcGuids.end(); ++itr)
{
if (Creature* pOrc = instance->GetCreature(*itr))
{
if (!pOrc->isAlive())
{
pOrc->Respawn();
BroggokEventPhase = 0;
}
}
}
DoUseDoorOrButton(BroggokEvent[i].CellGuid);
BroggokEvent[i].IsCellOpened = false;
if (GameObject* Lever = instance->GetGameObject(LeverGUID))
{
if (Lever)
Lever->ResetDoorOrButton();
}
}
}
}
if (data == DONE)
{
HandleGameObject(Brog2GUID, true);
}
if (Encounter[1] != DONE)
Encounter[1] = data;
break;
case DATA_KELIDANEVENT:
if (data == DONE)
{
HandleGameObject(Sewer1GUID, true);
HandleGameObject(Sewer2GUID, true);
}
if (Encounter[2] != DONE)
Encounter[2] = data;
break;
}
if (data == DONE)
{
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
示例12: OnGameObjectCreate
void OnGameObjectCreate(GameObject* go)
{
switch(go->GetEntry())
{
case 192518:
uiSladRanAltar = go->GetGUID();
// Make sure that they start out as unusuable
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
if (m_auiEncounter[0] == DONE)
{
if (uiSladRanStatueState == GO_STATE_ACTIVE)
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
else
{
++phase;
go->SetGoState(GO_STATE_ACTIVE);
}
}
break;
case 192519:
uiMoorabiAltar = go->GetGUID();
// Make sure that they start out as unusuable
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
if (m_auiEncounter[0] == DONE)
{
if (uiMoorabiStatueState == GO_STATE_ACTIVE)
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
else
{
++phase;
go->SetGoState(GO_STATE_ACTIVE);
}
}
break;
case 192520:
uiDrakkariColossusAltar = go->GetGUID();
// Make sure that they start out as unusuable
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
if (m_auiEncounter[0] == DONE)
{
if (uiDrakkariColossusStatueState == GO_STATE_ACTIVE)
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
else
{
++phase;
go->SetGoState(GO_STATE_ACTIVE);
}
}
break;
case 192564:
uiSladRanStatue = go->GetGUID();
go->SetGoState(uiSladRanStatueState);
break;
case 192565:
uiMoorabiStatue = go->GetGUID();
go->SetGoState(uiMoorabiStatueState);
break;
case 192566:
uiGalDarahStatue = go->GetGUID();
go->SetGoState(uiGalDarahStatueState);
break;
case 192567:
uiDrakkariColossusStatue = go->GetGUID();
go->SetGoState(uiDrakkariColossusStatueState);
break;
case 192632:
uiEckTheFerociousDoor = go->GetGUID();
if (bHeroicMode && m_auiEncounter[1] == DONE)
HandleGameObject(NULL, true, go);
break;
case 192569:
uiEckTheFerociousDoorBehind = go->GetGUID();
if (bHeroicMode && m_auiEncounter[4] == DONE)
HandleGameObject(NULL, true, go);
case 193208:
uiGalDarahDoor1 = go->GetGUID();
if (m_auiEncounter[3] == DONE)
HandleGameObject(NULL, true, go);
break;
case 193209:
uiGalDarahDoor2 = go->GetGUID();
if (m_auiEncounter[3] == DONE)
HandleGameObject(NULL, true, go);
break;
case 193188:
uiBridge = go->GetGUID();
go->SetGoState(uiBridgeState);
break;
case 192633:
uiCollision = go->GetGUID();
go->SetGoState(uiCollisionState);
// Can't spawn here with SpawnGameObject because go isn't added to world yet...
if (uiCollisionState == GO_STATE_ACTIVE_ALTERNATIVE)
spawnSupport = true;
break;
}
}
示例13: StartBossEncounter
void StartBossEncounter(uint8 uiBoss, bool bForceRespawn = true)
{
Creature* pBoss = NULL;
switch (uiBoss)
{
case BOSS_MORAGG:
HandleGameObject(uiMoraggCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiMoragg))
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
case BOSS_EREKEM:
HandleGameObject(uiErekemCell, bForceRespawn);
HandleGameObject(uiErekemRightGuardCell, bForceRespawn);
HandleGameObject(uiErekemLeftGuardCell, bForceRespawn);
if (pBoss = instance->GetCreature(uiErekem))
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
if (Creature* pGuard1 = instance->GetCreature(uiErekemGuard[0]))
{
if (bForceRespawn)
pGuard1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
else
pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
}
if (Creature* pGuard2 = instance->GetCreature(uiErekemGuard[1]))
{
if (bForceRespawn)
pGuard2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
else
pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
}
break;
case BOSS_ICHORON:
HandleGameObject(uiIchoronCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiIchoron))
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
case BOSS_LAVANTHOR:
HandleGameObject(uiLavanthorCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiLavanthor))
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
case BOSS_XEVOZZ:
HandleGameObject(uiXevozzCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiXevozz))
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
case BOSS_ZURAMAT:
HandleGameObject(uiZuramatCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiZuramat))
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
}
if (!bForceRespawn && pBoss)
{
if (pBoss->isDead())
{
// respawn but avoid to be looted again
pBoss->Respawn();
pBoss->RemoveLootMode(1);
}
pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
SetData(DATA_WAVE_COUNT,0);
uiWaveCount = 0;
}
}
示例14: SetData
void SetData(uint32 uiType, uint32 uiData)
{
switch(uiType)
{
case TYPE_GELIHAST:
m_auiEncounter[0] = uiData;
if (uiData == DONE)
if (GameObject* pGo = instance->GetGameObject(m_uiShrineOfGelihastGUID))
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
break;
case TYPE_AKU_MAI:
m_auiEncounter[3] = uiData;
if (uiData == DONE)
if (GameObject* pGo = instance->GetGameObject(m_uiAltarOfTheDeepsGUID))
{
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
pGo->SummonCreature(NPC_MORRIDUNE,SpawnsLocation[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case DATA_FIRE:
m_uiCountFires = uiData;
switch (m_uiCountFires)
{
case 1:
if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
{
pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case 2:
if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
{
for (uint8 i = 0; i < 2; ++i)
{
pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
}
break;
case 3:
if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
{
pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case 4:
if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
{
pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
}
break;
case DATA_EVENT:
uiDeathTimes = uiData;
if (uiDeathTimes == 18)
HandleGameObject(m_uiMainDoorGUID,true);
break;
}
}
示例15: SetBossState
bool SetBossState(uint32 type, EncounterState state)
{
if (!InstanceScript::SetBossState(type, state))
return false;
if (uiEncounter[type] != DONE)
uiEncounter[type] = state;
if (state == DONE)
SaveToDB();
switch (type)
{
case TYPE_LEVIATHAN:
for (std::list<uint64>::iterator i = uiLeviathanDoorGUIDList.begin(); i != uiLeviathanDoorGUIDList.end(); i++)
{
if (GameObject* obj = instance->GetGameObject(*i))
obj->SetGoState(state == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE );
}
if (state == DONE)
{
if (GameObject* go = instance->GetGameObject(leviathanChestGUID))
go->SetRespawnTime(go->GetRespawnDelay());
HandleGameObject(uiXT002DoorGUID, true);
}
break;
case TYPE_IGNIS:
case TYPE_RAZORSCALE:
case TYPE_XT002:
HandleGameObject(uiXT002DoorGUID, state != IN_PROGRESS);
break;
case TYPE_ASSEMBLY:
HandleGameObject(IronCouncilEntranceGUID, state != IN_PROGRESS);
if (state == DONE)
HandleGameObject(ArchivumDoorGUID, true);
break;
case TYPE_AURIAYA:
case TYPE_FREYA:
break;
case TYPE_MIMIRON:
for (std::list<uint64>::iterator i = uiMimironDoorGUIDList.begin(); i != uiMimironDoorGUIDList.end(); i++)
{
if (GameObject* obj = instance->GetGameObject(*i))
obj->SetGoState(state == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE );
}
break;
case TYPE_VEZAX:
if (state == DONE)
HandleGameObject(uiVezaxDoorGUID, true);
break;
case TYPE_YOGGSARON:
if (state == IN_PROGRESS)
HandleGameObject(uiYoggSaronDoorGUID, false);
else
HandleGameObject(uiYoggSaronDoorGUID, true);
break;
case TYPE_KOLOGARN:
if (state == DONE)
{
if (GameObject* go = instance->GetGameObject(uiKologarnChestGUID))
go->SetRespawnTime(go->GetRespawnDelay());
HandleGameObject(uiKologarnBridgeGUID, false);
}
break;
case TYPE_HODIR:
if (state == DONE)
{
HandleGameObject(uiHodirIceDoorGUID, true);
HandleGameObject(uiHodirStoneDoorGUID, true);
if (GameObject* HodirRareCache = instance->GetGameObject(HodirRareCacheGUID))
if (GetData(DATA_HODIR_RARE_CHEST) == 1)
HodirRareCache->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
if (GameObject* go = instance->GetGameObject(uiHodirChestGUID))
go->SetRespawnTime(go->GetRespawnDelay());
}
HandleGameObject(uiHodirEntranceDoorGUID, state != IN_PROGRESS);
break;
case TYPE_THORIM:
//if (state == DONE)
// if (GameObject* go = instance->GetGameObject(uiThorimChestGUID))
// go->SetRespawnTime(go->GetRespawnDelay());
if (GameObject* obj = instance->GetGameObject(uiThorimDoorGUID))
obj->SetGoState(state == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE);
break;
case TYPE_ALGALON:
switch (state)
{
case SPECIAL:
if (Creature* algalon = instance->GetCreature(uiAlgalonGUID))
{
algalon->setFaction(7);
algalon->setActive(true);
algalon->SetVisible(true);
//DoUpdateWorldState(WORLDSTATE_ALGALON_SHOW, 1);
//DoUpdateWorldState(WORLDSTATE_ALGALON_TIME, 60);
}
//.........这里部分代码省略.........