//  奉告
int Rule = 1;
int RoundTime = 450;
int PlayerSpawn = 41;
int PlayerSpawnDir = 80;
int PlayerWeapon = 15;
int PlayerWeapon2 = 24;
int PlayerHP = 8000;

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 trg10 = 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 gameover = 0;
int reborn = -1;
string rebornName;

OnStart()
{
	AddNPC("5关7");
}


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


        if (trg0 == 0)
	{
		c = GetChar("胡斐"); 
                if (c>=0)
		{
			ChangeBehavior(c, "kill", player);
                        PlayerPerform("block", 0);
                        Perform(c, "say", "哈哈！在下也是…… 接招了！");
                        Perform(c, "pause", 8);
                        PlayerPerform("say", "  哦？！早已久仰你的大名， 今天能跟你交手，也是我的服气，来吧。！");
                        PlayerPerform("pause", 7);
                        Perform(c, "say", "你果然爽快！在这关的关卡里，我就是BOSS…");
                        Perform(c, "pause", 7);
                        PlayerPerform("say", "你是来干什么来了，我清楚的很，想打直接来就行了，别废话。");
                        PlayerPerform("pause", 6);
                        Perform(c, "say", "阿……是这样的！你虽然作为杀手，但是你杀的人貌似也有不该杀的。");
                        Perform(c, "pause", 5);
                        PlayerPerform("say", "讨什么公平？有什么好讨的！我又没招惹你。");
                        PlayerPerform("pause", 4);
                       Perform(c, "say", "听说现在江湖上到处都有你的大名，在下也不是针对你。只不过在下想为大家讨个公平……");
                        Perform(c, "pause", 3);
                        PlayerPerform("say", "阿...胡斐… 江湖上的高手，找我领教干什么？ ");
                        PlayerPerform("pause", 2);  
                        Perform(c, "say", "伊人君？在下胡斐..想请教阁下几招！");
                        PlayerPerform("block", 1);
Perform(c, "faceto", player);
                        trg0 = 1;
		}
	} 
       
        if (trg0 == 1)
        {
                c = GetAnyChar("胡斐");      
                if (c>=0 && GetHP(c)<7000)
                {
                        Perform(c, "say", "呵啊…  果然是厉害…");
                        trg0 = 2;
		}
	} 
        if (trg0 == 2)
        {
                c = GetAnyChar("胡斐");      
                if (c>=0 && GetHP(c)<5000)
                {
                        Perform(c, "say", "怪不得你在江湖上流传的这么快，武功果然厉害。");
                        trg0 = 3;
		}
	} 
        if (trg0 == 3)
        {
                c = GetAnyChar("胡斐");      
                if (c>=0 && GetHP(c)<2000)
                {

                        Perform(c, "say", "呵呵。这个忙我看我是帮不了了。有机会在见。");
                        trg0 = 4;timer0 = now + 2;
		}
	}

	if (trg0 == 4 && now>timer0)
	{
		        AddNPC("5关"); RemoveNPC(GetAnyChar("胡斐"));
		        trg0 = 5;
	} 

        if (trg1 == 0)
	{
		c = GetChar("东方不败"); 
                if (c>=0)
		{
			ChangeBehavior(c, "kill", player);
                        PlayerPerform("block", 0);
                        Perform(c, "say", "哈哈！在下也是…… 接招了！");
                        Perform(c, "pause", 8);
                        PlayerPerform("say", "  哦？！早已久仰你的大名， 今天能跟你交手，也是我的服气，来吧。！");
                        PlayerPerform("pause", 7);
                        Perform(c, "say", "你果然爽快！在这关的关卡里，我就是BOSS…");
                        Perform(c, "pause", 7);
                        PlayerPerform("say", "你是来干什么来了，我清楚的很，想打直接来就行了，别废话。");
                        PlayerPerform("pause", 6);
                        Perform(c, "say", "阿……是这样的！你虽然作为杀手，但是你杀的人貌似也有不该杀的。");
                        Perform(c, "pause", 5);
                        PlayerPerform("say", "讨什么公平？有什么好讨的！我又没招惹你。");
                        PlayerPerform("pause", 4);
                       Perform(c, "say", "听说现在江湖上到处都有你的大名，在下也不是针对你。只不过在下想为大家讨个公平……");
                        Perform(c, "pause", 3);
                        PlayerPerform("say", "阿...东方不败…找我领教干什么？ ");
                        PlayerPerform("pause", 2);  
                        Perform(c, "say", "伊人君？在下东方不败..想请教阁下几招！");
                        PlayerPerform("block", 1);
Perform(c, "faceto", player);
                        trg1 = 1;
		}
	} 
        if (trg1 == 1)
        {
                c = GetAnyChar("东方不败");      
                if (c>=0 && GetHP(c)<2000)
                {
                        PlayerPerform("say", "这是怎么回事？ ");
                        PlayerPerform("pause", 2); 
                        Perform(c, "say", "呵呵。这个忙我看我是帮不了了。有机会在见。");
                        trg1 = 2;timer0 = now + 2;
		}
	}
	if (trg1== 2 && now>timer0)
	{
		        AddNPC("5关1");
		        AddNPC("5关2");
		        AddNPC("5关3");
		        AddNPC("5关4");
		        AddNPC("5关5");
RemoveNPC(GetAnyChar("东方不败"));
		        trg1 = 3;
	} 
 if (trg2 == 0)
	{
		c = GetChar("无名杀手1"); 
		c1 = GetChar("无名杀手2"); 
		c2 = GetChar("无名杀手3"); 
		c3 = GetChar("无名杀手4"); 
		c4 = GetChar("无名杀手5"); 
                if (c>=0)
		{
			ChangeBehavior(c, "kill", player);
                        PlayerPerform("block", 0);
                        Perform(c1, "pause", 25);
                        Perform(c2, "pause", 25);
                        Perform(c3, "pause", 25);
                        Perform(c4, "pause", 25);
                        PlayerPerform("say", " 可恶。。拿命来！");
                        PlayerPerform("pause", 8);
                        Perform(c, "say", " 哈哈。你的时间不多了，不陪你玩玩就没机会了。 ");
                        Perform(c, "pause", 8);
                        PlayerPerform("say", " 在坚强也不是我的对手，就你们。哼。。");
                        PlayerPerform("pause", 7);
                        Perform(c, "say", "哈哈！… 今天的我们可不是往常的了。别以为我们很懦弱。 ");
                        Perform(c, "pause", 7);
                        PlayerPerform("say", "小人。打不过你爷爷就做出这等的卑鄙事情！今天我就先杀了你，在杀你们的老大。");
                        PlayerPerform("pause", 6);
                        Perform(c, "say", "我们承认不是你的对手，不过世上有比的高的。。");
                        Perform(c, "pause", 5);
                        PlayerPerform("say", "那与江湖上的英雄何干。你们这么做是什么意思。");
                        PlayerPerform("pause", 4);
                       Perform(c, "say", "是你自找没趣…怪不得我们。我们只是服从命令！…");
                        Perform(c, "pause", 3);
                        PlayerPerform("say", "无名！你居心何在？ ");
                        PlayerPerform("pause", 2);  
                        Perform(c, "say", "哈哈！他们为什么会来找你，自然是我们搞的鬼。");
                        PlayerPerform("block", 1);
Perform(c, "faceto", player);
                        trg2 = 1;
		}
	} 


