function battle_sai007(npcID) --魑魅魍魉
	m=flag.GetBattleValue(12950)
    n=flag.GetBattleValue(12960)
	
	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	

	if m~=3 and n==0 then
		a = battle.GetRndNumber(1,10)
		if a>=1 and a<=4 then
			m=m+1
			flag.SetBattleValue(12950,m)
			id = battle.GetRndPlayer()
			battle.AtkToPlayer(id,1)     --普通攻击
		elseif a>=5 and a<=7 then
			m=m+1
			flag.SetBattleValue(12950,m)
			id = battle.GetRndPlayer()
			battle.MagicToPlayer(id,1436,1)   --单体法术
		else
			flag.SetBattleValue(12950,0)
			battle.MagicToPlayer(0,1437,2)   --全体法术	
			b = battle.GetRndNumber(1,10)
			if b>=1 and b<=5 then
				flag.SetBattleValue(12960,1)				
				battle.ActionTwice()
			end
		end

	elseif m==3 and n==0 then
		flag.SetBattleValue(12950,0)
		battle.MagicToPlayer(0,1437,2)   --全体法术	
		b = battle.GetRndNumber(1,10)
		if b>=1 and b<=5 then
			flag.SetBattleValue(12960,1)
			battle.ActionTwice()
		end
	
	elseif n==1 then
		minhp=9999
		for p=0,9,1 do   --获取血最少的玩家ID
			pid=2^p	
			if player.IsPlayerInBattle(pid)==1 and player.GetHP(pid,0)~=0 and battle.CheckPlayerStat(pid,28)==0 then
				hp = player.GetHP(pid,0)
				minhp = math.min(minhp,hp)
				if minhp==hp then
					id=pid
				end
			end	
		end
		
		flag.SetBattleValue(12960,0)		
		battle.MagicToPlayer(id,1436,1)   --单体法术		

	end
end