// 毒牙阵
int Rule = 5;
int RoundTime = 60;
int PlayerSpawn = 2;
int PlayerSpawnDir = 260;
int PlayerWeapon = 15;
int PlayerWeapon2 = 14;
int PlayerHP = 20000;

OnStart()
{
	AddNPC("Z1");
	AddNPC("Z2");
	AddNPC("Z3");
	AddNPC("Z4");
	AddNPC("Z5");
	AddNPC("Z6");
        AddNPC("Z7");
        AddNPC("Z8");
        AddNPC("Zb");
        AddNPC("Zxh");
        AddNPC("Zxd");
}
int player;
int trg0;
int trg1;
int trg2;
int timer0;
int timer1;
int gameover; 
OnUpdate()
{	
	if (player < 0)
	{
		return 0;
	}
	if (gameover == 2)
	{
		return 0;
	}
	int now = GetGameTime();
	if (trg0 == 0)
	{
		int player = GetAnyChar("player");
		int c = GetChar("剑神の曾彬");
		int c1 = GetChar("剑神の莫问剑");
		int c2 = GetChar("剑仙の麒麟");
		int c3 = GetChar("剑仙の青龙");
		int c4 = GetChar("剑仙の朱雀");
		int c5 = GetChar("剑仙の白虎");
                int c6 = GetChar("剑仙の玄武");
                int c7 = GetChar("剑圣の赵云");
		if (c6>=0)
		{
			Perform(c, "pause", 3);
			Perform(c, "say", "有意思！我在输了，我就带着其他人回昆仑山在修炼！！！...");
			Perform(c, "pause", 5);
			Perform(c, "say", "何须剑道争锋，千神指，万神封：敢问天下颠峰，三尺秋水尘不染，天下无双!!!");
			Perform(c, "pause", 5);
			Perform(c, "say", "哼哼！我没趁你们昏倒时候杀你们就不错了！");
			Perform(c, "pause", 5);
			Perform(c, "say", "呵呵！本来我们要杀进快活林，谁知道杨帆东自作主张下药，前后抓来了你们4人！这个卑鄙小人已经被我杀了！");
			Perform(c, "pause", 5);
			Perform(c, "say", "起来了吗？真亏了你那么辛苦的制药！还有亏你的上司带着2人回快活林支援！也被我们捉了！");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);
		
			Perform(c1, "pause", 25);
			Perform(c2, "pause", 25);
			Perform(c3, "pause", 25);
			Perform(c4, "pause", 25);
			Perform(c5, "pause", 25);

			PlayerPerform("block", 0);
			PlayerPerform("say", "哈哈~！同感！我输了，我也去深山老林修炼~~~~~");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "妖道，神道，霸者之道，违道，逆道，生死之道。凡道，仙道，王者之道，顺道，悟道，自然之道。");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "那就快点来个了断。");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "可恶的杨帆东，专门下药的贱人！");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "曾彬大人也被捉了！");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "我怎么在这里，我记得回快活林的时候，好像头晕~之后就不记得了？");
			PlayerPerform("block", 1);
		
			trg0 = 1;
			timer0 = now + 25;
		}
	}
	if (trg0 == 1 && now > timer0)
	{
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 &&  Distance(0, 1) < 50)
		{
			Perform(c, "say", "哈哈！受死吧！");
			Perform(c, "pause", 5);
			Perform(c, "say", "众仙们..一起把这招放出来吧！");
			Perform(c, "pause", 5);
			Perform(c, "say", "小伎俩罢了！");
			Perform(c, "pause", 5);
			Perform(c, "use", 19);
			Perform(c, "say", "奉陪？你指的是这招吗？");
			Perform(c, "guard", 3);
			Perform(c, "faceto", player);
		
			Perform(c1, "use", 19);
			Perform(c1, "pause", 15);

			Perform(c2, "use", 19);
			Perform(c2, "pause", 15);

			Perform(c3, "use", 19);
			Perform(c3, "pause", 15);

			Perform(c4, "use", 19);
			Perform(c4, "pause", 15);

			Perform(c5, "use", 19);
			Perform(c5, "pause", 15);

			Perform(c6, "use", 19);
			Perform(c6, "pause", 15);

			Perform(c7, "use", 19);
			Perform(c7, "pause", 15);

			PlayerPerform("block", 0);
			PlayerPerform("say", "o(≧v≦)o~~好棒的感觉");
			PlayerPerform("pause", 5);
			PlayerPerform("use", 19);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 20);
			PlayerPerform("say", "为善除恶，唯我快活林，喜乐悲愁，皆为尘土。怜我世人，忧患实多...");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "焚我残躯，熊熊圣火，燃烧我心。生亦何欢，死亦何苦。");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "虽然我不想用禁招，但是你们太强了，只好用了！哎！会减寿命的！");
			PlayerPerform("block", 1);
		
			trg0 = 2;
		}
	}
	if (trg0 == 2 )
	{
		SetTarget(0, "waypoint", 0);
		SetTarget(1, "char", player);
		SetTarget(2, "waypoint", 22);
		if (c>=0 &&  Distance(0, 1) < 500)
		{
			ChangeBehavior(c, "attacktarget",2,0);
			ChangeBehavior(c1, "attacktarget",2,0);
			ChangeBehavior(c2, "attacktarget",2,0);
			ChangeBehavior(c3, "attacktarget",2,0);
			ChangeBehavior(c4, "attacktarget",2,0);
			ChangeBehavior(c5, "attacktarget",2,0);
			ChangeBehavior(c6, "attacktarget",2,0);
			ChangeBehavior(c7, "attacktarget",2,0);
		}else
		{
			ChangeBehavior(c, "kill",player);
			ChangeBehavior(c1, "kill",player);
			ChangeBehavior(c2, "kill",player);
			ChangeBehavior(c3, "kill",player);
			ChangeBehavior(c4, "kill",player);
			ChangeBehavior(c5, "kill",player);
                        ChangeBehavior(c6, "kill",player);
                        ChangeBehavior(c7, "kill",player);
		}
		if (GetHP(c)<=0)
		{
			Perform(c, "say", "哈哈！....还是败了？");
			Perform(c, "pause", 5);
			Perform(c, "say", "我们还是回昆仑山在修炼吧！！！...");
			Perform(c, "faceto", player);

			RemoveNPC(c1);
			Perform(c1, "pause", 5);

			RemoveNPC(c2);
			Perform(c2, "pause", 5);

			RemoveNPC(c3);
			Perform(c3, "pause", 5);

			RemoveNPC(c4);
			Perform(c4, "pause", 5);

			RemoveNPC(c5);
			Perform(c5, "pause", 5);

                        RemoveNPC(c6);
			Perform(c5, "pause", 5);

                        RemoveNPC(c7);
			Perform(c5, "pause", 5);

			PlayerPerform("say", "╮(╯▽╰)╭");
			PlayerPerform("pause", 5);
			PlayerPerform("say", " 我非常不想和你们打，太牛了！");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);
		
			gameover = 1;
			timer1 = now + 3;
		}
	}
	if (gameover!=-1 && GetHP(player)<=0 && player > 0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}
}
