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

[Help] Question on Conditions Damage (Poison,Fire,Drown etc...)

MarkSmartRemark

Lua-Noob in Training :D
Joined
Jan 27, 2010
Messages
139
Reaction score
3
Hi, can someone help me edit the conditions for conditions?

is there a way to change from regular tick everytime to random or magic level based??

i want a soulfire rune that does damage with magic level or using a formula like this one idk

PHP:
function onGetFormulaValues(cid, level, maglevel)
     min = ((maglevel*1.5)+10) 
     max = ((maglevel*1.5)+12) 
     return -min, -max
end

Ya know? something where i can control formula values of the ticks and all that.. the same 10 damage is kinda boring
 
Last edited:
onGetFormulaValues do not work with conditions.

You have to rewrite all to this (use it as a lesson):
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
local condition1 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition1, CONDITION_PARAM_DELAYED, 1)
setConditionParam(condition1, CONDITION_PARAM_FORCEUPDATE, TRUE)
addDamageCondition(condition1, 4, 4000, -6)
setCombatCondition(combat1, condition1)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
local condition2 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition2, CONDITION_PARAM_DELAYED, 1)
setConditionParam(condition2, CONDITION_PARAM_FORCEUPDATE, TRUE)
addDamageCondition(condition2, 5, 4000, -10)
setCombatCondition(combat2, condition2)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
local condition3 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition3, CONDITION_PARAM_DELAYED, 1)
setConditionParam(condition3, CONDITION_PARAM_FORCEUPDATE, TRUE)
addDamageCondition(condition3, 8, 4000, -18)
setCombatCondition(combat3, condition3)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
local condition4 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition4, CONDITION_PARAM_DELAYED, 1)
setConditionParam(condition4, CONDITION_PARAM_FORCEUPDATE, TRUE)
addDamageCondition(condition4, 12, 4000, -25)
setCombatCondition(combat4, condition4)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
local condition5 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition5, CONDITION_PARAM_DELAYED, 1)
setConditionParam(condition5, CONDITION_PARAM_FORCEUPDATE, TRUE)
addDamageCondition(condition5, 15, 4000, -40)
setCombatCondition(combat5, condition5)

local combat6 = createCombatObject()
setCombatParam(combat6, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
local condition6 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition6, CONDITION_PARAM_DELAYED, 1)
setConditionParam(condition6, CONDITION_PARAM_FORCEUPDATE, TRUE)
addDamageCondition(condition6, 18, 4000, -56)
setCombatCondition(combat6, condition6)

local combat7 = createCombatObject()
setCombatParam(combat7, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
local condition7 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition7, CONDITION_PARAM_DELAYED, 1)
setConditionParam(condition7, CONDITION_PARAM_FORCEUPDATE, TRUE)
addDamageCondition(condition7, 24, 4000, -64)
setCombatCondition(combat7, condition7)

local combat8 = createCombatObject()
setCombatParam(combat8, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
local condition8 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition8, CONDITION_PARAM_DELAYED, 1)
setConditionParam(condition8, CONDITION_PARAM_FORCEUPDATE, TRUE)
addDamageCondition(condition8, 30, 4000, -82)
setCombatCondition(combat8, condition8)

local combat9 = createCombatObject()
setCombatParam(combat9, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
local condition9 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition9, CONDITION_PARAM_DELAYED, 1)
setConditionParam(condition9, CONDITION_PARAM_FORCEUPDATE, TRUE)
addDamageCondition(condition9, 36, 4000, -112)
setCombatCondition(combat9, condition9)

