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
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...
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
player:sendAdventurerBlessing()
return true
end
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
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()
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()
-- Advanced NPC System by Jiddo if Modules == nil then -- default words for - Pastebin.com6 is the twist of fate.
7 the adventurer blessing.
post your npc/lib/modules
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
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
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
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()
That is not possible due client limitations.its possible in tibia 8.6? i tried and get debug, have someway to make in tfs 1,2 for 8.6?