#include "../PScriptLib/AsHelper.as"
// 金华城
int Rule = 4;
int RoundTime = 15;
int PlayerSpawn = 257;
int PlayerSpawnDir = 332;
int PlayerWeapon = 59;
int PlayerWeapon2 = 0;
int PlayerHP = 800;

int g_counter = 0;
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 trg11 = 0;
int trg12 = 0;
int trg13 = 0;
int trg50 = 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 timer50 = 0;
int gameover = 0;
int gameover1 = 0;
int gameover2 = 0;
int gameover3 = 0;
int gameover4 = 0;
int gameover5 = 0;
int now = 0;
int damn =0; 
int survivor = -1;

void OnStart()
{
	string voiceFolder = "UserData/Voice/sn13/";
	AsSoundCacheFolder(voiceFolder);
	AsSetChatVoiceFolder(voiceFolder);
	
	AddNPC("npc13_01");
	AddNPC("npc13_02");
	AddNPC("npc13_03");
	AddNPC("npc13_04");
	AddNPC("npc13_05");
	AddNPC("npc13_06");
	AddNPC("npc13_07");
	AddNPC("npc13_09");
}

bool playerChanged; // 标识是否已修改主角
bool lengyanChanged; // 标识是否已修改冷燕
void OnUpdate()
{	
    int player = GetChar("player");
    if (!playerChanged && IsAlive(player)){
        // 修改显示名称，注意，这并不会改变角色真名
        SetDisplayName(player, "钓鱼佬.乙");
        // 修改所属队伍为蝴蝶
        SetTeam(player, 2);
        // 标识为已修改
        playerChanged = true;
    }
	int c;
	int c2;
	int flag;
	int c3;
	int c4;
	int c5;
	int c6;
	int c7;
	int c8;
	int c9;
	int c10;
	int c11;
	int c12;
	int c13;
	int t;
	now = GetGameTime();

    // 修改 攻击力基础值
    CharSetBaseAttrib(1, CharAttrib_Attack, -50);
    // 修改 防御力基础值
    CharSetBaseAttrib(1, CharAttrib_Defense, 40);
	 // 修改 速度基础值
	   // 修改 攻击力基础值
    CharSetBaseAttrib(2, CharAttrib_Attack, 200);
		   // 修改 攻击力基础值
    CharSetBaseAttrib(9, CharAttrib_Attack, 180);
	// 修改 防御力基础值
    CharSetBaseAttrib(9, CharAttrib_Defense, 40);
    // 修改 防御力基础值
    CharSetBaseAttrib(2, CharAttrib_Defense, 45);
	// 修改 速度基础值
	CharSetBaseAttrib(2, CharAttrib_Speed, 250);
	g_counter = g_counter + 1;


	//跳过剧情↓
	if(trg50 == 0&&now>timer50)
{
 Say(1,"提示：按下K键可以快速跳过剧情。");
 trg50=1;
 timer50=now+1; 
}
if(trg50 == 1&&now>timer50&&trg0<=4)
{
c2 = GetChar("钓鱼佬.甲");
 if (AsIsKeyPressed(ImGuiKey_K))
 {
 timer50=now+1;
 trg50=99;
 StopPerform(1);
   StopPerform(2);
 StopPerform(3);
  StopPerform(4);
   StopPerform(5);
    StopPerform(6);
	 StopPerform(7);
	  StopPerform(8);
	   StopPerform(9);
	   PlayerPerform("block", 0);
	   		SetAllowCharSwitchWeapon(2, false);
			timer0 = now + 3;
 }
}

	if (trg12 == 0&&now>timer1)
	{
			c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		if(c6>0)
		{
			AsPerform(c6, "say", "你现在行动不便，就当不认识我们，莫要卷入纷争。");
		Perform(c6, "pause", 6);
		Perform(c6, "say", "我们在金华城还有任务在身。");
		Perform(c6, "pause", 24);
		AsPerform(c6, "say", "那你现在还好吗？");
		Perform(c6, "say", "！！！");		
		Perform(c6, "pause", 14);
		AsPerform(c6, "say", "我们所有人当中......变化最多的莫过于高老大和叶翔了......对了，你气色不是太好。");
		Perform(c6, "pause", 20);
		AsPerform(c6, "say", "好久不见，星！没想到从点苍派归来的我竟然能看到你成了点苍渔夫。");
		Perform(c6, "pause", 7);
		AsPerform(c6, "say", "天接云涛连晓雾，星河欲转千帆舞。");
		Perform(c6, "aggress");
		SetAllowCharSwitchWeapon(2, false);
		Perform(c6, "faceto",c);
	
    AsCharAttack(c2, "bb"); // 新版

trg12= 1;		
}
}
if (trg0 == 0)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");

	
		if (c6>0)
		{
		PlayerPerform("block", 0);
		PlayerPerform("say", "我会注意的。");
		PlayerPerform("pause", 25);
		PlayerPerform("say", "不错，孙剑等人已死，图纸毁了许多，我这里还有些许零星的章节，或许孔雀你可以拿去研究。");
		PlayerPerform("pause", 7);
		PlayerPerform("say", "无碍。");
		PlayerPerform("pause", 9);
		PlayerPerform("say", "我不过是中了律香川的七星针，现在正隐居起来疗伤罢了。");
		PlayerPerform("pause", 17);

		PlayerPerform("say", "呵呵，蒲苇韧如丝，磐石无转移。两年了，想不到你们还是老样子！");
		PlayerPerform("pause", 16);
		PlayerPerform("aggress");
		PlayerPerform("faceto",c6);
		PlayerPerform("say", "（竟然是石群！）仿佛梦魂归帝所，问天语，殷勤问我归何处。");
		PlayerPerform("block", 0);
		PlayerPerform("pause", 11);
		PlayerPerform("say", "谁？！！");
		PlayerPerform("pause", 1);
		PlayerPerform("block", 1);
		
		Perform(c6, "faceto",c);
		
		AsPerform(c5, "say", "也就是说......一线天遗落的镖物在你手上？");
		Perform(c5, "pause", 56);
		AsPerform(c5, "say", "莫说相公痴，更有痴似相公者！");
		Perform(c5, "aggress");
		Perform(c5, "faceto",c);
		 Say(1,"提示：按下K键可以快速跳过剧情。");
		timer1 = now + 4;
			
		trg0 = 1;
		}
		}
		if (trg0 == 1)
		{
        int charId = GetAnyChar("player");
        int itemType = 4; // 道具类型， 1：武器，2：道具，4：VIP道具
        int itemId = 2; // 道具ID, 灵芝
        CharDropTempItem(charId, itemType, itemId); 
		trg0 = 2;
		timer0 = now + 63;//原本是63
		}
		
		if (trg0== 2)
		{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");	
		if(c5>0&&now>timer0)
		{		
ChangeBehavior(c5,"patrol",64);
ChangeBehavior(c6,"patrol",64);
RemoveNPC(c5);
RemoveNPC(c6);
		trg0 = 3;
		}
		}
		
	if(trg0 == 3)
	{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		
	if(c7>=0)
	{
	
		PlayerPerform("say", "不好，夜猫子现在不是我能对付的！（或许可以让这两个官差解围。）");
			PlayerPerform("pause", 20);
	
	AsPerform(c9, "say", "小子，把镖物和小命交出来！");
	ChangeBehavior(c9, "kill", player);
	Perform (c9, "use", 7);
	Perform(c9, "aggress");
	AsPerform(c9, "say", "嘻嘻嘻，我逮到你啦......");
	Perform(c9, "pause", 15);
	
	Perform(c8, "say", "那边有个不长眼的家伙，肯定知道些什么！");
	Perform(c8, "pause", 8);
	ChangeBehavior(c8, "kill", player);
	Say(1,"提示：可以将官差引至夜猫子处。");
	AsPerform(c8, "say", "别唱了别唱了，正好有任务在身，找找看吧！");
	Perform(c8, "pause", 25);
	
	ChangeBehavior(c7, "kill", player);
	AsPerform(c7, "say", "咦？刚才那个像飞贼一样的靓妹去哪了？爷还想爽一爽呢！");
	Perform(c7, "pause", 12);
	AsPerform(c7, "say", "只是因为在人群中多看了你一眼~却再也不能忘掉你容颜~");
	Perform(c7, "pause", 4);
	
	trg0 = 4;
	}
	}
	if(trg0 <= 4 && damn<=0)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		if(c3>0)
		{
			SetTarget(7, "char", c3);
			SetTarget(6, "char", c7);
			SetTarget(8, "char", c8);
			if(Distance(6, 7) < 150 or Distance(8, 7) < 150 )
			{
AsPerform(c3, "say", "救命啊！官差强抢民女啦！");
trg0 =5;
damn =1;
timer2 = now +3;
		    }
        }
}
	if(damn==1 && now>timer2)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		if(c3>0)
		{
		
RemoveNPC(c3);
damn =2;
		    
        }
}
if(trg0 == 4)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		if(c9>0)
		{
			SetTarget(0, "char", c);
			SetTarget(1, "char", c9);
			if(Distance(0, 1) < 150)
			{
			ChangeBehavior(c7, "kill", c9);
			ChangeBehavior(c8, "kill", c9);
			ChangeBehavior(c9, "wait");
			AsPerform(c9, "say", "嘿嘿嘿嘿，你看我像人还是像仙？");	
			Perform(c9, "pause", 8);
			
			AsPerform(c7, "say", "娘的，怎么是男的？贼眉鼠眼的，八成不是什么好东西，讨打！");
			Perform(c7, "pause", 11);
			AsPerform(c7, "say", "哈哈哈，宝贝儿，爷爷来喽！");	
			Perform(c7, "pause", 3);

            PlayerPerform("say", "此地不宜久留，或许还有其他人能够助我......");
            PlayerPerform("pause", 5);
            PlayerPerform("say", "（这两个人恐怕不是夜猫子的对手......）");
			PlayerPerform("pause", 10);
			PlayerPerform("say", "军爷，这边有飞贼！");
			SetTeam(c9, 0);
			trg0 = 5;
		    }
        }
}
		
