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

LUA (bonus+10magic with full set)

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,210
Solutions
35
Reaction score
207
Hello guys, how are u?
I'm using tfs 0.4 tibia 8.6

If a player are using a full set:
Blue Helm
Blue Armor
Blue Legs
Blue Boots

If he are using this full set, he will gain +10magic level.
Tkx!
 
Hello guys, how are u?
I'm using tfs 0.4 tibia 8.6

If a player are using a full set:
Blue Helm
Blue Armor
Blue Legs
Blue Boots

If he are using this full set, he will gain +10magic level.
Tkx!
Try this, sorry if it doesn't work its been a while ;)
LUA:
local set = { -- each index should be an itemid
    [12345] = 1,
    [12342] = 1,
    [12344] = 1,
    [12347] = 1,
    [12349] = 1,
}

function max(x)
    local c = -1
    for _, v in pairs(x) do
        c = c + 1
    end
    return c
end

local storage, isset = 123456, 999999

local magicLevel = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(magicLevel, CONDITION_PARAM_BUFF, true)
setConditionParam(magicLevel, CONDITION_PARAM_TICKS, -1)
setConditionParam(magicLevel, CONDITION_PARAM_STAT_MAGICLEVEL, 10)

function onEquip(cid, item, slot)
    local slots = getPlayerSlotItem(cid, slot)
    if slots.itemid ~= item.itemid then
        return true
    end
    setPlayerStorageValue(cid, storage, set[item.itemid] + 1)
    if getPlayerStorageValue(cid, storage) == max(set) and getPlayerStorageValue(cid, isset) == -1 then
        setPlayerStorageValue(cid, isset, 1)
        doAddCondition(cid, magicLevel)
    end
    return true
end

function onDeEquip(cid, item, slot)
    if getPlayerStorageValue(cid, isset) == 1 then
        doRemoveCondition(cid, CONDITION_ATTRIBUTES)
        setPlayerStorageValue(cid, isset, -1)
    end
    setPlayerStorageValue(cid, storage, set[item.itemid] - 1)
    return true
end
 
Back
Top