function  battle_bai035(npcID)--魔化瑕

	
	local wqx=flag.GetBattleValue(33037)--文星反转回合数
	if wqx>0 then
	flag.SetBattleValue(33037,wqx-1)
	if wqx-1==3 then
	flag.SetBattleValue(33038,2)--标记下一回合说话
	end
	    if wqx==3 and flag.GetBattleValue(33038)==2 then
		flag.SetBattleValue(33038,1)--屏蔽说话，标记觉醒阶段
		
		npc.ChangeDef(90000,-1200)
		npc.ChangeMagicDef(90000,0,-110)
		npc.ChangeMagicDef(90000,1,-110)
		npc.ChangeMagicDef(90000,2,-110)
		npc.ChangeMagicDef(90000,3,-110)
		npc.ChangeMagicDef(90000,4,-110)
		npc.ChangeMagicDef(90000,5,-110)
		npc.ChangeMagicDef(90000,7,-110)
		
		global.EnableSkipDialog(0)
        ui.Dialog_t(87016,529,1,0,1,0,6.5)--混蛋！把瑕还给我！瑕——
		--wt(3)
		global.EnableSkipDialog(1)
		ui.Message(170710)--夏侯瑾轩恨意觉醒
		--wt(2)
        end
		if wqx==1 and flag.GetBattleValue(33038)==1 then
		flag.SetBattleValue(33038,0)--结束
		
		npc.ChangeDef(90000,1200)
		npc.ChangeMagicDef(90000,0,110)
		npc.ChangeMagicDef(90000,1,110)
		npc.ChangeMagicDef(90000,2,110)
		npc.ChangeMagicDef(90000,3,110)
		npc.ChangeMagicDef(90000,4,110)
		npc.ChangeMagicDef(90000,5,110)
		npc.ChangeMagicDef(90000,7,110)
		
		global.EnableSkipDialog(0)
        ui.Dialog_t(170721,516,1,0,1,0,2.5)--从来尽是愁，千古空留恨……
		--wt(4)
		global.EnableSkipDialog(1)
		
		end
	end
	global.Print(wqx)
	
	local sg=flag.GetBattleValue(16222)	--语言提示打法
	
	m=flag.GetBattleValue(16001)   --阶段控制
	n=flag.GetBattleValue(16002)   --临时回合计数
	n=n+1
	HP1=flag.GetBattleValue(16003)   
	HP2=battle.GetSelfHP(2)
	
	if HP2>60 then
		if m==0 and HP2>85 then
			flag.SetBattleValue(16002,n)
			if n%4==3 then
				if battle.CheckNpcPlace(2)==1 and battle.CheckNpcPlace(3)==1 then
					battle.BeginSummon()
					battle.AddNpc(6047,2)
					battle.AddNpc(6047,3)
				elseif battle.CheckNpcPlace(2)==1 and battle.CheckNpcPlace(3)==0 then
					battle.BeginSummon()
					battle.AddNpc(6047,2)
				elseif battle.CheckNpcPlace(2)==0 and battle.CheckNpcPlace(3)==1 then
					battle.BeginSummon()
					battle.AddNpc(6047,3)
				else
					id=battle.GetPlaceNpcID(2)
					battle.MagicToNpc(id,307,1)
				end
			elseif n%4==2 then
				if battle.CheckNpcPlace(2)==0 then
					id=battle.GetPlaceNpcID(2)
					battle.MagicToNpc(id,307,1)
				elseif battle.CheckNpcPlace(3)==0 then
					id=battle.GetPlaceNpcID(3)
					battle.MagicToNpc(id,307,1)
				else
					a=battle.GetRndNumber(1,10)
					if a>=1 and a<=4 then
						if wqx>3 then
				        battle.SetSkillScale(-100)
					    elseif wqx>0 and wqx<=3 then
					    battle.SetSkillScale(150)
					    end
						battle.MagicToPlayer(0,302,1)
					elseif a>=5 and a<=8 then
						if wqx>3 then
				        battle.SetSkillScale(-100)
					    elseif wqx>0 and wqx<=3 then
					    battle.SetSkillScale(150)
					    end
						battle.MagicToPlayer(0,304,1)
					else
						if wqx>3 then
				        battle.SetSkillScale(-100)
					    elseif wqx>0 and wqx<=3 then
					    battle.SetSkillScale(150)
					    end
						battle.MagicToPlayer(0,305,1)
					end
				end
			else
				a=battle.GetRndNumber(1,10)
				if a>=1 and a<=4 then
					if wqx>3 then
				    battle.SetSkillScale(-100)
					elseif wqx>0 and wqx<=3 then
					battle.SetSkillScale(150)
					end
					battle.MagicToPlayer(0,302,1)
				elseif a>=5 and a<=8 then
					if wqx>3 then
				    battle.SetSkillScale(-100)
					elseif wqx>0 and wqx<=3 then
					battle.SetSkillScale(150)
					end
					battle.MagicToPlayer(0,304,1)
				else
					if wqx>3 then
				    battle.SetSkillScale(-100)
					elseif wqx>0 and wqx<=3 then
					battle.SetSkillScale(150)
					end
					battle.MagicToPlayer(0,305,1)
				end
			end
		elseif m==0 and HP2<=85 then
				if battle.CheckNpcPlace(2)==0 then
					id=battle.GetPlaceNpcID(2)
					battle.MagicToNpc(id,307,1)
				elseif battle.CheckNpcPlace(3)==0 then
					id=battle.GetPlaceNpcID(3)
					battle.MagicToNpc(id,307,1)
				else
					battle.BeginSummon()
					battle.AddNpc(6047,2)
					battle.AddNpc(6047,3)
				end
				
		elseif m==1 then
			global.CreateCameraSE(90000,3878,1)
			battle.Skip()
			flag.SetBattleValue(16001,2)
		elseif m==2 then
			--给镜头，特效，升空
			
			
			--[[if HP1-HP2>3 then
				--落地特效、受伤
				flag.SetBattleValue(16001,2)
			
			elseif n~=5 then
				flag.SetBattleValue(16002,n)
				
			else
				flag.SetBattleValue(16002,0)
			end]]
			flag.SetBattleValue(16002,n)
			if n%3==0 then
				if wqx>3 then
				battle.SetSkillScale(-100)
				elseif wqx>0 and wqx<=3 then
				battle.SetSkillScale(150)
				end
				battle.MagicToPlayer(0,306,1)
			else
				a=battle.GetRndNumber(1,10)
				if a>=1 and a<=6 then
					if wqx>3 then
				    battle.SetSkillScale(-100)
				    elseif wqx>0 and wqx<=3 then
				    battle.SetSkillScale(150)
				    end
					battle.MagicToPlayer(0,303,1)
				else
					if wqx>3 then
				    battle.SetSkillScale(-100)
				    elseif wqx>0 and wqx<=3 then
				    battle.SetSkillScale(150)
				    end
					battle.MagicToPlayer(0,305,1)
				end
			end
		
	
		end
	else
	
		camera.ChangeCameraStatic(2449,100,2258,2477,59,2345)
		global.Wait(0.5)
		player.SetAnim(1,226)
		ui.Dialog(87014,528,0,0,1,0)--可恶……瑕……难道我……连最后的安宁，都无法给你吗……
		
		global.Wait(0.5)
		ui.Dialog(87015,514,0,90000,0,0)--瑾轩，让你死在你最爱的女孩手中，就当是我对你最后的慈悲吧，呵呵呵……
		
		
		global.Wait(1)
		player.SetAnim(1,242)
		ui.Dialog(87016,529,0,0,1,0)--混蛋！把瑕还给我！瑕——
		global.Wait(0.5)
		--effect.FadeOut(1,0.7)
		--global.Wait(1.4)
		
		battle.End(120000)
	end
end