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

C++ Bless System tfs 1.2

Fortera Global

Intermediate OT User
Joined
Nov 20, 2015
Messages
1,180
Solutions
2
Reaction score
117
Hello, anyone know make this?
Yellow around the equipment, when the player is with the bless.
tfs 1.2 or 1.3 protocol 10.99+

6f57e7635ffb47f7b38348bdcc95d283.png


thanks
 
Solution
Code:
else
            npcHandler:say(parameters.text or "You have been blessed by one of the five gods!", cid)
            if parameters.bless == 4 then
                player:setStorageValue(Storage.KawillBlessing, 0)
            end
            player:addBlessing(parameters.bless)
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        end
replace x this
Code:
else
            npcHandler:say(parameters.text or "You have been blessed by one of the five gods!", cid)
            if parameters.bless == 4 then
                player:setStorageValue(Storage.KawillBlessing, 0)
            end
            player:addBlessing(parameters.bless)
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
if...
find server/data/lib/core/player.lua

at the end of the document, add this.

Code:
function Player.sendAdventurerBlessing(self)
    local msg = NetworkMessage()
    msg:addByte(0x9C)
    msg:addU16(self:hasBlessing(7) and 0x01 or 0x00)
    msg:sendToPlayer(self)
    msg:delete()
end

find server/data/creaturescript/other/login.lua

at the end of the document, add this.

Code:
player:sendAdventurerBlessing()

above the:

Code:
return true
end

server/data/actions/blessingcharms.lua

replace all the document for this.

Code:
local config = {
    [11258] = {blessId = 4, text = 'The Spark of the Phoenix'},
    [11259] = {blessId = 2, text = 'The Embrace of Tibia'},
    [11260] = {blessId = 1, text = 'The Spiritual Shielding'},
    [11261] = {blessId = 3, text = 'The Fire of the Suns'},
    [11262] = {blessId = 5, text = 'The Wisdom of Solitude'}
}

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)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, useItem.text .. ' protects you.')
    player:getPosition():sendMagicEffect(CONST_ME_LOSEENERGY)
    item:remove(1)
    if player:hasBlessing(1) and player:hasBlessing(2) and     player:hasBlessing(3) and player:hasBlessing(4) and     player:hasBlessing(5) then
    player:addBlessing(7)
    player:sendAdventurerBlessing()
    end
    return true
end

now you need to edit your Npcs(temple) to check if the player have five regular blessings to send the adventurer blessing.

here is the code needed to the npcs.

Code:
  if player:hasBlessing(1) and player:hasBlessing(2) and     player:hasBlessing(3) and player:hasBlessing(4) and     player:hasBlessing(5) then
    player:addBlessing(7)
    player:sendAdventurerBlessing()
 
Last edited:
find server/data/lib/core/player.lua

at the end of the document, add this.

Code:
function Player.sendAdventurerBlessing(self)
    local msg = NetworkMessage()
    msg:addByte(0x9C)
    msg:addU16(self:hasBlessing(7) and 0x01 or 0x00)
    msg:sendToPlayer(self)
    msg:delete()
end

find server/data/creaturescript/other/login.lua

at the end of the document, add this.

Code:
player:sendAdventurerBlessing()

above the:

Code:
return true
end

server/data/actions/blessingcharms.lua

replace all the document for this.

Code:
local config = {
    [11258] = {blessId = 4, text = 'The Spark of the Phoenix'},
    [11259] = {blessId = 2, text = 'The Embrace of Tibia'},
    [11260] = {blessId = 1, text = 'The Spiritual Shielding'},
    [11261] = {blessId = 3, text = 'The Fire of the Suns'},
    [11262] = {blessId = 5, text = 'The Wisdom of Solitude'}
}

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)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, useItem.text .. ' protects you.')
    player:getPosition():sendMagicEffect(CONST_ME_LOSEENERGY)
    item:remove(1)
    if player:hasBlessing(1) and player:hasBlessing(2) and     player:hasBlessing(3) and player:hasBlessing(4) and     player:hasBlessing(5) then
    player:addBlessing(7)
    player:sendAdventurerBlessing()
    end
    return true