if(trg2==0&&now>5)
		{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
			SetTarget(0, "char", c);
			SetTarget(9, "char", c2);
			if(Distance(0, 9) < 50)
			{
			timer4 = now + 2;
			trg2 = 1;
			trg7 = 1;
			}
			}

			
			if(trg2==1 && now>timer4)
		{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
			SetTarget(0, "char", c);
			SetTarget(1, "char", c9);
			SetTarget(2, "char", c2);
			if(Distance(0, 2) < 150 && trg0>=5)
			{
			
			AsPerform(c2, "say", "如果你能活着离开，你可以把消息带给他，但是你现在......");
			Perform(c2, "pause", 10);
			AsPerform(c2, "say", "有个气味和你很像的人或许有喜了，他“死”之前手筋被我挑了。");
			Perform(c2, "pause", 6);
			AsPerform(c2, "say", "我在想一件事。");
			Perform(c2, "pause", 5);
			AsPerform(c2, "say", "你今天不是来钓鱼的。");
			Perform(c2, "pause", 4);
			
			
			PlayerPerform("block", 0);
			PlayerPerform("pause", 5);
			PlayerPerform("say", "......!!!");
			PlayerPerform("pause", 10);
			PlayerPerform("say", "呵呵，是啊。");
			PlayerPerform("pause", 7);
			PlayerPerform("say", "又见面了。（此人定力高强，或许可助我......）");
			Perform(c, "faceto",c4);
			PlayerPerform("block", 1);
			trg2=2;timer4=now+25;
			trg8=3;
			SetTeam(c9, 0);
			}
			
			if(trg7==1 && trg2==1 && trg0<5)
			{
			AsPerform(c2, "say", "钓鱼要记得戴头盔。");
			trg7=2;
			}
		}
			
		if(trg0==5)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		c10 = GetChar("易潜龙");
