本文整理汇总了C++中CInstance::setDeadTime方法的典型用法代码示例。如果您正苦于以下问题:C++ CInstance::setDeadTime方法的具体用法?C++ CInstance::setDeadTime怎么用?C++ CInstance::setDeadTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInstance
的用法示例。
在下文中一共展示了CInstance::setDeadTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleInstances
void CInstanceHandler::handleInstances(uint32 tick) {
for(int i=0; i<m_MaxInstances; i++) {
if(m_Instances[i]!=NULL) { //handle it!
CInstance* PInstance = m_Instances[i];
int instzone = PInstance->getZoneId();
//Dynamis zone (need to add COP Dyna)
if(instzone > 184 && instzone < 189 || instzone > 133 && instzone < 136) {
//handle death time
if(PInstance->allPlayersDead()) { //set dead time
if(PInstance->getDeadTime()==0) {
PInstance->setDeadTime(tick);
ShowDebug("Dynamis %i instance %i : All players have fallen.\n",PInstance->getID(),PInstance->getInstanceNumber());
}
}
else {
if(PInstance->getDeadTime()!=0) {
PInstance->setDeadTime(0); //reset dead time when people are alive
ShowDebug("Dynamis %i instance %i : Death counter reset as a player is now alive.\n",PInstance->getID(),PInstance->getInstanceNumber());
}
}
//handle time remaining prompts (since its useful!) Prompts every minute
int Tremaining = (tick - PInstance->getStartTime())/1000;
//New message (in yellow) at the end of dynamis (5min before the end)
if((Tremaining % 60) == 0 && (PInstance->getTimeLimit() - Tremaining) <= 300) {
PInstance->pushMessageToAllInBcnm(449,((PInstance->getTimeLimit()-Tremaining)/60));
}
else {
if(((tick - PInstance->getStartTime())/1000) % 60 == 0) {
PInstance->pushMessageToAllInBcnm(202,(PInstance->getTimeLimit()-Tremaining));
}
}
//if the time is finished, exiting dynamis
if(instanceutils::meetsLosingConditions(PInstance,tick)) {
ShowDebug("Dynamis %i instance %i : Dynamis is finished. Exiting battlefield.\n",PInstance->getID(),PInstance->getInstanceNumber());
PInstance->finishDynamis();
}
}
else {
//handle locking of bcnm when engaged
if(!PInstance->locked && PInstance->isPlayersFighting()) {
PInstance->lockBcnm();
PInstance->locked = true;
ShowDebug("BCNM %i instance %i : Battlefield has been locked. No more players can enter.\n",PInstance->getID(),PInstance->getInstanceNumber());
}
//handle death time
if(PInstance->allPlayersDead()) { //set dead time
if(PInstance->getDeadTime()==0) {
PInstance->setDeadTime(tick);
ShowDebug("BCNM %i instance %i : All players have fallen.\n",PInstance->getID(),PInstance->getInstanceNumber());
}
}
else {
if(PInstance->getDeadTime()!=0) {
PInstance->setDeadTime(0); //reset dead time when people are alive
ShowDebug("BCNM %i instance %i : Death counter reset as a player is now alive.\n",PInstance->getID(),PInstance->getInstanceNumber());
}
}
//handle time remaining prompts (since its useful!) Prompts every minute
if(((tick - PInstance->getStartTime())/1000) % 60 == 0) {
PInstance->pushMessageToAllInBcnm(202,(PInstance->getTimeLimit()-((tick - PInstance->getStartTime())/1000)));
}
//handle win conditions
if(instanceutils::meetsWinningConditions(PInstance,tick)) {
//check rule mask to see if warp immediately or pop a chest
if(PInstance->m_RuleMask & RULES_SPAWN_TREASURE_ON_WIN) {
//spawn chest
if(PInstance->treasureChestSpawned == false)
{
ShowDebug("BCNM %i instance %i : Winning conditions met. Spawning chest.\n",PInstance->getID(),PInstance->getInstanceNumber());
PInstance->spawnTreasureChest();
//PInstance->getHighestTHforBcnm(); apparently not used in bcnm
PInstance->treasureChestSpawned = true;
}
}
else {
ShowDebug("BCNM %i instance %i : Winning conditions met. Exiting battlefield.\n",PInstance->getID(),PInstance->getInstanceNumber());
PInstance->winBcnm();
}
}
//handle lose conditions
else if(instanceutils::meetsLosingConditions(PInstance,tick)) {
ShowDebug("BCNM %i instance %i : Losing conditions met. Exiting battlefield.\n",PInstance->getID(),PInstance->getInstanceNumber());
PInstance->loseBcnm();
}
}
}
}
//send 246 with bunrning circle as target (bcnm is full. followed by time remaining)
}