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

Travel NPC problem

lol94

Loler
Joined
Dec 23, 2008
Messages
764
Reaction score
55
Location
Mexico
Hey Otland! i have this little bug, I really dont know whats wrong, well here is it:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Nimral" script="data/npc/scripts/default.lua" walkinterval="0" floorchange="0">
	<health now="150" max="150"/>
	<look type="96" head="0" body="0" legs="0" feet="0" corpse="2212"/>
    <parameters>
        <parameter key="module_travel" value="1"/>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. If you don't know where to flow, say {travel}."/>
        <parameter key="travel_destinations" value="Aleda,1218,1038,7,0;Leafport,1682,653,5,0;Fallen,1300,1557,5,0;Selroth,1735,1178,6,0;Seldia,1468,1364,5,0;Shadow Wood,863,920,5,0;"/>
    </parameters>
</npc>

but in ingame I got this:

Code:
16:24 Nimral: Hello Matt. If you don't know where to flow, say travel.
16:25 Matt [2]: travel
16:25 Nimral: I can bring you to Aleda, Leafport, Fallen, Selroth, Seldia and Shadow Wood.
16:25 Matt [2]: Leafport
16:25 Matt [2]: Fallen
16:25 Matt [2]: Seldia
16:25 Matt [2]: shadow wood
16:25 Matt [2]: aleda
16:25 Matt [2]: WTF? IS WRONG?
 
Try this:

LUA:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Nimral" script="data/npc/scripts/Nimral.lua" walkinterval="0" floorchange="0">
	<health now="150" max="150"/>
	<look type="96" head="0" body="0" legs="0" feet="0" corpse="2212"/>
</npc>

Nimral.lua
LUA:
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({'leafport'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Leafport for free?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=32310, y=32210, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
        
        keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? Leafport, Fallen, Seldia, Shadow Wood or Aleda?'})
        keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
		keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
       

        npcHandler:addModule(FocusModule:new())

Add other locations, edit position and costs...

And read http://otland.net/f16/proper-tagging-110327/

:}
 
Back
Top