• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to change manaGain and healthGain during game

Togu

Advanced OT User
Joined
Jun 22, 2018
Messages
308
Solutions
1
Reaction score
178
Location
Brazil
I was looking on sources where to change theses values but I couldn't find. It looks like these addCondition, updateCondition and setParam are a little hard to understand.

Do you guys have some tips?

I want to make it based on skills
 
Not sure how to set it, but you can get it from the Vocations metatable.

Perhaps look into the sources around this, to see if there are any set methods here as well, and that the docs just arent updated.
If its not here, then my guess is that its not implemented and currently hardcoded into vocations based on that xml file.

Perhaps it could be an Issue (Feature request) on github?
 
It doesn't require a source edit, look at how Player.feed works. It uses a regen condition and creates a new one if you haven't eaten any food, and sets the healthgain/ticks/managain/ticks from what's defined in vocations.xml, and applies it to the player.

If they have already eaten food, the condition ticks (length) are added on to, and nothing else happens, since the definition for the regen to that player is already defined and applied.

If you wanted to change it, you'd use the same logic and getCondition for that regen condition, set the params you want, and set the new condition ticks (you shouldn't need to apply it to the player, unless the regeneration is currently not running) but then it becomes a problem of how long the condition should be if you haven't eaten any food.

It's also a question of whether or not you want to add a custom regen that's applied without food, or if you want to merge it with the default regeneration players get (food).

If you wanted to merge it, you'd just simply set the new params regardless if they've eaten or not, adding the previous value (there is no getParam method, so you'll have to caculate the base regen yourself by doing the same thing it already does and get the vocation's values) with the new value added on, and apply condition to the player if the condition is not already applied.
 
Last edited by a moderator:
Back
Top