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

TFS 1.X+ Perfect paralyze rune

a Shadou

Member
Joined
Oct 22, 2020
Messages
13
Reaction score
7
Location
Poland
I've made script for paralyze rune but i have one problem.
This script requires target to calculate how much speed it has to decrease.
Problem is that you can't throw rune without targeting someone. Example: you won't be able to use rune through battle list.
Does anyone know better way to find rune target that is not targeted?
I was considering doing it through events like
Lua:
Creature:onTargetCombat(target)

Lua:
function onCastSpell(creature, var)
local target = creature:getTarget()
    if not target then
        creature:sendCancelMessage("You need to target creature first.")
        creature:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end

local combat = Combat()
    combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = Condition(CONDITION_PARALYZE)
    condition:setParameter(CONDITION_PARAM_TICKS, 20000)
    condition:setFormula(0, -(target:getSpeed()) + 80, 0, -(target:getSpeed()) + 80)
    combat:addCondition(condition)

    if not combat:execute(creature, var) then
        return false
    end
    creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    return true
end
 
Back
Top