• 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+ Spells no damage

Forkz

Well-Known Member
Joined
Jun 29, 2020
Messages
360
Solutions
1
Reaction score
76
Hello,
I'm copying some spells from another server in the past, and there are some conditions that I'm not able to modify for 1x + tfs, if you have a soul willing to help me, follow the code below.

Lua:
local time_in_seconds = 1 -- in seconds
local cooldown_id = 9004

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 3)
function onGetFormulaValues(cid, level, maglevel)
    min = -(level * 15.3 + maglevel * 20.85)
    max = -(level * 18.0 + maglevel * 27.6)
    return min, max
end

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)
condition:setFormula(-0.9, 0, -0.9, 0)
combat1:setCondition(condition)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 3)
function onGetFormulaValues(cid, level, maglevel)
    min = -(level * 15.3 + maglevel * 20.85)
    max = -(level * 18.0 + maglevel * 27.6)
    return min, max
end

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)
condition:setFormula(-0.9, 0, -0.9, 0)
combat2:setCondition(condition)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 3)
function onGetFormulaValues(cid, level, maglevel)
    min = -(level * 15.3 + maglevel * 20.85)
    max = -(level * 18.0 + maglevel * 27.6)
    return min, max
end

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)
condition:setFormula(-0.9, 0, -0.9, 0)
combat3:setCondition(condition)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 3)
function onGetFormulaValues(cid, level, maglevel)
    min = -(level * 15.3 + maglevel * 20.85)
    max = -(level * 18.0 + maglevel * 27.6)
    return min, max
end

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)
condition:setFormula(-0.9, 0, -0.9, 0)
combat4:setCondition(condition)

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

arr1 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}

arr2 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}

arr3 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}

arr4 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)

setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)

function onCastSpell(player, variant)
    if checkSpellCd(player, cooldown_id, time_in_seconds) == false then return false end
    return combat1:execute(player, variant)
end
 
Lua:
local time_in_seconds = 1 -- in seconds

local cooldown_id = 9004



local combat10 = createCombatObject()

setCombatParam(combat10, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat10, COMBAT_PARAM_EFFECT, 3)

function onGetFormulaValues(cid, level, maglevel)

min = -(level * 15.3 + maglevel * 20.85)

max = -(level * 18.0 + maglevel * 27.6)

return min, max

end



local combat20 = createCombatObject()

setCombatParam(combat20, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat20, COMBAT_PARAM_EFFECT, 3)

function onGetFormulaValues(cid, level, maglevel)

min = -(level * 15.3 + maglevel * 20.85)

max = -(level * 18.0 + maglevel * 27.6)

return min, max

end



local combat30 = createCombatObject()

setCombatParam(combat30, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat30, COMBAT_PARAM_EFFECT, 3)

function onGetFormulaValues(cid, level, maglevel)

min = -(level * 15.3 + maglevel * 20.85)

max = -(level * 18.0 + maglevel * 27.6)

return min, max

end



local combat40 = createCombatObject()

setCombatParam(combat40, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat40, COMBAT_PARAM_EFFECT, 3)

function onGetFormulaValues(cid, level, maglevel)

min = -(level * 15.3 + maglevel * 20.85)

max = -(level * 18.0 + maglevel * 27.6)

return min, max

end



local condition = Condition(CONDITION_PARALYZE)

condition:setParameter(CONDITION_PARAM_TICKS, 20000)

condition:setFormula(-0.9, 0, -0.9, 0)

combat10:setCondition(condition)

combat20:setCondition(condition)

combat30:setCondition(condition)

combat40:setCondition(condition)



setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")



local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr3)

local area4 = createCombatArea(arr4)

setCombatArea(combat10, area1)

setCombatArea(combat20, area2)

setCombatArea(combat30, area3)

setCombatArea(combat40, area4)



arr1 = {

{0, 1, 1, 1, 0},

{1, 1, 1, 1, 1},

{1, 1, 2, 1, 1},

{1, 1, 1, 1, 1},

{0, 1, 1, 1, 0},

}



arr2 = {

{0, 1, 1, 1, 0},

{1, 1, 1, 1, 1},

{1, 1, 2, 1, 1},

{1, 1, 1, 1, 1},

{0, 1, 1, 1, 0},

}



arr3 = {

{0, 1, 1, 1, 0},

{1, 1, 1, 1, 1},

{1, 1, 2, 1, 1},

{1, 1, 1, 1, 1},

{0, 1, 1, 1, 0},

}



arr4 = {

{0, 1, 1, 1, 0},

{1, 1, 1, 1, 1},

{1, 1, 2, 1, 1},

{1, 1, 1, 1, 1},

{0, 1, 1, 1, 0},

}



function onCastSpell(player, variant)

if checkSpellCd(player, cooldown_id, time_in_seconds) == false

then

return false

end

return combat10:execute(player, variant)

end

synatx issue



Variable pointing to non existent area at the time of execution. That would be my guess 🙂
 
Back
Top