if(trg0==5&&!IsAlive(c7)&&!IsAlive(c8))
{
ChangeBehavior(c9, "kill", c);
trg0=6;
}
}	

if(trg2==2)
{
SetTarget(1, "char", player);
SetTarget(8, "waypoint", 250);

		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetAnyChar("夜猫子");
		c10 = GetChar("易潜龙");
	SetTarget(0, "char", c);
	SetTarget(2, "char", c2);
			if(Distance(0, 2) < 150 && trg0>=5&&trg8==0)
			{
			
			AsPerform(c2, "say", "如果你能活着离开，你可以把消息带给他，但是你现在......");
			Perform(c2, "pause", 10);
			AsPerform(c2, "say", "有个气味和你很像的人或许有喜了，他“死”之前手筋被我挑了。");
			Perform(c2, "pause", 6);
			AsPerform(c2, "say", "我在想一件事。");
			Perform(c2, "pause", 5);
			AsPerform(c2, "say", "你今天不是来钓鱼的。");
			Perform(c2, "pause", 4);
			
			
			PlayerPerform("block", 0);
			PlayerPerform("pause", 5);
			PlayerPerform("say", "......!!!");
			PlayerPerform("pause", 10);
			PlayerPerform("say", "呵呵，是啊。");
			PlayerPerform("pause", 7);
			PlayerPerform("say", "又见面了。（此人定力高强，或许可助我......）");
			Perform(c, "faceto",c4);
			PlayerPerform("block", 1);
			timer4=now+25;
			SetTeam(c9, 0);
			trg8=1;
			}
if(c2>=0&&now>timer4&&c10<0)
{

SetTeam(c10, 1);
ChangeBehavior(c2, "Kill",c);
ChangeBehavior(c2, "attacktarget", 1, 8);
AsCharAttack(c2, "bb"); // 新版
AsPerform(c2, "say", "......必须死！");
SetTeam(c2, 1);
trg2 = 3;
}
if(c2>=0&&!IsAlive(c9))
{
SetTeam(c2, 1);
ChangeBehavior(c2, "Kill",c);
ChangeBehavior(c10, "Kill",c);
ChangeBehavior(c2, "attacktarget", 1, 8);
AsCharAttack(c2, "bb"); // 新版
AsPerform(c2, "say", "......必须死！");
SetTeam(c10, 1);
trg2 = 3;
}
if(c2>=0&&now>timer4&&IsAlive(c10)&&trg8==1)
{
SetTeam(c2, 1);
ChangeBehavior(c2, "Kill",c);
ChangeBehavior(c10, "Kill",c);
ChangeBehavior(c2, "attacktarget", 1, 8);
AsCharAttack(c2, "bb"); // 新版
AsPerform(c2, "say", "......必须死！");
SetTeam(c10, 1);
trg2 = 3;
}
}	
	
