• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

looking for script (actions)

zxzxzx

New Member
Joined
Mar 12, 2011
Messages
334
Reaction score
3
Hello!

Im looking for sudden death rune script for tfs 1.2+ that would be working in actions.xml because I have problem with exhausted in my ot and I can't use standard sd in spells.xml

my sd script from spells
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(player, level, maglevel)
    local min = (level * 7.8) + (maglevel * 10) + 0
    local max = (level * 9) + (maglevel * 10) + 0
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var, isHotkey)
    return combat:execute(creature, var)
end

help for rep++
 
Last edited:
This should be in "requests", not "support" tbh... But since it is in "support" I will help lead you to the answer rather than making it for you!

You can quite literally copy paste that script into actions and it should work with a couple changes.

In the action script you will not have "var" which is required for combat so you can use this to make sure that the target is a player.
Code:
local enemy = Player(target)

And if I'm not mistaken you would turn enemy into a variant by doing this:
Code:
local var = Variant(enemy)

And it should work as normal. The only problem is actions do not have level/ml checks in the xml so you will have to add your own such as:
Code:
if(player:getLevel() < 45) then
    -- your level is too low
    return true
end

Oh and don't forget to change this
return combat:execute(creature, var)
to "player"
 
Code:
local enemy = Player(target)
local var = Variant(enemy)
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(player, level, maglevel)
    local min = (level * 7.8) + (maglevel * 10) + 0
    local max = (level * 9) + (maglevel * 10) + 0
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(player, var, isHotkey)
    return combat:execute(player, var)
end

like this?

I have event OnUse not found??
 
Back
Top