本文整理汇总了C++中ResetObjs函数的典型用法代码示例。如果您正苦于以下问题:C++ ResetObjs函数的具体用法?C++ ResetObjs怎么用?C++ ResetObjs使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ResetObjs函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendMessageToAll
void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
{
if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC] &&
GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED &&
GateStatus[BG_SA_YELLOW_GATE] == BG_SA_GATE_DESTROYED &&
(GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED) &&
(GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED))
{
if (Source->GetTeamId() == Attackers)
{
if (Source->GetTeamId() == TEAM_ALLIANCE)
SendMessageToAll(LANG_BG_SA_ALLIANCE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else SendMessageToAll(LANG_BG_SA_HORDE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
if (Status == BG_SA_ROUND_ONE)
{
RoundScores[0].winner = Attackers;
RoundScores[0].time = TotalTime;
//Achievement Storm the Beach (1310)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
if (player->GetTeamId() == Attackers)
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65246);
}
Attackers = (Attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
Status = BG_SA_SECOND_WARMUP;
TotalTime = 0;
ToggleTimer();
SendWarningToAll(LANG_BG_SA_ROUND_ONE_END);
UpdateWaitTimer = 5000;
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = true;
ResetObjs();
}
else if (Status == BG_SA_ROUND_TWO)
{
RoundScores[1].winner = Attackers;
RoundScores[1].time = TotalTime;
ToggleTimer();
//Achievement Storm the Beach (1310)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
if (player->GetTeamId() == Attackers && RoundScores[1].winner == Attackers)
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65246);
}
if (RoundScores[0].time == RoundScores[1].time)
EndBattleground(0);
else if (RoundScores[0].time < RoundScores[1].time)
EndBattleground(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
else
EndBattleground(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
}
}
}
}
示例2: ToggleTimer
void BattleGroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
{
if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC])
{
if (Source->GetTeamId() == attackers)
{
if (status == BG_SA_ROUND_ONE)
{
RoundScores[0].winner = attackers;
RoundScores[0].time = TotalTime;
attackers = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
status = BG_SA_SECOND_WARMUP;
TotalTime = 0;
ToggleTimer();
ResetObjs();
}
else if (status == BG_SA_ROUND_TWO)
{
RoundScores[1].winner = attackers;
RoundScores[1].time = TotalTime;
ToggleTimer();
if (RoundScores[0].time == RoundScores[1].time)
EndBattleGround(NULL);
else if (RoundScores[0].time < RoundScores[1].time)
EndBattleGround(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
else
EndBattleGround(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
}
}
}
}
示例3: SendMessageToAll
void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
{
if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC] && GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED)
{
if (Source->GetTeamId() == attackers)
{
if (Source->GetTeamId() == TEAM_ALLIANCE)
SendMessageToAll(LANG_BG_SA_ALLIANCE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else SendMessageToAll(LANG_BG_SA_HORDE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
if (status == BG_SA_ROUND_ONE)
{
RoundScores[0].winner = attackers;
RoundScores[0].time = TotalTime;
attackers = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
status = BG_SA_SECOND_WARMUP;
TotalTime = 0;
ToggleTimer();
SendWarningToAll(LANG_BG_SA_ROUND_ONE_END);
UpdateWaitTimer = 5000;
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = true;
ResetObjs();
}
else if (status == BG_SA_ROUND_TWO)
{
RoundScores[1].winner = attackers;
RoundScores[1].time = TotalTime;ToggleTimer();
if (RoundScores[0].time == RoundScores[1].time)
EndBattleground(NULL);
else if (RoundScores[0].time < RoundScores[1].time)
EndBattleground(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
else
EndBattleground(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
}
}
}
}
示例4: ResetObjs
bool BattlegroundSA::SetupBattleground()
{
return ResetObjs();
}
示例5: SendMessageToAll
void BattlegroundSA::PostUpdateImpl(uint32 diff)
{
if (InitSecondRound)
{
if (UpdateWaitTimer < diff)
{
if (!SignaledRoundTwo)
{
SignaledRoundTwo = true;
InitSecondRound = false;
SendMessageToAll(LANG_BG_SA_ROUND_TWO_ONE_MINUTE, CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
}
else
{
UpdateWaitTimer -= diff;
return;
}
}
TotalTime += diff;
if (Status == BG_SA_WARMUP )
{
EndRoundTimer = BG_SA_ROUNDLENGTH;
if (TotalTime >= BG_SA_WARMUPLENGTH)
{
TotalTime = 0;
ToggleTimer();
DemolisherStartState(false);
Status = BG_SA_ROUND_ONE;
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, (Attackers == TEAM_ALLIANCE)? 23748 : 21702);
}
if (TotalTime >= BG_SA_BOAT_START)
StartShips();
return;
}
else if (Status == BG_SA_SECOND_WARMUP)
{
if (RoundScores[0].time<BG_SA_ROUNDLENGTH)
EndRoundTimer = RoundScores[0].time;
else
EndRoundTimer = BG_SA_ROUNDLENGTH;
if (TotalTime >= 60000)
{
SendWarningToAll(LANG_BG_SA_HAS_BEGUN);
TotalTime = 0;
ToggleTimer();
DemolisherStartState(false);
Status = BG_SA_ROUND_TWO;
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, (Attackers == TEAM_ALLIANCE) ? 23748 : 21702);
// status was set to STATUS_WAIT_JOIN manually for Preparation, set it back now
SetStatus(STATUS_IN_PROGRESS);
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player* p = ObjectAccessor::FindPlayer(itr->first))
p->RemoveAurasDueToSpell(SPELL_PREPARATION);
}
if (TotalTime >= 30000)
{
if (!SignaledRoundTwoHalfMin)
{
SignaledRoundTwoHalfMin = true;
SendMessageToAll(LANG_BG_SA_ROUND_TWO_START_HALF_MINUTE, CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
}
StartShips();
return;
}
else if (GetStatus() == STATUS_IN_PROGRESS)
{
if (Status == BG_SA_ROUND_ONE)
{
if (TotalTime >= BG_SA_ROUNDLENGTH)
{
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
player->CastSpell(player, 52459, true);
RoundScores[0].winner = Attackers;
RoundScores[0].time = BG_SA_ROUNDLENGTH;
TotalTime = 0;
Status = BG_SA_SECOND_WARMUP;
Attackers = (Attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
UpdateWaitTimer = 5000;
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = true;
ToggleTimer();
ResetObjs();
return;
}
}
else if (Status == BG_SA_ROUND_TWO)
{
if (TotalTime >= EndRoundTimer)
{
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
player->CastSpell(player, 52459, true);
//.........这里部分代码省略.........
示例6: SendMessageToAll
void BattlegroundSA::PostUpdateImpl(uint32 diff)
{
if (InitSecondRound)
{
if (UpdateWaitTimer < diff)
{
if (!SignaledRoundTwo)
{
SignaledRoundTwo = true;
InitSecondRound = false;
SendMessageToAll(LANG_BG_SA_ROUND_TWO_ONE_MINUTE, CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
}else
{
UpdateWaitTimer -= diff;
return;
}
}
TotalTime += diff;
if (Status == BG_SA_WARMUP )
{
EndRoundTimer = BG_SA_ROUNDLENGTH;
if (TotalTime >= BG_SA_WARMUPLENGTH)
{
TotalTime = 0;
ToggleTimer();
DemolisherStartState(false);
Status = BG_SA_ROUND_ONE;
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, (Attackers == TEAM_ALLIANCE)?23748:21702);
}
if (TotalTime >= BG_SA_BOAT_START)
StartShips();
return;
}
else if (Status == BG_SA_SECOND_WARMUP)
{
if (RoundScores[0].time<BG_SA_ROUNDLENGTH)
EndRoundTimer = RoundScores[0].time;
else
EndRoundTimer = BG_SA_ROUNDLENGTH;
if (TotalTime >= 60000)
{
SendWarningToAll(LANG_BG_SA_HAS_BEGUN);
TotalTime = 0;
ToggleTimer();
DemolisherStartState(false);
Status = BG_SA_ROUND_TWO;
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, (Attackers == TEAM_ALLIANCE)?23748:21702);
}
if (TotalTime >= 30000)
{
if (!SignaledRoundTwoHalfMin)
{
SignaledRoundTwoHalfMin = true;
SendMessageToAll(LANG_BG_SA_ROUND_TWO_START_HALF_MINUTE, CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
}
StartShips();
return;
}
else if (GetStatus() == STATUS_IN_PROGRESS)
{
if (Status == BG_SA_ROUND_ONE)
{
if (TotalTime >= BG_SA_ROUNDLENGTH)
{
RoundScores[0].winner = Attackers;
RoundScores[0].time = BG_SA_ROUNDLENGTH;
TotalTime = 0;
Status = BG_SA_SECOND_WARMUP;
Attackers = (Attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
UpdateWaitTimer = 5000;
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = true;
ToggleTimer();
ResetObjs();
return;
}
}
else if (Status == BG_SA_ROUND_TWO)
{
if (TotalTime >= EndRoundTimer)
{
RoundScores[1].time = BG_SA_ROUNDLENGTH;
RoundScores[1].winner = (Attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
if (RoundScores[0].time == RoundScores[1].time)
EndBattleground(0);
else if (RoundScores[0].time < RoundScores[1].time)
EndBattleground(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
else
EndBattleground(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
return;
}
}
if (Status == BG_SA_ROUND_ONE || Status == BG_SA_ROUND_TWO)
{
//.........这里部分代码省略.........
示例7: SendMessageToAll
void BattlegroundSA::TitanRelicActivated(Player* clicker)
{
if (!clicker)
return;
if (GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED &&
GateStatus[BG_SA_YELLOW_GATE] == BG_SA_GATE_DESTROYED &&
(GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED) &&
(GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED))
{
if (clicker->GetBGTeamId() == Attackers)
{
if (clicker->GetBGTeamId() == TEAM_ALLIANCE)
SendMessageToAll(LANG_BG_SA_ALLIANCE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else
SendMessageToAll(LANG_BG_SA_HORDE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
if (Status == BG_SA_ROUND_ONE)
{
RoundScores[0].winner = Attackers;
RoundScores[0].time = TotalTime;
// Achievement Storm the Beach (1310)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
if (player->GetBGTeamId() == Attackers)
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65246);
}
Attackers = (Attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
Status = BG_SA_SECOND_WARMUP;
TotalTime = 0;
ToggleTimer();
if (Creature* c = GetBGCreature(BG_SA_NPC_KANRETHAD))
SendChatMessage(c, TEXT_ROUND_1_FINISHED);
UpdateWaitTimer = 5000;
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = true;
ResetObjs();
GetBgMap()->UpdateAreaDependentAuras();
CastSpellOnTeam(SPELL_END_OF_ROUND, ALLIANCE);
CastSpellOnTeam(SPELL_END_OF_ROUND, HORDE);
}
else if (Status == BG_SA_ROUND_TWO)
{
RoundScores[1].winner = Attackers;
RoundScores[1].time = TotalTime;
ToggleTimer();
// Achievement Storm the Beach (1310)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
if (player->GetBGTeamId() == Attackers && RoundScores[1].winner == Attackers)
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65246);
}
if (RoundScores[0].time == RoundScores[1].time)
EndBattleground(0);
else if (RoundScores[0].time < RoundScores[1].time)
EndBattleground(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
else
EndBattleground(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
}
}
}
}