1C Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official 1C Company forum > 1C Publishing > King's Bounty > King's Bounty: Crossworlds > Mods

Mods King's Bounty: Crossworlds Mods

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2010, 07:38 AM
hasim hasim is offline
Approved Member
 
Join Date: Oct 2008
Posts: 75
Default 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
http://forum.1cpublishing.eu/showthread.php?t=11383
Reply With Quote
  #2  
Old 11-15-2010, 05:57 PM
Alamei Alamei is offline
Approved Member
 
Join Date: Apr 2009
Posts: 5
Default Mana Regen Mod (Orcs Compatible)

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.
Attached Files
File Type: zip mod_cw13_orcs_eng_mana_regen.zip (3.1 KB, 476 views)
Reply With Quote
  #3  
Old 11-16-2010, 09:46 AM
hasim hasim is offline
Approved Member
 
Join Date: Oct 2008
Posts: 75
Default

Thank you very much!
Reply With Quote
  #4  
Old 08-21-2011, 05:21 AM
hasim hasim is offline
Approved Member
 
Join Date: Oct 2008
Posts: 75
Default 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?

Hasim.
Reply With Quote
  #5  
Old 07-30-2020, 08:57 PM
Moxxy Moxxy is offline
Approved Member
 
Join Date: Jul 2020
Posts: 1
Default 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.

Code:
function accelerate_manaregen()
  Game.ClearEffect("mana")
  local max_mana = Logic.cur_lu_item("mana","limit")
  local mana = Logic.cur_lu_item("mana","count")
  if mana < max_mana then
    Game.ClearEffect("rage")
    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)
    Game.ClearEffect("mana")
    Logic.cur_lu_item("rage", "count", math.max(min_rage, rage))
    Game.ClearEffect("rage")
  end
end

Last edited by Moxxy; 07-30-2020 at 09:07 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:51 AM.


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