int Rule = 3;
int RoundTime = 85;
int PlayerSpawn = 127;
int PlayerSpawnDir = 120;
int PlayerWeapon = 24;
int PlayerWeapon2 = 26;
int PlayerHP = 15000;

int trg0 = 0;
int trg1 = 0;

int trg2 = 0;
int trg3 = 0;
int trg4 = 0;
int trg5 = 0;

int trg10 = 0;
int trg11 = 0;
int trg12 = 0;
int trg13 = 0;
int trg14 = 0;
int trg15 = 0;
int timer6 = 0;
int timer7 = 0;
int timer8 = 0;
int timer9 = 0;
int timer10 = 0;
int timer11 = 0;

int timer0 = 0;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;
int timer5 = 0;

int gameover = 0;
int player;
int now;

int h1;
int h2;
int h3;
int h4;
int h5;

int c;
int c1;
int c2;
int c3;
int c4;
int c5;
int c6;
int c7;

int c8;
int c9;
int c10;
int c11;
int c12;
int c13;

int c14;
int c15;

int c16;
int c17;
int c18;
int c19;
int c20;

int g1 = 0;
int g2 = 0;
int g3 = 0;
int g4 = 0;
int g5 = 0;
int g6 = 0;

int sc1;

OnStart()
{
	AddNPC("npc13_02");
	AddNPC("npc13_03");
	AddNPC("npc13_04");
	AddNPC("npc13_05");
	AddNPC("npc13_06");
	AddNPC("npc13_07");
	AddNPC("npc13_09");
}

