Dran Ryszard
Active Member
Hi, i was use a slot system by oen432, and i tried change MAX HP / MP bonus to MAX HP/MP Percent bonus, but everytime when i tried change it gone wrong..
So, i change in upgrade_system_const
CONDITION_PARAM_STAT_MAXHITPOINTS to CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT
and i tried do some change in upgrade_system_core, but what i do it not work
And when im change only CONDITION_PARAM_STAT_MAXHITPOINTS to CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT
Then my character have 325k HP, after i equp item with 7% bonus my health gone low to 22k (max health) it back to 325k when i dequip item.
I tried add something like that
but nothing change
So, i change in upgrade_system_const
CONDITION_PARAM_STAT_MAXHITPOINTS to CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT
LUA:
[1] = {
name = "Max HP",
combatType = US_TYPES.CONDITION,
condition = CONDITION_ATTRIBUTES,
param = CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT,
VALUES_PER_LEVEL = 3,
format = function(value)
return "Max HP +" .. value
end,
itemType = US_ITEM_TYPES.HELMET + US_ITEM_TYPES.ARMOR + US_ITEM_TYPES.LEGS + US_ITEM_TYPES.BOOTS
},
and i tried do some change in upgrade_system_core, but what i do it not work
LUA:
-- apply new
if item:getType():isUpgradable() then
local newBonuses = item:getBonusAttributes()
if newBonuses then
for key, value in pairs(newBonuses) do
local attr = US_ENCHANTMENTS[value[1]]
if attr then
if attr.combatType == US_TYPES.CONDITION then
if not US_CONDITIONS[value[1]] then
US_CONDITIONS[value[1]] = {}
end
if not US_CONDITIONS[value[1]][value[2]] then
US_CONDITIONS[value[1]][value[2]] = Condition(attr.condition)
if attr.condition ~= CONDITION_MANASHIELD then
US_CONDITIONS[value[1]][value[2]]:setParameter(attr.param, attr.percentage == true and 100 + value[2] or value[2])
US_CONDITIONS[value[1]][value[2]]:setParameter(CONDITION_PARAM_TICKS, -1)
US_CONDITIONS[value[1]][value[2]]:setParameter(CONDITION_PARAM_SUBID, 1000 + math.ceil(value[1] ^ 2) + value[2])
else
US_CONDITIONS[value[1]][value[2]]:setParameter(CONDITION_PARAM_TICKS, 86400000)
end
US_CONDITIONS[value[1]][value[2]]:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
player:addCondition(US_CONDITIONS[value[1]][value[2]])
if attr == BONUS_TYPE_MAXHP then
if player:getHealth() == maxHP then
player:addHealth((player:getMaxHealth()))
end
end
if attr == BONUS_TYPE_MAXMP then
if player:getMana() == maxMP then
player:addMana(player:getMaxMana())
end
end
else
player:addCondition(US_CONDITIONS[value[1]][value[2]])
if attr.param == CONDITION_PARAM_STAT_MAXHITPOINTS then
if player:getHealth() == maxHP then
player:addHealth(player:getMaxHealth())
end
end
if attr.param == CONDITION_PARAM_STAT_MAXMANAPOINTS then
if player:getMana() == maxMP then
player:addMana(player:getMaxMana())
end
end
end
end
end
end
end
end
end
end
end
And when im change only CONDITION_PARAM_STAT_MAXHITPOINTS to CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT
Then my character have 325k HP, after i equp item with 7% bonus my health gone low to 22k (max health) it back to 325k when i dequip item.
I tried add something like that
Code:
player:addHealth((player:getMaxHealth()/100) * value[2])
but nothing change