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

Lua Groundshaker with bleeding condition

Kuantikum

Member
Joined
Jul 3, 2015
Messages
219
Solutions
1
Reaction score
20
Hello guys!

I'm trying to add the bleeding condition, but apparently I'm not getting it, there is no error in the log, the spell is normally casted, but nothing happens.
That was the modification I made so far:

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))
local condition = Condition(CONDITION_BLEEDING)
function onGetFormulaValues(player, skill, attack, factor)
    local min = (player:getLevel() / 5) + (skill * attack * 0.02) + 4
    local max = (player:getLevel() / 5) + (skill * attack * 0.03) + 6
    local damage = math.random(math.floor(min) * 1000, math.floor(max) * 1000) / 1000
    addDamageCondition(Condition, DAMAGELIST_LOGARITHMIC_DAMAGE and damage)
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end

I am so gratefull! 😍😘🥰
 
Solution
Hello guys!

I'm trying to add the bleeding condition, but apparently I'm not getting it, there is no error in the log, the spell is normally casted, but nothing happens.
That was the modification I made so far:

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))
local condition = Condition(CONDITION_BLEEDING)
function onGetFormulaValues(player, skill, attack, factor)
    local min = (player:getLevel() / 5) + (skill * attack * 0.02) + 4
    local max = (player:getLevel() / 5) +...
Hello guys!

I'm trying to add the bleeding condition, but apparently I'm not getting it, there is no error in the log, the spell is normally casted, but nothing happens.
That was the modification I made so far:

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))
local condition = Condition(CONDITION_BLEEDING)
function onGetFormulaValues(player, skill, attack, factor)
    local min = (player:getLevel() / 5) + (skill * attack * 0.02) + 4
    local max = (player:getLevel() / 5) + (skill * attack * 0.03) + 6
    local damage = math.random(math.floor(min) * 1000, math.floor(max) * 1000) / 1000
    addDamageCondition(Condition, DAMAGELIST_LOGARITHMIC_DAMAGE and damage)
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end

I am so gratefull! 😍😘🥰
You're initializing the condition but you're not adding any parameters nor are you assigning it to the combat. Look at how this works for reference:
Lua:
local condition = Condition(CONDITION_BLEEDING)
condition:setParameter(CONDITION_PARAM_DELAYED, 1)
condition:addDamage(10, 2000, -1)
combat:addCondition(condition)

By the way, you should include what TFS you are using in all your support questions so you can get the best answer possible.
 
Solution
I forgot, I am using TFS 1.3, I would like to add the damage with this base:
Lua:
local damage = math.random(math.floor(min) * 1000, math.floor(max) * 1000) / 1000
    addDamageCondition(Condition, DAMAGELIST_LOGARITHMIC_DAMAGE and damage)
or bleeding damage based on skills, is it possible?
 
Last edited:
Back
Top