// 忘幽谷
int Rule = 10;
int RoundTime = 888;
int PlayerSpawn = 124;
int PlayerSpawnDir = 180;
int PlayerWeapon = 47;
int PlayerWeapon2 = 0;
int PlayerHP = 5000;

int trg0 = 0;
int trg1 = 0;
int trg2 = 0;
int trg3 = 0;
int trg4 = 0;

OnStart()
{
	AddNPC("npc44_01");
	AddNPC("npc44_02");
	AddNPC("npc44_03");
	AddNPC("npc44_04");
	AddNPC("npc44_05");
	AddNPC("npc44_06");
	AddNPC("npc44_07");
	AddNPC("npc44_08");
}


OnUpdate()
{
	int player = GetChar("player");
	if (player < 0)
	{
		return 0;
	}
	
	int c;
	int c2;
	
	if (trg0 == 0)
	{
		c = GetChar("【大鹏展翅】-1");
		c2 = GetChar("【大鹏展翅】-2");
		
		if (c>=0 && c2>=0)
		{		
			ChangeBehavior(c, "patrol", 0);
			Perform(c, "pause", 12);
			Perform(c, "aggress");
			Perform(c, "pause", 12);
			Perform(c, "faceto", c2);			
			
			ChangeBehavior(c2, "patrol", 16, 18, 19, 20, 21);
			Perform(c2, "pause", 8);
			Perform(c2, "aggress", 10);
			Perform(c2, "pause", 8);
			Perform(c2, "pause", 8);
			Perform(c2, "faceto", c);
			
			trg0 = 1;
		}
	}
	

	if (trg1 == 0)
	{
		c = GetChar("【大鹏展翅】-1");
		if (c>=0 && GetEnemy(c)==player )
		{
			StopPerform(c);
			c2 = GetChar("【大鹏展翅】-2");
			StopPerform(c2);
			
			Perform(c, "say", "宁鹏你还是来了，好，今天我们就较量一下！！");
			trg1 = 1;
		}
	}	
	if (trg1 == 1)
	{
		c = GetChar("【大鹏展翅】-1");
		if (c>=0 && GetEnemy(c)!=player)
		{
			trg1 = 2;
		}	
	}	
	if (trg1 == 2)
	{
		c = GetChar("【大鹏展翅】-1");
		if (c>=0 && GetEnemy(c)==player)
		{
			trg1 = 3;
		}
	}		
	if (trg1 == 3)
	{
		c = GetChar("【大鹏展翅】-1");
		if (c>=0 && GetEnemy(c)!=player)
		{
			Perform(c, "aggress");
			trg1 = 4;
		}	
	}
	
	if (trg2 == 0)
	{
		c = GetChar("【大鹏展翅】-2");
		if (c>=0 && GetEnemy(c)==player)
		{
			StopPerform(c);		
			c2 = GetAnyChar("【大鹏展翅】-1");
			StopPerform(c2);
			
			if (c2>=0 && GetHP(c2)>0)
			{
				ChangeBehavior(c2, "follow", c);
			} else
			{
				ChangeBehavior(c, "follow", player);
				Perform(c, "attack");				
			}
				
			Perform(c, "guard", 4);
			Perform(c, "say", "我们那么多人，你就别想赢了.");
			Perform(c, "faceto", player);
				
			trg2 = 1;			
		}
	}
	if (trg2 == 1)
	{
		c = GetChar("【大鹏展翅】-2");
		if (c>=0 && GetEnemy(c)!=player)
		{
			trg2 = 2;			
		}
	}	
	if (trg2 == 2)
	{
		c = GetChar("【大鹏展翅】-2");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "attack");
			trg2 = 3;			
		}
	}	
	if (trg2 == 3)
	{
		c = GetChar("【大鹏展翅】-2");
		if (c>=0 && GetEnemy(c)!=player)
		{
			Perform(c, "aggress");
			trg2 = 4;			
		}
	}	
	
	if (trg3 == 0)
	{
		c = GetAnyChar("【大鹏展翅】-1");
		if (c>=0 && GetHP(c)<=0)
		{			
			trg3 = 1;
		}						
	}
	if (trg3 == 1)
	{
		c = GetChar("【大鹏展翅】-2");
		if (c>=0 && GetEnemy(c)==player)
		{
			ChangeBehavior(c, "kill", player);				
			Perform(c, "faceto", player);
			trg3 = 2;
			trg2 = 4;
		}							
	}
	
	if (trg4 == 0)
	{
		c = GetAnyChar("【大鹏展翅】-2");
		if (c>=0 && GetHP(c)<=0)
		{		
			trg4 = 1;
		}						
	}
	if (trg4 == 1)
	{
		c = GetChar("【大鹏展翅】-1");
		if (c>=0 && GetEnemy(c)==player)
		{			
			ChangeBehavior(c, "kill", player);				
			Perform(c, "faceto", player);
			trg4 = 2;
			trg1 = 4;
		}					
	}
}