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

Lua TFS 1.3 solution to CONDITION_PARAM_SKILL_SHIELDPERCENT in healing spell

Icaraii

Well-Known Member
Joined
Jan 5, 2020
Messages
469
Solutions
1
Reaction score
58
Hello,

I'm trying to put increased shield percent on a healing spell I have, but I can't seem to make it work.

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

local skill = Condition(CONDITION_ATTRIBUTES)
skill:setParameter(CONDITION_PARAM_TICKS, 13000)
skill:setParameter(CONDITION_PARAM_SKILL_SHIELDPERCENT, 220)
skill:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
combat:addCondition(skill)

function onCastSpell(creature, variant)
    local maxHealth = creature:getMaxHealth()
    local currentHealth = creature:getHealth()
    local healthGain = math.floor((maxHealth / 100) * 10)
    if currentHealth <= healthGain then
        return false
    end
    creature:addHealth(healthGain)

    local summons = creature:getSummons()
    if #summons > 0 then
        for i = 1, #summons do
            summons[i]:addHealth(healthGain)
        end
    end   
    
    return combat:execute(creature, variant)
end

I would like to know what I'm doing at this script. The healing works fine, also the effect and everything else, I just can't increase shield %.
 
Back
Top