pPet->setFtarg( pPlayer->serial() ); pPet->setNpcWander(1);
pPet->setWanderFollowTarget( pPlayer->serial() ); pPet->setWanderType( enFollowTarget );
bool PetCommand( cUOSocket *socket, P_CHAR pPlayer, P_CHAR pPet, const QString& comm ){	if( pPet->owner() != pPlayer && !pPlayer->isGM() )		return false;	// player vendor	if( pPet->npcaitype() == 17 )		return false;		// too far away to hear us	if( pPlayer->dist( pPet ) > 7 )		return false;		QString petname = pPet->name();	bool bAllCommand = false;	if( !comm.contains( petname, false ) )		if( comm.contains( "ALL", false ) )			bAllCommand = true;		else			return false;		bool bReturn = false;		if( comm.contains( " FOLLOW" ) )	{		if( comm.contains( " ME" ) )		{			pPet->setFtarg( pPlayer->serial() );			pPet->setNpcWander( 1 );			playmonstersound( pPet, pPet->id(), SND_STARTATTACK );		}		else		{			// LEGACY: target( s, 0, 1, 0, 117, "Click on the target to follow." );		}		bReturn = true;	}	else if( ( comm.contains( " KILL" ) ) || ( comm.contains( " ATTACK" ) ) )	{		if( pPet->inGuardedArea() ) // Ripper..No pet attacking in town.		{			pPlayer->message( tr( "You can't have pets attack in town!" ) );			return false;		}		//pPlayer->setGuarded( false );		// >> LEGACY		//addx[s]=pPet->serial();		//target(s, 0, 1, 0, 118, "Select the target to attack.");//AntiChrist		bReturn = true;	}	else if( ( comm.contains( " FETCH" ) ) || ( comm.contains( " GET" ) ) )	{		//pPlayer->setGuarded(false);		// >> LEGACY		//addx[s]=pPet->serial();		//target(s, 0, 1, 0, 124, "Click on the object to fetch.");		bReturn = true;	}	else if( comm.contains( " COME" ) )	{		//pPlayer->setGuarded( false );		pPet->setFtarg( pPlayer->serial() );		pPet->setNpcWander(1);		pPet->setNextMoveTime();		pPlayer->message( tr( "Your pet begins following you." ) );		bReturn = true;	}	else if( comm.contains( " GUARD" ) )	{		// LEGACY		/*addx[s] = pPet->serial();	// the pet's serial		addy[s] = 0;		if( comm.find( " ME" ) != string::npos )			addy[s]=1;	// indicates we already know whom to guard (for future use)				// for now they still must click on themselves (Duke)		target(s, 0, 1, 0, 120, "Click on the char to guard.");*/		bReturn = true;	}	else if( ( comm.contains( " STOP" ) ) || ( comm.contains(" STAY") ) )	{		//pPlayer->setGuarded( false );		pPet->setFtarg( INVALID_SERIAL );		pPet->setTarg( INVALID_SERIAL );		if (pPet->war()) 			pPet->toggleCombat();		pPet->setNpcWander(0);		bReturn = true;	}	else if( comm.contains( " TRANSFER" ) )	{		//pPlayer->setGuarded( false );		// >> LEGACY		/*addx[s]=pPet->serial();		target(s, 0, 1, 0, 119, "Select character to transfer your pet to.");*/		bReturn = true;	}	else if( comm.contains( " RELEASE" ) )	{		//pPlayer->setGuarded( false );		// Has it been summoned ? Let's dispel it		if( pPet->summontimer() )			pPet->setSummonTimer( uiCurrentTime );		pPet->setFtarg( INVALID_SERIAL );		pPet->setNpcWander( 2 );		pPet->setOwner( NULL );		pPet->setTamed( false );		pPet->emote( tr( "%1 appears to have decided that it is better off without a master" ).arg( pPet->name() ) );		if( SrvParams->tamedDisappear() ==1 )		{			pPet->soundEffect( 0x01FE );			cCharStuff::DeleteChar( pPet );		}		bReturn = true;	}	// give other pets opotunity to process command	if ( bReturn && bAllCommand )		return false; 	else		return bReturn;}