[EDIT] Oops I forgot to add, this is TFS 1.2. If someone could edit the topic title.
This was requested in the support section. It could definitely be approved upon, but I'd like to release just for archive reasons.
Here is a simple auto regeneration code. I quickly made it tonight, not sure if it works. I used the food script as reference.
creaturtescripts/login.lua
lib/core/player.lua
This was requested in the support section. It could definitely be approved upon, but I'd like to release just for archive reasons.
Here is a simple auto regeneration code. I quickly made it tonight, not sure if it works. I used the food script as reference.
creaturtescripts/login.lua
Code:
--auto health mana regeneration
local condition = player:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
if condition == nil then
player:constregen()
end
lib/core/player.lua
Code:
local pahealCondition = Condition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
function Player.constregen(self)
local condition = self:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
local vocation = self:getVocation()
pahealCondition:setTicks(-1)
pahealCondition:setParameter(CONDITION_PARAM_HEALTHGAIN, vocation:getHealthGainAmount())
pahealCondition:setParameter(CONDITION_PARAM_HEALTHTICKS, vocation:getHealthGainTicks() * 1000)
pahealCondition:setParameter(CONDITION_PARAM_MANAGAIN, vocation:getManaGainAmount())
pahealCondition:setParameter(CONDITION_PARAM_MANATICKS, vocation:getManaGainTicks() * 1000)
self:addCondition(pahealCondition)
end