//  
int Rule = 1;
int RoundTime = 99;
int PlayerSpawn = 115;
int PlayerSpawnDir = 135;
int PlayerWeapon = 6;
int PlayerWeapon2 = 47;
int PlayerHP = 3000;

int trg0 = 0;
int timer0 = 0;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;
int timer5 = 0;
int gameover = 0;
OnStart()
{
		AddNPC("npc+18+01");
}
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 c7;
	int c8;
	int c9;
	int c10;
	int now = GetGameTime();

	if (trg0 == 0)
	{

		c = GetChar("神秘女子");
		if (c>=0 && GetHP(player)>0)
		{
			Perform(c, "pause", 100);

			PlayerPerform("block", 0);
			PlayerPerform("crouch", 0);
			PlayerPerform("pause", 3);
			PlayerPerform("say", "（难道是马贼团的人？）");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "（那个女子是谁？）");
			PlayerPerform("crouch", 1);
			PlayerPerform("pause", 5);
			PlayerPerform("say", "（好完成任务）");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "（我便可以趁机问出他们首领的下落）");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "（过一会儿疾风马贼团的人就会来袭击这里）");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "（如果首领的消息没错的话）");
			PlayerPerform("block", 1);

			trg0 = 1;
		}
	}
	if (trg0==1)
	{
		c = GetChar("神秘女子");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<150)
		{
			StopPerform(player);
			StopPerform(c);

			Perform(c, "say", "喂. . .");
			Perform(c, "pause", 8);
			Perform(c, "say", "什么？");
			Perform(c, "pause", 5);
			Perform(c, "faceto", player);
			Perform(c, "pause", 3);

			PlayerPerform("block", 0);
			PlayerPerform("say", "原来你还没死，今天我先解决你！！");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "关玉茹！！？？");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "请问. . . . . .");
			PlayerPerform("block", 1);

			timer1 = now + 60;
			trg0 = 2;
		}
	}	
	if (trg0==2 && now>timer1)
	{
		c = GetChar("神秘女子");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && Distance(0, 1)<150)
		{				
			Perform(c, "pause", 100);
			Perform(c, "say", "你怎么知道的？你是什么人啊？");
			Perform(c, "pause", 6);
			Perform(c, "say", "你又是谁啊，上来就动手");
			Perform(c, "pause", 4);
			Perform(c, "say", "咳、咳！我有说过我是吗？");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);

			PlayerPerform("block", 0);
			PlayerPerform("say", "告辞");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "一会儿会有马贼袭击这里，姑娘小心");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "抱歉，刚才是个误会");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "那你是谁？");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "你不是关玉茹。");
			PlayerPerform("block", 1);

			timer2 = now + 20;
			trg0 = 3;
		}
	}
	if (trg0==3 && now>timer2)
	{
		c = GetChar("神秘女子");

		if (c>=0)
		{
		AddNPC("npc+18+02");
		AddNPC("npc+18+03");
		AddNPC("npc+18+04");
		AddNPC("npc+18+05");
		AddNPC("npc+18+06");
		AddNPC("npc+18+07");
		RemoveNPC(c);
			trg0 = 4;
		}
	}
