function  battle_bai021(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,-1000)
		npc.ChangeMagicDef(90000,0,-70)
		npc.ChangeMagicDef(90000,1,-70)
		npc.ChangeMagicDef(90000,2,-70)
		npc.ChangeMagicDef(90000,3,-70)
		npc.ChangeMagicDef(90000,4,-70)
		npc.ChangeMagicDef(90000,5,-70)
		npc.ChangeMagicDef(90000,7,-70)
		
		global.EnableSkipDialog(0)
        ui.Dialog_t(170709,529,1,0,1,0,2.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,1000)
		npc.ChangeMagicDef(90000,0,70)
		npc.ChangeMagicDef(90000,1,70)
		npc.ChangeMagicDef(90000,2,70)
		npc.ChangeMagicDef(90000,3,70)
		npc.ChangeMagicDef(90000,4,70)
		npc.ChangeMagicDef(90000,5,70)
		npc.ChangeMagicDef(90000,7,70)
		
		global.EnableSkipDialog(0)
        ui.Dialog_t(170721,516,1,0,1,0,2.5)--从来尽是愁，千古空留恨……
		--wt(4)
		global.EnableSkipDialog(1)
		
		end
	end
	if wqx>3 then
	flag.SetBattleValue(33039,1)
	else
	flag.SetBattleValue(33039,0)
	end
	global.Print(wqx)
	
	local n=flag.GetBattleValue(16002)  --魔球回合记录
	n=n+1
	flag.SetBattleValue(16002,n)
	
	hp1=flag.GetBattleValue(16010)  --魔球血量记录
	hp2=battle.GetSelfHP(2)
	flag.SetBattleValue(16010,hp2)
	x=flag.GetBattleValue(16008)  --魔球大小记录
	y=flag.GetBattleValue(16009)  --魔球位置记录
	
	if hp2<50 or hp2<hp1 then
		flag.SetBattleValue(19034,1)
	end
	
	if hp2>70 and hp1<=70 then
		npc.ScaleTo(npcID,150,2000)
		x=13
		flag.SetBattleValue(16008,x)
		global.Wait(2)
	elseif (hp2<=70 and hp2>=40) and (hp1>70 or hp1<40) then
		npc.ScaleTo(npcID,100,2000)
		x=10
		flag.SetBattleValue(16008,x)
		global.Wait(2)
	elseif hp2<40 and hp1>=40 then
		npc.ScaleTo(npcID,70,2000)
		x=7
		flag.SetBattleValue(16008,x)
		global.Wait(2)
	end
	
	if (n%4==0 or hp2>=hp1) and y~=3 then
		if y==2 then
			npc.MoveTo(npcID,2515,2508,1)
			npc.SetAtPos(npcID,2522,2687)
		elseif y==1 then
			npc.MoveTo(npcID,2515,2463,1)
			npc.SetAtPos(npcID,2522,2687)
		end
		y=y+1
		flag.SetBattleValue(16009,y)
	elseif hp1-hp2>=10 and y~=1 then
		if y==2 then
			npc.MoveTo(npcID,2515,2428,1)
			npc.SetAtPos(npcID,2522,2687)
		elseif y==3 then
			npc.MoveTo(npcID,2515,2463,1)
			npc.SetAtPos(npcID,2522,2687)
		end
		y=y-1
		flag.SetBattleValue(16009,y)		
	end
	
	z=x*(0.8+(y-1)/2)*10
	battle.SetSkillScale(z)
	local wqx=flag.GetBattleValue(33037)--文星反转回合数
	if wqx>3 then
	battle.SetSkillScale(-z)
	elseif wqx>0 and wqx<=3 then
	battle.SetSkillScale(z*1.5)
	end
	battle.MagicToPlayer(0,271,1)
	
end