function battle_sai037(npcID)       --欧阳慧
		t=flag.GetBattleValue(2001) --回合计数
 
	
		
		t=t+1
		flag.SetBattleValue(2001,t)

	
	    summon = 0
	    m=0
		
		d=flag.GetValue(40209)
		
	if battle.CheckPlayerStat(16,725)==1 then
	    for se=1,7,1 do
        if battle.CheckNpcPlace(se)==0 then
	    local tid=battle.GetPlaceNpcID(se)
		    if npc.GetHP(tid,1)>2 then
			   npc.CreateSE(tid,3844)--剑斩的特效
			   global.PlaySound(531,200)--音效插入
			   npc.ChangeHP(1,0,tid,-2)
			end
	    end
		end	
	wt(1.5)
	end
	
	for p=4,7,1        --是否有空位
	      do
	       x=battle.CheckNpcPlace(p)
	       --global.Print(x)
		   if x==1 then
	       summon = 1
		   end
	end
	
	for p=4,7,1        --雷球数
	      do
	       x=battle.CheckNpcPlace(p)
	       --global.Print(x)
		   if x==0 then
	       m=m+1
		   end
	end



	if  summon==1  and t%4==0 then
	
	
		if battle.CheckNpcPlace(2)==0 and battle.CheckNpcPlace(3)==0 then
		
			battle.BeginSummon()
				global.Wait(3) 
			battle.ActionTwice()
			for p=4,7,3        --召唤
			  do
			  y=battle.CheckNpcPlace(p)
			   if y==1 then
				  battle.AddNpc(10144,p)
				  global.Print(m)
				  --flag.SetBattleValue(2002,1)
			   end
			end
			battle.WaitToUpdate(1000)
			return
		
		
		
		elseif battle.CheckNpcPlace(2)==1 and battle.CheckNpcPlace(3)==1 then
			battle.BeginSummon()
				global.Wait(3) 
			battle.ActionTwice()
			for p=4,7,1        --召唤
			  do
			  y=battle.CheckNpcPlace(p)
			   if y==1 then
				  battle.AddNpc(10144,p)
				  global.Print(m)
				  --flag.SetBattleValue(2002,1)
			   end
			end
			battle.WaitToUpdate(1000)
			return
			
			
		else
			battle.BeginSummon()
				global.Wait(3) 
			battle.ActionTwice()
			for p=4,7,1        --召唤
			  do
			  y=battle.CheckNpcPlace(p)
			   if y==1 and m<3 then
				  battle.AddNpc(10144,p)
				  m=m+1				  
				  global.Print(m)
				  --flag.SetBattleValue(2002,1)
			   end
			end
			battle.WaitToUpdate(1000)
			return
			
		end
	end
	
	n=flag.GetBattleValue(15119)
	if n~=5 then
	    b=battle.GetRndNumber(1,4)
	    if m>=1 and b>=3 then

	      if m==1 then
	        battle.MagicToPlayer(0,1526,3)  --全体法术
	        return
	
	      elseif m==2 then
	        battle.MagicToPlayer(0,1527,3)  --全体法术
	        return
	
	      elseif m==3 then
	        battle.MagicToPlayer(0,1528,3)  --全体法术
	        return
	
	      elseif m==4 then
	        battle.MagicToPlayer(0,1529,3)  --全体法术
	        return
		  
	      end
	
	    else
	      a=battle.GetRndNumber(1,10)
		  if a>=1 and a<=4 then
		    n=n+1
		    flag.SetBattleValue(15119,n)
			if player.IsPlayerInBattle(4)==1 then
				if player.GetHP(4,0)>0 then
					id=4
				else
					id = battle.GetRndPlayer()
				end
			else
				id = battle.GetRndPlayer()
			end
		    battle.AtkToPlayer(id,1)    --(普通攻击)
	
		  elseif a>=5 and a<=8  then
		    n=n+1
		    flag.SetBattleValue(15119,n)
		    if player.IsPlayerInBattle(4)==1 then
				if player.GetHP(4,0)>0 then
					id=4
				else
					id = battle.GetRndPlayer()
				end
			else
				id = battle.GetRndPlayer()
			end
		    battle.MagicToPlayer(id,1524,1)   --技能 单
		  
		  else
		    if player.IsPlayerInBattle(4)==1 then
				if player.GetHP(4,0)>0 then
					id=4
				else
					id = battle.GetRndPlayer()
				end
			else
				id = battle.GetRndPlayer()
			end
		    battle.MagicToPlayer(id,1533,2)   --技能 2
	        flag.SetBattleValue(15119,0)
		  end
	    end
		
	else
	    b=battle.GetRndNumber(1,2)
	    if m>=1 and b==1 then

	        if m==1 then
	          battle.MagicToPlayer(0,1526,3)	 --全体法术
		      flag.SetBattleValue(15119,0)
	          return
	
	        elseif m==2 then
	          battle.MagicToPlayer(0,1527,3)	  --全体法术
		      flag.SetBattleValue(15119,0)
	          return
	
	        elseif m==3 then
	          battle.MagicToPlayer(0,1528,3)	 --全体法术
		      flag.SetBattleValue(15119,0)
	          return
	
	        elseif m==4 then
	          battle.MagicToPlayer(0,1529,3)	 --全体法术
		      flag.SetBattleValue(15119,0)
	          return
	        end
	
	    else
		    if player.IsPlayerInBattle(4)==1 then
				if player.GetHP(4,0)>0 then
					id=4
				else
					id = battle.GetRndPlayer()
				end
			else
				id = battle.GetRndPlayer()
			end
		    battle.MagicToPlayer(id,1533,2)
		    flag.SetBattleValue(15119,0)
	    end
	
	end


end