// 四方陣
int Rule = 5;
int RoundTime = 30;
int PlayerSpawn = 0;
int PlayerSpawnDir = 100;
int PlayerWeapon = 8;
int PlayerWeapon2 = 15;
int PlayerHP = 8000;

OnStart()
{
	AddNPC("npc06_01");
}
int player;
int trg0;
int trg1;
int trg2;
int Spa1;
int Spa2;
int k1;
int k2;
int k3;
int k4;
int timer0;
int timer1;
int gameover; 
OnUpdate()
{	
	if (gameover == 2)
	{
		return 0;
	}
	int now = GetGameTime();
	if (trg0 == 0)
	{
		int player = GetAnyChar("player");
		int c = GetChar("刀恶");
		if (c > 0)
		{
			Perform(c, "pause", 3);
			Perform(c, "say", "笑话！你说要我教就教，那不是对不住先到的人吗？");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);
		
			PlayerPerform("block", 0);
			PlayerPerform("say", "先到的人？？");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "刀恶！你快点教我做失心散的解药！！");
			PlayerPerform("block", 1);
		
			trg0 = 1;
			timer0 = now + 5;
		}
	}
	if (trg0 == 1 && now > timer0)
	{
		if (Spa1 == 0){AddNPC("npc06_02");Spa1=1;}
		int c1 = GetChar("小何");
		if (c1>0)
		{
			Perform(c, "say", "没错没错...只要你重伤什么都好谈，不然就算你打死我..我也不教！");
			Perform(c, "pause", 8);
			Perform(c, "say", "没错！！快活林的人互打..一定很有趣！！");
			Perform(c, "guard", 4);
			Perform(c, "faceto", player);
		
			Perform(c1, "pause", 4);
			Perform(c1, "say", "没什么！就是看你不爽！！另外这个可制药的人跟你结下梁子罢了！！");
			Perform(c1, "pause", 4);
			Perform(c1, "say", "为了救我们快活林的人，只要请你让我打成重伤吧！！");
			Perform(c1, "pause", 4);
			Perform(c1, "say", "哈哈哈！！他要我痛扁你一顿，才愿意帮我做解药！！");
			Perform(c1, "pause", 2);
			Perform(c1, "faceto", player);

			PlayerPerform("say", "....我每次要吧你打昏，我容易吗我");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "小何！！为什么这么执着呢？");
			PlayerPerform("pause", 8);
			PlayerPerform("say", "小何??");
			PlayerPerform("block", 1);
		
			trg0 = 2;
			timer0 = now + 15;
		}
	}
	if (trg0 == 2  && now > timer0)
	{
		if (Spa2 == 0){AddNPC("Zengbin");
AddNPC("Zengxiaodi");
AddNPC("Zengxiaohuang");
Spa2 = 1;}
		int c2 = GetChar("曾彬");
		if (c2 > 0)
		{
			Perform(c, "guard", 6);
			Perform(c, "say", "是谁！！");
			Perform(c, "guard", 2);
			Perform(c, "faceto", player);
		
			Perform(c1, "pause", 2);
			Perform(c1, "say", "我忍了很久了，这次我一定要杀了他！");
			Perform(c1, "pause", 6);
			Perform(c1, "faceto", c2);

			Perform(c2, "say", "愚蠢！啸皇、啸帝，先捉小何，在捉刀恶。");
			Perform(c2, "pause", 8);
			Perform(c2, "say", "大胆小何！我不在这里的时候你就造反了！啸皇、啸帝给我活捉小何!");
			Perform(c2, "faceto", c);

			PlayerPerform("block", 0);
			PlayerPerform("pause", 4);
			PlayerPerform("say", "曾彬大人......");
			PlayerPerform("pause", 4);
			PlayerPerform("block", 1);
		
			trg0 = 3;
			timer0 = now + 8;
		}
	}
	if (trg0 == 3  && now > timer0)
	{
		if (GetHP(c)< 200 && k1 == 0)
		{
			if (GetHP(c1)<=0 && GetHP(c2)<=0)
			{
				
				Perform(c, "pause", 5);
				Perform(c, "say", "啊！！大侠！！饶小人一命吧！！解药的练法我教你就是了！！");
				Perform(c, "faceto", player);
		
				PlayerPerform("block", 0);
				PlayerPerform("pause", 3);
				PlayerPerform("block", 1);
		
				gameover = 1;
				timer1 = now + 5;
				k1 = 1;
			}
		}
		if (GetHP(c) <= 0 && gameover != -1)
		{
			Say(player,"啊！！我失手宰掉他了！！");
			gameover = -1;
			timer1 = now + 1;
		}
		if (GetHP(c1) <= 0 && k3 ==0)
		{
			Say(c1,"混帐！！又输了！！");
			k3 = 1;
		}
		if (GetHP(c2) <= 0 && k4 ==0)
		{
			Say(c2,"可恶啊！！只凭我的力量..不能报仇吗？");
			k4 = 1;
		}
	}
	if (gameover!=-1 && GetHP(player)<=0 && player > 0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}
}
