class 1 pet_around_pet_manager : default_npc
{
parameter:

handler:
	EventHandler CREATED()
	{
		myself::AddPetDefaultDesire_Follow(30.000000);
		myself::AddTimerEx(5001,3000);
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0,i1)
	{
		if( timer_id == 5001 )
		{
			if( myself::DistFromMe(myself.boss) >= 50 )
			{
				myself::AddMoveToDesire(( myself::FloatToInt(myself.boss.x) + gg::Rand(20) ),( myself::FloatToInt(myself.boss.y) + gg::Rand(20) ),myself::FloatToInt(myself.boss.z),30);
			}
			else
			{
				i0 = gg::Rand(2);
				i1 = gg::Rand(2);
				if( i0 == 0 )
				{
					if( i1 == 0 )
					{
						myself::AddMoveToDesire(( myself::FloatToInt(myself.boss.x) - gg::Rand(50) ),( myself::FloatToInt(myself.boss.y) - gg::Rand(50) ),myself::FloatToInt(myself.boss.z),30);
					}
					else
					{
						myself::AddMoveToDesire(( myself::FloatToInt(myself.boss.x) - gg::Rand(50) ),( myself::FloatToInt(myself.boss.y) + gg::Rand(50) ),myself::FloatToInt(myself.boss.z),30);
					}
				}
				else if( i1 == 0 )
				{
					myself::AddMoveToDesire(( myself::FloatToInt(myself.boss.x) + gg::Rand(50) ),( myself::FloatToInt(myself.boss.y) - gg::Rand(50) ),myself::FloatToInt(myself.boss.z),30);
				}
				else
				{
					myself::AddMoveToDesire(( myself::FloatToInt(myself.boss.x) + gg::Rand(50) ),( myself::FloatToInt(myself.boss.y) + gg::Rand(50) ),myself::FloatToInt(myself.boss.z),30);
				}
			}
			myself::AddTimerEx(5001,5000);
		}
	}

}
