PDA

View Full Version : add stats at levelup


Ancentre
11-23-2010, 10:06 PM
anyone know how to add mana and rage at levelup?

for attack, defense, intellect, it works by adding this line into logic_hero.lua after
Levelup.add( 0, "leadership", leadership*(level))
Levelup.add( 0, "attack", 1)

but i tried that for mana and rage, and it did not add mana or rage at levelup

anyone know how to change that? thanks

MattCaspermeyer
11-27-2010, 09:04 PM
Ancentre:

You might try looking at the skills that add rage and mana - I think it is SKILLS.LUA. These add it permanently and so that should be a good example.

Good luck!

Matt

Ancentre
11-28-2010, 01:04 AM
i took a look at the skill.lua
and i found
local cur_rage=Logic.hero_lu_item("rage","limit")
local cur_mana=Logic.hero_lu_item("mana","limit")
Logic.hero_lu_item("rage","limit",cur_rage+bonus)
Logic.hero_lu_item("mana","limit",cur_mana+bonus)

so i took those lines and pasted
local cur_rage=Logic.hero_lu_item("rage","limit")
local cur_mana=Logic.hero_lu_item("mana","limit")
under the levelup function

and
Logic.hero_lu_item("rage","limit",cur_rage+1)
Logic.hero_lu_item("mana","limit",cur_mana+1)
under if level<50
now, it adds 1 mana and rage everytime i levelup
thank you very much matt

jawnTEM
04-24-2011, 04:13 AM
I too would like to know how to do this? Which file/folder is it in?

Ancentre
12-30-2011, 11:31 PM
its in hero.lua

just add the 4 lines of code under if level < 50

i think it might be 51 now, instead of 50 after the patching

should work, havent checked back in a while so gl

Ancentre
01-01-2012, 01:26 AM
sorry made a mistake its in
logic_hero.lua

local cur_rage=Logic.hero_lu_item("rage","limit")
local cur_mana=Logic.hero_lu_item("mana","limit")
Logic.hero_lu_item("rage","limit",cur_rage+1)
Logic.hero_lu_item("mana","limit",cur_mana+1)

add the above four lines under

function calc_levelup()

this should give u +1 to max mana and rage at lv up