function gen_herolups_hint()
        local txt = ""
        local txt_rune = ""
        local i, m, k
        local oldver=0
        local farr = { ["attack"] = 0, ["defense"] = 0, ["intellect"] = 0, ["mana"] = 0, ["rage"] = 0, ["leadership"] = 0 }
        
        local level = Game.GVStrAr( "herolups" )
        local hclass = Game.HSP_class()
        if hclass == nil or hclass < 0 then hclass = 0 end
        local hero = Game.Config("heroclasses/" .. tostring(hclass))
        local hero_cfg="hero_"..hero
        local leadership = tonumber(text_dec(Game.Config(hero_cfg.."/level_up/leadership"),1))
        local mana=tonumber(text_dec(Game.Config(hero_cfg.."/level_up/mana"),1))
        local rage=tonumber(text_dec(Game.Config(hero_cfg.."/level_up/rage"),1))
        if Game.HSP_difficulty()==0 then 
            mana,rage=mana+2,rage+2
        end 
        if Game.HSP_difficulty()==1 then 
            mana,rage=mana+1,rage+1
        end 

        local max_var=6
        local rune_war={"4,1,2","4,2,1","5,2,0","4,3,1","4,2,2","5,1,2"}
        local rune_pal={"1,4,2","2,4,2","2,4,2","3,4,0","0,4,3","2,5,1"}
        local rune_mag={"1,2,4","2,1,4","0,1,6","1,3,4","3,1,4","2,1,5"}
        local rindex=Logic.hero_lu_var("rindex")
        local rside=Logic.hero_lu_var("rside")
        local   might,mind,magic=0,0,0
        local   it_might,it_mind,it_magic=0,0,0
        local tmp_mas
        local fu_rindex=0
        if rindex==nil or rindex=="" then 
           oldver=1
        end 
        if rside==nil or rside=="" then
           oldver=1
        end
      if oldver==1 then txt = txt.."<br><label=hluhh_ver>" end
      if oldver==0 then
        rindex=tonumber(rindex)
        rside=tonumber(rside)

            -- прогноз надо перескочить уровень
            if rside==0 then
                fu_rindex=rindex+1
            else 
                fu_rindex=rindex-1
            end 
            if fu_rindex==0 then
                fu_rindex=max_var
            end
            if fu_rindex==(max_var+1) then
                fu_rindex=1
            end
            txt = txt.."<color=255,243,179>"
            if level ~= 30 then  -- убираем прогноз если 31 уровень          
               txt = txt.."<br><br><label=hluhh_fu>  <image=Message_icon2_rune_red.png>   <image=Message_icon2_rune_green.png>   <image=Message_icon2_rune_blue.png>"
            end
            for i=level+2, 31 do
                if i<10 then txt = txt.."<br>   ".."0"..tostring(i)..": " else txt = txt.."<br>   "..tostring(i)..": " end
                might,mind,magic=0,0,0      
                if hclass==0 then
                    tmp_mas=rune_war
                    if Game.HSP_difficulty()==0 then 
                        might=might+1
                    end 
                end 
                if hclass==1 then
                    tmp_mas=rune_pal
                    if Game.HSP_difficulty()==0 then 
                        mind=mind+1
                        end 
                end 
                if hclass==2 then
                        tmp_mas=rune_mag
                        if Game.HSP_difficulty()==0 then 
                        magic=magic+1
                        end 
                    end 
                -- прогноз смотрим прямо
                if rside==0 then
                fu_rindex=fu_rindex-1
                else 
                fu_rindex=fu_rindex+1
                end 
                if fu_rindex==0 then
                fu_rindex=max_var
                end
                if fu_rindex==(max_var+1) then
                fu_rindex=1
                end
                might=might+tonumber(text_dec(tmp_mas[fu_rindex],1))
                mind=mind+tonumber(text_dec(tmp_mas[fu_rindex],2))
                magic=magic+tonumber(text_dec(tmp_mas[fu_rindex],3))
                txt = txt.."    "..tostring(might).."      "..tostring(mind).."      "..tostring(magic)

            end
          end
            txt = txt.."<color=255,243,179><br><br><label=hluhh_up>"
            m = 0
            for i=0, level-1 do
              if oldver==0 then
                might,mind,magic=0,0,0      
                if hclass==0 then
                        tmp_mas=rune_war
                        if Game.HSP_difficulty()==0 then 
                        might=might+1
                        end 
                end 
                if hclass==1 then
                tmp_mas=rune_pal
                if Game.HSP_difficulty()==0 then 
                        mind=mind+1
                end 
                    end 
                    if hclass==2 then
                tmp_mas=rune_mag
                if Game.HSP_difficulty()==0 then 
                        magic=magic+1
                end 
                    end 
                    -- историю смотрим в обратку   
                    if rside==0 then
                             rindex=rindex+1
                    else 
                             rindex=rindex-1
                    end 
                    if rindex==0 then
                             rindex=max_var
                    end
                    if rindex==(max_var+1) then
                             rindex=1
                    end
                    might=might+tonumber(text_dec(tmp_mas[rindex],1))
                    mind=mind+tonumber(text_dec(tmp_mas[rindex],2))
                    magic=magic+tonumber(text_dec(tmp_mas[rindex],3))
                    it_might=it_might+tonumber(text_dec(tmp_mas[rindex],1))
                    it_mind=it_mind+tonumber(text_dec(tmp_mas[rindex],2))
                    it_magic=it_magic+tonumber(text_dec(tmp_mas[rindex],3))
                end
                    -- история прокачки              
                    local sel = Game.GVStrAr( "herolups", i )
                    local ov = farr[sel]
                    if ov == nil then
                        farr[sel] = 1
                    else
                       farr[sel] = ov + 1
                    end
                    if level-i+1<10 then txt = txt.."<br>".."0"..tostring(level-i+1)..": " else txt = txt.."<br>"..tostring(level-i+1)..": " end

                    if sel == "leadership" then
                        k = leadership*(level-i+1)
                        txt = txt.."+"..tostring(k)
                        m = m + k
                    elseif sel == "rage" then
                        txt = txt.."+"..tostring(rage)
                    elseif sel == "mana" then
                        txt = txt.."+"..tostring(mana)
                    else
                        txt = txt.."+".."1"
                    end
                    txt = txt.." <label=hluhh_"..sel..">"
            end
            if oldver==0 then
              txt_rune = txt_rune.."<br><image=Message_icon2_rune_red.png>"..tostring(it_might).." <image=Message_icon2_rune_green.png>"..tostring(it_mind).." <image=Message_icon2_rune_blue.png>"..tostring(it_magic)
            end
            txt = txt.."<br><br><label=hluhh_it>"
            local w, n
            --извращение для вывода в нужном порядке
            local att=""
            local def=""
            local int=""
            local rag=""
            local man=""
            local lead=""
            for w,n in farr do
              if w == "attack" then att = att.."<br><label=hluhh_"..w.."> <color=252,249,220>+"..n.."</color>" end
              if w == "defense" then def = def.."<br><label=hluhh_"..w.."> <color=252,249,220>+"..n.."</color>" end
              if w == "intellect" then int = int.."<br><label=hluhh_"..w.."> <color=252,249,220>+"..n.."</color>" end
              if w == "rage" then rag = rag.."<br><label=hluhh_"..w.."> <color=252,249,220>+"..n*rage.."</color>".." ("..n..")" end
              if w == "mana" then man = man.."<br><label=hluhh_"..w.."> <color=252,249,220>+"..n*mana.."</color>".." ("..n..")" end
              if w == "leadership" then lead = lead.."<br><label=hluhh_"..w.."> <color=252,249,220>+"..m.."</color>".." ("..n..")" end
            end
        txt = txt..att..def..int..rag..man..lead..txt_rune
        return txt

end