function battle_ai043(npcID)  -- 眼魔
	local sg=flag.GetBattleValue(12700)
	if sg==0 then
		local ar=battle.GetRndNumber(1,10)
		if ar==1 then
			flag.SetBattleValue(12700,1)
			ui.Popo_Auto(86794,1,npcID,3,0) --竟然有人闯进幻境了吗？咦，还有个蜀山弟子？--竟然有人闯进幻境了吗？咦，还有个蜀山弟子？
			global.WaitForPopo()
		elseif ar==2 or ar==10 then
			flag.SetBattleValue(12700,1)
			ui.Popo_Auto(86795,1,npcID,3,0) --你们熟悉五灵的相生相克吗？不熟的话最好去温习一下，不然待会得吃苦头了~--你们熟悉五灵的相生相克吗？不熟的话最好去温习一下，不然待会得吃苦头了~
			global.WaitForPopo()
		elseif ar==3 then
			flag.SetBattleValue(12700,1)
			ui.Popo_Auto(86796,1,npcID,3,0) --水克火，火克雷，雷克风……风生火，火生土，土生……生……生啥？--水克火，火克雷，雷克风……风生火，火生土，土生……生……生啥？
			global.WaitForPopo()
		end
	end 
	
	n=flag.GetBattleValue(12043)
    if n~=4 then
		a=battle.GetRndNumber(1,10)
		if a>=1 and a<=4 then
			players = {}               --用以储存场上玩家没有被昏睡的
			i=1
			for p=0,9,1 do
				pid=2^p
				if player.IsPlayerInBattle(pid)==1 and battle.CheckPlayerStat(pid,5)==0 and player.GetHP(pid,0)~=0 and battle.CheckPlayerStat(pid,28)==0 then
					players[i]=pid
					i=i+1
				end
			end
			j=#players
			if j>1 then
				o = battle.GetRndNumber(1,j)
				id = players[o]
				if id==128 and battle.CheckNpcStat(npcID,734)==1 and battle.CheckPlayerStat(128,735)==1 and battle.GetRndNumber(1,10)<=3 then
                    battle.SetDamageScale(9999)
					player.RemoveStat(0,64,731)
			    end
				battle.AtkToPlayer(id,1)     --普通攻击
				--if id==128 and battle.CheckNpcStat(npcID,734)==1 and battle.CheckPlayerStat(128,735)==1 and battle.GetRndNumber(1,10)<=3 then
                --    player.AddStat(0,128,9000,29,1)
				--    player.RemoveStat(0,64,731)
			    --end
				n=n+1
				flag.SetBattleValue(12043,n)
			elseif j==1 then
				id = players[1]
				if id==128 and battle.CheckNpcStat(npcID,734)==1 and battle.CheckPlayerStat(128,735)==1 and battle.GetRndNumber(1,10)<=3 then
                    battle.SetDamageScale(9999)
					player.RemoveStat(0,64,731)
			    end
				battle.AtkToPlayer(id,1)     --普通攻击	
				n=n+1
				flag.SetBattleValue(12043,n)
			else
				minhp=9999
				for p=0,9,1 do   --获取血最少的玩家ID
					pid=2^p	
					if player.IsPlayerInBattle(pid)==1 and player.GetHP(pid,0)~=0 then
						hp = player.GetHP(pid,0)
						minhp = math.min(minhp,hp)
						if minhp==hp then
							id=pid
						end
					end	
				end
				if id==128 and battle.CheckNpcStat(npcID,734)==1 and battle.CheckPlayerStat(128,735)==1 and battle.GetRndNumber(1,10)<=3 then
                    battle.SetDamageScale(9999)
					player.RemoveStat(0,64,731)
			    end
				battle.AtkToPlayer(id,1)     --普通攻击
				n=n+1
				flag.SetBattleValue(12043,n)
			end
		else
			players = {}               --用以储存场上玩家没有被昏睡的
			i=1
			for p=0,9,1 do
				pid=2^p
				if player.IsPlayerInBattle(pid)==1 and battle.CheckPlayerStat(pid,5)==0 and player.GetHP(pid,0)~=0 and battle.CheckPlayerStat(pid,28)==0 then
					players[i]=pid
					i=i+1
				end
			end
			j=#players
			if j>1 then
				o = battle.GetRndNumber(1,j)
				id = players[o]
				battle.MagicToPlayer(id,1038,1)   --单体法术
			elseif j==1 then
				id = players[1]
				battle.MagicToPlayer(id,1038,1)   --单体法术	  
			else
				minhp=9999
				for p=0,9,1 do   --获取血最少的玩家ID
					pid=2^p	
					if player.IsPlayerInBattle(pid)==1 and player.GetHP(pid,0)~=0 then
						hp = player.GetHP(pid,0)
						minhp = math.min(minhp,hp)
						if minhp==hp then
							id=pid
						end
					end	
				end
				if id==128 and battle.CheckNpcStat(npcID,734)==1 and battle.CheckPlayerStat(128,735)==1 and battle.GetRndNumber(1,10)<=3 then
                    battle.SetDamageScale(9999)
					player.RemoveStat(0,64,731)
			    end
				battle.AtkToPlayer(id,1)     --普通攻击
			end
		end

	else
		id = battle.GetRndPlayer()
		battle.MagicToPlayer(id,1038,1)
		flag.SetBattleValue(12043,0)
	end
end