// 五爪峰
int Rule = 3;
int RoundTime = 15;
int PlayerSpawn = 19;
int PlayerSpawnDir = 0;
int PlayerWeapon = 16;
int PlayerWeapon2 = 58;
int PlayerHP = 30000;

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;
int timer5 = 0;
int timer6 = 0;
int timer7 = 0;
int timer8 = 0;
int reborn = -1;
string rebornName;



OnStart()
{
	AddNPC("npc11_10");

}

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;
	int c9;
	int now = GetGameTime();

        if (trg0 == 0)
	{
				
			PlayerPerform("use", 33);
			trg0 = 1;
		
	}
	if (trg0==1 )
	{

                c = GetChar("律香彬");
		if (c>=0 && GetEnemy(c)==player)
		{
                        Perform(c, "pause", 5);
			Perform(c, "say", "﹒﹒﹒﹒﹒﹒来人阿，烂住他。。？");
			Perform(c, "faceto", player);
                        Perform(c, "aggress");			
			Perform(c, "say", " 哼..有我在这，别想从这过去。。.");
			Perform(c, "faceto", player); 

			PlayerPerform("say", "（休想拦住我，？我一定要从这过去。 ）");
			PlayerPerform("pause", 4);
			PlayerPerform("block", 1);

			trg0 = 2;
                        timer0 = now + 5;
		}
	}



	if (trg0==2 && now>timer0)
	{

		        AddNPC("npc11_01");
		        AddNPC("npc11_02");
		        AddNPC("npc11_03");
		        AddNPC("npc11_04");
		        AddNPC("npc11_05");
		        AddNPC("npc11_06");
		        AddNPC("npc11_07");
		        AddNPC("npc11_08");
                        RemoveNPC(GetAnyChar("律香彬"));

		        trg0 = 3;
                }

       if (trg2==0 && trg0==3)
	{
		c2 = GetAnyChar("镖客");
		if (c2>=0 && GetHP(c2)<=0)
		{
			reborn = c2;
			rebornName = "npc11_01";
			trg2 = 1;
			timer4 = now + 3;
		}
		c3 = GetAnyChar("镖客1");
		if (c3>=0 && GetHP(c3)<=0)
		{
			reborn = c3;
			rebornName = "npc11_02";
			trg2 = 1;
			timer4 = now + 3;
		}
		c4 = GetAnyChar("镖客2");
		if (c4>=0 && GetHP(c4)<=0)
		{
			reborn = c4;
			rebornName = "npc11_03";
			trg2 = 1;
			timer4 = now + 3;
		}
		c5 = GetAnyChar("镖客3");
		if (c5>=0 && GetHP(c5)<=0)
		{
			reborn = c5;
			rebornName = "npc11_04";
			trg2 = 1;
			timer4 = now + 3;
		}
		c6 = GetAnyChar("镖客4");
		if (c6>=0 && GetHP(c6)<=0)
		{
			reborn = c6;
			rebornName = "npc11_05";
			trg2 = 1;
			timer4 = now + 3;
		}
		c7 = GetAnyChar("镖客6");
		if (c7>=0 && GetHP(c7)<=0)
		{
			reborn = c7;
			rebornName = "npc11_06";
			trg2 = 1;
			timer4 = now + 3;
		}
		c8 = GetAnyChar("镖客7");
		if (c8>=0 && GetHP(c8)<=0)
		{
			reborn = c8;
			rebornName = "npc11_07";
			trg2 = 1;
			timer4 = now + 3;
		}
	        c9 = GetAnyChar("镖客8");
		if (c9>=0 && GetHP(c9)<=0)
		{
			reborn = c8;
			rebornName = "npc11_08";
			trg2 = 1;
			timer4 = now + 3;
		}
           }
        if (trg2==1 && now>timer4)
	{
		RemoveNPC(reborn);
		timer4 = now+ 2;
		trg2 = 2;
	}
	if (trg2==2 && now>timer4)
	{
		AddNPC(rebornName);
		trg2 = 0;
	}

        if (trg3 == 0)
	{
			PlayerPerform("block", 0);
			PlayerPerform("pause", 5);
			PlayerPerform("say", "还是不给敌人打斗，直接破城而入。。。。");
			PlayerPerform("pause", 5);
			PlayerPerform("say", " 看来想通过城门这里不简单？");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "看来我只有破过这里的城门前往洛阳！");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "孙老伯！他跑到洛阳城了。？");
			PlayerPerform("block", 1);

		           trg3 = 1;
	}
}