Greetings!
I've configured an NPC that's located in
Pit's of Inferno, Venore.
What does he do?
He basicly just sends you out of Pit's of Inferno seal room.
Where does he sends you?
The script are based at a normal captain script, but basicly
just reconfigured so he'll use the rightful sentences, and
sends you to the rightful coordinates.
Coordinates: x=441, y=1327, z=8
These coordinates are the Pit's of Inferno, level door place based at FrankFarmers REAL-TIBIA Project.
Picture:
Picture of location where he is standing.
(NOTE THAT HE DOES NOT WALK AROUND. HE'S STANDING RIGHT STILL
THERE. NO WALKINTERVALS HAS BEEN ADDED.)
And then where you turn out... Not necessarily, but it might be good for
members that does not have the same coordinates, to easy navigate
the place yourself and reconfigure the coordinates.
These scripts are very basic!
But they are working as well as in the original Tibia.
Scripts & Guide:
1.
Create a new XML file in the "NPC" folder, inside your
data directory of your server. Name it 'A Ghostly Sage'
Copy and paste the following NPC codes into the XML
document, and follow to the next step!
A Ghostly Sage.xml
2.
Now we're up to creating a script file. Where we're going to place
some lua scripts, and functions.
Inside of your NPC folder, there's yet another folder called scripts.
In general all scripts are placed here, unless anywhere else has been directed
in the XML file of your NPC.
Well well, create a new LUA file, and name it 'Poi_out' or
any name of your own suggestion. (Note that you have to change script direction in the XML file of your NPC in case you chose any own name).
Copy and paste all this in to your LUA file.
Poi_out.lua
Further steps wont be written down.
But for a followed up "tutorial" how to change coordinates,
name of the NPC or placing the NPC somewhere else at your map, or
any other question of your own choise. Will be handeled in the comments below!
Hope this NPC will be helpful for your server,
and to create it as original as possible!
More to come, stay tuned!
Sincerely,
Siramix!
I've configured an NPC that's located in
Pit's of Inferno, Venore.
What does he do?
He basicly just sends you out of Pit's of Inferno seal room.
Where does he sends you?
The script are based at a normal captain script, but basicly
just reconfigured so he'll use the rightful sentences, and
sends you to the rightful coordinates.
Coordinates: x=441, y=1327, z=8
These coordinates are the Pit's of Inferno, level door place based at FrankFarmers REAL-TIBIA Project.
Picture:
Picture of location where he is standing.
(NOTE THAT HE DOES NOT WALK AROUND. HE'S STANDING RIGHT STILL
THERE. NO WALKINTERVALS HAS BEEN ADDED.)

And then where you turn out... Not necessarily, but it might be good for
members that does not have the same coordinates, to easy navigate
the place yourself and reconfigure the coordinates.

These scripts are very basic!
But they are working as well as in the original Tibia.
Scripts & Guide:
1.
Create a new XML file in the "NPC" folder, inside your
data directory of your server. Name it 'A Ghostly Sage'
Copy and paste the following NPC codes into the XML
document, and follow to the next step!
A Ghostly Sage.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="A Ghostly Sage" script="data/npc/scripts/poi_out.lua" walkinterval="0" floorchange="0">
<health now="100" max="100"/>
<look type="130" head="9" body="85" legs="9" feet="85" addons="1"/>
<parameters>
<parameter key="message_greet" value="Ah, I feel a mortal walks these ancient halls again. Pardon me, I barely notice you. I am so lost in my thoughts."/>
<parameter key="message_farewell" value="Good bye."/>
<parameter key="message_walkaway" value="Farewell then.." />
</parameters>
</npc>
2.
Now we're up to creating a script file. Where we're going to place
some lua scripts, and functions.
Inside of your NPC folder, there's yet another folder called scripts.
In general all scripts are placed here, unless anywhere else has been directed
in the XML file of your NPC.
Well well, create a new LUA file, and name it 'Poi_out' or
any name of your own suggestion. (Note that you have to change script direction in the XML file of your NPC in case you chose any own name).
Copy and paste all this in to your LUA file.
Poi_out.lua
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- 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
-- OTServ event handling functions end
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You will now be travelled out of here. Are you sure that you want to face that teleport?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=441, y=1327, z=8} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here in these ghostly halls.'})
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can offer you a {passage}.'})
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dont mind me.'})
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can offer you a {passage}.'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
Further steps wont be written down.
But for a followed up "tutorial" how to change coordinates,
name of the NPC or placing the NPC somewhere else at your map, or
any other question of your own choise. Will be handeled in the comments below!
Hope this NPC will be helpful for your server,
and to create it as original as possible!
More to come, stay tuned!
Sincerely,
Siramix!