First of all this script is really amazing. This combinations of strike on hit/attack - this works perfectly. Really good job - I can only imagine how much work and effort it took.
After few hours of testing on downgraded tfs 1.5 I have found some bugs.
Propably they are related to this downgraded version, but maybe not.
I have tested it on clean nekiro 1.5 downgraded 772 and on Rookie 7.4 uploaded here on otland. Both use the same core engine.
I'm using the newest 3.0.3 version of the script (maybe older version would work better?)
The behaviour is really complicated but I will try to explain each case.
Case: 1
GameLog:
Start TFS Server
Login to game, Char setup: 100HP/100MP Backpack: | necklace (+100MaxHP, +100MaxMP) |
Equip necklace - 100/200HP, 100/200MP - good
DeEquip necklace - 100/100HP, 100/100MP
Equip necklace - 200/200HP, 200/200MP - bad (In ServerLog: 00:17 You were healed for 100 hitpoints.)
DeEquip necklace - 100/100HP, 100/100MP
Equip necklace - 200/200HP, 200/200MP - bad (the same every time)
DeEquip necklace - 100/100HP, 100/100MP
Case: 2
GameLog:
Start TFS Server
Login to game, Char setup: 100HP/100MP Backpack: | necklace (+100MaxHP, +100MaxMP) |
Equip necklace - 100/200HP, 100/200MP - good
Relog character
Now character have - 200/200HP, 200/200MP - bad (also in ServerLog: 00:17 You were healed for 100 hitpoints.)
Case: 3
GameLog:
Start TFS Server
Login to game, Char setup: 100HP/100MP Backpack: | necklace (+100MaxHP, +100MaxMP) | sword (+100MaxMP) | armor (+100MaxHP) |
Equip necklace -100/200HP, 100/200MP - good
Equip sword - 100/200HP, 100/300MP - good
DeEquip sword - 100/200HP, 100/200MP - good
Equip sword - 100/200HP, 100/300MP - good
DeEquip sword - 100/200HP, 100/200MP - good
Equip armor - 100/200HP, 100/300MP - good
DeEquip armor - 100/200HP, 100/200MP - good
Equip sword - 100/200HP, 100/300MP - good
Equip armor - 100/300HP, 100/300MP - good
DeEquip sword - 100/300HP, 100/200MP - good
DeEquip armor - 100/200HP, 100/200MP - good
Here all is good (I can now equip any item which gives MaxHP or MaxMP or (MaxHP and MaxMP), and it will just increase the MaxHP/MP parameter, not the current HP/MP. It looks like equiping the item with both bonuses at start - somehow prevents from setting the current HP/MP parameter as the MaxHP/MP)
Case: 4
GameLog:
Start TFS Server
Login to game, Char setup: 100HP/100MP Backpack: | necklace (+100MaxHP, +100MaxMP) | sword (+100MaxMP) | armor (+100MaxHP) |
Equip armor - 100/200HP, 100/100MP - good
Equip necklace - 100/300HP, 100/200MP - good
DeEquip necklace - 100/200HP, 100/100MP - good
Equip necklace - 100/300HP, 200/200MP - bad (The current mana regenerates because of swapping item. Now it looks like armor was holding the MaxHP value and it was correct all time, but nothing was holding the MaxMP and it regenerates the current mana)
Case: 5
GameLog:
Start TFS Server
Login to game, Char setup: 100HP/100MP Backpack: | necklace (+100MaxHP, +100MaxMP) | ring (+100MaxHP, +100MaxMP) |
Equip necklace - 100/200HP, 100/200MP - good
Equip ring - 100/300HP, 100/300MP - good
DeEquip necklace - 100/200HP, 100/200MP - good
Equip necklace - 100/300HP, 100/300MP - good
Here the ring tooks a role from necklace (inherit his ability) and now I can equip sword, armor or any item and everything will work good as long as ring stays there or other item which gives both abilitis will be equipped.
Maybe someone have an idea what can be wrong on this release? it would be really great to have it fully working on old release.
Thanks in advance for help.
Update:
With the help of DeepSeek I figured out what can cause the issue.
The AI points to this section of code in us_onEquip and us_onLogin function in core.lua:
LUA:
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
It suggest to remove this conditions from code, and it really improve the behaviour.
The real question is, how big impact it can have for other parts of the script

But I will keep testing it.
Another update:
I figured out the root issue.
The problem occurs only when my character's current base health is equal to my character base Max Health (100 Current health and 100 Max Health).
It means - if my character have 100Current Health and 100Max Health, and I wear an item with for example MaxHP bonus- it will change my MaxHP but for the script my MaxHP will be still be equal my current Health. The script still points to the original MaxHealth value not the changed one (changed by the item).
When I set my current health/mana to 99 but keep max health/mana to 100 - everything is working well, including reloggin etc.
Again update:
DeepSeek suggested to refresh the value of current max health/mana after equipping the item, and it looks like it solved all the issues.
Maybe someone will head similiar issue, so I upload the updated fragment of code from core.lua:
LUA:
function us_onEquip(cid, iuid, slot)
local player = Player(cid)
if not player:getSlotItem(slot) then
return
end
iuid = iuid + 1
local slotUid = player:getSlotItem(slot):getUniqueId()
if iuid ~= slotUid then
return
end
local item = Item(iuid)
if player and item then
local maxHP = player:getMaxHealth() -- Get the current max health
local maxMP = player:getMaxMana() -- Get the current max mana
local newBonuses = item:getBonusAttributes()
if not newBonuses then
return
end
for i = 1, #newBonuses do
local value = newBonuses[i]
local bonusId = value[1]
local bonusValue = value[2]
local attr = US_ENCHANTMENTS[bonusId]
if attr then
if attr.combatType == US_TYPES.CONDITION then
if not US_CONDITIONS[bonusId] then
US_CONDITIONS[bonusId] = {}
end
local itemId = item:getId()
if not US_CONDITIONS[bonusId][bonusValue] then
US_CONDITIONS[bonusId][bonusValue] = {}
end
if not US_CONDITIONS[bonusId][bonusValue][itemId] then
US_CONDITIONS[bonusId][bonusValue][itemId] = Condition(attr.condition)
if attr.condition ~= CONDITION_MANASHIELD then
US_CONDITIONS[bonusId][bonusValue][itemId]:setParameter(CONDITION_PARAM_SUBID, 1000 + player:getNextSubId(slot, i))
US_CONDITIONS[bonusId][bonusValue][itemId]:setParameter(attr.param, attr.percentage == true and 100 + bonusValue or bonusValue)
US_CONDITIONS[bonusId][bonusValue][itemId]:setParameter(CONDITION_PARAM_TICKS, -1)
else
US_CONDITIONS[bonusId][bonusValue][itemId]:setParameter(CONDITION_PARAM_TICKS, 86400000)
end
US_CONDITIONS[bonusId][bonusValue][itemId]:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
player:addCondition(US_CONDITIONS[bonusId][bonusValue][itemId])
-- Update maxHP and maxMP after applying the condition
maxHP = player:getMaxHealth()
maxMP = player:getMaxMana()
-- Remove the healing logic
-- 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[bonusId][bonusValue][itemId])
-- Update maxHP and maxMP after applying the condition
maxHP = player:getMaxHealth()
maxMP = player:getMaxMana()
-- Remove the healing logic
-- 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
Have a great day!
And I found a posts (I corrected the search string) that everything that I wrote is incorrect, and this script should work that way. I guess the only issue can be with not healing the character when equipping the items for the first time after server booted. Need to rethink this and all possible cases.