function battle_bai036(npcID)--骨蛇--2灵魂

	
	
	
	local m=flag.GetBattleValue(16001)
	m=m+1
	flag.SetBattleValue(16001,m)
	local n=flag.GetBattleValue(16007)
	
	if battle.CheckPlayerStat(64,30)==1 then 
		if n==0 then
			flag.SetBattleValue(16007,1)
			battle.MagicToPlayer(64,322,1)
			battle.ActionTwice()
		
		elseif n==1 then
			flag.SetBattleValue(16007,2)
			player.RemoveStat(0,64,30)
			ui.Dialog(87019,633,0,0,64,0)--可恶，没有灵力再次使用越行之术了，下次一定得躲开。
			battle.Skip()
		elseif n==2 then
			battle.MagicToPlayer(0,297,1)
		end
	else
		if m%4==0 then
			global.CreateCameraSE(90000,3661)
			global.Wait(1.1)
			battle.QTE(16510,16513)
		else
			local a=battle.GetRndNumber(1,10)
			if a>=1 and a<=3 then
				battle.MagicToPlayer(64,295,1)
			elseif a>=4 and a<=6 then
				battle.MagicToPlayer(0,296,1)
			elseif a>=7 and a<=8 then
				battle.MagicToPlayer(0,297,1)
			else
				global.CreateCameraSE(90000,3661)
				global.Wait(1.1)
				battle.QTE(16510,16513)
			end
		end
	end
end