// 地狱方阵
int Rule = 5;
int RoundTime = 50;
int PlayerSpawn = 12;
int PlayerSpawnDir = 270;
int PlayerWeapon = 8;
int PlayerWeapon2 = 51;
int PlayerHP = 3000;


int trg0 = 0;
int trg1 = 0;
int timer0 = 0;
int timer1 = 0;
int gameover = 0;

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

OnUpdate()
{	
	int player = GetAnyChar("player");
	if (player < 0)
	{
		return 0;
	}
	if (gameover == 2)
	{
		return 0;
	}
	
	int c;
	int c2;
	int c3;
	int c4;
	int c5;
	int c6;
	int now = GetGameTime();
	
	
	if (trg0 == 0)
	{
		c2 = GetChar("张天岳");
		c = GetChar("天网首领");
		c3 = GetChar("【攻】");
		c4 = GetChar("【防】");
		c5 = GetChar("【敏】");
		
		if (c>=0 && c2>=0)
		{

			Perform(c, "pause", 100);
			Perform(c, "say", "攻防敏，别让他们跟进来");
			Perform(c, "pause", 2);
			Perform(c, "say", "我现在没空和你玩这种游戏");
			Perform(c, "pause", 2);
			Perform(c, "say", "我没有抓谁");
			Perform(c, "pause", 6);
			Perform(c, "say", "你不觉得过分吗？");
			Perform(c, "pause", 2);
			Perform(c, "say", "又拦我的路");
			Perform(c, "pause", 2);
			Perform(c, "say", "现在还带外人来天网总坛");
			Perform(c, "pause", 2);
			Perform(c, "say", "反到是你，不但杀了天网三个杀手");
			Perform(c, "pause", 2);
			Perform(c, "say", "我没下过这种命令");
			Perform(c, "pause", 2);
			Perform(c, "say", "派李明楠他们杀你？");
			Perform(c, "faceto", player);
			
			Perform(c2, "pause", 35);

			Perform(c3, "guard", 8);
			Perform(c3, "say", "是");
			Perform(c3, "pause", 30);
			Perform(c3, "faceto", player);

			Perform(c5, "guard", 8);
			Perform(c5, "say", "是");
			Perform(c5, "pause", 30);
			Perform(c5, "faceto", player);

			Perform(c4, "guard", 8);
			Perform(c4, "say", "是");
			Perform(c4, "pause", 30);
			Perform(c4, "faceto", player);
			
			PlayerPerform("block", 0);
			PlayerPerform("say", "三位前辈，得罪了");
			PlayerPerform("pause", 14);
			PlayerPerform("say", "又不敢承认，你才过分");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "你身为首领，却拿人质威胁我");
			PlayerPerform("pause", 15);
			PlayerPerform("block", 1);
			
			trg0 = 1;
			timer0 = now + 30;
		}
	}
	if (trg0==1 && now>timer0)
	{
		c = GetChar("天网首领");
		if (c >= 0)
		{
			RemoveNPC(c);
			trg0 = 2;
		}
	}

	if (gameover!=-1 && GetHP(player)<=0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}
}
