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

Npc travel problem

Hafexo

New Member
Joined
Jul 14, 2009
Messages
27
Reaction score
2
Witam,

Mam problem z npc od travel, gdyż jak mu mówie gdzie chce popłynąć i gdy on sie pyta czy na pewno i mu mówie tak, to w wypadku gdy ustawiłem ze ma brać kase to ją bierze, nie przenosi i mówi ze nie mam tyle kasy, a jak ustawione ze ma nie brać to nie bierze, nie przenosi i gada że nie mam forsy.
Mój silnik TFS 0.3.4pl2 [8.42]

skrypt boat.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

	local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to bring you to Svargrond?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=509, y=667, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'}) 
	
	
	
	local travelNode = keywordHandler:addKeyword({'trimeria'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to bring you to Trimeria?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1069, y=1048, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'}) 

			
			
	local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to bring you to Port Hope?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=966, y=1194, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'}) 

			
			
	local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to bring you to Darashia?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=993, y=1484, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'}) 
			
			
	local travelNode = keywordHandler:addKeyword({'origmar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to bring you to Origmar?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=830, y=1034, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'}) 

			
	local travelNode = keywordHandler:addKeyword({'premmy isle'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to bring you to Premmy Isle?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=759, y=1089, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'}) 

npcHandler:addModule(FocusModule:new())

timral.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Timral" script="data/npc/scripts/boat.lua" walkinterval="2000" floorchange="0">
	<health now="150" max="150"/>
	<look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/>
    <parameters>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I can take you to {Trimeria}, {Darashia}, {Port Hope}, {Svargrond}, {Origmar} and {Premmy Isle}."/>
    </parameters>
</npc>

Z góry za pomoc thx ;)
 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1069, y=1048, z=6} })

Na 100% dobra pozycja?
 
Back
Top