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:
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()