Official 1C Company forum

Official 1C Company forum (
-   Mods (
-   -   Mana Regeneration Mod (

hasim 11-12-2010 08:38 AM

Mana Regeneration Mod
Anyone cares to re-make the mod for AP:Crossworlds that you hovered your mouse over the time of day and it passed the time till your mana bar was filled?

It can be found here for KB:AP

Alamei 11-15-2010 06:57 PM

Mana Regen Mod (Orcs Compatible)
1 Attachment(s)
Sure thing; it only required a couple changes to be orcs-compatible. You probably know the installation drill: unzip the file into your \sessions\orcs\mods folder.

hasim 11-16-2010 10:46 AM

Thank you very much!

hasim 08-21-2011 06:21 AM

Mana Regeneration Mod 1.31
Since the release of 1.31 patch the mana regen mod is not working any more - would someone please be so kind as to rectify that please?


Moxxy 07-30-2020 09:57 PM

Fixed code
All other mana regen mods on the forum that I could find suffer from the +30 mana glitch. This is caused when the game returns 30 for both mana and max_mana, so when the mod sets mana to 30 when it isn't really the max, it adds 30 to the max. Also, in AP and CW, the mods don't take into account Bloodlust skill. The below code is my current fix.

Sometimes the mod will appear not to work. In these cases you can wait a bit and try again, or try saving the game and reloading. I have found that activating this right after a battle almost always works.


function accelerate_manaregen()
  local max_mana = Logic.cur_lu_item("mana","limit")
  local mana = Logic.cur_lu_item("mana","count")
  if mana < max_mana then
    local max_rage = Logic.cur_lu_item("rage","limit")
    local rage = Logic.cur_lu_item( "rage", "count" )
    local min_rage = 0
    local sk_level = Logic.hero_lu_skill("blood_lust")
    if sk_level > 0 then min_rage = math.floor(skill_power("blood_lust",1,sk_level-1)*max_rage/100) end
    local mana_str = string.gsub(Game.Config("difficulty_k/manarage"),"|",",")
    local rage_str = string.gsub(Game.Config("difficulty_k/manarage"),"|",",")
    local diff = Game.HSP_difficulty()
    local k_mana_diff = tonumber(text_dec(mana_str,diff+1))
    local k_rage_diff = tonumber(text_dec(rage_str,diff+1))
    local wiz_bonus = skill_power("meditation",1)+Logic.hero_lu_item("sp_mana_map_prc","count")
    local mana_per_tick = math.max(1,max_mana/20*(1+wiz_bonus/100)*k_mana_diff)
    local rage_per_tick = math.max(1,max_rage/20*(1-Logic.hero_lu_item("sp_rage_map","count")/100)/k_rage_diff)
    local ticks = math.ceil((max_mana-mana)/mana_per_tick)
    rage = rage - rage_per_tick * ticks
    Logic.cur_lu_item("mana", "count", max_mana)
    Logic.cur_lu_item("rage", "count", math.max(min_rage, rage))

All times are GMT. The time now is 01:19 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2007 1C Company. All rights reserved.