• 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
332
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 ?
 
Back
Top