• 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!

boost healing tfs 1.5 nekiro 8.6

Dran Ryszard

Active Member
Joined
Apr 25, 2023
Messages
136
Reaction score
30
Location
Poland
Hi, any one know how to use a boost healing? I just add it to item, and it is diplay in desc, but not work with any healing spell..
SOmething with custom attributes like boost magic damage work normal..

Any ideas how to fix it? Or maybe im stupid and it not work for spell healing?
1747498751501.webp
 
Solution
im not good in lua for 1.x but this better way i think
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

local SHIELD_BONUS_ID = 21707
local SHIELD_HEAL_BOOST = 1.05

function onGetFormulaValues(player, skill, attack, factor)
    local level = player:getLevel()
    local magicLevel = player:getMagicLevel()
    local min = (level / 3) + (skill * attack * 0.15) + (magicLevel * 80.9)
    local max = (level / 3) + (skill * attack * 0.18) + (magicLevel * 85.2)
    local shield = player:getSlotItem(CONST_SLOT_RIGHT)
    local multiplier =...
well, custom attributes only store's the value, you have to start use them, in movement when player equip item add to player class the value from item
 
well, custom attributes only store's the value, you have to start use them, in movement when player equip item add to player class the value from item

If u mean, about register Item in movements.xml its done.. I said boost magic damage work :( Only boost healing has problem.
 
In combat.cpp, you should call the new attribute using a function defined in player.cpp. It’s better to have a two-way attribute system — you can also use a storage value. Then, in combat.cpp, call the function and check if the combat type is healing, and apply any healing bonuses.
Alternatively, you can create a function in player.cpp (like getArmor()), for example: getHealingBonus(). Then expose it to Lua in luascript.cpp as getPlayerHealingBonus, so you can use it directly in your Lua spells.
 
In combat.cpp, you should call the new attribute using a function defined in player.cpp. It’s better to have a two-way attribute system — you can also use a storage value. Then, in combat.cpp, call the function and check if the combat type is healing, and apply any healing bonuses.
Alternatively, you can create a function in player.cpp (like getArmor()), for example: getHealingBonus(). Then expose it to Lua in luascript.cpp as getPlayerHealingBonus, so you can use it directly in your Lua spells.

Yo, but its already register in items.cpp same like boost a magic damage.. And magic damage work but healing not :(

LUA:
                case ITEM_PARSE_BOOSTPERCENTHEALING: {
                    abilities.boostPercent[combatTypeToIndex(COMBAT_HEALING)] += pugi::cast<int16_t>(valueAttribute.value());
                    break;
                }
 
Up
Post automatically merged:

So, i tried make it with other way.. Without a boosthealing attribute, all work but can somone better with LUA tell me its good solution?

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

function onGetFormulaValues(player, skill, attack, factor)
    local magicLevel = player:getMagicLevel()
    local min = (player:getLevel() / 3) + (skill * attack * 0.15) + (magicLevel * 80.9)
    local max = (player:getLevel() / 3) + (skill * attack * 0.18) + (magicLevel * 85.2)
    local min2 = ((player:getLevel() / 3) + (skill * attack * 0.15) + (magicLevel * 80.9)) * 1.05
    local max2 = ((player:getLevel() / 3) + (skill * attack * 0.18) + (magicLevel * 85.2)) * 1.05

    local shieldItem = player:getSlotItem(CONST_SLOT_RIGHT)
    if shieldItem and shieldItem:getId() == 21707 then
        return min2, max2
    else
        return min, max
    end
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end
 
Last edited:
im not good in lua for 1.x but this better way i think
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

local SHIELD_BONUS_ID = 21707
local SHIELD_HEAL_BOOST = 1.05

function onGetFormulaValues(player, skill, attack, factor)
    local level = player:getLevel()
    local magicLevel = player:getMagicLevel()
    local min = (level / 3) + (skill * attack * 0.15) + (magicLevel * 80.9)
    local max = (level / 3) + (skill * attack * 0.18) + (magicLevel * 85.2)
    local shield = player:getSlotItem(CONST_SLOT_RIGHT)
    local multiplier = (shield and shield:getId() == SHIELD_BONUS_ID) and SHIELD_HEAL_BOOST or 1
    return min * multiplier, max * multiplier
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end
 
Solution
Back
Top