if(trg3 == 0)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		if(c3>0)
		{
			SetTarget(0, "char", c);
			SetTarget(4, "char", c3);
			if(Distance(0, 4) < 150)
			{
			 Say(1,"提示：在官差遇到麻烦之前，“浣纱女”遇到官差会跑路。");
			ChangeBehavior(c3, "follow", c);
			AsPerform(c3, "say", "谢谢你替我解围，你是个好人，姑奶奶今天就跟你混了！");
			Perform(c3, "pause", 1);
			Perform(c3, "faceto",c);
			trg3 =1;
		    }
        }
}
if(trg5 == 0)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		if(c4>0)
		{
			SetTarget(0, "char", c);
			SetTarget(5, "char", c4);
			SetTarget(6, "char", c3);
			if(Distance(0, 5) < 50)
			{
			ChangeBehavior(c4, "follow", c);
			AsPerform(c4, "say", "这个位置全是肥鲶鱼哇！话说我该怎么出去呢......兄弟，快救救我！我肯定会报答你的！");
			Perform(c4, "pause", 1);
			Perform(c4, "faceto",c);
			trg5 =1;
			timer5 = now + 10;
		    }
			if(Distance(5, 6) < 1900)
			{
			ChangeBehavior(c4, "follow", c);
			AsPerform(c4, "say", "这个位置全是肥鲶鱼哇！话说我该怎么出去呢......兄弟，快救救我！我肯定会报答你的！");
			Perform(c4, "pause", 10);
			
			ChangeBehavior(c3, "patrol",167,264);
			Perform(c3, "say", "咦，狗洞那里有个人？");
			Perform(c3, "pause", 1);
			Perform(c3, "aggress");
			Perform(c3, "faceto",c4);
			trg5 =1;
			timer5 = now + 28;
		    }
        }
}
if(trg5 == 1)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		if(c4>0 && now>timer5)
		{			
            RemoveNPC(c4);
			trg5 =2;			 
		 
        }
}
if(trg5 == 2)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		if(c>0)
		{
		AddNPC("npc13_11");
		trg5 =3;
        }
}
if(trg5 == 3)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetAnyChar("夜猫子");
		c10 = GetAnyChar("易潜龙");
		if(c10>0&&trg2<=2)
		{
		Perform(c10, "aggress");
		ChangeBehavior(c3, "follow",c);
		ChangeBehavior(c10, "kill", c9);
		AsPerform(c10, "say", "你放出来了一条恶魔！现在......我......自由啦！");		
		trg5 =4;
		trg2 =2;
		SetTeam(c10,2);
        }
		if(c10>0&&trg2>=3)
		{
		ChangeBehavior(c10, "kill", c9);
		Perform(c10, "aggress");
		ChangeBehavior(c3, "follow",c);
		SetTeam(c10,2);
		AsPerform(c10, "say", "你放出来了一条恶魔！现在......我......自由啦！");		
		trg5 =4;
		trg2=4;
        }
}
if(trg2 >= 3 && trg5 == 4)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		c10 = GetChar("易潜龙");
		if(c10>0)
		{
			SetTarget(0, "char", c);
			SetTarget(2, "char", c2);
			SetTarget(5, "char", c10);
			
			if(Distance(2, 5) < 450)
			{
			ChangeBehavior(c10, "kill", c);			
			Perform(c10, "pause", 1);
			Perform(c10, "faceto",c);
			timer5 = now + 20;
			Perform(c10, "say", "韩棠，我来助你一臂之力！");
			trg5=5;
		    }
        }
}
if(trg2 == 3)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		c10 = GetChar("易潜龙");
		c11 = GetChar("无名.甲");
		c12 = GetChar("无名.乙");
		if(c2>0)
		{
		AddNPC("npc13_08");
		AddNPC("npc13_10");
		AddNPC("npc13_12");
		AddNPC("npc13_13");
trg2 =4; timer3=now + 5;
		}
}
if(trg2 == 4&& now>timer3)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetChar("唐孔雀");
		c6 = GetChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		c10 = GetChar("易潜龙");
		c11 = GetChar("无名.甲");
		c12 = GetChar("无名.乙");
		if(c2>0)
		{
        ChangeBehavior(c5, "Kill", c2);
		ChangeBehavior(c6, "Kill", c2);
		ChangeBehavior(c11, "Kill", c2);
		ChangeBehavior(c12, "Kill", c2);
		ChangeBehavior(c7, "Kill", c2);
		ChangeBehavior(c8, "Kill", c2);
		ChangeBehavior(c2, "wait");
		AsCharAttack(c2, "bb"); // 新版		
		PlayerPerform("say", "（韩棠......此人武功极高，石群恐怕不是对手，我得助石群一臂之力！但我自己的状态......）");
		PlayerPerform("pause", 40);
		SetDisplayName(c, "孟星魂");
		SetDisplayName(c2, "韩棠");
		AsSay(6,"韩棠，今日你必死无疑！");
		trg2 =5;
		timer3=now + 8;
		}
}
if(trg2 == 5 && now>timer3)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		c10 = GetChar("易潜龙");
		c11 = GetChar("无名.甲");
		c12 = GetChar("无名.乙");
		if(c2>0)
		{
        ChangeBehavior(c5, "kill", c2);
		ChangeBehavior(c6, "kill", c2);
		ChangeBehavior(c11, "kill", c2);
		ChangeBehavior(c12, "kill", c2);
		ChangeBehavior(c7, "kill", c2);
		ChangeBehavior(c10, "kill", c2);
		ChangeBehavior(c8, "kill", c2);
		ChangeBehavior(c9, "kill", c);
		ChangeBehavior(c3, "follow", c);
		AsPerform(c12, "say", "碍事的钓鱼佬赶快滚！");
		CharSetBaseAttrib(10, CharAttrib_Attack, 80);
		Perform (c3, "use", 16);
		Perform (c7, "use", 16);
		Perform (c8, "use", 16);
		Perform (c11, "use", 16);
		Perform (c12, "use", 16);
		Perform (c5, "use", 16);
		Perform (c6, "use", 16);
		 AsCharAttack(c2, "bb"); // 新版
		trg2 =6;
		timer6 = now+15;
		}
}
if(trg2 == 6 && now> timer3)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		c10 = GetChar("易潜龙");
		c11 = GetChar("无名.甲");
		c12 = GetChar("无名.乙");
		if(c2>0)
		{
        ChangeBehavior(c5, "kill", c2);
		ChangeBehavior(c6, "kill", c2);
		ChangeBehavior(c11, "kill", c2);
		ChangeBehavior(c12, "kill", c2);
		ChangeBehavior(c7, "kill", c2);
		ChangeBehavior(c10, "kill", c);
		ChangeBehavior(c8, "kill", c2);
		ChangeBehavior(c9, "kill", c);
		ChangeBehavior(c3, "follow", c);
		AsPerform(c12, "say", "碍事的钓鱼佬赶快滚！");
		CharSetBaseAttrib(10, CharAttrib_Attack, 80);
		Perform (c3, "use", 16);
		Perform (c7, "use", 16);
		Perform (c8, "use", 16);
		Perform (c11, "use", 16);
		Perform (c12, "use", 16);
		Perform (c5, "use", 16);
		Perform (c6, "use", 16);
		AsCharAttack(c2, "bb");
		trg2 =5;timer3 = now + 60;	
PlayerPerform("say", "（提示石群和唐孔雀不能同时倒下！T键救治周围倒下的队友）");	
PlayerPerform("pause",10);	
		PlayerPerform("say", "（倒下的其他人或许也是助拳者，我可以施以援手......）");
		PlayerPerform("pause",10);
			PlayerPerform("say", "（夜猫子和韩棠的立场不同，韩棠或许会连着夜猫子一起对付......）");
			PlayerPerform("pause",10);
		}
}

