function skill039()

if global.GetGameStat()==2 then

p = flag.GetBattleValue(33032)
local pid=battle.GetActingPlayerID()
   id = player.GetTargetPlayer()
  if id~=-1 then
	player.Relive(id)
	if pid==1 and id==2 and player.GetHP(id,1)<=0 and (flag.GetValue(6001)>115 or flag.GetValue(33121)==2) then
	player.ChangeHP(1,0,id,100)
	else
    player.ChangeHP(1,0,id,50)
	end
	if p==2 then
        player.ChangeDP(0,id,5)
        player.CreateSE(id,3911)
		if id==32 then
		    player.AddStat(0,id,100,704,999)
		end
	end
	if p==1 and id==32 then
	    player.AddStat(0,id,100,703,999)
	end
  else
   id= player.GetTargetNpc()
    npc.ChangeHP(1,0,id,50)
  end

if p==2 then

--local pid=battle.GetActingPlayerID()
player.ChangeDP(0,pid,3)
player.CreateSE(pid,3911)

end

end
  
end