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

!bless tfs 1.3

xGustadoIts

New Member
Joined
Apr 13, 2015
Messages
50
Reaction score
0
I would like to make this script work on a single item

Code:
local config = {
    [11260] = {blessId = 5, text = 'The Spiritual Shielding'},
    [11259] = {blessId = 6, text = 'The Embrace of Tibia'},
    [11261] = {blessId = 4, text = 'The Fire of the Suns'},
    [11258] = {blessId = 3, text = 'The Spark of the Phoenix'},
    [11262] = {blessId = 2, text = 'The Wisdom of Solitude'},
    [28036] = {blessId = 7, text = 'Heart of the Mountain'},
    [28037] = {blessId = 8, text = 'Blood of the Mountain'}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local useItem = config[item.itemid]
    if not useItem then
        return true
    end

    if player:hasBlessing(useItem.blessId) then
        player:say('You already possess this blessing.', TALKTYPE_MONSTER_SAY)
        return true
    end

    player:addBlessing(useItem.blessId,1)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, useItem.text .. ' protects you.')
    player:getPosition():sendMagicEffect(CONST_ME_LOSEENERGY)
    item:remove(1)
    return true
end
 
Lua:
local getPlayerBlessings(player)
    local t = 0
    for i = 2, 8 do
        if player:hasBlessing(i) then
            t = t + 1
        end
    end
    return t < 7 and false or true
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if getPlayerBlessings(player) then
        player:say('You are already blessed.', TALKTYPE_MONSTER_SAY)
        return true
    end
    for i = 1, 8 do
        player:addBlessing(i,1)
    end
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You are now blessed.')
    player:getPosition():sendMagicEffect(CONST_ME_LOSEENERGY)
    item:remove(1)
    return true
end

Try this out!
 

Similar threads

Back
Top