本文整理汇总了C++中DoToggleGameObjectFlags函数的典型用法代码示例。如果您正苦于以下问题:C++ DoToggleGameObjectFlags函数的具体用法?C++ DoToggleGameObjectFlags怎么用?C++ DoToggleGameObjectFlags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoToggleGameObjectFlags函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void instance_serpentshrine_cavern::SetData(uint32 uiType, uint32 uiData)
{
switch (uiType)
{
case TYPE_HYDROSS_EVENT:
m_auiEncounter[uiType] = uiData;
break;
case TYPE_LEOTHERAS_EVENT:
m_auiEncounter[1] = uiData;
if (uiData == FAIL)
{
for (GuidList::const_iterator itr = m_lSpellBindersGUIDList.begin(); itr != m_lSpellBindersGUIDList.end(); ++itr)
{
if (Creature* pSpellBinder = instance->GetCreature(*itr))
pSpellBinder->Respawn();
}
m_uiSpellBinderCount = 0;
}
break;
case TYPE_THELURKER_EVENT:
case TYPE_KARATHRESS_EVENT:
case TYPE_MOROGRIM_EVENT:
m_auiEncounter[uiType] = uiData;
break;
case TYPE_LADYVASHJ_EVENT:
m_auiEncounter[uiType] = uiData;
if (uiData == FAIL)
{
// interrupt the shield
for (GuidList::const_iterator itr = m_lShieldGeneratorGUIDList.begin(); itr != m_lShieldGeneratorGUIDList.end(); ++itr)
{
if (Creature* pGenerator = instance->GetCreature(*itr))
pGenerator->InterruptNonMeleeSpells(false);
}
// reset generators
DoToggleGameObjectFlags(GO_SHIELD_GENERATOR_1, GO_FLAG_NO_INTERACT, false);
DoToggleGameObjectFlags(GO_SHIELD_GENERATOR_2, GO_FLAG_NO_INTERACT, false);
DoToggleGameObjectFlags(GO_SHIELD_GENERATOR_3, GO_FLAG_NO_INTERACT, false);
DoToggleGameObjectFlags(GO_SHIELD_GENERATOR_4, GO_FLAG_NO_INTERACT, false);
}
break;
}
if (uiData == 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_strInstData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
示例2: switch
void instance_steam_vault::SetData(uint32 uiType, uint32 uiData)
{
switch (uiType)
{
case TYPE_HYDROMANCER_THESPIA:
if (uiData == DONE)
DoToggleGameObjectFlags(GO_ACCESS_PANEL_HYDRO, GO_FLAG_NO_INTERACT, false);
if (uiData == SPECIAL)
{
if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)
DoUseDoorOrButton(GO_MAIN_CHAMBERS_DOOR);
}
m_auiEncounter[uiType] = uiData;
break;
case TYPE_MEKGINEER_STEAMRIGGER:
if (uiData == DONE)
DoToggleGameObjectFlags(GO_ACCESS_PANEL_MEK, GO_FLAG_NO_INTERACT, false);
if (uiData == SPECIAL)
{
if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)
DoUseDoorOrButton(GO_MAIN_CHAMBERS_DOOR);
}
m_auiEncounter[uiType] = uiData;
break;
case TYPE_WARLORD_KALITHRESH:
DoUseDoorOrButton(GO_MAIN_CHAMBERS_DOOR);
if (uiData == FAIL)
{
// Reset Distiller flags - respawn is handled by DB
for (GuidList::const_iterator itr = m_lNagaDistillerGuidList.begin(); itr != m_lNagaDistillerGuidList.end(); ++itr)
{
if (Creature* pDistiller = instance->GetCreature(*itr))
{
if (!pDistiller->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
pDistiller->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
}
}
m_auiEncounter[uiType] = uiData;
break;
}
if (uiData == DONE || uiData == SPECIAL)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2];
m_strInstData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
示例3: DoToggleGameObjectFlags
void instance_dire_maul::OnPlayerEnter(Player* pPlayer)
{
// figure where to enter to set library doors accordingly
// Enter DM North first
if (pPlayer->IsWithinDist2d(260.0f, -20.0f, 20.0f) && m_auiEncounter[TYPE_WARPWOOD] != DONE)
m_bDoNorthBeforeWest = true;
else
m_bDoNorthBeforeWest = false;
DoToggleGameObjectFlags(GO_WEST_LIBRARY_DOOR, GO_FLAG_NO_INTERACT, m_bDoNorthBeforeWest);
DoToggleGameObjectFlags(GO_WEST_LIBRARY_DOOR, GO_FLAG_LOCKED, !m_bDoNorthBeforeWest);
}
示例4: debug_log
void instance_ramparts::SetData(uint32 uiType, uint32 uiData)
{
debug_log("SD2: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData);
switch (uiType)
{
case TYPE_VAZRUDEN:
if (uiData == DONE && m_auiEncounter[1] == DONE)
DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_FEL_IRON_CHEST : GO_FEL_IRON_CHEST_H, HOUR);
if (uiData == FAIL && m_auiEncounter[0] != FAIL)
DoFailVazruden();
m_auiEncounter[0] = uiData;
break;
case TYPE_NAZAN:
if (uiData == SPECIAL)
{
++m_uiSentryCounter;
if (m_uiSentryCounter == 2)
m_auiEncounter[1] = uiData;
return;
}
if (uiData == DONE && m_auiEncounter[0] == DONE)
{
DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_FEL_IRON_CHEST : GO_FEL_IRON_CHEST_H, HOUR);
DoToggleGameObjectFlags(instance->IsRegularDifficulty() ? GO_FEL_IRON_CHEST : GO_FEL_IRON_CHEST_H, GO_FLAG_NO_INTERACT, false);
}
if (uiData == FAIL && m_auiEncounter[1] != FAIL)
DoFailVazruden();
m_auiEncounter[1] = uiData;
break;
}
}
示例5: DoToggleGameObjectFlags
void instance_sunken_temple::DoUpdateFlamesFlags(bool bRestore)
{
for (GuidList::const_iterator itr = m_luiFlameGUIDs.begin(); itr != m_luiFlameGUIDs.end(); ++itr)
{
DoToggleGameObjectFlags(*itr, GO_FLAG_NO_INTERACT, bRestore);
}
}
示例6: switch
void instance_oculus::SetData(uint32 uiType, uint32 uiData)
{
switch(uiType)
{
case TYPE_DRAKOS:
m_auiEncounter[TYPE_DRAKOS] = uiData;
break;
case TYPE_VAROS:
m_auiEncounter[TYPE_VAROS] = uiData;
break;
case TYPE_UROM:
m_auiEncounter[TYPE_UROM] = uiData;
break;
case TYPE_EREGOS:
m_auiEncounter[TYPE_EREGOS] = uiData;
if (uiData == DONE)
DoToggleGameObjectFlags(instance->IsRegularDifficulty() ? GO_CACHE_EREGOS : GO_CACHE_EREGOS_H, GO_FLAG_NO_INTERACT, false);
break;
}
if (uiData == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[TYPE_DRAKOS] << " " << m_auiEncounter[TYPE_VAROS] << " " << m_auiEncounter[TYPE_UROM] << " " << m_auiEncounter[TYPE_EREGOS];
strInstData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
示例7: DoToggleGameObjectFlags
/// Function that uses a door or button that is stored in m_mGoEntryGuidStore
void ScriptedInstance::DoToggleGameObjectFlags(uint32 uiEntry, uint32 uiGOflags, bool bApply)
{
EntryGuidMap::iterator find = m_mGoEntryGuidStore.find(uiEntry);
if (find != m_mGoEntryGuidStore.end())
DoToggleGameObjectFlags(find->second, uiGOflags, bApply);
else
// Output log, possible reason is not added GO to storage, or not yet loaded
debug_log("SD2: Script call ToogleTameObjectFlags (by Entry), but no gameobject of entry %u was created yet, or it was not stored by script for map %u.", uiEntry, instance->GetId());
}
示例8: DoToggleGameObjectFlags
void instance_blackwing_lair::OnCreatureDeath(Creature* pCreature)
{
if (pCreature->GetEntry() == NPC_GRETHOK_CONTROLLER)
{
DoToggleGameObjectFlags(GO_ORB_OF_DOMINATION, GO_FLAG_NO_INTERACT, false);
if (Creature* pOrbTrigger = GetSingleCreatureFromStorage(NPC_BLACKWING_ORB_TRIGGER))
pOrbTrigger->InterruptNonMeleeSpells(false);
}
}
示例9: switch
void instance_blackwing_lair::OnCreatureDeath(Creature* pCreature)
{
switch (pCreature->GetEntry())
{
case NPC_GRETHOK_CONTROLLER:
// Allow orb to be used
DoToggleGameObjectFlags(GO_ORB_OF_DOMINATION, GO_FLAG_NO_INTERACT, false);
if (Creature* pOrbTrigger = GetSingleCreatureFromStorage(NPC_BLACKWING_ORB_TRIGGER))
pOrbTrigger->InterruptNonMeleeSpells(false);
break;
case NPC_RAZORGORE:
// Only set the event as done if Razorgore dies in last phase
if (GetData(TYPE_RAZORGORE) == SPECIAL)
{
SetData(TYPE_RAZORGORE, DONE);
break;
}
// If the event is not already failed in Razorgore script, then force group wipe by making the boss trigger an AoE
// this is basically a duplicate of what is in Razorgore script because when the boss is Mind Controlled the AI is overriden
// So we have to handle it in the instance script instead to prevent the event to be stucked or exploited
if (GetData(TYPE_RAZORGORE) != FAIL)
{
if (Creature* pRazorgore = GetSingleCreatureFromStorage(NPC_RAZORGORE))
{
pRazorgore->CastSpell(pRazorgore, SPELL_FIREBALL, TRIGGERED_OLD_TRIGGERED);
SetData(TYPE_RAZORGORE, FAIL);
DoScriptText(SAY_RAZORGORE_DEATH, pRazorgore);
pRazorgore->ForcedDespawn();
}
if (Creature* pOrbTrigger = GetSingleCreatureFromStorage(NPC_BLACKWING_ORB_TRIGGER))
pOrbTrigger->CastSpell(pOrbTrigger, SPELL_EXPLODE_ORB, TRIGGERED_IGNORE_UNATTACKABLE_FLAG);
}
break;
case NPC_BLACKWING_LEGIONNAIRE:
case NPC_BLACKWING_MAGE:
m_uiBlackwingDefCount--;
break;
case NPC_DRAGONSPAWN:
m_uiDragonspawnCount--;
break;
}
}
示例10: switch
void instance_sethekk_halls::SetData(uint32 uiType, uint32 uiData)
{
switch (uiType)
{
case TYPE_SYTH:
m_auiEncounter[uiType] = uiData;
break;
case TYPE_ANZU:
m_auiEncounter[uiType] = uiData;
// Respawn the Raven's Claw if event fails
if (uiData == FAIL)
{
if (GameObject* pClaw = GetSingleGameObjectFromStorage(GO_RAVENS_CLAW))
pClaw->Respawn();
}
break;
case TYPE_IKISS:
if (uiData == DONE)
{
DoUseDoorOrButton(GO_IKISS_DOOR, DAY);
DoToggleGameObjectFlags(GO_IKISS_CHEST, GO_FLAG_NO_INTERACT | GO_FLAG_INTERACT_COND, false);
}
m_auiEncounter[uiType] = uiData;
break;
default:
return;
}
if (uiData == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2];
m_strInstData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
示例11: SetData
void instance_blackwing_lair::SetData64(uint32 uiData, uint64 uiGuid)
{
if (uiData == DATA_DRAGON_EGG)
{
if (GameObject* pEgg = instance->GetGameObject(ObjectGuid(uiGuid)))
m_lUsedEggsGuids.push_back(pEgg->GetObjectGuid());
// If all eggs are destroyed, then allow Razorgore to be attacked
if (m_lUsedEggsGuids.size() == m_lDragonEggsGuids.size())
{
SetData(TYPE_RAZORGORE, SPECIAL);
DoToggleGameObjectFlags(GO_ORB_OF_DOMINATION, GO_FLAG_NO_INTERACT, true);
// Emote for the start of the second phase
if (Creature* pTrigger = GetSingleCreatureFromStorage(NPC_NEFARIANS_TROOPS))
{
DoScriptText(EMOTE_ORB_SHUT_OFF, pTrigger);
DoScriptText(EMOTE_TROOPS_FLEE, pTrigger);
}
// Break mind control and set max health
if (Creature* pRazorgore = GetSingleCreatureFromStorage(NPC_RAZORGORE))
{
pRazorgore->RemoveAllAuras();
pRazorgore->CastSpell(pRazorgore, SPELL_WARMING_FLAMES, TRIGGERED_OLD_TRIGGERED);
}
// All defenders evade and despawn
for (GuidList::const_iterator itr = m_lDefendersGuids.begin(); itr != m_lDefendersGuids.end(); ++itr)
{
if (Creature* pDefender = instance->GetCreature(*itr))
{
pDefender->AI()->EnterEvadeMode();
pDefender->ForcedDespawn(10000);
}
}
m_uiBlackwingDefCount = 0;
m_uiDragonspawnCount = 0;
}
}
}
示例12: switch
void instance_oculus::SetData(uint32 uiType, uint32 uiData)
{
switch (uiType)
{
case TYPE_DRAKOS:
m_auiEncounter[TYPE_DRAKOS] = uiData;
if (uiData == DONE)
{
// Open all cages
for (GuidList::const_iterator itr = m_lCageDoorGUIDs.begin(); itr != m_lCageDoorGUIDs.end(); ++itr)
DoUseDoorOrButton(*itr);
// Notes: The dialogue is handled by DB script
// Also the Centrifuge Constructs and the related npcs should be summoned - requires additional research
// Activate the world state - the Centrifuge contructs should be loaded by now
DoUpdateWorldState(WORLD_STATE_CONSTRUCTS, 1);
DoUpdateWorldState(WORLD_STATE_CONSTRUCTS_COUNT, m_sConstructsAliveGUIDSet.size());
DoStartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEV_START_EREGOS_ID);
}
break;
case TYPE_VAROS:
m_auiEncounter[TYPE_VAROS] = uiData;
if (uiData == DONE)
{
// Note: Image of Belgaristrasz dialogue is handled by DB script
DoSpawnNextBossIfCan();
DoUpdateWorldState(WORLD_STATE_CONSTRUCTS, 0);
}
break;
case TYPE_UROM:
m_auiEncounter[TYPE_UROM] = uiData;
// Note: Image of Belgaristrasz dialogue is handled by DB script
if (uiData == DONE)
DoSpawnNextBossIfCan();
break;
case TYPE_EREGOS:
m_auiEncounter[TYPE_EREGOS] = uiData;
// Note: Image of Belgaristrasz teleports to the Cache location and does more dialogue - requires additional research
if (uiData == DONE)
{
// The data about the cache isn't consistent, so it's better to handle both cases
DoToggleGameObjectFlags(instance->IsRegularDifficulty() ? GO_CACHE_EREGOS : GO_CACHE_EREGOS_H, GO_FLAG_NO_INTERACT, false);
DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_CACHE_EREGOS : GO_CACHE_EREGOS_H, 30 * MINUTE);
}
break;
}
if (uiData == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[TYPE_DRAKOS] << " " << m_auiEncounter[TYPE_VAROS] << " " << m_auiEncounter[TYPE_UROM] << " " << m_auiEncounter[TYPE_EREGOS];
strInstData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
示例13: switch
void instance_karazhan::SetData(uint32 uiType, uint32 uiData)
{
switch (uiType)
{
case TYPE_ATTUMEN:
m_auiEncounter[uiType] = uiData;
if (uiData == FAIL)
{
// Respawn Midnight on Fail
if (Creature* pMidnight = GetSingleCreatureFromStorage(NPC_MIDNIGHT))
{
if (!pMidnight->isAlive())
pMidnight->Respawn();
}
}
break;
case TYPE_MOROES:
case TYPE_MAIDEN:
m_auiEncounter[uiType] = uiData;
break;
case TYPE_OPERA:
// Don't store the same data twice
if (uiData == m_auiEncounter[uiType])
break;
m_auiEncounter[uiType] = uiData;
if (uiData == IN_PROGRESS)
m_uiOzDeathCount = 0;
if (uiData == DONE)
{
DoUseDoorOrButton(GO_STAGE_DOOR_LEFT);
DoUseDoorOrButton(GO_STAGE_DOOR_RIGHT);
DoToggleGameObjectFlags(GO_SIDE_ENTRANCE_DOOR, GO_FLAG_LOCKED, false);
}
// use curtain only for event start or fail
else
DoUseDoorOrButton(GO_STAGE_CURTAIN);
break;
case TYPE_CURATOR:
case TYPE_TERESTIAN:
m_auiEncounter[uiType] = uiData;
break;
case TYPE_ARAN:
if (uiData == FAIL || uiData == DONE)
DoToggleGameObjectFlags(GO_PRIVATE_LIBRARY_DOOR, GO_FLAG_LOCKED, false);
if (uiData == IN_PROGRESS)
DoToggleGameObjectFlags(GO_PRIVATE_LIBRARY_DOOR, GO_FLAG_LOCKED, true);
m_auiEncounter[uiType] = uiData;
break;
case TYPE_NETHERSPITE:
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(GO_MASSIVE_DOOR);
break;
case TYPE_CHESS:
if (uiData == DONE)
{
// doors and loot are not handled for friendly games
if (GetData(TYPE_CHESS) != SPECIAL)
{
DoUseDoorOrButton(GO_GAMESMANS_HALL_EXIT_DOOR);
DoRespawnGameObject(GO_DUST_COVERED_CHEST, DAY);
DoToggleGameObjectFlags(GO_DUST_COVERED_CHEST, GO_FLAG_NO_INTERACT, false);
}
// cast game end spells
if (Creature* pMedivh = GetSingleCreatureFromStorage(NPC_ECHO_MEDIVH))
{
pMedivh->CastSpell(pMedivh, SPELL_FORCE_KILL_BUNNY, TRIGGERED_OLD_TRIGGERED);
pMedivh->CastSpell(pMedivh, SPELL_GAME_OVER, TRIGGERED_OLD_TRIGGERED);
pMedivh->CastSpell(pMedivh, SPELL_CLEAR_BOARD, TRIGGERED_OLD_TRIGGERED);
}
if (Creature* pController = GetSingleCreatureFromStorage(NPC_CHESS_VICTORY_CONTROLLER))
pController->CastSpell(pController, SPELL_VICTORY_VISUAL, TRIGGERED_OLD_TRIGGERED);
// remove silence debuff
Map::PlayerList const& players = instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* pPlayer = itr->getSource())
pPlayer->RemoveAurasDueToSpell(SPELL_GAME_IN_SESSION);
}
m_bFriendlyGame = false;
m_uiChessResetTimer = 35000;
}
else if (uiData == FAIL)
{
// clean the board for reset
if (Creature* pMedivh = GetSingleCreatureFromStorage(NPC_ECHO_MEDIVH))
{
pMedivh->CastSpell(pMedivh, SPELL_GAME_OVER, TRIGGERED_OLD_TRIGGERED);
pMedivh->CastSpell(pMedivh, SPELL_CLEAR_BOARD, TRIGGERED_OLD_TRIGGERED);
}
// remove silence debuff
Map::PlayerList const& players = instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* pPlayer = itr->getSource())
pPlayer->RemoveAurasDueToSpell(SPELL_GAME_IN_SESSION);
}
//.........这里部分代码省略.........
示例14: debug_log
void instance_ahnkahet::SetData(uint32 uiType, uint32 uiData)
{
debug_log("SD2: Instance Ahn'Kahet: SetData received for type %u with data %u", uiType, uiData);
switch (uiType)
{
case TYPE_NADOX:
m_auiEncounter[uiType] = uiData;
if (uiData == IN_PROGRESS)
m_bRespectElders = true;
else if (uiData == SPECIAL)
m_bRespectElders = false;
else if (uiData == DONE)
{
DoToggleGameObjectFlags(GO_ANCIENT_DEVICE_L, GO_FLAG_NO_INTERACT, false);
DoToggleGameObjectFlags(GO_ANCIENT_DEVICE_R, GO_FLAG_NO_INTERACT, false);
}
break;
case TYPE_TALDARAM:
if (uiData == SPECIAL)
{
++m_uiDevicesActivated;
if (m_uiDevicesActivated == 2)
{
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(GO_VORTEX);
// Lower Taldaram
if (Creature* pTaldaram = GetSingleCreatureFromStorage(NPC_TALDARAM))
pTaldaram->GetMotionMaster()->MovePoint(1, aTaldaramLandingLoc[0], aTaldaramLandingLoc[1], aTaldaramLandingLoc[2]);
// Interrupt the channeling
for (GuidList::const_iterator itr = m_lJedogaControllersGuidList.begin(); itr != m_lJedogaControllersGuidList.end(); ++itr)
{
if (Creature* pTemp = instance->GetCreature(*itr))
pTemp->InterruptNonMeleeSpells(false);
}
}
}
else if (uiData == DONE)
{
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(GO_DOOR_TALDARAM);
}
break;
case TYPE_JEDOGA:
m_auiEncounter[uiType] = uiData;
if (uiData == IN_PROGRESS)
m_bVolunteerWork = true;
else if (uiData == SPECIAL)
m_bVolunteerWork = false;
else if (uiData == FAIL)
m_uiInitiatesKilled = 0;
break;
case TYPE_AMANITAR:
m_auiEncounter[uiType] = uiData;
break;
case TYPE_VOLAZJ:
m_auiEncounter[uiType] = uiData;
if (uiData == IN_PROGRESS)
{
m_uiTwistedVisageCount = 0;
m_lInsanityPlayersGuidList.clear();
}
break;
default:
script_error_log("Instance Ahn'Kahet: ERROR SetData = %u for type %u does not exist/not implemented.", uiType, uiData);
break;
}
// For some encounters Special data needs to be saved
if (uiData == DONE || (uiData == SPECIAL && uiType == TYPE_TALDARAM))
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]
<< " " << m_auiEncounter[4];
m_strInstData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
示例15: switch
void instance_magisters_terrace::SetData(uint32 uiType, uint32 uiData)
{
switch (uiType)
{
case TYPE_SELIN:
if (uiData == DONE)
DoUseDoorOrButton(GO_SELIN_DOOR);
if (uiData == FAIL)
{
// Reset crystals - respawn and kill is handled by creature linking
for (GuidList::const_iterator itr = m_lFelCrystalGuid.begin(); itr != m_lFelCrystalGuid.end(); ++itr)
{
if (Creature* pTemp = instance->GetCreature(*itr))
{
if (!pTemp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (pTemp->isAlive())
pTemp->AI()->EnterEvadeMode();
}
}
}
if (uiData == IN_PROGRESS)
{
// Stop channeling when the fight starts
for (GuidList::const_iterator itr = m_lFelCrystalGuid.begin(); itr != m_lFelCrystalGuid.end(); ++itr)
{
if (Creature* pTemp = instance->GetCreature(*itr))
pTemp->InterruptNonMeleeSpells(false);
}
}
DoUseDoorOrButton(GO_SELIN_ENCOUNTER_DOOR);
m_auiEncounter[uiType] = uiData;
break;
case TYPE_VEXALLUS:
if (uiData == DONE)
DoUseDoorOrButton(GO_VEXALLUS_DOOR);
m_auiEncounter[uiType] = uiData;
break;
case TYPE_DELRISSA:
if (uiData == DONE)
DoUseDoorOrButton(GO_DELRISSA_DOOR);
if (uiData == IN_PROGRESS)
m_uiDelrissaDeathCount = 0;
m_auiEncounter[uiType] = uiData;
break;
case TYPE_KAELTHAS:
DoUseDoorOrButton(GO_KAEL_DOOR);
if (uiData == DONE)
DoToggleGameObjectFlags(GO_ESCAPE_QUEL_DANAS, GO_FLAG_NO_INTERACT, false);
m_auiEncounter[uiType] = uiData;
break;
}
if (uiData == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
m_strInstData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}