
/*
作者：『流星奇迹』_兵兵  

QQ：765739946 / 1529869085

Q群：40816428 / 87877010

QQ邮箱：765739946@qq.com / 1529869085@qq.com

流星网：www.23yh.cn / www.yfzz.net / www.lx766.com
*/ 
npcztxs(int id, int hp, int hpf, int luckflag)
{
	if(luckflag>=0){Say(id, "生命值: ", hp/10, " 生命恢复: ", hpf, "秒");}
	else           {Say(id, "生命值: ", hp/10, " 生命恢复: ", hpf, "秒");}

	return 0;
}
npcztxs1(int id, int hp, int luckflag)
{
	if(luckflag>=0){Say(id, "生命值: ", hp/10, "点");}
	else           {Say(id, "生命值: ", hp/10, "点");}

	return 0;
}
int lxqj_bb;
int lxqj_b0;

int zong0;
int zong1;
int zong2;
int zong3;
int snj0;
int snj1;
int snj2;
int snj3;
int i;
int zj;
int lxsj;
int lx_bb;
int lxqjsj;
int player;
int gameover;
int c1; int ca1;            
int c2; int ca2;  
int c3; int ca3;
zanting(int playerId) // 玩家 && NPC暂停
{
	int i;

	PlayerPerform("pause",1000);
	PlayerPerform("block", 1);
	for(i=3; i<=16; i++) {Perform(i, "pause", 1000);}

	return 0;
}	       
npcsiwang(int startId, int stopId)
{
	int i;
	int allys = 0;
	int enemys = 0;
	int anys = 0;
	int dieds = 0;
	int g_tmpReturn;

	for(i=startId; i<=stopId; i++)
	{
		if(GetTeam(i)==0)		{anys++;if(GetHP(i)<=0){dieds++;}}
		if(GetTeam(i)==1 && GetHP(i)>0)	{allys++;}
		if(GetTeam(i)==2)		{enemys++;if(GetHP(i)<=0){dieds++;}}
	}

	if(anys+enemys <= dieds)
	{
		g_tmpReturn = 1;
	}
	else
	{
		g_tmpReturn = 0;
	}
	return g_tmpReturn-0;
}
npclikai1(int startId, int stopId)
{
	int i;
	int g_tmpReturn = 0;

	for(i=startId; i<=stopId; i++)
	{
		if(GetTeam(i)==1 && GetHP(i)<=0)
		{
			if(GetMaxHP(i) > 0)
			{
				RemoveNPC(i);
				g_tmpReturn ++;
			}
		}
	}

	return g_tmpReturn-0;
}

npclikai2(int startId, int stopId)
{
	int i;
	int g_tmpReturn = 0;

	for(i=startId; i<=stopId; i++)
	{
		if((GetTeam(i)==2 || GetTeam(i)==0) && GetHP(i)<=0)
		{
			if(GetMaxHP(i) > 0)
			{
				RemoveNPC(i);
				g_tmpReturn ++;
			}
		}
	}

	return g_tmpReturn-0;
}

npcrenshu1(int startId, int stopId)
{
	int i;
	int ret = 0;
	for(i=startId; i<stopId; i++)
	{
		if(GetTeam(i)==1)
		{
			ret ++;
		}
	}
	return ret-0;
}
npcrenshu2(int startId, int stopId) 
{
	int i;
	int ret = 0;
	for(i=startId; i<stopId; i++)
	{
		if((GetTeam(i)==2 || GetTeam(i)==0))
		{
			ret ++;
		}
	}
	return ret-0;
}

julipanduan(int k1,int k2)  // 距离判断
{
   SetTarget(0, "char", k1);
   SetTarget(1, "char", k2);
   return Distance(0,1);
}
daodadidian(int man,int place)  // 到达地点
{
   SetTarget(0, "char", man);
   SetTarget(1, "waypoint", place);
   return Distance(0,1);
}

zhidingdidian(int id,int fx)     // 指定地点奔跑
{
	SetTarget(0, "waypoint", fx);
	ChangeBehavior(id, "attacktarget", 0);
}
shenghuarenwuxuanze() 
{
        int Model;
	int gh = Rand(10);

	if(gh==0){Model=3;}
	if(gh==1){Model=7;}
	if(gh==2){Model=9;}
	if(gh==3){Model=10;}
	if(gh==4){Model=11;}
	if(gh==5){Model=14;}
	if(gh==6){Model=2;}
	if(gh==7){Model=18;}
	if(gh==8){Model=100;}
	if(gh==9){Model=922;}

	return Model-0;
}
renwushengming1()
{
	int hp=Rand(10);

	if(hp==0){hp=100;}
	if(hp==1){hp=200;}
	if(hp==2){hp=300;}
	if(hp==3){hp=400;}
	if(hp==4){hp=500;}
	if(hp==5){hp=600;}
	if(hp==6){hp=700;}
	if(hp==7){hp=800;}
	if(hp==8){hp=999;}
	if(hp==9){hp=2000;}
	return hp-0;
}
renwushengming2()
{
	int hp=Rand(5);

	if(hp==0){hp=500;}
	if(hp==1){hp=1000;}
	if(hp==2){hp=1500;}
	if(hp==3){hp=2000;}
	if(hp==4){hp=2500;}
	return hp-0;
}
renwushengming3()
{
	int hp=Rand(5);

	if(hp==0){hp=1000;}
	if(hp==1){hp=2000;}
	if(hp==2){hp=3000;}
	if(hp==3){hp=4000;}
	if(hp==4){hp=5000;}
	return hp-0;
}
npcggjwuqi()
{

	int weapon;
	int lxqj = Rand(5);
	if(lxqj==0){weapon=3;}
	if(lxqj==1){weapon=12;}
	if(lxqj==2){weapon=21;}
	if(lxqj==3){weapon=30;}
	if(lxqj==4){weapon=39;}	
	return weapon-0;
}
jiangshixuanze()
{
	int model;
	int tmp = Rand(10);
	if(tmp==0){model=1;} // 母体僵尸. 小
	if(tmp==1){model=17;}// 母体僵尸. 大
	if(tmp==2){model=30;}// 混血护士	
	if(tmp==3){model=31;}// 小僵尸. 孟
	if(tmp==4){model=32;}// 威猛僵尸
	if(tmp==5){model=33;}// 憎恶屠夫
	if(tmp==6){model=34;}// 僵尸.小
	if(tmp==7){model=35;}// 豹子精	
	if(tmp==8){model=917;}// 骷颅精
	if(tmp==9){model=919;}// 巫蛊术尸
	return model-0;
}
jiangshishengming(int model)
{
	int hp;
	if(model==1){hp=2000;}
	if(model==17){hp=3000;}
	if(model==30){hp=5000;}
	if(model==31){hp=1500;}
	if(model==32){hp=5000;}
	if(model==33){hp=6000;}
	if(model==34){hp=1000;}
	if(model==35){hp=7000;}
	if(model==917){hp=7000;}
	if(model==919){hp=8000;}
	return hp-0;
}