pc->setPoisontime(currenttime+(5*MY_CLOCKS_PER_SEC));
pc->setPoisonTime(currenttime+(5*MY_CLOCKS_PER_SEC));
void checkNPC( P_CHAR pc, unsigned int currenttime ){	if (pc == NULL)		return;	if (pc->stablemaster_serial() != INVALID_SERIAL) return;	int pcalc;	char t[120];	cCharStuff::CheckAI( currenttime, pc );	Movement::instance()->NpcMovement( currenttime, pc );    setcharflag( pc );	// We are at war and want to prepare a new swing	if( !pc->dead() && pc->swingtarg() == -1 && pc->war() )		Combat::combat( pc );	// We are swinging and completed our move	else if( !pc->dead() && ( pc->swingtarg() >= 0 && pc->timeout() <= currenttime ) )		Combat::checkandhit( pc );	Magic->CheckFieldEffects2( currenttime, pc, 0 );	if( pc->shop() )		restockNPC( currenttime, pc );	if( !pc->free )	{		if( pc->summontimer() && ( pc->summontimer() <= currenttime ) )		{			pc->soundEffect( 0x01FE );			pc->setDead( true );			cCharStuff::DeleteChar(pc);			return;		}	}	// Character is not fleeing but reached the border	if( pc->npcWander() != 5 && pc->hp() < pc->st()*pc->fleeat() / 100 )	{		pc->setOldNpcWander( pc->npcWander() );		pc->setNpcWander(5);		pc->setNextMoveTime();	}    // Character is fleeing and has regenerated	if( pc->npcWander() == 5 && pc->hp() > pc->st()*pc->reattackat() / 100 )	{		pc->setNpcWander( pc->oldnpcWander() );		pc->setNextMoveTime();		pc->setOldNpcWander( 0 );	}	// new poisoning code	if (pc->poisoned() && !(pc->isInvul()) )	{		if( pc->poisontime() <= currenttime )		{			if (pc->poisonwearofftime()>currenttime) // lb, makes poison wear off pc's			{				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()), 0x0026);					}//					pc->hp -= RandomNum(1,2);					pc->setHp( pc->hp() - RandomNum(1,2) );					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()), 0x0026);					}					pcalc = ( ( pc->hp() * RandomNum(2,5) ) / 100) + RandomNum(0,2); // damage: 1..2..5% of hp's+ 1..2 constant					//					pc->hp -= pcalc;					pc->setHp( pc->hp() - pcalc);					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()), 0x0026 );					}					pcalc=( ( pc->hp() * RandomNum(5,10) ) / 100 ) + RandomNum(1,3); // damage: 5..10% of hp's+ 1..2 constant//					pc->hp -= pcalc;					pc->setHp( pc->hp() - pcalc);					pc->updateHealth();					break; // lb !!!				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("* %s looks extremely weak and is wrecked in pain! *").arg(pc->name()), 0x0026 );					}					pcalc=( (pc->hp() * RandomNum(10,15) ) / 100 ) + RandomNum(3,6); // damage:10 to 15% of hp's+ 3..6 constant, quite deadly <g>//					pc->hp -= pcalc;					pc->setHp(pc->hp() - pcalc);					pc->updateHealth();					break;				default:					clConsole.send("ERROR: Fallout of switch statement without default. wolfpack.cpp, checkNPC()\n"); //Morrolan					pc->setPoisoned(0);					return;				}				if( pc->hp() < 1 )				{					pc->kill();				}			} // end switch		} // end if poison-wear off-timer	} // end if poison-damage timer	if ((pc->poisonwearofftime()<=currenttime))	{		if ((pc->poisoned()))		{			pc->setPoisoned(0);			pc->update();		}	}	//hunger code for npcs	if( SrvParams->hungerRate() && (pc->hungertime() <= currenttime ) )	{		t[0] = '\0';		if (pc->hunger()) 			pc->setHunger( pc->hunger()-1 ); //Morrolan GMs and Counselors don't get hungry		if(pc->tamed() && pc->npcaitype() != 17)		{//if tamed let's display his hungry status			switch(pc->hunger())			{			case 6:			case 5:	break;			case 4:	pc->emote( tr("* %1 looks a little hungry *").arg(pc->name()), 0x0026);		break;			case 3:	pc->emote( tr("* %1 looks fairly hungry *").arg(pc->name()), 0x0026);			break;			case 2:	pc->emote( tr("* %1 looks extremely hungry *").arg(pc->name()), 0x0026);		break;			case 1:	pc->emote( tr("* %1 looks weak from starvation *",pc->name()), 0x0026);		break;			case 0:				//maximum hunger - untame code				//pet release code here				if(pc->tamed())				{					pc->setFtarg( INVALID_SERIAL );					pc->setNpcWander( 2 );					pc->setTamed( false );					if( pc->owner() )						pc->setOwner( NULL );					pc->emote( tr("%1 appears to have decided that it is better off without a master").arg(pc->name()), 0x0026 );					pc->soundEffect( 0x01FE );					if( SrvParams->tamedDisappear() == 1 )						cCharStuff::DeleteChar(pc);				}				break;			}		}//if tamed		pc->setHungerTime( currenttime+(SrvParams->hungerRate()*MY_CLOCKS_PER_SEC) );	}//if hungerrate>1}