What I find interesting is that after reading 70 pages of all sorts of fixes I have not even once read about the fact that upon leveling, a players mana doesn't seem to return to full. I'm quite sure that upon advancing a level both values, health and mana should return to full.
Now sure if any of you encountered the same bug, or just hadn't noticed but I'd gladly appreciate any answers helping me in this matter.
Besides that I've been having a lot of trouble with my banking NPC. For some odd reason it doesn't recognize the getNumber value, which indicated that this is missing somewhere in the NPChandler.lua file.
Config message:
Code:
data/npc/scripts/bank.lua:36: attempt to call global 'getNumber' <a nil value> stack traceback
data/npc/scripts/bank.lua:36: in function 'callback'
data/npc/scripts/lib/npcsystem/npchandler.lua:299: in function 'onCreatureSay'
data/npc/scripts/bank.lua:10: in function <data/npc/scripts/bank.lua:10:>
NPCHandler lines 287 - 308:
Code:
-- Handles onCreatureSay events. If you with to handle this yourself, please use the CALLBACK_CREATURE_SAY callback.
function NpcHandler:onCreatureSay(cid, msgtype, msg)
local callback = self:getCallback(CALLBACK_CREATURE_SAY)
if(callback == nil or callback(cid, msgtype, msg)) then
if(self:processModuleCallback(CALLBACK_CREATURE_SAY, cid, msgtype, msg)) then
if(not self:isInRange(cid)) then
return
end
if(self.keywordHandler ~= nil) then
local ret = self.keywordHandler:processMessage(cid, msg)
if(not ret) then
local callback = self:getCallback(CALLBACK_MESSAGE_DEFAULT)
if(callback ~= nil and callback(cid, msgtype, msg)) then
self.talkStart = os.time()
end
else
self.talkStart = os.time()
end
end
end
end
end
Bank.LUA lines 7-11
Code:
-- OTServ event handling functions start
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
Bank.LUA lines 35-57
Code:
----------------------CHANGE GOLD---------------------------------------------------------------------------------
elseif talkState == 8 and getNumber(msg) == 0 or getNumber(msg) >= 999 then
npcHandler:say('How many platinum coins do you want to get?')
elseif talkState == 8 then
n = getNumber(msg)
b = n * 100
npcHandler:say('So I should change '..b..' of your gold coins to '..n..' platinum coins for you?')
talkState = 9
elseif talkState == 9 then
if msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid, 2148, b) == TRUE then
doPlayerAddItem(cid, 2152, n)
npcHandler:say('Here you are.')
talkState = 0
else
npcHandler:say('You do not have enough money.')
talkState = 0
end
else
npcHandler:say('Ok. We cancel.')
talkState = 0
end
I've ben stuck with this bit of code for the longest of times now, and I can't seem to resolve it on my own.
Better yet, I need help.
Hopefully some of you are able to provide me with a satisfactory answer.
Yours,
Kjeld