function battle_sai027(npcID)       --蝶精

	local hp=battle.GetSelfHP(2)
	local n=flag.GetBattleValue(16002)
	
	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 hp>=50 then
		if n~=4 then
			local a=battle.GetRndNumber(1,10)
			if a>=1 and a<=4 then
				n=n+1
				flag.SetBattleValue(16002,n)
				id=battle.GetRndPlayer()
				battle.MagicToPlayer(id,1510,1)
			elseif a>=5 and a<=8 then
				n=n+1
				flag.SetBattleValue(16002,n)
				id=battle.GetRndPlayer()
				battle.MagicToPlayer(id,1511,1)


			else
				flag.SetBattleValue(16002,0)
				id=battle.GetRndPlayer()
				battle.MagicToPlayer(id,1512,1)

			end
		else
			flag.SetBattleValue(16002,0)
			id=battle.GetRndPlayer()
			battle.MagicToPlayer(id,1512,1)
		end
		
	else
		
		if battle.CheckNpcPlace(4)==1 or battle.CheckNpcPlace(5)==1 or battle.CheckNpcPlace(6)==1 or battle.CheckNpcPlace(7)==1 then
			battle.BeginSummon()
			if battle.CheckNpcPlace(4)==1 then
				battle.AddNpc(10027,4)
				global.Wait(3)
				battle.Skip()
				return
			end
			if battle.CheckNpcPlace(5)==1 then
				battle.AddNpc(10027,5)
				global.Wait(3)
				battle.Skip()
				return
			end
			if battle.CheckNpcPlace(6)==1 then	
				battle.AddNpc(10027,6)
				global.Wait(3)
				battle.Skip()
				return
			end
			if battle.CheckNpcPlace(7)==1 then	
				battle.AddNpc(10027,7)
				global.Wait(3)
				battle.Skip()
				return
			end
		else
			if n~=4 then
				local a=battle.GetRndNumber(1,10)
				if a>=1 and a<=4 then
					n=n+1
					flag.SetBattleValue(16002,n)
					id=battle.GetRndPlayer()
					battle.MagicToPlayer(id,1510,1)
				elseif a>=5 and a<=8 then
					n=n+1
					flag.SetBattleValue(16002,n)
					id=battle.GetRndPlayer()
					battle.MagicToPlayer(id,1511,1)


				else
					flag.SetBattleValue(16002,0)
					id=battle.GetRndPlayer()
					battle.MagicToPlayer(id,1512,1)

				end
			else
				flag.SetBattleValue(16002,0)
				id=battle.GetRndPlayer()
				battle.MagicToPlayer(id,1512,1)
			end
		end
	end
end