tempeffect2(0, pi, 13, 0, 0, 0);
void dooruse( cUOSocket *socket, P_ITEM pi ){	if( !pi )		return;	if( socket && socket->player() && !socket->player()->inRange( pi, 2 ) )	{		socket->sysMessage( tr( "You cannot reach the handle from here." ) );		return;	}	UINT16 x = pi->id();	UINT16 db;	for( UINT32 i = 0; i < DOORTYPES; ++i )	{		db = doorbase[i];		if( x == ( db + 0 ) )		{			pi->setId( pi->id() + 1 );			Coord_cl pos( pi->pos() );			pos.x--;			pos.y++;			pi->moveTo( pos );			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		}		else if( x == ( db + 1 ) )		{			pi->setId( pi->id() - 1 );			Coord_cl pos( pi->pos() );			pos.x++;			pos.y--;			pi->moveTo( pos );			doorsfx(pi, x, 1);			pi->setDoorOpen(0);		}		else if (x==(db+2))		{			pi->setId( pi->id() + 1 );			Coord_cl pos( pi->pos() );			pos.x++;			pos.y++;			pi->moveTo( pos );			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		}		else if (x==(db+3))		{			pi->setId( pi->id() - 1 );			Coord_cl pos( pi->pos() );			pos.x--;			pos.y--;			pi->moveTo( pos );			doorsfx(pi, x, 1);			pi->setDoorOpen(0);		}		else if (x==(db+4))		{			pi->setId( pi->id() + 1 );			Coord_cl pos( pi->pos() );			pos.x--;			pi->moveTo( pos );			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		}		else if (x==(db+5))		{			pi->setId( pi->id() - 1 );			Coord_cl pos( pi->pos() );			pos.x++;			pi->moveTo( pos );			doorsfx(pi, x, 1);			pi->setDoorOpen(0);		}		else if (x==(db+6))		{			pi->setId( pi->id() + 1 );			Coord_cl pos( pi->pos() );			pos.x++;			pos.y--;			pi->moveTo( pos );			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		}		else if (x==(db+7))		{			pi->setId( pi->id() - 1 );			Coord_cl pos( pi->pos() );			pos.x--;			pos.y++;			pi->moveTo( pos );			doorsfx(pi, x, 1);			pi->setDoorOpen(0);		}		else if (x==(db+8))		{			pi->setId( pi->id() + 1 );			Coord_cl pos( pi->pos() );			pos.x++;			pos.y++;			pi->moveTo( pos );			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		}		else if (x==(db+9))		{			pi->setId( pi->id() - 1 );			Coord_cl pos( pi->pos() );			pos.x--;			pos.y--;			pi->moveTo( pos );			doorsfx(pi, x, 1);			pi->setDoorOpen(0);		}		else if (x==(db+10))		{			pi->setId( pi->id() + 1 );			Coord_cl pos( pi->pos() );			pos.x++;			pos.y--;			pi->moveTo( pos );			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		}		else if (x==(db+11))		{			pi->setId( pi->id() - 1 );			Coord_cl pos( pi->pos() );			pos.x--;			pos.y++;			pi->moveTo( pos );			doorsfx(pi, x, 1);			pi->setDoorOpen(0);		}		else if (x==(db+12))		{			pi->setId( pi->id() + 1 );			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		}		else if (x==(db+13))		{			pi->setId( pi->id() - 1 );			doorsfx(pi, x, 1);			pi->setDoorOpen(0);		}		else if( x == ( db + 14 ) )		{			pi->setId( pi->id() + 1 );			Coord_cl pos( pi->pos() );			pos.y--;			pi->moveTo( pos );			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		}		else if( x == ( db + 15 ) )		{			pi->setId( pi->id() - 1 );			Coord_cl pos( pi->pos() );			pos.y++;			pi->moveTo( pos );			doorsfx(pi, x, 1);			pi->setDoorOpen(0);		}		// This is *so* obvious...		if( x != pi->id() )		{			pi->update();			break;		}	}		if( socket && ( x != pi->id() ) )	{		// house refreshment when a house owner or friend of a houe opens the house door		float ds = 0;		P_CHAR pChar = socket->player();		if( !pChar )			return;				cHouse* pHouse = dynamic_cast<cHouse*>( cMulti::findMulti( pi->pos() ) );		if( !pHouse )			return;		if( !( pChar->Owns( pHouse ) || pHouse->isFriend( pChar ) ) )			return;		if( SrvParams->housedecay_secs() != 0 )			ds = static_cast<float>((pHouse->time_unused)*100) / (SrvParams->housedecay_secs());		else			ds = -1;		if( ds >= 50 ) // sysmessage if decay status >= 50%		{			socket->sysMessage( tr( "You refreshed the house" ) );		}		pHouse->time_unused = 0;		pHouse->last_used = getNormalizedTime();	}}