end

now you need to edit your Npcs(temple) to check if the player have five regular blessings to send the adventurer blessing.

here is the code needed to the npcs.

Code:
  if player:hasBlessing(1) and player:hasBlessing(2) and     player:hasBlessing(3) and player:hasBlessing(4) and     player:hasBlessing(5) then
    player:addBlessing(7)
    player:sendAdventurerBlessing()

hey, THANKS!
can you give an example with this script in some npcs temple?

PS. dont is player:addBlessing(6) ? why 7?
 
Hey I have free bless for level 100.
Its right?:

Lua:
local freeBlessMaxLevel = 100

function onLogin(cid)
    local player = Player(cid)
    if player:getLevel() <= freeBlessMaxLevel then
        for i = 1, 7 do
            player:addBlessing(i)
            player:sendAdventurerBlessing()
        end
        player:say('FREE BLESS LVL 100.', TALKTYPE_ORANGE_1)
        player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE)
    end
    return true
end
 
Code:
else
            npcHandler:say(parameters.text or "You have been blessed by one of the five gods!", cid)
            if parameters.bless == 4 then
                player:setStorageValue(Storage.KawillBlessing, 0)
            end
            player:addBlessing(parameters.bless)
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        end
replace x this
Code:
else
            npcHandler:say(parameters.text or "You have been blessed by one of the five gods!", cid)
            if parameters.bless == 4 then
                player:setStorageValue(Storage.KawillBlessing, 0)
            end
            player:addBlessing(parameters.bless)
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
if player:hasBlessing(1) and player:hasBlessing(2) and     player:hasBlessing(3) and player:hasBlessing(4) and     player:hasBlessing(5) then
  player:addBlessing(7)
    player:sendAdventurerBlessing()
        end
 
Solution
its possible in tibia 8.6? i tried and get debug, have someway to make in tfs 1,2 for 8.6?
find server/data/lib/core/player.lua

at the end of the document, add this.

Code:
function Player.sendAdventurerBlessing(self)
    local msg = NetworkMessage()
    msg:addByte(0x9C)
    msg:addU16(self:hasBlessing(7) and 0x01 or 0x00)
    msg:sendToPlayer(self)
    msg:delete()
end

find server/data/creaturescript/other/login.lua

at the end of the document, add this.

Code:
player:sendAdventurerBlessing()

above the:

Code:
return true
end

server/data/actions/blessingcharms.lua

replace all the document for this.

Code:
local config = {
    [11258] = {blessId = 4, text = 'The Spark of the Phoenix'},
    [11259] = {blessId = 2, text = 'The Embrace of Tibia'},
    [11260] = {blessId = 1, text = 'The Spiritual Shielding'},
    [11261] = {blessId = 3, text = 'The Fire of the Suns'},
    [11262] = {blessId = 5, text = 'The Wisdom of Solitude'}
}

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)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, useItem.text .. ' protects you.')
    player:getPosition():sendMagicEffect(CONST_ME_LOSEENERGY)
    item:remove(1)
    if player:hasBlessing(1) and player:hasBlessing(2) and     player:hasBlessing(3) and player:hasBlessing(4) and     player:hasBlessing(5) then
    player:addBlessing(7)
    player:sendAdventurerBlessing()
    end
    return true
end

now you need to edit your Npcs(temple) to check if the player have five regular blessings to send the adventurer blessing.

here is the code needed to the npcs.

Code:
  if player:hasBlessing(1) and player:hasBlessing(2) and     player:hasBlessing(3) and player:hasBlessing(4) and     player:hasBlessing(5) then
    player:addBlessing(7)
    player:sendAdventurerBlessing()
 
Back
Top