• 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+ block use rune tfs 1.2

gubbo123

New Member
Joined
Aug 15, 2017
Messages
151
Solutions
1
Reaction score
3
How block use this mwall rune in 3 positions? not player position, but the target tile postion.

position A 3401 ,3411 ,6
position B 3401, 3415 ,6
position C 3401, 3416, 6


Rune script
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, 2128)

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end
 
Solution
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, 2128)

local blockedPositions = {
    Position(3401, 3411, 6),
    Position(3401, 3415, 6),
    Position(3401, 3416, 6)
}

function onCastSpell(creature, variant, isHotkey)
    if table.contains(blockedPositions, variant:getPosition()) then
        return false
    end
    return combat:execute(creature, variant)
end
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, 2128)
local pos1 = Position(3401, 3411, 6)
local pos2 = Position(3401, 3415, 6)
local pos3 = Position(3401, 3416, 6)
function onCastSpell(creature, variant, isHotkey)
if combat:getPosition() = pos1 then
return RETURNVALUE_NOTPOSSIBLE
elseif combat:getPosition() = pos2 then
return RETURNVALUE_NOTPOSSIBLE
elseif combat:getPosition() = pos3 then
return RETURNVALUE_NOTPOSSIBLE
else
    return combat:execute(creature, variant)
end

You can try this o_O


but Delusion's script is probably better 😅
 
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, 2128)

local blockedPositions = {
    Position(3401, 3411, 6),
    Position(3401, 3415, 6),
    Position(3401, 3416, 6)
}

function onCastSpell(creature, variant, isHotkey)
    if table.contains(blockedPositions, variant:getPosition()) then
        return false
    end
    return combat:execute(creature, variant)
end
 
Solution
Back
Top