pc->setPoisontime(currenttime+(4*MY_CLOCKS_PER_SEC));
pc->setPoisonTime(currenttime+(4*MY_CLOCKS_PER_SEC));
void checkPC( P_CHAR pc, unsigned int currenttime ) //Char cMapObjects::getInstance(){	cUOSocket *socket = pc->socket();	// We are not logged in so dont check anything at all.	if( !socket )		return;	unsigned int tempuint;	signed short tempshort;	int timer;//, valid=0;	if ( pc == NULL ) return;	// Check if the character is in a field which affects him	Magic->CheckFieldEffects2( currenttime, pc, 1 ); 		// We are not swinging 	// So set up a swing target and start swinging	if( !pc->dead() && pc->swingtarg() == -1 )		Combat::combat( pc );	// We are swinging and completed swinging	else if( !pc->dead() && ( pc->swingtarg() >= 0 && pc->timeout() <= currenttime ) )		Combat::checkandhit( pc );	// Unmute players who have been muted for a certain amount of time	if( pc->isPlayer() && pc->squelched() == 2 )	{		if( pc->mutetime() && ( pc->mutetime() <= currenttime ) )		{			pc->setSquelched(0);			pc->setMutetime(0);			socket->sysMessage( tr( "You are no longer muted." ) );		}	}	// Reputation System	if( pc->isPlayer() )	{		if ( pc->crimflag() > 0 && ( pc->crimflag() <= currenttime  ) &&  pc->isCriminal() )//AntiChrist		{			socket->sysMessage( tr( "You are no longer criminal" ) );			pc->setCrimflag(0);			pc->setInnocent();		}		if( pc->murderrate() < currenttime )		{			if (pc->kills()>0)			{//				pc->kills--;				tempuint = pc->kills();				pc->setKills( --tempuint );			}			if ((pc->kills()==SrvParams->maxkills())&&(SrvParams->maxkills()>0))				socket->sysMessage( tr( "You are no longer a murderer." ) );			pc->setMurderrate( ( SrvParams->murderdecay() * MY_CLOCKS_PER_SEC ) + currenttime );		}		setcharflag( pc );	}/* still needed !?	if( pc->isPlayer() && pc->casting() )//PC casting a spell	{		pc->setNextact( pc->nextact() - 1 );		if( pc->spelltime() <= currenttime  )//Spell is complete target it		{			// TODO: Reactivate when spellcasting is redone			//Magic->AfterSpellDelay( s, pc );		}		else if( pc->nextact() <= 0 )//redo the spell action		{			pc->setNextact( 75 );			pc->action( pc->spellaction() );		}	}*/	if( SrvParams->bgSound() >= 1 )	{		timer = SrvParams->bgSound() * 100;		if( timer == 0 )			timer = 1;		if( socket && !pc->dead() && ( (rand()%(timer) ) == (timer/2))) 			bgsound( pc );	}/*	// Reset spirit-speak	if( pc->spiritspeaktimer() > 0 && pc->spiritspeaktimer() <= uiCurrentTime )		pc->setSpiritSpeakTimer(0);*/	#pragma note("TODO: jail reimplementation with xml")/*	// Jail stuff	if( pc->cell() > 0 )	{		if( ( pc->jailtimer() > 0 ) && ( pc->jailtimer() <= uiCurrentTime ) )		{			socket->sysMessage( tr( "Your jail time is over!" ) );						if( pc )			{				jails[ pc->cell() ].occupied = false;				pc->removeFromView( false );				pc->moveTo( jails[ pc->cell() ].oldpos );				pc->resend( false );									pc->setCell(0);				pc->setJailSecs(0);				pc->setJailTimer(0);				pc->setPriv2(0);														savelog( tr( "%1 [0x%2] is automatically released from jail." ).arg( pc->name() ).arg( pc->serial(), 8, 16 ), "server.log" );				socket->sysMessage( tr( "You have been released." ) );			}				}	}*/	if( SrvParams->hungerRate() > 1 && ( pc->hungertime() <= currenttime  ) )	{		if( !pc->isGMorCounselor() && pc->hunger() ) 			pc->setHunger( pc->hunger() - 1 ); // GMs and Counselors don't get hungry		switch( pc->hunger() )		{		case 6: break; //Morrolan		case 5: socket->sysMessage( tr("You are still stuffed from your last meal") );	break;		case 4:	socket->sysMessage( tr("You are not very hungry but could eat more") );	break;		case 3:	socket->sysMessage( tr("You are feeling fairly hungry") );				break;		case 2:	socket->sysMessage( tr("You are extremely hungry") );						break;		case 1:	socket->sysMessage( tr("You are very weak from starvation") );			break;		case 0:			if (!pc->isGMorCounselor())				socket->sysMessage( tr( "You must eat very soon or you will die!" ) );			break;		}		pc->setHungerTime( currenttime + ( SrvParams->hungerRate() * MY_CLOCKS_PER_SEC ) );	}	 // Damage them if they are very hungry	if( ( hungerdamagetimer <= currenttime ) && SrvParams->hungerDamage() )	{		hungerdamagetimer=currenttime+(SrvParams->hungerDamageRate()*MY_CLOCKS_PER_SEC); /** set new hungertime **/		if( pc->hp() > 0 && pc->hunger()<2 && !pc->isGMorCounselor() && !pc->dead() )		{			socket->sysMessage( tr( "You are starving." ) );//			pc->hp -= SrvParams->hungerDamage();			pc->setHp( pc->hp() - SrvParams->hungerDamage() );						if( pc->hp() <=0 )			{				socket->sysMessage( tr( "You have died of starvation." ) );				pc->kill();			}		}	}	// new math + poison wear off timer added by lord binary !	if( pc->poisoned() && !pc->isInvul() )	{		if( pc->poisontime() <= currenttime )		{			if( pc->poisonwearofftime() > currenttime ) // lb, makes poison wear off pc's			{				// We only support 4 levels of poison here.				switch( pc->poisoned() )				{				case 1:					pc->setPoisontime(currenttime+(5*MY_CLOCKS_PER_SEC));					if( pc->poisontxt() <= currenttime )					{						pc->setPoisontxt(currenttime+(10*MY_CLOCKS_PER_SEC));						pc->emote( tr( "*%1 looks a bit nauseous!*" ).arg( pc->name() ), 0x26 );					}				 //					pc->hp -= QMAX(((pc->hp)*RandomNum(5,15))/100, RandomNum(0,1) ); // between 0% and 10% of player's hp 					tempshort = pc->hp();					tempshort -= QMAX(((tempshort)*RandomNum(5,15))/100, RandomNum(0,1) );					pc->setHp( tempshort );					pc->updateHealth();					break;				case 2:					pc->setPoisontime(currenttime+(4*MY_CLOCKS_PER_SEC));					if( pc->poisontxt() <= currenttime )					{						pc->setPoisontxt(currenttime+(10*MY_CLOCKS_PER_SEC));						pc->emote( tr( "*%1 looks disoriented and nauseous!*" ).arg( pc->name() ), 0x26 );					}					//					pc->hp -= QMAX(((pc->hp)*RandomNum(10,20))/100, RandomNum(0,1)); //between 10% and 20% of player's hp					tempshort = pc->hp();					tempshort -= QMAX(((tempshort)*RandomNum(10,20))/100, RandomNum(0,1));					pc->setHp( tempshort );					pc->updateHealth();					break;				case 3:					pc->setPoisontime(currenttime+(3*MY_CLOCKS_PER_SEC));										if( pc->poisontxt() <= currenttime )					{						pc->setPoisontxt(currenttime+(10*MY_CLOCKS_PER_SEC));						pc->emote( tr( "*%1 is in severe pain!*" ).arg( pc->name() ), 0x26 );					}					//					pc->hp -= QMAX( ( pc->hp * RandomNum( 20, 30 ) ) / 100, RandomNum( 0, 1 ) ); // between 20% and 30% of player's hp 					tempshort = pc->hp();					tempshort -= QMAX( ( tempshort * RandomNum( 20, 30 ) ) / 100, RandomNum( 0, 1 ) );					pc->setHp( tempshort );					pc->updateHealth();					break;				case 4:					pc->setPoisontime( currenttime+(3*MY_CLOCKS_PER_SEC) );					if( pc->poisontxt() <= currenttime )					{						pc->setPoisontxt(currenttime+(10*MY_CLOCKS_PER_SEC));						pc->emote( tr( "*%1 looks extremely sick*" ).arg( pc->name() ), 0x26 );					}				//					pc->hp -= QMAX( ( pc->hp * RandomNum( 30, 40 ) ) / 100, 1 ); //between 30% and 40% of player's hp					tempshort = pc->hp();					tempshort -= QMAX( ( tempshort * RandomNum( 30, 40 ) ) / 100, 1 );					pc->setHp( tempshort );					pc->updateHealth();					break;				default:					clConsole.send( tr( "Unknown poison type for Character %1 [0x%2]\n" ).arg( pc->name() ).arg( pc->serial(), 8, 16 ) );					pc->setPoisoned( 0 );					return;				}				if( pc->hp() < 1 )				{					socket->sysMessage( tr( "The poison killed you.") );					pc->kill();				}			} // end switch		} // end if poison-wear off-timer	} // end if poison-damage timer	if( pc->poisoned() && pc->poisonwearofftime() <= currenttime )	{		pc->setPoisoned( 0 );		pc->update(); // a simple status-update should be enough here		socket->sysMessage( tr( "The poison has worn off." ) );	}}