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

Solved [SOLVED] How to implement the OLD NPC system (default channel)

AdiMit

c(;
Joined
May 2, 2016
Messages
70
Solutions
2
Reaction score
3
Hello :)

I'm using the [9.80-9.86] The Forgotten Server v0.2.15 (Mystic Spirit) for private purposes (just me and my friends) and as the NPCs Channel/Chat Window is not working (not opening) in >>OTClient<< (though it works fine in the regular Tibia client) I was wondering if implementing the retro npc system would resolve this...
Well, since it is an RPG server, I thought that not only might it be easier to do than fixing the bug connected with OTClient but also provide greater immersion.

What I'm asking for are some pieces of advice regarding the implementing of the retro NPC system. (interacting in the Default chat, 1 player at a time...)

Thanks in advance,
Best regards! :)
 
Solution
The strange thing is that I'm using the newest release of OTClient:

"Commit df422c0 [Latest Upload]
Commit date: 4th February 2017
Lastest version supported: 10.99"

I haven't seen any posts regarding this issue, so, perhaps, the problem might concern my npc data files, as I doubt that no one would report the bug since the 4th of February...
I'm going to take your advice and try to fix the issue on the OTClient's side then...

If you happen to use the OTClient, does the NPCs chat window pop up for you?
I can't seem to engage in any further conversation besides 'hi' and 'bye'

Just to be sure whether it is the fault of my npc data files or not, I will post the one regarding blessings below:

Lua:
local...
Hard to say without looking at the codes, but most likely some source edits and then editing the npc lib files.
Might take you 1 min, might take you a couple of hours :p

OTClient should be easier to edit, start by checking the source code and then the Lua modules files;
otclient/game.cpp at master · edubart/otclient · GitHub
 
Hard to say without looking at the codes, but most likely some source edits and then editing the npc lib files.
Might take you 1 min, might take you a couple of hours :p

OTClient should be easier to edit, start by checking the source code and then the Lua modules files;
otclient/game.cpp at master · edubart/otclient · GitHub

The strange thing is that I'm using the newest release of OTClient:

"Commit df422c0 [Latest Upload]
Commit date: 4th February 2017
Lastest version supported: 10.99"

I haven't seen any posts regarding this issue, so, perhaps, the problem might concern my npc data files, as I doubt that no one would report the bug since the 4th of February...
I'm going to take your advice and try to fix the issue on the OTClient's side then...

If you happen to use the OTClient, does the NPCs chat window pop up for you?
I can't seem to engage in any further conversation besides 'hi' and 'bye'

Just to be sure whether it is the fault of my npc data files or not, I will post the one regarding blessings below:

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
function onPlayerEndTrade(cid)                npcHandler:onPlayerEndTrade(cid)            end
function onPlayerCloseChannel(cid)            npcHandler:onPlayerCloseChannel(cid)        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())
 
The strange thing is that I'm using the newest release of OTClient:

"Commit df422c0 [Latest Upload]
Commit date: 4th February 2017
Lastest version supported: 10.99"

I haven't seen any posts regarding this issue, so, perhaps, the problem might concern my npc data files, as I doubt that no one would report the bug since the 4th of February...
I'm going to take your advice and try to fix the issue on the OTClient's side then...

If you happen to use the OTClient, does the NPCs chat window pop up for you?
I can't seem to engage in any further conversation besides 'hi' and 'bye'

Just to be sure whether it is the fault of my npc data files or not, I will post the one regarding blessings below:

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
function onPlayerEndTrade(cid)                npcHandler:onPlayerEndTrade(cid)            end
function onPlayerCloseChannel(cid)            npcHandler:onPlayerCloseChannel(cid)        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())

That files dosn't handle anything regarding to the npc channel, as I said look in your lib files.
Can't say, the OTC I have is pretty modified haha, but for me it does show up on both 8.6 and 10.x servers, but might be a bug I fixed can't say, best would be for you to try it on another server with the same client version.
 
Solution
That files dosn't handle anything regarding to the npc channel, as I said look in your lib files.
Can't say, the OTC I have is pretty modified haha, but for me it does show up on both 8.6 and 10.x servers, but might be a bug I fixed can't say, best would be for you to try it on another server with the same client version.

Thank you, I will try to check it on other servers as well as other versions :)
 
Back
Top