• 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 Weapon damage over time (TFS 1.3)

Joined
Feb 16, 2017
Messages
53
Solutions
2
Reaction score
9
Hey all, i dont know how to create script that adds DOT condiction to weapon.
Can someone help me with that? I mean - Axe with bleeding DOT (that scales by skills/level/atk by default like other weapons i made)
I searched a whole forum and I found outdated/not working etc. scrtips.

Here is this axe script without DOT: (TFS 1.3)

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true)

function onGetFormulaValues(player, skill, attack, factor)
    local min = (player:getLevel() / 3) + ((skill / 2) * (attack * 2) * 0.05) + 15
    local max = (player:getLevel() / 3) + ((skill / 2) * (attack * 2) * 0.06) + 25
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(creature, variant)
    return combat:execute(creature, variant)
end
 
Use whatever damage formula you want.

I used the average of min and max for this example

Lua:
local condition = Condition(CONDITION_BLEEDING)
condition:setParameter(CONDITION_PARAM_DELAYED, true)

local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true)

function onGetFormulaValues(player, skill, attack, factor)
    local min = (player:getLevel() / 3) + ((skill / 2) * (attack * 2) * 0.05) + 15
    local max = (player:getLevel() / 3) + ((skill / 2) * (attack * 2) * 0.06) + 25
    local bleedDamage = ((min + max) / 2)
    condition:addDamage(5, 3000, -bleedDamage) -- rounds, time, value
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

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