- Joined
- Mar 16, 2017
- Messages
- 1,455
- Solutions
- 162
- Reaction score
- 2,139
- Location
- London
- GitHub
- MillhioreBT
- YouTube
- millhiorebt
You need to remove the
You should also delete the configuration of
Then you can use the following script to have your pair of soft boots with percentage regeneration that is updated when you level up so that it always regenerates the real amount of % according to your maximum health:

active
and inactive Id
settings in items.xml
, in this case the pair of soft boots
, 2640
and 6132
You should also delete the configuration of
movements.xml
Then you can use the following script to have your pair of soft boots with percentage regeneration that is updated when you level up so that it always regenerates the real amount of % according to your maximum health:
data/scripts/pair_of_soft_boots.lua
LUA:
local config = {
activeId = 2640,
inactiveId = 6132,
level = 8,
slot = "feet",
healthGainPercent = 5,
healthTicks = 1000,
manaGainPercent = 5,
manaTicks = 1000,
}
local isItemAbilityEnabled = {}
local moveEvent = MoveEvent()
function moveEvent.onEquip(player, item, slot, isCheck)
if player:getLevel() < config.level then
return RETURNVALUE_NOERROR
end
if isCheck then
return RETURNVALUE_NOERROR
end
if isItemAbilityEnabled[player:getId()] then
return RETURNVALUE_NOERROR
else
isItemAbilityEnabled[player:getId()] = true
end
item:transform(config.activeId)
local conditionRegeneration = Condition(CONDITION_REGENERATION, CONDITIONID_FEET)
conditionRegeneration:setTicks(-1)
conditionRegeneration:setParameter(CONDITION_PARAM_HEALTHGAIN, player:getMaxHealth() * config.healthGainPercent / 100)
conditionRegeneration:setParameter(CONDITION_PARAM_HEALTHTICKS, config.healthTicks)
conditionRegeneration:setParameter(CONDITION_PARAM_MANAGAIN, player:getMaxMana() * config.manaGainPercent / 100)
conditionRegeneration:setParameter(CONDITION_PARAM_MANATICKS, config.manaTicks)
player:addCondition(conditionRegeneration)
player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
player:say("The pair of soft boots have been activated.", TALKTYPE_MONSTER_SAY)
return RETURNVALUE_NOERROR
end
moveEvent:id(config.inactiveId)
moveEvent:level(config.level)
moveEvent:slot(config.slot)
moveEvent:register()
local moveEvent = MoveEvent()
function moveEvent.onDeEquip(player, item, slot)
isItemAbilityEnabled[player:getId()] = nil
item:transform(config.inactiveId)
player:removeCondition(CONDITION_REGENERATION, CONDITIONID_FEET)
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:say("The pair of soft boots have been deactivated.", TALKTYPE_MONSTER_SAY)
return RETURNVALUE_NOERROR
end
moveEvent:id(config.activeId)
moveEvent:level(config.level)
moveEvent:slot(config.slot)
moveEvent:register()
local creatureEvent = CreatureEvent("playerRegenerationUpdate")
function creatureEvent.onAdvance(player, skill, oldLevel, newLevel)
if skill == SKILL_LEVEL then
player:removeCondition(CONDITION_REGENERATION, CONDITIONID_FEET)
local conditionRegeneration = Condition(CONDITION_REGENERATION, CONDITIONID_FEET)
conditionRegeneration:setTicks(-1)
conditionRegeneration:setParameter(CONDITION_PARAM_HEALTHGAIN, player:getMaxHealth() * config.healthGainPercent / 100)
conditionRegeneration:setParameter(CONDITION_PARAM_HEALTHTICKS, config.healthTicks)
conditionRegeneration:setParameter(CONDITION_PARAM_MANAGAIN, player:getMaxMana() * config.manaGainPercent / 100)
conditionRegeneration:setParameter(CONDITION_PARAM_MANATICKS, config.manaTicks)
player:addCondition(conditionRegeneration)
player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
player:say("The pair of soft boots have been updated.", TALKTYPE_MONSTER_SAY)
end
return true
end
creatureEvent:register()
local creatureEvent = CreatureEvent("playerRegenerationLogin")
function creatureEvent.onLogin(player)
player:registerEvent("playerRegenerationUpdate")
return true
end
creatureEvent:register()