function onCastSpell(cid, var)
local level = getPlayerLevel(cid)
if level < 8 then
return doCombat(cid, combat1, var)
elseif level >= 8 and level < 19 then
return doCombat(cid, combat2, var)
elseif level >= 19 and level < 27 then
return doCombat(cid, combat3, var)
elseif level >= 27 and level < 42 then
return doCombat(cid, combat4, var)
elseif level >= 42 and level < 50 then
return doCombat(cid, combat5, var)
elseif level >= 50 and level < 63 then
return doCombat(cid, combat6, var)
elseif level >= 63 and level < 75 then
return doCombat(cid, combat7, var)
elseif level >= 75 and level < 85 then
return doCombat(cid, combat8, var)
elseif level >= 85 then
return doCombat(cid, combat9, var)
end
return true
end

Use this code, shorter:
Code:
local combat = {}
for i = 1, 199 do
    combat[i] = createCombatObject()
    setCombatParam(combat[i], COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
end
local condition = {}
for j = 1, 199 do
    condition[j] = createConditionObject(CONDITION_CURSED)
    setConditionParam(condition[j], CONDITION_PARAM_DELAYED, 1)
    setConditionParam(condition[j], CONDITION_PARAM_FORCEUPDATE, TRUE)
    addDamageCondition(condition[j], math.ceil(j/20), 4000, -j)
    setCombatCondition(combat[j], condition[j])
end

function onCastSpell(cid, var)
    local level = getPlayerLevel(cid)
    if level > 199 then
        level = 199
    end
    doCombat(cid, combat[level], var)
    return true
end
 
onGetFormulaValues do not work with conditions.

You have to rewrite all to this (use it as a lesson):


Use this code, shorter:
Code:
local combat = {}
for i = 1, 199 do
    combat[i] = createCombatObject()
    setCombatParam(combat[i], COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
end
local condition = {}
for j = 1, 199 do
    condition[j] = createConditionObject(CONDITION_CURSED)
    setConditionParam(condition[j], CONDITION_PARAM_DELAYED, 1)
    setConditionParam(condition[j], CONDITION_PARAM_FORCEUPDATE, TRUE)
    addDamageCondition(condition[j], math.ceil(j/20), 4000, -j)
    setCombatCondition(combat[j], condition[j])
end

function onCastSpell(cid, var)
    local level = getPlayerLevel(cid)
    if level > 199 then
        level = 199
    end
    doCombat(cid, combat[level], var)
    return true
end

I will try both of them, and play around with them a little, thanks alot andu! rep~

Going to try and learn what that "FORCEUPDATE" does, i dont think ive seen it before loll
 
@andu Hey thanks alot.. i tried both of them and they work perfectly.. and i just came back and website is all different so im not really sure how to rep you haha :p

Just another question, the spells you gave me are based on level but there is no formula.. i understand that condition cant do this.. although they are nice and i will use

But Do you think it would work if i make a regular combat spell, and put "addEvent" with alot of combat but dont add COMBAT_PARAM_DISTANCEEFFECT?
maybe it can just be COMBAT_PARAM_TYPE and COMBAT_PARAM_EFFECT?
 
@andu Hey thanks alot.. i tried both of them and they work perfectly.. and i just came back and website is all different so im not really sure how to rep you haha :p

You can like posts. Down-left position in post, near reply.

Just another question, the spells you gave me are based on level but there is no formula.. i understand that condition cant do this.. although they are nice and i will use

But Do you think it would work if i make a regular combat spell, and put "addEvent" with alot of combat but dont add COMBAT_PARAM_DISTANCEEFFECT?
maybe it can just be COMBAT_PARAM_TYPE and COMBAT_PARAM_EFFECT?

You can edit whatever you want, if you want a new formula you have to define it easy in 2nd code I posted to you.
Eg:
Code:
local lv = getPlayerLevel(cid)
local ml = getPlayerMagLevel(cid)
local formula = (ml * 4) + lv
doCombat(cid, combat[formula], var)

But for eg. if is on your server a character with level 300 and mlv 120, you have to calculate it.
(300 * 4) + 120 = 1320

So,
Code:
for i = 1, 199 do
combat[i] = createCombatObject()
setCombatParam(combat[i], COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
end
Should have at least
Code:
for i = 1, 1320 do
Unless code will not work
 
Back
Top