Forkz
Well-Known Member
- Joined
- Jun 29, 2020
- Messages
- 380
- Solutions
- 1
- Reaction score
- 89
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.
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