Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.24 KB | None | 0 0
  1. local keywordHandler = KeywordHandler:new()
  2.         local npcHandler = NpcHandler:new(keywordHandler)
  3.         NpcSystem.parseParameters(npcHandler)
  4.        
  5.        
  6.        
  7.         -- OTServ event handling functions start
  8.         function onCreatureAppear(cid)              npcHandler:onCreatureAppear(cid) end
  9.         function onCreatureDisappear(cid)           npcHandler:onCreatureDisappear(cid) end
  10.         function onCreatureSay(cid, type, msg)  npcHandler:onCreatureSay(cid, type, msg) end
  11.         function onThink()                      npcHandler:onThink() end
  12.         -- OTServ event handling functions end
  13.        
  14.        
  15.         -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
  16.        
  17.             local travelNode = keywordHandler:addKeyword({'kazordoon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'So you want to go to Kazordoon for free?'})
  18.             travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32659, y=31958, z=15} })
  19.             travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
  20.  
  21.             local travelNode = keywordHandler:addKeyword({'Zao'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'So you want to go to Zao for free?'})
  22.             travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33025, y=31554, z=10} })
  23.             travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
  24.            
  25.         keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {Kazordoon} or {Zao}.'})
  26.         keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this steamship.'})
  27.         keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {Kazordoon} or {Zao}.'})
  28.         -- Makes sure the npc reacts when you say hi, bye etc.
  29.         npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement