// 风雪四方
int Rule = 5;
int RoundTime = 10;
int PlayerSpawn = 41;
int PlayerSpawnDir = 180;
int PlayerWeapon = 16;
int PlayerWeapon2 = 55;
int PlayerHP = 4000;

int trg0 = 0;
int trg1 = 0;
int trg2 = 0;
int trg3 = 0;
int timer0 = 0;
int timer1 = 0;


OnStart()
{
	AddNPC("npc+33+02");
	AddNPC("npc+33+03");
	AddNPC("npc+33+04");
	AddNPC("npc+33+05");
}

OnUpdate()
{
	int player = GetChar("player");
	if (player < 0)
	{
		return 0;
	}
	
	int c;
	int c2;
	int c3;
	int c4;
	int c5;
	int c6;
	int c7;
	int c8;

	if (trg0 == 0)
	{
		PlayerPerform("crouch", 0);
		PlayerPerform("block", 0);
		PlayerPerform("say", "（应该没什么问题吧）");
		PlayerPerform("pause", 2);
		PlayerPerform("say", "（还是我手下的那些人）");
		PlayerPerform("pause", 2);
		PlayerPerform("say", "（但若是从我自己的训练场进入通道的话）");
		PlayerPerform("pause", 2);
		PlayerPerform("say", "（如果硬闯天网可能很困难）");
		PlayerPerform("block", 1);
		PlayerPerform("crouch", 1);
		trg0 = 1;
	}
	if (trg1 == 0)
	{
		c = GetAnyChar("天网杀手-1");
		c2 = GetAnyChar("天网杀手-2");
		c3 = GetAnyChar("天网杀手-3");
		c4 = GetAnyChar("天网杀手-4");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && Distance(0, 1)<150)
		{
		 	Perform(c2, "crouch", 0);
			Perform(c2, "guard", 16);
			Perform(c2, "pause", 4);
			Perform(c2, "say", "什么意外都没有，也没有外人进来");
			Perform(c2, "pause", 3);
		 	Perform(c2, "crouch", 1);
			Perform(c2, "faceto", player);

		 	Perform(c, "crouch", 0);
			Perform(c, "guard", 17);
			Perform(c, "pause", 8);
		 	Perform(c, "crouch", 1);
			Perform(c, "faceto", player);

		 	Perform(c3, "crouch", 0);
			Perform(c3, "guard", 17);
			Perform(c3, "pause", 8);
		 	Perform(c3, "crouch", 1);
			Perform(c3, "faceto", player);

		 	Perform(c4, "crouch", 0);
			Perform(c4, "guard", 17);
			Perform(c4, "pause", 8);
		 	Perform(c4, "crouch", 1);
			Perform(c4, "faceto", player);

			PlayerPerform("block", 0);
			PlayerPerform("say", "哼，放马过来！");
			PlayerPerform("pause", 8);
			PlayerPerform("say", "就凭你们几个？");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "原来你早有预谋");
			PlayerPerform("pause", 15);
			PlayerPerform("say", "我出去的这段日子，出过什么事吗？");
			PlayerPerform("block", 1);

			trg1 = 1;
			timer1 = GetGameTime() + 6;
		}
	}
	if (trg1 == 1 && GetGameTime()>timer1)
	{
		AddNPC("npc+33+01");
		AddNPC("npc+33+06");
		AddNPC("npc+33+07");
		AddNPC("npc+33+08");
		AddNPC("npc+33+09");
		AddNPC("npc+33+10");
		AddNPC("npc+33+11");
		AddNPC("npc+33+12");
		trg1 = 2;
	}
	if (trg1 == 2)
	{
		c = GetAnyChar("王飞雪");
		c2 = GetAnyChar("天网杀手-5");
		c3 = GetAnyChar("天网杀手-6");
		c4 = GetAnyChar("天网杀手-7");
		c5 = GetAnyChar("天网杀手-8");
		c6 = GetAnyChar("天网杀手-9");
		c7 = GetAnyChar("天网杀手-10");
		c8 = GetAnyChar("天网杀手-11");
		if (c2>=0)
		{
			ChangeBehavior(c8, "follow", player);
			Perform(c8, "pause", 15);

			ChangeBehavior(c7, "follow", player);
			Perform(c7, "pause", 15);

			ChangeBehavior(c6, "follow", player);
			Perform(c6, "pause", 15);

			ChangeBehavior(c5, "follow", player);
			Perform(c5, "pause", 15);

			ChangeBehavior(c4, "follow", player);
			Perform(c4, "pause", 15);

			ChangeBehavior(c3, "follow", player);
			Perform(c3, "pause", 15);

			ChangeBehavior(c2, "follow", player);
			Perform(c2, "pause", 15);

			ChangeBehavior(c, "follow", player);
			Perform(c, "aggress");
			Perform(c, "say", "而且这里全是一等一的高手，你说我有胜算吗？");
			Perform(c, "pause", 2);
			Perform(c, "say", "我早在你手下的食物中下了毒，现在他们的功力还不如从前的一半");
			Perform(c, "pause", 4);
			Perform(c, "say", "今天就是你的末日");
			Perform(c, "pause", 4);
			Perform(c, "say", "为了让你进来，我们一直留着他们");
			Perform(c, "pause", 3);
			Perform(c, "say", "当然不会有以外");
			Perform(c, "faceto", player);

			trg1 = 3; 			
		}		
	}
	if (trg1 == 3)
	{
		c = GetAnyChar("王飞雪");


		if (c2>=0 && GetHP(player)<2000)
		{
			Perform(c, "pause", 3);
			trg1 = 4;
		}
	}
	if (trg1 == 4)
	{
		AddNPC("npc+33+13");

		trg1 = 5;
	}
	if (trg1 == 5)
	{
		c = GetAnyChar("张天岳");
		if (c>=0)
		{
			ChangeBehavior(c, "follow", player);
			Perform(c, "say", "ＯＫ！ＧＯ！ＧＯ！ＧＯ！！");
			Perform(c, "pause", 6);
			Perform(c, "say", "我是那种让朋友一个人去冒险的人吗？");
			Perform(c, "pause", 4);
			Perform(c, "say", "我没来晚吧？");
			Perform(c, "faceto", player);

			PlayerPerform("say", "﹒﹒﹒﹒﹒﹒﹒﹒﹒﹒﹒﹒﹒﹒﹒");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "让他们见识见识你们张家的武功！");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "呵呵，好");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "张天岳？你怎么来了？？");
			PlayerPerform("pause", 2);
			trg1 = 6; 
		}
	}
	if (trg2 == 0)
	{
		c = GetChar("王飞雪");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{
			Perform(c, "say", "呃﹒﹒可恶！");
			Perform(c, "faceto", player);
			trg2 = 1;
		}		
	}
	if (trg2 == 1)
	{
		c = GetAnyChar("王飞雪");
		if (c>=0 && GetHP(c)<=0)
		{		
			Say(c, "我﹒﹒﹒我﹒﹒不﹒﹒﹒服气﹒﹒");
			trg2 = 2;
		}	
	}	
	if (trg3 == 0)
	{
		c = GetAnyChar("天网杀手-1");
		if (c>=0 && GetHP(c)<=0)
		{		
			Say(c, "主子﹒﹒﹒我﹒﹒对不﹒起﹒﹒你﹒﹒");
			trg3 = 1;
		}	
	}	

}
