function battle_sai046(npcID) --冰泥

	
	n=flag.GetBattleValue(12011)
	m=flag.GetBattleValue(12805)
	l=flag.GetValue(12515)
	q=flag.GetBattleValue(12000)
	
	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 l==1 then
		if battle.CheckPlayerStat(battle.GetPlacePlayerID(4),0)==1 or battle.CheckPlayerStat(battle.GetPlacePlayerID(5),0)==1 or battle.CheckPlayerStat(battle.GetPlacePlayerID(6),0)==1 or battle.CheckPlayerStat(battle.GetPlacePlayerID(7),0)==1 then
			a=battle.GetRndNumber(1,10)
			if a>=1 and a<=5 then
				flag.SetBattleValue(12000,1)
				battle.MagicToPlayer(0,1099,4)
				battle.ActionTwice()
				return
			end	
		end
	end
	

	if m==1 and battle.CheckNpcStat(npcID,13)==0 then 
		battle.MagicToNpc(npcID,1096,1)   --自体法术
		flag.SetBattleValue(12805,0)
	     
	else
		if n~=3 then
		a=battle.GetRndNumber(1,10)
			if a>=1 and a<=4 then
				id = battle.GetRndPlayer()
				battle.AtkToPlayer(id,1)     --普通攻击 
				n=n+1
				flag.SetBattleValue(12022,n)
			elseif a>=5 and a<=7 then
				id = battle.GetRndPlayer()
				battle.SetDamageScale(1.5)
				battle.AtkToPlayer(id,2)     --2号攻击
				n=n+1
				flag.SetBattleValue(12022,n) 
			elseif a>=8 and a<=10 then
				id = battle.GetRndPlayer()
				battle.MagicToPlayer(0,1010,2)   --全体法术
				flag.SetBattleValue(12022,0)
				flag.SetBattleValue(12805,1)
			end

    else
		id = battle.GetRndPlayer()
		battle.MagicToPlayer(0,1010,2)   --全体法术
		flag.SetBattleValue(12022,0)
		flag.SetBattleValue(12805,1)
    end
  end
  
end