OnUpdate()
{	
	player = GetAnyChar("player");
	if (player < 0)
	{
		return 0;
	}
	
	now = GetGameTime();
	if (trg0 == 0){PlayerPerform("block", 1);trg0++;timer0 = now + 3;}

	if (trg0 <= 5 && trg0 >= 1){PlayerPerform("block", 1);}

	if (trg0 == 1 && now>timer0)
	{
		c = GetAnyChar("曹少千");
		c2 = GetAnyChar("万无楼");
		c3 = GetAnyChar("夜魅魂");
		c4 = GetAnyChar("火将");
		c5 = GetAnyChar("追命");
		c6 = GetAnyChar("忍者");
		c7 = GetAnyChar("假面战士");
		if (c>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0 && c7>=0)
		{
				Perform(c, "say", "！这..这是...");
				Perform(c, "pause", 6);
Perform(c, "use", 46);
				Perform(c, "faceto", c4);

				Perform(c7, "faceto", c);

				Perform(c6, "say", "嘻嘻....看样子，任务结束了..");
				Perform(c6, "pause", 14);
				Perform(c6, "faceto", c);

				Perform(c5, "say", "哼哼，怎么？吓傻啦？");
				Perform(c5, "pause", 12);
				Perform(c5, "faceto", c);

				Perform(c4, "say", "哈哈哈！！“龙木舍利”到手啰！");
				Perform(c4, "pause", 10);
				Perform(c4, "faceto", c);

				Perform(c2, "say", "别跟他废话，辗毙他！！！");
				Perform(c2, "pause", 4);
				Perform(c2, "faceto", c);

				Perform(c3, "say", "曹少千，你还是先交出“龙木舍利”好吗？");
				Perform(c3, "faceto", c);
trg0++;timer0 = now + 13;
		}
	}


	if (trg0 == 2 && now>timer0)
	{
				Perform(c, "say", "不过，这玩意...能耐我何！");
Perform(c, "aggress");
				Perform(c, "pause", 2);
				Perform(c, "say", "（冷笑）哼哼哼！有意思....");
				Perform(c, "pause", 5);

				Perform(c2, "say", "原始人也想跟我们斗？这就是我们现代的武器！！");
				Perform(c2, "faceto", c);
trg0++;timer0 = now + 7;
	}	
	if (trg0 == 3 && now>timer0)
	{
				Perform(c6, "say", "这..这..不可能..");
				Perform(c6, "pause", 10);
				Perform(c6, "faceto", c);

				Perform(c5, "say", "天....天哪");
				Perform(c5, "pause", 9);
				Perform(c5, "faceto", c);

				Perform(c4, "use", 6);
				Perform(c4, "say", "不好！！哇啊啊啊啊啊啊啊啊啊啊啊！");
				Perform(c4, "pause", 3);
				Perform(c4, "faceto", c);

				Perform(c2, "say", "！！");
				Perform(c2, "pause", 2);
				Perform(c2, "faceto", c);

				Perform(c3, "say", "不会吧？");
				Perform(c3, "faceto", c);
trg0++;timer0 = now + 9;
	}

	if (trg0 == 4 && now>timer0)
	{
				Perform(c6, "say", "我..我也是....，报酬奖金我不要了....");
				Perform(c6, "pause", 14);
				Perform(c6, "faceto", c);

				Perform(c5, "say", "哇啊啊，我不陪你们玩了啦....");
				Perform(c5, "pause", 10);
				Perform(c5, "faceto", c);

				Perform(c2, "say", ".....");
				Perform(c2, "pause", 6);
				Perform(c2, "faceto", c);

				Perform(c3, "say", "哇啊，这...这简直是怪物");
				Perform(c3, "pause", 3);
				Perform(c3, "faceto", c);
trg0++;timer0 = now + 12;
	}
	if (trg0 == 5 && now>timer0)
	{
RemoveNPC(c6);
RemoveNPC(c5);
	AddNPC("npc13_01");
				Perform(c, "say", "在上头的那位....下来吧");
				Perform(c, "faceto", player);
				Perform(c, "pause", 4);
				Perform(c, "say", "呵呵呵....逃也没用");
				Perform(c, "pause", 6);
				Perform(c, "faceto", c2);

				Perform(c3, "say", "喂，你们别跑啊，快回来啊");
				Perform(c3, "pause", 3);
				Perform(c3, "faceto", c);

				Perform(c2, "say", "逃跑了...");
trg0++;timer0 = now + 11;
	}
	if (trg0==6 && now>timer0)
	{
				PlayerPerform("block", 0);
				PlayerPerform("say", "被发现了吗...");
			trg0 = 7;
			timer0 = now + 1;
	}

	if (trg0==7 && now>timer0)
	{
		c1 = GetAnyChar("宋冰");
			SetTarget(1, "char", c);
			SetTarget(0, "char", player);
			if (Distance(0, 1) < 400 && c1>0)
			{
				Perform(c7, "faceto", player);
				Perform(c3, "faceto", player);
				Perform(c2, "faceto", player);
				Perform(c1, "faceto", c);

				Perform(c,"use", 47);
				Perform(c,"say", "哼....凭本事");
				Perform(c,"pause", 10);

				PlayerPerform("say", "没...没错");
				PlayerPerform("pause", 8);

				Perform(c,"say", "喔～～是咱家身上的...“龙木舍利”，对吧");
				Perform(c, "faceto", player);
				Perform(c,"pause", 2);

				PlayerPerform("say", "（声音颤抖）曹..曹少千...交...交出...");
				PlayerPerform("block", 1);
                                trg0++;
			        timer0 = now + 11;
			}
	}
if (now>timer0 && trg0==8) {
				Perform(c7, "faceto", c);
				Perform(c3, "faceto", c);
ChangeBehavior(c1, "follow", c);
				Perform(c1, "pause", 7);
ChangeBehavior(c2, "follow", c);
				Perform(c2, "pause", 7);
PlayerPerform("block", 0);
PlayerPerform("pause", 7);
				Perform(c3, "say", "好...好丢脸....不...不好意思...你..你们先上...");
				Perform(c3, "pause", 3);
				Perform(c3, "say", "我...我...被吓的无法动弹了");
				Perform(c3, "pause", 1);

				Perform(c7, "say", "....");
trg0++;timer0 = now + 2;trg4=1;timer5 = now + 2;}

if (now>timer0 && trg0==9 && (GetHP(c)<=28000 || GetHP(c1)<=13000 || GetHP(c2)<=3000 || GetHP(player)<=13000)) {
PlayerPerform("block", 1);
ChangeBehavior(c1, "idle");
ChangeBehavior(c2, "idle");
				Perform(c1, "faceto", c);
				Perform(c7, "faceto", c);

				Perform(c3, "say", "等...等..等我啦...");
				Perform(c3, "pause", 6);
				Perform(c3, "faceto", c2);

				Perform(c2, "say", "可恶，这家伙太强了...先逃再说");
				Perform(c2, "pause", 3);

				Perform(c, "say", "怎了？本督主～可还没出手哪");
trg0++;timer0 = now + 7;trg4 = 3;}

if (now>timer0 && trg0 == 10)
	        {
RemoveNPC(c2);
		        RemoveNPC(c3);
				Perform(c7, "say", ".....");
				Perform(c7, "pause", 4);

				Perform(c, "say", "哼哼，你们真以为能逃出本督主的手掌心吗？？");

				PlayerPerform("block", 1);
trg0++;timer0 = now + 6;trg4 = 3;}

if (now>timer0 && trg0 == 11)
	        {
RemoveNPC(c);
ChangeBehavior(c1, "follow",player);
				Perform(c1, "say", "不过，那个曹少千的实力真是怪物级的..");
				Perform(c1, "faceto", player);
				Perform(c1, "pause", 5);

				PlayerPerform("block", 0);
				PlayerPerform("pause", 5);
				PlayerPerform("say", "那臭屁的家伙逃走了？？");
				PlayerPerform("block", 1);
trg0++;timer0 = now + 10;}

	if (now>timer0 && trg0 == 12)
	{
		SetTarget(2, "char", c7);
		SetTarget(1, "char", c1);
		SetTarget(0, "char", player);
		if (Distance(0, 2) < 150 || Distance(1, 2) < 150)
		{
ChangeBehavior(c1, "idle");
				Perform(c1, "faceto", c7);

				PlayerPerform("say", "其实任务已变更了");
				PlayerPerform("pause", 3);
				PlayerPerform("say", "呵呵....");
				PlayerPerform("pause", 26);

				Perform(c7, "say", "不过，全是一群为了钱而来，没用的废物！");
				Perform(c7, "pause", 5);
			        Perform(c7, "say", "也跟你们一样，只是他们是较早到的一批");
				Perform(c7, "pause", 5);
				Perform(c7, "say", "不错，刚刚的那些杀手也是");
				Perform(c7, "pause", 11);

				PlayerPerform("say", "什么任务？难道你也是...");
				PlayerPerform("pause", 10);

				Perform(c7, "say", "我不清楚，我来执行任务的");
				Perform(c7, "pause", 8);

				PlayerPerform("say", "说吧，这是怎么回事？那个tank又是怎么回事？");
				PlayerPerform("pause", 2);

				Perform(c7, "faceto", player);
				PlayerPerform("block", 1);
                                trg0++;
			        timer0 = now + 34;}}
	if (now>timer0 && trg0 == 13)
	{
				Perform(c1, "faceto", c7);

				PlayerPerform("say", "只要不是曹少千就好！");
				PlayerPerform("pause", 5);
				PlayerPerform("say", "哼....放马过来吧");
				PlayerPerform("pause", 26);

				Perform(c7, "say", "被包围的可是我们！");
				Perform(c7, "pause", 5);
			        Perform(c7, "say", "曹少千是不会只身一人，而不带任何手下的");
				Perform(c7, "pause", 5);
				Perform(c7, "say", "刚来的路上早已布满了锦衣卫重兵");
				Perform(c7, "pause", 9);

				PlayerPerform("say", "为何？？");
				PlayerPerform("pause", 10);

				Perform(c7, "say", "他们是逃不掉了");
				Perform(c7, "pause", 10);

				PlayerPerform("say", "我原是来找刚刚逃掉的那两人，那是我们组员");
				PlayerPerform("pause", 2);

				Perform(c7, "say", "噢！我们与召集人失联了...");
				Perform(c7, "faceto", player);
				PlayerPerform("block", 1);
                                trg0++;
			        timer0 = now + 35;}

if (now>timer0 && trg0==14) {
AddNPC("npc13_10");
AddNPC("npc13_11");
AddNPC("npc13_12");
AddNPC("npc13_13");
AddNPC("npc13_14");
AddNPC("npc13_15");
				Perform(c1, "use", 29);
				Perform(c1, "say", "我则是“防御围巾”");
				Perform(c1, "pause", 8);

				Perform(c7, "say", "！是“聚气手机”...");
				Perform(c7, "pause", 5);
				Perform(c7, "faceto", player);

				PlayerPerform("use", 33);
				PlayerPerform("say", "我可有带法宝呢！");
				PlayerPerform("block", 1);
trg0++;timer0 = now + 10;}

if (now>timer0 && trg0==15) {
		c8 = GetAnyChar("锦衣卫_1");
		c9 = GetAnyChar("锦衣卫_2");
		c10 = GetAnyChar("锦衣卫_3");
		c11 = GetAnyChar("锦衣卫_4");
		c12 = GetAnyChar("锦衣卫_5");
		c13 = GetAnyChar("锦衣卫_6");
		if (c13>=0)
		{
PlayerPerform("block", 0);
ChangeBehavior(c7, "wait");
ChangeBehavior(c1, "follow", player);

ChangeBehavior(c13, "follow", c9);
ChangeBehavior(c12, "follow", c8);
ChangeBehavior(c11, "follow", c1);
ChangeBehavior(c10, "follow", c1);
ChangeBehavior(c9, "follow", player);
ChangeBehavior(c8, "follow", player);
				Perform(c8, "say", "竟敢暗杀督主？杀光他们！");
				Perform(c8, "pause", 5);

				PlayerPerform("say", "我们上！！");
				PlayerPerform("say", "看样子..来了.");
trg0++;timer0 = now + 8;}}

if (now>timer0 && trg0==16 && g1+g2+g3+g4+g5+g6>=10) {
				Perform(c7, "say", "他们的主将还未现身，可要当心啊");
				Perform(c7, "pause", 8);

				Perform(c1, "say", "到底有多少人啊...");
				Perform(c1, "pause", 5);

				PlayerPerform("say", "可恶！真是一群打不死的蟑螂");
trg0++;timer0 = now + 10;}

if (now>timer0 && trg0==17 && g1==3 && g2==3 && g3==3 && g4==3 && g5==3 && g6==3)
{
				RemoveNPC(c12);
				RemoveNPC(c13);
				RemoveNPC(c8);
				RemoveNPC(c9);
				RemoveNPC(c10);
				RemoveNPC(c11);				
				PlayerPerform("say", "再来啊！！！");
				PlayerPerform("pause", 2);
				PlayerPerform("say", "哼哼...");
		trg0 = 18;timer0 = now + 4;
}

if (trg0==18 && now>timer0)
{
ChangeBehavior(c7, "follow", player);
		AddNPC("npc13_18");
		AddNPC("npc13_20");
		trg0 = 19;
		timer0 = now + 2;
}

if (trg0==19 && now>timer0)
{
		c = GetAnyChar("曹少千");
		c1 = GetAnyChar("宋冰");
		c2 = GetAnyChar("万无楼");
		c7 = GetAnyChar("假面战士");
	SetTarget(2, "char", c1);
	SetTarget(1, "char", c);
	SetTarget(0, "char", player);
	if (c >= 0 && (Distance(0, 1) < 300 || Distance(2, 1) < 300))
	{
ChangeBehavior(c7, "idle");
ChangeBehavior(c1, "idle");
				Perform(c7, "faceto", c);
				Perform(c1, "faceto", c);

				PlayerPerform("say", "这事不是我干的....");
				PlayerPerform("pause", 5);
				PlayerPerform("say", "....");
				PlayerPerform("pause", 26);

				Perform(c, "say", "你们一个也别想走！");
				Perform(c, "pause", 5);
			        Perform(c, "say", "此事...与你们脱不了干系！");
				Perform(c, "pause", 5);
				Perform(c, "say", "且慢！最近，宫中的【上古天书】被盗...");
				Perform(c, "pause", 11);

				PlayerPerform("say", "我...我们要离开了...");
				PlayerPerform("pause", 10);

				Perform(c, "say", "你们打哪来的？穿着不像是汉人？");
				Perform(c, "pause", 8);

				PlayerPerform("say", "喔～他啊...我不认识");
				PlayerPerform("pause", 2);

				Perform(c, "say", "这～是不是你的同伴啊～？？");
				Perform(c, "faceto", player);
				PlayerPerform("block", 1);
                                trg0++;
			        timer0 = now + 36;

	}
}

if (trg0==20 && now>timer0)
{
		AddNPC("npc13_08");
		trg0 = 21;
		timer0 = now + 2;
}

	if (trg0 == 21 && now>timer0)
	{
		c14 = GetAnyChar("杨非青");
		if (c14>=0)
		{

				Perform(c14,"say", "就是要杀了你...替我杨家所有人报仇！！！！");
				Perform(c14,"pause", 5);

				Perform(c14,"say", "我隐居山中....每天苦练武功，不为了什么....");
				Perform(c14,"pause", 5);
				Perform(c14,"say", "哼....恶心的东西");
				Perform(c14,"pause", 36);

				Perform(c, "say", "咱家一直都在找你哇！！");
				Perform(c, "pause", 5);
				Perform(c, "say", "这些年....你躲哪儿去啦？");
				Perform(c, "pause", 5);
				Perform(c, "say", "这些人胆敢跟本督主做对？？全～都被咱家杀啦～呵呵呵...");
				Perform(c, "pause", 5);
			        Perform(c, "say", "杨善与周鹏等人，诬陷咱家....侵占民田及其他数十项罪行呀");
				Perform(c, "pause", 5);
				Perform(c, "say", "哦～原来是杨善的儿子啊！！");
				Perform(c, "pause", 22);

				Perform(c14,"say", "难道...你都忘了");
				Perform(c14,"pause", 5);

				Perform(c14,"say", "你杀了我爹娘...你杀了我杨家十余人....");
				Perform(c14,"pause", 5);

				Perform(c14,"say", "你忘了？我！杨非青，御史杨善的儿子！！");
				Perform(c14,"pause", 10);

				Perform(c, "say", "！你～是什么人呀～");
				Perform(c, "pause", 8);

				Perform(c14,"say", "曹阉狗！！");
				Perform(c14,"pause", 2);
				Perform(c14, "faceto", c);

				Perform(c, "faceto", c14);
				PlayerPerform("block", 1);
                                trg0++;
			        timer0 = now + 55; 
		}
	}
if (now>timer0 && trg0==22) {
PlayerPerform("block", 0);
				PlayerPerform("use", 15);
				PlayerPerform("pause", 4);
ChangeBehavior(c, "wait");
ChangeBehavior(c1, "follow", player);

ChangeBehavior(c14, "follow", c);
ChangeBehavior(c7, "follow", c);
Perform(c7, "use", 15);
Perform(c7, "use", 15);
Perform(c7, "pause", 4);
Perform(c1, "use", 15);
Perform(c1, "use", 15);
Perform(c1, "pause", 4);
				Perform(c, "use", 19);
				Perform(c, "say", "“狂暴心诀”第三层：暴怒！！！");
				Perform(c, "pause", 2);
				Perform(c, "say", "哼哼，一群杂碎，找死！");
				Perform(c, "pause", 2);

				Perform(c14, "pause", 4);
				Perform(c14,"say", "曹少千！！受死吧！！！！！！！！");
trg0++;timer0 = now + 8;}

if (now>timer0 && GetHP(c)<=20000 && trg0 == 23)
	        {
ChangeBehavior(c1, "idle");
ChangeBehavior(c14, "idle");
ChangeBehavior(c7, "idle");
ChangeBehavior(c, "idle");
				PlayerPerform("block", 1);
		AddNPC("npc13_16");
		AddNPC("npc13_25");
		AddNPC("npc13_26");
		AddNPC("npc13_12");
		AddNPC("npc13_13");
		AddNPC("npc13_14");
		AddNPC("npc13_15");
			Say(c,"好！！你们这么想死....本督主就成全你们！！！");
				Perform(c, "pause", 2);
			trg0 = 24;
		        timer0 = now + 4;}

	if (trg0 == 24 && now>timer0)
	{
		c8 = GetAnyChar("锦衣卫_1");
		c9 = GetAnyChar("锦衣卫_2");
		c10 = GetAnyChar("锦衣卫_3");
		c11 = GetAnyChar("锦衣卫_4");
		c12 = GetAnyChar("锦衣卫_5");
		c13 = GetAnyChar("锦衣卫_6");
		c15 = GetAnyChar("锦衣卫千户_志满天");
		if (c15>=0 && c8>=0 && c9>=0 && c10>=0 && c11>=0 && c12>=0 && c13>=0)
		{
				Perform(c7, "faceto", c);
				Perform(c14, "faceto", c);
				Perform(c1, "faceto", c);

				Perform(c15, "say", "（大喊）督主，此事怎办是好");
				Perform(c15, "pause", 14);

				Perform(c,"say", "（惊恐）！什么....啊！那...无上..血刃（小声）...");
				Perform(c,"pause", 10);

				Perform(c15, "say", "（大喊）千羽寒大人被....被杀了，他的手下也被解决了");
				Perform(c15, "pause", 8);

				Perform(c,"say", "嗯～怎么啦？");
				Perform(c, "faceto", c15);
				Perform(c,"pause", 2);

				Perform(c15, "say", "（大喊）督主！不好了！！");
				Perform(c15, "faceto", c);
				PlayerPerform("block", 1);
                                trg0++;
			        timer0 = now + 18;
		}
	}

if (now>timer0 && trg0==25) {
				Perform(c15, "say", "诺！！");
				Perform(c15, "pause", 10);

				Perform(c, "say", "别让他们给逃了...");
				Perform(c, "pause", 5);
				Perform(c, "say", "（心想）难道是....他们干的...？");
				Perform(c, "faceto", player);

				PlayerPerform("block", 1);
trg0++;timer0 = now + 10;}

if (now>timer0 && trg0==26)
{
				Perform(c14,"say", "曹少千！！你别想逃！！");
				RemoveNPC(c);
				Perform(c13,"say", "诺！！！");
				Perform(c13,"pause", 6);
				Perform(c12,"say", "诺！！！");
				Perform(c12,"pause", 6);
				Perform(c11,"say", "诺！！！");
				Perform(c11,"pause", 5);			
				Perform(c10,"say", "诺！！！");
				Perform(c10,"pause", 4);

				Perform(c15,"say", "你们几个，快去保护厂公");
				Perform(c10,"pause", 2);
				Perform(c15, "faceto", c10);
		trg0 = 27;timer0 = now + 7;
}

if (now>timer0 && trg0==27)
{
				RemoveNPC(c10);
				RemoveNPC(c11);
				RemoveNPC(c12);
				RemoveNPC(c13);
				Perform(c7, "faceto", player);
				Perform(c14, "faceto", player);

				PlayerPerform("say", "但在这之前...，我还有一件事要做");
				PlayerPerform("pause", 14);

				Perform(c1,"say", "嗯，要去古墓，这是目前唯一的路...");
				Perform(c1,"pause", 10);

				PlayerPerform("say", "附近已被锦衣卫包围，唯一的出路，就是那一头的城门....");
				PlayerPerform("pause", 8);

				Perform(c1,"say", "嗯，我们要快逃离这里");
				Perform(c1, "faceto", player);
				Perform(c1,"pause", 2);

				PlayerPerform("say", "看样子，“无上血刃”的事他们已发现了");
				PlayerPerform("block", 1);
		trg0 = 28;timer0 = now + 18;
}

if (now>timer0 && trg0==28) {
PlayerPerform("block", 0);
				PlayerPerform("pause", 2);
ChangeBehavior(c1, "follow", player);

ChangeBehavior(c14, "follow", player);
ChangeBehavior(c7, "follow", player);
				Perform(c14, "say", "什么！回去的路有伏兵？？");
				Perform(c14, "pause", 3);

				Perform(c7, "say", "......");
				Perform(c7, "pause", 2);

				Perform(c1, "pause", 2);
				Perform(c1,"say", "喂喂！你还要干嘛啊");
				Perform(c1, "pause", 2);
trg0++;timer0 = now + 4;trg1 = 1;}


	if (trg10==0 && now>timer6 && trg0>=16 && g1<3)
	{
		if (c8>=0 && GetHP(c8)<=0)
		{
			trg10 = 1;
			timer6 = now + 5;g1++;
		}
	}
	if (trg10==1 && now>timer6 && g1<3)
	{
		RemoveNPC(c8);
		trg10 = 2;
		timer6 = now + 2;
	}
	if (trg10==2 && now>timer6)
	{
		AddNPC("npc13_10");
		trg10 = 3;
		timer6 = now + 1;
	}
	if (trg10==3 && now>timer6)
	{
c8 = GetAnyChar("锦衣卫_1");
		if (c8>=0)
		{
			ChangeBehavior(c8, "follow",player);
			trg10 = 0;
			timer6 = now + 5;
		}
	}

	if (trg11==0 && trg0>=16 && now>timer7 && g2<3)
	{
		if (c9>=0 && GetHP(c9)<=0)
		{
			trg11 = 1;
			timer7 = now + 5;g2++;
		}
	}
	if (trg11==1 && now>timer7 && g2<3)
	{
		RemoveNPC(c9);
		trg11 = 2;
		timer7 = now + 2;
	}
	if (trg11==2 && now>timer7)
	{
		AddNPC("npc13_11");
		trg11 = 3;
		timer7 = now + 1;
	}
	if (trg11==3 && now>timer7)
	{
c9 = GetAnyChar("锦衣卫_2");
		if (c9>=0)
		{
			ChangeBehavior(c9, "follow",player);
			trg11 = 0;
			timer7 = now + 5;
		}
	}

	if (trg12==0 && trg0>=16 && now>timer8 && g3<3)
	{
		if (c10>=0 && GetHP(c10)<=0)
		{
			trg12 = 1;
			timer8 = now + 5;g3++;
		}
	}
	if (trg12==1 && now>timer8 && g3<3)
	{
		RemoveNPC(c10);
		trg12 = 2;
		timer8 = now + 2;
	}
	if (trg12==2 && now>timer8)
	{
		AddNPC("npc13_12");
		trg12 = 3;
		timer8 = now + 1;
	}
	if (trg12==3 && now>timer8)
	{
c10 = GetAnyChar("锦衣卫_3");
		if (c10>=0)
		{
			ChangeBehavior(c10, "follow",c1);
			trg12 = 0;
			timer8 = now + 5;
		}
	}

	if (trg13==0 && trg0>=16 && now>timer9 && g4<3)
	{
		if (c11>=0 && GetHP(c11)<=0)
		{
			trg13 = 1;
			timer9 = now + 5;g4++;
		}
	}
	if (trg13==1 && now>timer9 && g4<3)
	{
		RemoveNPC(c11);
		trg13 = 2;
		timer9 = now + 2;
	}
	if (trg13==2 && now>timer9)
	{
		AddNPC("npc13_13");
		trg13 = 3;
		timer9 = now + 1;
	}
	if (trg13==3 && now>timer9)
	{
c11 = GetAnyChar("锦衣卫_4");
		if (c11>=0)
		{
			ChangeBehavior(c11, "follow",c1);
			trg13 = 0;
			timer9 = now + 5;
		}
	}

	if (trg14==0 && trg0>=16 && now>timer10 && g5<3)
	{
		if (c12>=0 && GetHP(c12)<=0)
		{
			trg14 = 1;
			timer10 = now + 5;g5++;
		}
	}
	if (trg14==1 && now>timer10 && g5<3)
	{
		RemoveNPC(c12);
		trg14 = 2;
		timer10 = now + 2;
	}
	if (trg14==2 && now>timer10)
	{
		AddNPC("npc13_14");
		trg14 = 3;
		timer10 = now + 1;
	}
	if (trg14==3 && now>timer10)
	{
c12 = GetAnyChar("锦衣卫_5");
		if (c12>=0)
		{
			ChangeBehavior(c12, "follow",c8);
			trg14 = 0;
			timer10 = now + 5;
		}
	}

	if (trg15==0 && trg0>=16 && now>timer11 && g6<3)
	{
		if (c13>=0 && GetHP(c13)<=0)
		{
			trg15 = 1;
			timer11 = now + 5;g6++;
		}
	}
	if (trg15==1 && now>timer11 && g6<3)
	{
		RemoveNPC(c13);
		trg15 = 2;
		timer11 = now + 2;
	}
	if (trg15==2 && now>timer11)
	{
		AddNPC("npc13_15");
		trg15 = 3;
		timer11 = now + 1;
	}
	if (trg15==3 && now>timer11)
	{
c13 = GetAnyChar("锦衣卫_6");
		if (c13>=0)
		{
			ChangeBehavior(c13, "follow",c9);
			trg15 = 0;
			timer11 = now + 5;
		}
	}



	if (trg1 == 1 && now>timer0)
	{
		c8 = GetAnyChar("锦衣卫_1");
		c9 = GetAnyChar("锦衣卫_2");
		c15 = GetAnyChar("锦衣卫千户_志满天");
	SetTarget(4, "char", c14);
	SetTarget(3, "char", c7);
	SetTarget(2, "char", c1);
	SetTarget(1, "char", c15);
	SetTarget(0, "char", player);
	if (Distance(0, 1) < 350)
	{
				Perform(c8, "faceto", player);
				Perform(c9, "faceto", player);

				Perform(c15, "say", "哼哼哼...就凭你？！");
				Perform(c15, "pause", 11);

				PlayerPerform("say", "我要杀了这两个猪狗不如的东西！！");
				PlayerPerform("pause", 10);

				Perform(c15, "say", "？？");
				Perform(c15, "pause", 8);

				PlayerPerform("say", "说，万军敌和寄天风在哪");
				PlayerPerform("pause", 2);

				Perform(c15, "say", "督主说的就是你们吧？");
				Perform(c15, "faceto", player);
				PlayerPerform("block", 1);
                                trg1++;
			        timer1 = now + 19;

	}
	}	

	if (trg1 >= 1 && trg1 <= 7 && now>timer0)
	{
	SetTarget(4, "char", c14);
	SetTarget(3, "char", c7);
	SetTarget(2, "char", c1);
	SetTarget(1, "char", c15);
	if (Distance(2, 1) < 360 && h3==0)
	{
ChangeBehavior(c1, "idle");
				Perform(c1, "faceto", c15);
                                h3++;
	}
	if (Distance(3, 1) < 360 && h4==0)
	{
ChangeBehavior(c7, "idle");
				Perform(c7, "faceto", c15);
                                h4++;
	}
	if (Distance(4, 1) < 360 && h5==0)
	{
ChangeBehavior(c14, "idle");
				Perform(c14, "faceto", c15);
                                h5++;
	}
	}	

if (now>timer1 && trg1==2) {

				Perform(c15, "say", "下场不是死，就是退隐江湖，还真是惨啊，哈哈哈");
				Perform(c15, "pause", 5);
				Perform(c15, "say", "但还是有反抗我们曹督主的愚蠢之徒，");
				Perform(c15, "pause", 5);
				Perform(c15, "say", "还有现为东厂杀手的和光玄同");
				Perform(c15, "pause", 5);
			        Perform(c15, "say", "曹督主广招天下各方高手，除了他之外，");
				Perform(c15, "pause", 5);
				Perform(c15, "say", "哼，你不知道的事可多着呢");
				Perform(c15, "faceto", c14);
				Perform(c15, "pause", 24);

				PlayerPerform("say", "哦...");
				PlayerPerform("pause", 13);

				Perform(c14, "say", "此人的飞刀天下无双...无人能及");
				Perform(c14, "pause", 5);

				Perform(c14, "say", "不算，只有耳闻，那是几年前了......");
				Perform(c14, "pause", 6);

				PlayerPerform("say", "嗯，怎么，你认识他");
				PlayerPerform("pause", 7);

				Perform(c14, "say", "万军敌成了东厂的鹰犬？？");
				Perform(c14, "pause", 4);
				Perform(c14, "say", "你刚刚说什么");
				Perform(c14, "faceto", player);

				PlayerPerform("block", 1);
                                trg1++;
			        timer1 = now + 36; }

if (now>timer1 && trg1==3) {
				PlayerPerform("say", "哦，真令人兴奋啊");
				PlayerPerform("pause", 25);

				Perform(c14,"say", "千万不能被他卷到，否则难逃一死");
				Perform(c14,"pause", 5);
			        Perform(c14,"say", "但他的原地无限回转，天下一绝");
				Perform(c14,"pause", 5);
				Perform(c14,"say", "他善用匕首，不敢说他的匕首天下无敌");
				Perform(c14,"pause", 11);

				PlayerPerform("say", "很厉害吗");
				PlayerPerform("pause", 10);

				Perform(c14,"say", "原是江湖上令人闻之丧胆的杀手！");
				Perform(c14,"pause", 8);

				PlayerPerform("say", "他是哪位");
				PlayerPerform("pause", 2);

				Perform(c14,"say", "和光玄同...");
				PlayerPerform("block", 1);
                                trg1++;
			        timer1 = now + 28; }

if (now>timer1 && trg1==4) {
		AddNPC("npc13_19");
				Perform(c15, "say", "立即封住城门，叫他们插翅也难飞！！");
				Perform(c15, "pause", 5);
				Perform(c15, "say", "好了！督主有令，别让他们给逃了");
trg1++;timer1 = now + 7;}


	if (now>timer1 && trg1 == 5)
	{
		c1 = GetAnyChar("宋冰");
		sc1 = GetAnyChar("                                                                                   ");
	if(c1>0 && sc1>0)
		{
				Perform(c1, "say", "我们得要快离开啊！！");
				Perform(c1, "pause", 1);
				Perform(c1, "say", "不好！");
				Perform(c1, "faceto", player);
			trg1 = 6;
		        timer1 = now + 3;
		}
	}

if (now>timer1 && trg1==6) {
		RemoveNPC(sc1);
		AddNPC("npc13_17");
		AddNPC("npc13_21");
		AddNPC("npc13_22");
		AddNPC("npc13_23");
		AddNPC("npc13_24");
trg1++;timer1 = now + 2;}

	if (now>timer1 && trg1 == 7)
	{
		c8 = GetAnyChar("锦衣卫_1");
		c9 = GetAnyChar("锦衣卫_2");
		c15 = GetAnyChar("锦衣卫千户_志满天");
		c16 = GetAnyChar("守城士兵_1");
		c17 = GetAnyChar("守城士兵_2");
		c18 = GetAnyChar("守城士兵_3");
		c19 = GetAnyChar("守城士兵_4");
		c20 = GetAnyChar("东厂杀手_和光玄同");
		if(c16>0 && c17>0 && c18>0 && c19>0 && c20>0)
		{
				Perform(c19, "say", "诺！！");
				Perform(c19, "pause", 2);
				Perform(c18, "say", "诺！！");
				Perform(c18, "pause", 2);
				Perform(c17, "say", "诺！！");
				Perform(c17, "pause", 3);
				Perform(c16, "say", "诺！！");
				Perform(c16, "pause", 2);

				Perform(c20, "say", "别让任何人通过！");
			trg1 = 8;trg3 = 1;timer4 = now + 4;
		        timer1 = now + 4;
		}
	}

if (now>timer1 && trg1==8) {
PlayerPerform("block", 0);
				PlayerPerform("use", 15);
ChangeBehavior(c1, "follow", player);

ChangeBehavior(c14, "run");
ChangeBehavior(c7, "follow", c15);

ChangeBehavior(c15, "follow", c14);
ChangeBehavior(c9, "follow", c15);
ChangeBehavior(c8, "follow", c15);

ChangeBehavior(c16, "wait");
ChangeBehavior(c17, "wait");
ChangeBehavior(c18, "wait");
ChangeBehavior(c19, "wait");

Perform(c7, "use", 15);
Perform(c1, "use", 15);
Perform(c14, "use", 15);

timer2 = now + 2;trg1 = 9;trg2 = 1;trg10=10;trg11=10;trg12=10;trg13=10;trg14=10;trg15=10;}


	if (trg10==10 && now>timer6 && trg1>=8 && GetHP(c15)>0)
	{
		if (c8>=0 && GetHP(c8)<=0)
		{
			trg10 = 11;
			timer6 = now + 5;
		}
	}
	if (trg10==11 && now>timer6 && GetHP(c15)>0)
	{
		RemoveNPC(c8);
		trg10 = 12;
		timer6 = now + 2;
	}
	if (trg10==12 && now>timer6)
	{
		AddNPC("npc13_25");
		trg10 = 13;
		timer6 = now + 1;
	}
	if (trg10==13 && now>timer6)
	{
c8 = GetAnyChar("锦衣卫_1");
		if (c8>=0 && c15>0)
		{
			ChangeBehavior(c8, "follow",c15);
			trg10 = 10;
			timer6 = now + 5;
		}
		if (c8>=0 && GetHP(c15)<=0)
		{
			ChangeBehavior(c8, "follow",player);
			trg10 = 10;
			timer6 = now + 5;
		}
	}

	if (trg11==10 && trg1>=8 && now>timer7 && GetHP(c15)>0)
	{
		if (c9>=0 && GetHP(c9)<=0)
		{
			trg11 = 11;
			timer7 = now + 5;
		}
	}
	if (trg11==11 && now>timer7 && GetHP(c15)>0)
	{
		RemoveNPC(c9);
		trg11 = 12;
		timer7 = now + 2;
	}
	if (trg11==12 && now>timer7)
	{
		AddNPC("npc13_26");
		trg11 = 13;
		timer7 = now + 1;
	}
	if (trg11==13 && now>timer7)
	{
c9 = GetAnyChar("锦衣卫_2");
		if (c9>=0 && c15>0)
		{
			ChangeBehavior(c9, "follow",c15);
			trg11 = 10;
			timer7 = now + 5;
		}
		if (c9>=0 && GetHP(c15)<=0)
		{
			ChangeBehavior(c9, "follow",player);
			trg11 = 10;
			timer7 = now + 5;
		}
	}

	if (trg12==10 && trg1>=8 && now>timer8)
	{
		if (c16>=0 && GetHP(c16)<=0)
		{
			trg12 = 11;
			timer8 = now + 5;
		}
	}
	if (trg12==11 && now>timer8)
	{
		RemoveNPC(c16);
		trg12 = 12;
		timer8 = now + 2;
	}
	if (trg12==12 && now>timer8)
	{
		AddNPC("npc13_21");
		trg12 = 13;
		timer8 = now + 1;
	}
	if (trg12==13 && now>timer8)
	{
c16 = GetAnyChar("守城士兵_1");
		if (c16>=0 && trg2 < 3)
		{
			ChangeBehavior(c16, "follow",player);
			trg12 = 10;
			timer8 = now + 5;
		}
		if (c16>=0 && trg2 >= 3)
		{
			ChangeBehavior(c16, "patrol", 123);
			trg12 = 10;
			timer8 = now + 5;
		}
	}

	if (trg13==10 && trg1>=8 && now>timer9)
	{
		if (c17>=0 && GetHP(c17)<=0)
		{
			trg13 = 11;
			timer9 = now + 5;
		}
	}
	if (trg13==11 && now>timer9)
	{
		RemoveNPC(c17);
		trg13 = 12;
		timer9 = now + 2;
	}
	if (trg13==12 && now>timer9)
	{
		AddNPC("npc13_22");
		trg13 = 13;
		timer9 = now + 1;
	}
	if (trg13==13 && now>timer9)
	{
c17 = GetAnyChar("守城士兵_2");
		if (c17>=0 && trg2 < 3)
		{
			ChangeBehavior(c17, "follow",player);
			trg13 = 10;
			timer9 = now + 5;
		}
		if (c17>=0 && trg2 >= 3)
		{
			ChangeBehavior(c17, "patrol", 123);
			trg13 = 10;
			timer9 = now + 5;
		}
	}

	if (trg14==10 && trg1>=8 && now>timer10)
	{
		if (c18>=0 && GetHP(c18)<=0)
		{
			trg14 = 11;
			timer10 = now + 5;
		}
	}
	if (trg14==11 && now>timer10)
	{
		RemoveNPC(c18);
		trg14 = 12;
		timer10 = now + 2;
	}
	if (trg14==12 && now>timer10)
	{
		AddNPC("npc13_23");
		trg14 = 13;
		timer10 = now + 1;
	}
	if (trg14==13 && now>timer10)
	{
c18 = GetAnyChar("守城士兵_3");
		if (c18>=0 && trg2 < 3)
		{
			ChangeBehavior(c18, "follow",player);
			trg14 = 10;
			timer10 = now + 5;
		}
		if (c18>=0 && trg2 >= 3)
		{
			ChangeBehavior(c18, "patrol", 123);
			trg14 = 10;
			timer10 = now + 5;
		}
	}

	if (trg15==10 && trg1>=8 && now>timer11)
	{
		if (c19>=0 && GetHP(c19)<=0)
		{
			trg15 = 11;
			timer11 = now + 5;
		}
	}
	if (trg15==11 && now>timer11)
	{
		RemoveNPC(c19);
		trg15 = 12;
		timer11 = now + 2;
	}
	if (trg15==12 && now>timer11)
	{
		AddNPC("npc13_24");
		trg15 = 13;
		timer11 = now + 1;
	}
	if (trg15==13 && now>timer11)
	{
c19 = GetAnyChar("守城士兵_4");
		if (c19>=0 && trg2 < 3)
		{
			ChangeBehavior(c19, "follow",player);
			trg15 = 10;
			timer11 = now + 5;
		}
		if (c19>=0 && trg2 >= 3)
		{
			ChangeBehavior(c19, "patrol", 123);
			trg15 = 10;
			timer11 = now + 5;
		}
	}

if (now>timer2 && trg2 == 1)
{
		c15 = GetAnyChar("锦衣卫千户_志满天");
		c20 = GetAnyChar("东厂杀手_和光玄同");
SetTarget(0, "waypoint", 123);
SetTarget(1, "char", c20);
SetTarget(2, "char", c15);
SetTarget(3, "char", player);
SetTarget(4, "waypoint", 20);
	if(Distance(0,3) < Distance(0,4) && GetHP(c20)>0)
	{
				Perform(c19, "say", "诺！！");
				Perform(c19, "pause", 4);
				Perform(c18, "say", "诺！！");
				Perform(c18, "pause", 3);
				Perform(c17, "say", "诺！！");
				Perform(c17, "pause", 3);
				Perform(c16, "say", "诺！！");
				Perform(c16, "pause", 4);

			ChangeBehavior(c20, "follow",player);
				Perform(c20,"say", "马的！！快，快守住城门啊！");
			trg2 = 2;
		        timer2 = now + 8;
	}
	if(Distance(0,3) < 130 && GetHP(c20)<=0)
	{
				Perform(c19, "say", "啊！被闯入了");
				Perform(c19, "pause", 2);
				Perform(c18, "say", "想破城？");
				Perform(c18, "pause", 2);
				Perform(c17, "say", "哼！别想过去！");
				Perform(c17, "pause", 3);
				Perform(c16, "say", "想攻城");
			trg2 = 3;
		        timer2 = now + 4;
	}
}

if (now>timer2 && trg2 == 2)
{
		c15 = GetAnyChar("锦衣卫千户_志满天");
		c20 = GetAnyChar("东厂杀手_和光玄同");
SetTarget(0, "waypoint", 123);
SetTarget(1, "char", c20);
SetTarget(2, "char", c15);
SetTarget(3, "char", player);
SetTarget(4, "waypoint", 20);
	if(Distance(0,4) < Distance(0,3) && GetHP(c20)>0)
	{
				Perform(c19, "say", "诺！！");
				Perform(c19, "pause", 4);
				Perform(c18, "say", "诺！！");
				Perform(c18, "pause", 3);
				Perform(c17, "say", "诺！！");
				Perform(c17, "pause", 3);
				Perform(c16, "say", "诺！！");
				Perform(c16, "pause", 4);

			ChangeBehavior(c20, "follow",player);
				Perform(c20,"say", "想逃？这小子交给我处理！你们都给我守住城门！！");
			trg2 = 3;
		        timer2 = now + 5;
	}
}

if (now>timer2 && trg2 == 3)
{
		c15 = GetAnyChar("锦衣卫千户_志满天");
		c20 = GetAnyChar("东厂杀手_和光玄同");
SetTarget(0, "waypoint", 123);
SetTarget(1, "char", player);
SetTarget(2, "waypoint", 20);
	if(Distance(0,1) < Distance(0,2) && GetHP(c20)<=0 && GetHP(c15)>0)
	{
			ChangeBehavior(c15, "follow",player);
				Perform(c15, "say", "看样子，我不得不出马了");
			trg2 = 4;
		        timer2 = now + 4;
	}
}

if (now>timer4 && GetHP(c15)<=0 && trg3 == 1 && h1==0)
	        {
				PlayerPerform("use", 15);
				PlayerPerform("say", "（击败敌方大将，给予生命奖励）");
			Say(c15,"你...你们....");
			h1=1;
		        timer4 = now + 2;}


if (now>timer4 && GetHP(c20)<=0 && trg3 == 1 && h2==0)
	        {
				Perform(c19, "say", "诺！！");
				Perform(c19, "pause", 2);
				Perform(c18, "say", "诺！！");
				Perform(c18, "pause", 2);
				Perform(c17, "say", "诺！！");
				Perform(c17, "pause", 3);
				Perform(c16, "say", "诺！！");
				Perform(c16, "pause", 2);

				PlayerPerform("use", 4);
				PlayerPerform("use", 15);
				PlayerPerform("say", "（击败敌方特别BOSS，给予额外奖励）");

				Perform(c15, "say", "什么，和光玄同竟然输了....");
				Perform(c15, "pause", 4);

			Say(c20,"所...所有人....给我死守城门....");
			h2=1;
		        timer4 = now + 5;}

	if (now>timer4 && trg3 == 1 && h2==1 && h1==1)
	{

				PlayerPerform("say", "那你可要小心啊");
				PlayerPerform("pause", 5);
				PlayerPerform("say", "....");
				PlayerPerform("pause", 32);

				Perform(c7, "say", "我来帮你们争取时间，你们就趁这段时间快去古墓！");
				Perform(c7, "pause", 5);

				Perform(c7, "say", "即使门被攻破了，追兵仍是不断，就由我来断后吧！");
				Perform(c7, "pause", 5);
			        Perform(c7, "say", "我还有什么脸回去！");
				Perform(c7, "pause", 5);
				Perform(c7, "say", "我和我的组员们早已任务失败了");
				Perform(c7, "pause", 11);

				PlayerPerform("say", "什么意思？");
				PlayerPerform("pause", 10);

				Perform(c7, "say", "那是目前唯一的出路，攻破后就别管我了");
				Perform(c7, "pause", 8);

				PlayerPerform("say", "这我知道啊");
				PlayerPerform("pause", 2);

				Perform(c7, "say", "快去攻破城门！");
                                trg3++;
			        timer4 = now + 40;}

if (now>timer5 && trg4 == 1)
{
		c = GetAnyChar("曹少千");
		c1 = GetAnyChar("宋冰");
		c2 = GetAnyChar("万无楼");
SetTarget(0, "char", c);
SetTarget(1, "char", c1);
SetTarget(2, "char", c2);
SetTarget(3, "char", player);
	if(Distance(0,3) < 200)
	{
Perform(c, "attack",1);
Perform(c, "faceto", player);
		        trg4 = 2;timer5 = now + 1;
	}
	if(Distance(0,2) < 200)
	{
Perform(c, "attack",1);
Perform(c, "faceto", c2);
		        trg4 = 2;timer5 = now + 1;
	}
	if(Distance(0,1) < 200)
	{
Perform(c, "attack",1);
Perform(c, "faceto", c1);
		        trg4 = 2;timer5 = now + 1;
	}

}
if (now>timer5 && trg4 == 2 && trg0<=9)
{
		        trg4 = 1;timer5 = now;
}




if (gameover!=-1 && GetHP(player)<=0 && trg5==0) 
{ gameover=-1;trg5 = 2;timer3 = now + 2;}

if (gameover!=-1 && GetHP(c1)<=0 && trg5==0 && trg0>=8) 
{ gameover=-1;PlayerPerform("say", "宋冰...你不能死啊");trg5 = 2;timer3 = now + 2;}

if (gameover!=-1 && GetHP(c7)<=0 && trg5==0 && trg0>=2) 
{ gameover=-1;PlayerPerform("say", "啊...假面战士...");trg5 = 2;timer3 = now + 2;}

if (gameover!=-1 && GetHP(c14)<=0 && trg5==0 && trg0>=22) 
{ gameover=-1;PlayerPerform("say", "啊.....我失败了...");trg5 = 2;timer3 = now + 2;}

	if (trg5==2)
	{
		if ((gameover==1 || gameover==-1) && now>timer3)
		{
			GameOver(gameover);
			gameover = 2;
		}
	}	
}