if (trg2 == 1)
	{
		c = GetAnyChar("无名杀手1");
		c1 = GetAnyChar("无名杀手2"); 
		c2 = GetAnyChar("无名杀手3");
		c3 = GetAnyChar("无名杀手4");
		c4 = GetAnyChar("无名杀手5");
if (GetHP(c)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c1)<=0 && player>=0 && GetHP(player)>0)
		{
	              AddNPC("5关");

			trg2 = 2;
		}
	}  

        if (trg2 == 2)
	{
		c = GetChar("东方不败"); 
                if (c>=0)
		{
			ChangeBehavior(c, "kill", player);
                        PlayerPerform("block", 0);
                         Perform(c, "pause", 100);
                        PlayerPerform("say", "为什么！好。明天我就去给你们解释！ ");
                        PlayerPerform("pause", 6); 
                       Perform(c, "say", "明天在各位英雄的面前一一的请清楚！！不去的话，后果不堪设想！ ");
                        Perform(c, "pause", 1);
                       Perform(c, "say", "你自己看着办吧！小小年纪竟能如此猖狂，天理何在。 ");
                        Perform(c, "pause", 1);
                       Perform(c, "say", "废话杀说… 如果明天不到的话，江湖上的人就要血洗快活林 ");
                        Perform(c, "pause", 3);
                        PlayerPerform("say", "阿.你们中了朝廷的奸计了。我是来杀奸贼的！ ");
                        PlayerPerform("pause", 2);  
                        Perform(c, "say", "伊人君？你不死！江湖会大乱，启能让你猖狂！明天在武林塔上自行了断吧");
                        PlayerPerform("block", 1);
Perform(c, "faceto", player);
                        trg2 = 3;timer0 = now + 10;
		}
	} 
	if (trg2 == 3 && now>timer0)
	{
	    gameover = 1;

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