• 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 how to get table with conditions?

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
969
Solutions
17
Reaction score
354
GitHub
olrios
Twitch
olrios
I need to make a spells what is doing increased dmg for each fire conditions target have on himself

player A have four fire conditions with different subids each. (1,2,3, and subid 4)

How to check in lua how many fireconditions he have?

getCondition works well, but it require subids, but what if I don't know subids of conditions? (have around 500 of them)

C++ also welcome.
 
I need to make a spells what is doing increased dmg for each fire conditions target have on himself

player A have four fire conditions with different subids each. (1,2,3, and subid 4)

How to check in lua how many fireconditions he have?

getCondition works well, but it require subids, but what if I don't know subids of conditions? (have around 500 of them)

C++ also welcome.
Hi,
Why u don't try to store the count of conditions in storage, and when you need to perform the dmg, just read the storage count?

Lua:
FIRE_CONDITION_COUNT_STORAGE = 1000

function Player.addFireCondition()
    local conditionCount = self:getStorageValue(FIRE_CONDITION_COUNT_STORAGE)
    self:setStorageValue(FIRE_CONDITION_COUNT_STORAGE, conditionCount + 1)
    return true
end

function Player.removeFireCondition()
    local conditionCount = self:getStorageValue(FIRE_CONDITION_COUNT_STORAGE)
    if conditionCount <= 0 then
        self:setStorageValue(FIRE_CONDITION_COUNT_STORAGE, 0)
        return false
    end
    self:setStorageValue(FIRE_CONDITION_COUNT_STORAGE, conditionCount - 1)
    return true
end

function Player.performFireDamage()
    local conditionCount = self:getStorageValue(FIRE_CONDITION_COUNT_STORAGE)
    --Do you damage based on conditionCount
end
 
Back
Top