Hello. I use TFS 1.4 8.6 Downgrade by Nekiro. I have the following problem. When I buy bless by bless talkaction or at npc Alice in database i can see but when i click on ceremonial ankh in game i see so in result i have only 3 bless?
Additionally i noticed that after buying blessing and without save when I die I lose my bp but when I relog or there will be global save Im not losing anything.
Bless talkaction:
Npc Alice:
Ceremonial ankh:
Additionally i noticed that after buying blessing and without save when I die I lose my bp but when I relog or there will be global save Im not losing anything.
Bless talkaction:
Lua:
-- 5 or 6 [twist of fate] ?
local totalBlessCount = 5
function onSay(player, words, param)
if player:hasBlessing(1) then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You are already blessed.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
else
local playerBlessCost
if player:getLevel() < 50 then
-- under level 50 it's free
playerBlessCost = 0
else
-- from level 50 cost 36k + 200 gold coins for each level
-- limit to maximum 120k
playerBlessCost = math.min(1000000, 36000 + (player:getLevel() - 50) * 600)
end
if player:removeMoney(playerBlessCost) then
for blessId = 1, totalBlessCount do
player:addBlessing(blessId)
end
player:sendCancelMessage("You received all blessings for " .. playerBlessCost .. " gold coins.")
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "You do not have enough money. Bless on your level costs " .. playerBlessCost .. " gold coins.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
end
end
return false
end
Npc Alice:
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local node1 = keywordHandler:addKeyword({'first bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first blessing for 10000 gold?'})
node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 1, premium = true, cost = 10000})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node2 = keywordHandler:addKeyword({'second bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the second blessing for 10000 gold?'})
node2:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 2, premium = true, cost = 10000})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node3 = keywordHandler:addKeyword({'third bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the third blessing for 10000 gold?'})
node3:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 3, premium = true, cost = 10000})
node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node4 = keywordHandler:addKeyword({'fourth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fourth blessing for 10000 gold?'})
node4:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 4, premium = true, cost = 10000})
node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node5 = keywordHandler:addKeyword({'fifth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fifth blessing for 10000 gold?'})
node5:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, bless = 5, premium = true, cost = 10000})
node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
npcHandler:addModule(FocusModule:new())
Ceremonial ankh:
Lua:
local blessings = {
"Spiritual Shielding",
"Embrace of Tibia",
"Fire of the Suns",
"Spark of the Phoenix",
"Wisdom of Solitude",
"Twist of Fate"
}
local checkBless = Action()
function checkBless.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local message = {"Received blessings:"}
for i, blessing in pairs(blessings) do
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, tostring(i))
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, tostring(player:hasBlessing(i)))
if player:hasBlessing(i) then
message[#message + 1] = blessing
end
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, #message == 1 and "No blessings received." or table.concat(message, '\n'))
return true
end
checkBless:id(12424, 6561)
checkBless:register()