if(trg2 >= 5 && now> timer6)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		c10 = GetChar("易潜龙");
		c11 = GetChar("无名.甲");
		c12 = GetChar("无名.乙");
		if(c2>0&&!IsAlive(c5)&&!IsAlive(c6))
		{		
GameOver(1);
		trg2 =5;timer6 = now + 15;
		}
}

 if(trg2 >= 5 && trg13 >= 0&&now>timer6)
{
		c = GetChar("player");
		c2 = GetChar("钓鱼佬.甲");
		c3 = GetChar("浣纱女");
		c4 = GetChar("钓鱼佬.丙");
		c5 = GetAnyChar("唐孔雀");
		c6 = GetAnyChar("石群");	        
		c7 = GetChar("官差﹒甲");	
		c8 = GetChar("官差﹒乙");	
		c9 = GetChar("夜猫子");
		c10 = GetChar("易潜龙");
		c11 = GetChar("无名.甲");
		c12 = GetChar("无名.乙");
		if(c2>0)
		{
        ChangeBehavior(c5, "kill", c2);
		ChangeBehavior(c6, "kill", c2);
		ChangeBehavior(c11, "kill", c2);
		ChangeBehavior(c12, "kill", c2);
		ChangeBehavior(c7, "kill", c2);
		ChangeBehavior(c10, "kill", c);
		ChangeBehavior(c8, "kill", c2);
		ChangeBehavior(c9, "kill", c);
		ChangeBehavior(c3, "follow", c);
		 AsCharAttack(c2, "bb"); // 新版
		trg2 =6; timer6 = now + 15;
		}
}
}
void OnCharacterReborn(int charId){
   Perform (charId, "use", 1); 
}
