本文整理匯總了C++中EncounterState函數的典型用法代碼示例。如果您正苦於以下問題:C++ EncounterState函數的具體用法?C++ EncounterState怎麽用?C++ EncounterState使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EncounterState函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: Load
void Load(const char* data)
{
if (!data)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(data);
char dataHead1, dataHead2;
uint16 data0;
std::istringstream loadStream(data);
loadStream >> dataHead1 >> dataHead2 >> data0;
if (dataHead1 == 'E' && dataHead2 == 'E')
{
if (data0 == IN_PROGRESS || data0 > SPECIAL)
data0 = NOT_STARTED;
SetBossState(BOSS_MALYGOS, EncounterState(data0));
}
else
OUT_LOAD_INST_DATA_FAIL;
OUT_LOAD_INST_DATA_COMPLETE;
}
示例2: Load
void Load(const char * str)
{
if (!str)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(str);
char dataHead1, dataHead2;
std::istringstream loadStream(str);
loadStream >> dataHead1 >> dataHead2;
if(dataHead1 == 'N' && dataHead2 == 'X')
{
for(int i = 0; i < MAX_BOSS_NUMBER; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
loadStream >> PlayerDeathCount >> HeiganPlayerDeathCount;
}
else
示例3: Load
void Load(char const* str)
{
if (!str)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(str);
char dataHead1, dataHead2;
std::istringstream loadStream(str);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'R' && dataHead2 == 'S')
{
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
// Xinef: additional check
if (GetBossState(DATA_HALION_INTRO_DONE) != DONE)
{
SetBossState(DATA_HALION_INTRO1, NOT_STARTED);
SetBossState(DATA_HALION_INTRO2, NOT_STARTED);
}
}
else
示例4: Load
void Load(char const* str)
{
if (!str)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(str);
char dataHead1, dataHead2;
std::istringstream loadStream(str);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'S' && dataHead2 == 'L')
{
for (uint32 i = 0; i < EncounterCount; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
}
else
示例5: Load
void Load(const char* strIn)
{
if (!strIn)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(strIn);
char dataHead1, dataHead2;
std::istringstream loadStream(strIn);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'S' && dataHead2 == 'H')
{
for (uint8 i = 0; i < ENCOUNTER_COUNT; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
loadStream >> RescueTimer;
}
else
示例6: Load
void Load(const char* strIn) override
{
if (!strIn)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(strIn);
char dataHead1, dataHead2;
std::istringstream loadStream(strIn);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'N' && dataHead2 == 'X')
{
for (uint8 i = 0; i < EncounterCount; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
loadStream >> playerDied;
}
OUT_LOAD_INST_DATA_COMPLETE;
}
示例7: Load
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
char dataHead1, dataHead2;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'V' && dataHead2 == 'P')
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
}
else OUT_LOAD_INST_DATA_FAIL;
示例8: Load
void Load(const char* strIn)
{
if (!strIn)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(strIn);
char dataHead1, dataHead2;
std::istringstream loadStream(strIn);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'U' && dataHead2 == 'U')
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
if (i == TYPE_COLOSSUS)
SetData(i, tmpState);
else
SetBossState(i, EncounterState(tmpState));
}
}
OUT_LOAD_INST_DATA_COMPLETE;
}
示例9: SetData
void SetData(uint32 type, uint32 data)
{
SetBossState(type, EncounterState(data));
if (data == DONE)
SaveToDB();
}
示例10: SetData
void SetData(uint32 type, uint32 data) override
{
switch (type)
{
case DATA_HANDLE_CORBORUS_ROCKDOOR:
HandleGameObject(corborusRockDoorGUID, true);
break;
case DATA_MILLHOUSE_EVENT_FACE:
MillhouseEvent_Face();
break;
case DATA_MILLHOUSE_EVENT_KNOCKBACK:
MillhouseEvent_Knockback();
break;
case DATA_MILLHOUSE_EVENT_DESPAWN:
MillhouseEvent_Despawn();
break;
case DATA_SLABHIDE_INTRO:
slabhideIntro = EncounterState(data);
break;
case DATA_SLABHIDE_ROCK_WALL: // Handles rock walls
for (std::vector<ObjectGuid>::iterator itr = slabhideRockWallGUIDs.begin(); itr != slabhideRockWallGUIDs.end(); ++itr)
HandleGameObject((*itr), data ? true : false);
break;
default:
break;
}
}
示例11: Load
void Load(const char* str)
{
if (!str)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(str);
char dataHead1, dataHead2;
std::istringstream loadStream(str);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'M' && dataHead2 == 'E')
{
for (uint32 i = 0; i < MAX_ENCOUNTER; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
loadStream >> _passageEncounter;
if (_passageEncounter == ENCOUNTER_PASSAGE_DONE)
_passageEncounter = ENCOUNTER_PASSAGE_PHASE6;
}
else
示例12: Load
void Load(const char* strIn) override
{
if (!strIn)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(strIn);
std::istringstream loadStream(strIn);
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
loadStream >> TrialCounter;
EventStage = 0;
OUT_LOAD_INST_DATA_COMPLETE;
}
示例13: Load
void Load(char const* strIn)
{
if (!strIn)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(strIn);
char dataHead1, dataHead2;
std::istringstream loadStream(strIn);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'U' && dataHead2 == 'U')
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
uint32 tempState;
loadStream >> tempState;
if (tempState == IN_PROGRESS || tempState > SPECIAL)
tempState = NOT_STARTED;
SetData(DATA_COLOSSUS, tempState);
loadStream >> _algalonTimer;
loadStream >> tempState;
_algalonSummoned = tempState != 0;
if (_algalonSummoned && GetBossState(BOSS_ALGALON) != DONE)
{
_summonAlgalon = true;
if (_algalonTimer && _algalonTimer <= 60)
{
_events.ScheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 60000);
DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 1);
DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, _algalonTimer);
}
}
}
OUT_LOAD_INST_DATA_COMPLETE;
}
示例14: SetBossState
void InstanceScript::ReadSaveDataBossStates(std::istringstream& data)
{
uint32 bossId = 0;
for (std::vector<BossInfo>::iterator i = bosses.begin(); i != bosses.end(); ++i, ++bossId)
{
uint32 buff;
data >> buff;
if (buff == IN_PROGRESS || buff == SPECIAL)
buff = NOT_STARTED;
if (buff < TO_BE_DECIDED)
SetBossState(bossId, EncounterState(buff));
}
}
示例15: Load
void Load(const char* strIn)
{
if (!strIn)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(strIn);
char dataHead1, dataHead2;
uint32 data1,data2,data3;
std::istringstream loadStream(strIn);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'U' && dataHead2 == 'U')
{
for (uint8 i = 0; i <= MAX_ENCOUNTER; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
// needed because of custom GetBossState(uint32 type) ?
uiEncounter[i] = tmpState;
}
uint32 tmpState, tmpState2;
loadStream >> tmpState >> tmpState2;
ColossusData = tmpState;
uiPlayerDeathFlag = tmpState2;
loadStream >> data1;
loadStream >> data2;
loadStream >> data3;
SetData(DATA_ALGALON_INTRO, data1);
SignalTimerState = data2;
SignalTimerMinutes = data3;
}
OUT_LOAD_INST_DATA_COMPLETE;
}