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

Azerty

Active Member
Joined
Apr 15, 2022
Messages
334
Solutions
4
Reaction score
36
How do I make the damage increase instead of decreasing?

Lua:
local condition = Condition(CONDITION_CURSED, CONDITIONID_COMBAT)
condition:setParameter(CONDITION_PARAM_DELAYED, true)
condition:setParameter(CONDITION_PARAM_MINVALUE, -1)
condition:setParameter(CONDITION_PARAM_MAXVALUE, -1000)
condition:setParameter(CONDITION_PARAM_STARTVALUE, 50)
condition:setParameter(CONDITION_PARAM_TICKINTERVAL, 2000)
condition:setParameter(CONDITION_PARAM_FORCEUPDATE, true)

local deathin = MoveEvent()
function deathin.onStepIn(player, creature, target, item, pos, fromPosition)
local cid = player:getId()
   if player:isPlayer() then
     if player:getCondition(CONDITION_CURSED,CONDITIONID_COMBAT) == nil then
     player:addCondition(condition)
     end
     if player:getStorageValue(17100) > os.time() then
     if player:getStorageValue(17101) < 1 then
       player:setStorageValue(17101,1)
     end
     end
   end

   return true
end
deathin:type("stepin")
deathin:id(37449)
deathin:register()

local tile = {37449}

local deathing = MoveEvent()
function deathing.onStepOut(player, item, pos)
local cid = player:getId()
   if player:isPlayer() then
     local ppos = player:getPosition()
     if(isInArray(tile, getThingfromPos({x = ppos.x, y = ppos.y, z = ppos.z, stackpos = 0}).itemid)) then
       return true
     else
        doRemoveCondition(player, CONDITION_CURSED)     
       if player:getStorageValue(17101) == 1 then
         player:setStorageValue(17101,0)
       end
     end
   end
   return true
end

deathing:type("stepOut")
deathing:id(37449)
deathing:register()
 
How do I make the damage increase instead of decreasing?

Lua:
local condition = Condition(CONDITION_CURSED, CONDITIONID_COMBAT)
condition:setParameter(CONDITION_PARAM_DELAYED, true)
condition:setParameter(CONDITION_PARAM_MINVALUE, -1)
condition:setParameter(CONDITION_PARAM_MAXVALUE, -1000)
condition:setParameter(CONDITION_PARAM_STARTVALUE, 50)
condition:setParameter(CONDITION_PARAM_TICKINTERVAL, 2000)
condition:setParameter(CONDITION_PARAM_FORCEUPDATE, true)

local deathin = MoveEvent()
function deathin.onStepIn(player, creature, target, item, pos, fromPosition)
local cid = player:getId()
   if player:isPlayer() then
     if player:getCondition(CONDITION_CURSED,CONDITIONID_COMBAT) == nil then
     player:addCondition(condition)
     end
     if player:getStorageValue(17100) > os.time() then
     if player:getStorageValue(17101) < 1 then
       player:setStorageValue(17101,1)
     end
     end
   end

   return true
end
deathin:type("stepin")
deathin:id(37449)
deathin:register()

local tile = {37449}

local deathing = MoveEvent()
function deathing.onStepOut(player, item, pos)
local cid = player:getId()
   if player:isPlayer() then
     local ppos = player:getPosition()
     if(isInArray(tile, getThingfromPos({x = ppos.x, y = ppos.y, z = ppos.z, stackpos = 0}).itemid)) then
       return true
     else
        doRemoveCondition(player, CONDITION_CURSED)  
       if player:getStorageValue(17101) == 1 then
         player:setStorageValue(17101,0)
       end
     end
   end
   return true
end

deathing:type("stepOut")
deathing:id(37449)
deathing:register()
think it's hardcoed in source :( like poison but not 100% sure i use tfs 1.4 protocol 8.6
and when i use curse i start from 19 few hits then 9 and so on my script looks like this
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)

function onCastSpell(creature, variant)
    local min = (creature:getLevel() / 80) + (creature:getMagicLevel() * 0.5) + 7
    local max = (creature:getLevel() / 80) + (creature:getMagicLevel() * 0.9) + 8
    local damage = math.random(math.floor(min), math.floor(max))
    for _, target in ipairs(combat:getTargets(creature, variant)) do
        creature:addDamageCondition(target, CONDITION_CURSED, DAMAGELIST_EXPONENTIAL_DAMAGE, damage)
    end
    return true
end
Post automatically merged:

@Mateus Robeerto ?
 
I'm using Nekiro's 8.60 downgrade, I not know if it will work in your version, but, I do it at this way:

Lua:
local startDamage = 100
local increaseMultiplier = 1.2
local ticks = 5
local tickInterval = 500

--common attack
local combat_melee = Combat()
combat_melee:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
--for COMBAT_FORMULA_DAMAGE, only the 1° and 3° values matters. It's a common randon betwen min and max.
combat_melee:setFormula(COMBAT_FORMULA_DAMAGE, -1, 0, -2, 0)

local cursed_condition = Condition(CONDITION_CURSED)
local damage = startDamage
cursed_condition:addDamage(1, tickInterval, -startDamage)

for i = 2, ticks do
    --you can also add a value for each damage instead of a multiplier, like:
    --damage = damage + 20
    damage = damage * increaseMultiplier
    cursed_condition:addDamage(1, tickInterval, -damage)
end

combat_melee:addCondition(cursed_condition)

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

Note that it's useful to do a specific damage.
For same damage over time, there's a better solution using CONDITION_PARAM_TICKS.
 
Back
Top