// 洛阳城
int Rule = 4;
int RoundTime = 60;
int PlayerSpawn = 141;
int PlayerSpawnDir = 0;
int PlayerWeapon = 6;
int PlayerWeapon2 = 0;
int PlayerHP = 5000;

int trg0 = 0;
int trg1 = 0;
int trg2 = 0;
int trg3 = 0;
int trg4 = 0;
int trg5 = 0;
int trg6 = 0;
int trg7 = 0;
int trg8 = 0;
int trg9 = 0;
int timer0 = 0;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;

OnStart()
{
	AddNPC("npc-19-07");
	AddNPC("npc-19-01");
	AddNPC("npc-19-09");
	AddNPC("npc-19-10");
	AddNPC("npc-19-11");
	AddNPC("npc-19-12");
	AddNPC("npc-19-13");
}


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

	if (trg0 == 0)
	{
		c = GetChar("阳城卫队长"); 
		c1 = GetChar("阳城卫");
		c2 = GetChar("阳城卫 "); 
		c3 = GetChar("阳城卫  ");
		c4 = GetChar("阳城卫   "); 
		c6 = GetChar("履面使");
		
		if (c>=0 && c1>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0)
		{
			Perform(c, "say", "那个贼就在前面，快去把他灭了！！！！");
			Perform(c, "faceto", c2);
	
			ChangeBehavior(c2, "kill", c6);
			Perform(c1, "say", "是！");
			Perform(c1, "pause", 3);
			Perform(c1, "faceto", c);
		
			ChangeBehavior(c2, "kill", c6);
			Perform(c2, "say", "是！");
			Perform(c2, "pause", 3);
			Perform(c2, "faceto", c);

			ChangeBehavior(c3, "kill", c6);
			Perform(c3, "say", "是！");
			Perform(c3, "pause", 3);
			Perofrm(c3, "faceto", c);

			ChangeBehavior(c4, "kill", c6);
			Perform(c4, "say", "是！");
			Perform(c4, "pause", 3);
			Perofrm(c4, "faceto", c);
			
			Perform(c6, "say", "离落，你来得正好，快帮帮我！！！");
			Perform(c6, "pause", 9);

			PlayerPerform("block", 0);
			PlayerPerform("pause", 2);
                        PlayerPerform("say", "（还是先去帮帮他吧）"); 
			PlayerPerform("pause", 2);
                        PlayerPerform("say", "（履面使？？那个笨蛋又惹什么麻烦了……）"); 
			PlayerPerform("pause", 6);
			PlayerPerform("block", 1);
			trg0 = 1;
		}
	}
	if (trg1 == 0)
	{
		c = GetChar("阳城卫队长");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "你这小子还真有两下子");
			Perform(c, "faceto", player);
			trg1 = 1;
		}
	}
	if (trg1 == 1)
	{
		c = GetAnyChar("阳城卫队长"); 
		c1 = GetAnyChar("阳城卫");
		c2 = GetAnyChar("阳城卫 "); 
		c3 = GetAnyChar("阳城卫  ");
		c4 = GetAnyChar("阳城卫   "); 
		if (c>=0 && GetHP(c)<GetMaxHP(c)/3)
		{			
			Perform(c, "guard", 2);
			Perform(c, "say", "唔……好厉害，撤！！！！");
			Perform(c, "faceto", player);

			Perform(c1, "say", "是！");
			Perform(c1, "pause", 3);
			Perform(c1, "faceto", c);
		
			Perform(c2, "say", "是！");
			Perform(c2, "pause", 3);
			Perform(c2, "faceto", c);

			Perform(c3, "say", "是！");
			Perform(c3, "pause", 3);
			Perofrm(c3, "faceto", c);

			Perform(c4, "say", "是！");
			Perform(c4, "pause", 3);
			Perofrm(c4, "faceto", c);

			trg1 = 2;
			timer0 = now + 10;
		}
	}
        if (trg1 == 2 && now>timer0)
	{
			RemoveNPC(c);
			RemoveNPC(c1);
			RemoveNPC(c2);
			RemoveNPC(c4);
			RemoveNPC(c3);

	                AddNPC("npc-19-08");

	                trg1 = 3;               
	}
	if (trg1 == 3)
	{
		c = GetChar("履面使");
		c1 = GetChar("七侠-风");
		if (c>=0)
		{
			Perform(c, "say", "哦（靠，怎么又是我？？）");
			Perform(c, "pause", 6);
			Perform(c, "say", "丫的，他们跑得快，进了城，我没有通行证，只好硬闯，结果被一群官兵缠上了……");
			Perform(c, "pause", 4);
			Perform(c, "say", "呼呼！！真麻烦 ！！！");
			Perform(c, "faceto", player);

			Perform(c1, "say", "当然在！！！");
			Perform(c1, "pause", 7);

			PlayerPerform("block", 0);
                        PlayerPerform("say", "……履面使，上！！"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "够了，他们还在城里吗？"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "我不是让你去拦住他们吗？你怎么惹上官兵了？"); 
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			trg1 = 4;
		}
	}
	if (trg2 == 0)
	{
		c = GetChar("七侠-风"); 
		
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "想不到你居然可以追到这里来，不过你完了！！！");
			
			trg2 = 1;
		}
	}
	if (trg3 == 0)
	{
		c = GetChar("七侠-风");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "哼哼，再来！！！");
			Perform(c, "faceto", player);
			trg3 = 1;
		}
	}
	if (trg3 == 1)
	{
		c = GetAnyChar("七侠-风");
		if (GetHP(c) <= 0)
		{
			Say(c, "哈哈哈哈，别以为只有这样而已！！！");
			trg3 = 2;
		}
	}
	if (trg3 == 2)
	{
		c = GetAnyChar("七侠-风"); 
		if (GetHP(c)<=0 && player>=0 && GetHP(player)>0)
		{

			AddNPC("npc-19-02");

		        RemoveNPC(c);
			trg3 = 3;
		}
	}
	if (trg4 == 0)
	{
		c = GetChar("七侠-雨"); 
		
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "呵呵，你能赢我么？");
			
			trg4 = 1;
		}
	}
	if (trg4 == 1)
	{
		c = GetChar("七侠-雨");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "哟，不错不错");
			Perform(c, "faceto", player);
			trg4 = 2;
		}
	}
	if (trg4 == 2)
	{
		c = GetAnyChar("七侠-雨");
		if (GetHP(c) <= 0)
		{
			Say(c, "哈哈，还会有更多的");
			trg4 = 3;
		}
	}
	if (trg4 == 3)
	{
		c = GetAnyChar("七侠-雨"); 
		if (GetHP(c)<=0 && player>=0 && GetHP(player)>0)
		{

			AddNPC("npc-19-03");

		        RemoveNPC(c);
			trg4 = 4;
		}
	}
	if (trg5 == 0)
	{
		c = GetChar("七侠-月"); 
		
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "来吧,让你见证我真正的实力！！！");
			
			trg5 = 1;
		}
	}
	if (trg5 == 1)
	{
		c = GetChar("七侠-月");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "…………");
			Perform(c, "faceto", player);
			trg5 = 2;
		}
	}
	if (trg5 == 2)
	{
		c = GetAnyChar("七侠-月");
		if (GetHP(c) <= 0)
		{
			Say(c, "……你好自为之吧……");
			trg5 = 3;
		}
	}
	if (trg5 == 3)
	{
		c = GetAnyChar("七侠-月"); 		
		if (GetHP(c)<=0 && player>=0 && GetHP(player)>0)
		{

			AddNPC("npc-19-05");

		        RemoveNPC(c);

			trg5 = 4;
		}
	}
	if (trg6 == 0)
	{
		c = GetChar("七侠-怒"); 
		
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "哼！今天就是你的死期！");
			
			trg6 = 1;
		}
	}
	if (trg6 == 1)
	{
		c = GetChar("七侠-怒");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "哇丫的，我要把你大卸八块！！！");
			Perform(c, "faceto", player);
			trg6 = 2;
		}
	}
	if (trg6 == 2)
	{
		c = GetAnyChar("七侠-怒");
		if (GetHP(c) <= 0)
		{
			Say(c, "你…………");
			trg6 = 3;
		}
	}
	if (trg6 == 3)
	{
		c = GetAnyChar("七侠-怒"); 		
		if (GetHP(c)<=0 && player>=0 && GetHP(player)>0)
		{

			AddNPC("npc-19-04");

		        RemoveNPC(c);

			trg6 = 4;
		}
	}
	if (trg7 == 0)
	{
		c = GetChar("七侠-雪"); 
		
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "又见面了呵（…………你知不知道我好想你的…………）");
			
			trg7 = 1;
		}
	}
	if (trg7 == 1)
	{
		c = GetChar("七侠-雪");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "哎呀，见到女孩你不知道要温柔一点啊！！！");
			Perform(c, "faceto", player);

                        PlayerPerform("say", "……………………"); 
			PlayerPerform("pause", 2);
			trg7 = 2;
		}
	}
	if (trg7 == 2)
	{
		c = GetAnyChar("七侠-雪");
		if (GetHP(c) <= 0)
		{
			Say(c, "哼，你坏死了！！！");

                        PlayerPerform("say", "……………………"); 
			PlayerPerform("pause", 2);
			trg7 = 3;
		}
	}	
	if (trg7 == 3)
	{
		c = GetAnyChar("七侠-雪"); 		
		if (GetHP(c)<=0 && player>=0 && GetHP(player)>0)
		{

			AddNPC("npc-19-06");

		        RemoveNPC(c);

			trg7 = 4;
		}
	}
	if (trg8 == 0)
	{
		c = GetChar("七侠-火"); 
		
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "上次有事失陪，这次特来请教，还望多多指教");
			
			trg8 = 1;
		}
	}
	if (trg8 == 1)
	{
		c = GetChar("七侠-火");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "……………（承受了这样的车轮居然还面不改色，真是太可怕了）");
			Perform(c, "faceto", player);

			trg8 = 2;
		}
	}
	if (trg8 == 2)
	{
		c = GetAnyChar("七侠-火");
		if (GetHP(c) <= 0)
		{
			Say(c, "佩服");

			trg8 = 3;
		}
	}
	if (trg8 == 3)
	{
		c = GetAnyChar("七侠-火"); 		
		if (GetHP(c)<=0 && player>=0 && GetHP(player)>0)
		{

			AddNPC("npc-19-14");

		        RemoveNPC(c);

			trg8 = 4;
		}
	}
	if (trg8 == 4)
	{
		c = GetChar("履面使");
                c1 = GetChar("七侠-雷");
                c2 = GetChar("");
		if (c>=0 && c1>=0)
		{
			Perform(c, "say", "！！！莫非是…………");
			Perform(c, "pause", 4);
			Perform(c, "say", "…………（这人可有够笨的，这么明显的拖时间还不知道…………搞得我还以为他早有对策了）");
			Perform(c, "pause", 4);
			Perform(c, "say", "他们总是一个个来你不觉得很奇怪么……");
			Perform(c, "pause", 4);
			Perform(c, "say", "呼呼！！好累！！！这样下去可不是办法呀！！");
			Perform(c, "faceto", player);

			Perform(c1, "say", "跟我来吧！！！！");
			Perform(c1, "pause", 4);
			Perform(c1, "say", "来吧，你们不是想要飞焱剑么，跟我来吧！！！");
			Perform(c1, "pause", 27);

			Perform(c2, "use", 35);
			Perform(c2, "pause", 35);

			PlayerPerform("block", 0);
                        PlayerPerform("say", "谁？？？！！！"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "是这样了，飞焱剑一定在最后一个人手上！！！"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "履面使，你注意到了没有，他们号称七侠，但至今为止我们仍只见到过六个人…………"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "！！！不好，他们在拖时间！！！"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "恩……"); 
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);

			trg8 = 5;
		}
	}		
}