if (trg0==4)
	{
		c = GetAnyChar("疾风马贼小队长");
		c2 = GetAnyChar("林娜娜");
		c3 = GetAnyChar("疾风马贼-1");
		c4 = GetAnyChar("疾风马贼-2");
		c5 = GetAnyChar("疾风马贼-3");
		c6 = GetAnyChar("疾风马贼-4");
		if (c>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0 && GetHP(player)>0)
		{
			Perform(c, "say", "可恶,既当我不存在,给我上！！");
			Perform(c, "pause", 17);

			Perform(c2, "pause", 3);
			Perform(c2, "say", "-_-||,汗～啊峰没让你说这句台词吧～");
			Perform(c2, "pause", 5);
			Perform(c2, "say", "？？你怎么知道的？");
			Perform(c2, "pause", 8);
			Perform(c2, "faceto", player);

		        Perform(c3, "say", "是！");
			Perform(c3, "pause", 20);
			Perform(c3, "faceto", c);
				
			Perform(c4, "say", "是！");
			Perform(c4, "pause", 20);
			Perform(c4, "faceto", c);		
			
			Perform(c5, "say", "是！");
			Perform(c5, "pause", 20);
			Perform(c5, "faceto", c);
			
			Perform(c6, "say", "是！");
			Perform(c6, "pause", 20);
			Perform(c6, "faceto", c);


			PlayerPerform("block", 0);
			PlayerPerform("pause", 7);
			PlayerPerform("say", "我又不瞎你头顶上那么大字我看不见啊～～");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "原来你叫林娜娜啊");
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);

			trg0 = 5;
		}
	}
	if (trg0 == 5)
	{
		c = GetAnyChar("疾风马贼小队长");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "你这小子还真有两下子");
			trg0 = 6;
		}
	}
	if (trg0 == 6)
	{
		c = GetAnyChar("疾风马贼小队长");
		if (GetHP(c) <= 0)
		{
			Say(c, "剩下﹒﹒﹒那个﹒﹒快回去报﹒﹒﹒报告﹒﹒﹒");
			trg0 = 7;
		}
	}	
	if (trg0 == 7)
	{
		c = GetAnyChar("疾风马贼小队长");
		c3 = GetAnyChar("疾风马贼-1");
		c4 = GetAnyChar("疾风马贼-2");
		c5 = GetAnyChar("疾风马贼-3");
		c6 = GetAnyChar("疾风马贼-4");
		
		if (GetHP(c)<=0 && GetHP(c4)<=0 && GetHP(c3)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && player>=0 && GetHP(player)>0)
		{
			AddNPC("npc+18+08");

			PlayerPerform("say", "还露一个，去找找");
			PlayerPerform("pause", 5);

			trg0 = 8;
		}
	}
	if (trg0 == 8)
	{
		c = GetAnyChar("疾风马贼-5");
		c2 = GetAnyChar("林娜娜");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<150)
		{
			Perform(c, "guard", 150);
			Perform(c, "say", "小的句句是实话啊");
			Perform(c, "guard", 5);
			Perform(c, "say", "我只知道我们整个组织都在伏虎山");
			Perform(c, "guard", 3);
			Perform(c, "say", "首领具体在什么地方我也不知道");
			Perform(c, "guard", 3);
			Perform(c, "say", "我只是个小兵");
			Perform(c, "guard", 6);
			Perform(c, "faceto", player);
			Perform(c, "say", "大﹒﹒﹒大侠，别﹒﹒﹒别杀我");

			Perform(c2, "say", "你到底是谁？");
			Perform(c2, "pause", 8);
			Perform(c2, "say", "为什么不杀了他？他回去报告怎么办？");
			Perform(c2, "pause", 36);

			PlayerPerform("say", "在下有任务在身，先告辞了");
			PlayerPerform("pause", 8);
			PlayerPerform("say", "就是让他回去报告，到时候哪里防御最好哪里就是首领藏身之地");
			PlayerPerform("pause", 8);
			PlayerPerform("say", "好，滚，不要让我再见到你");
			PlayerPerform("pause", 8);
			PlayerPerform("say", "真的？");
			PlayerPerform("pause", 13);
			PlayerPerform("say", "说，你们首领在哪");
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);

			timer4 = now + 25;
			trg0 = 9;
		}
	}
	if (trg0 == 9 && now>timer4)
	{
		c = GetAnyChar("疾风马贼-5");
		if (c>=0)
		{
			RemoveNPC(c);
		}

			timer5 = now + 11;
		trg0 = 10;
	}
	if (trg0 == 10 && now>timer5)
	{
		trg0 = 11;
		gameover = 1;
	}

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

}
