Guest User

Untitled

a guest
Dec 14th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 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. function kick(cid, message, keywords, parameters, node)
  15. if(not npcHandler:isFocused(cid)) then
  16. return false
  17. end
  18.  
  19. npcHandler:releaseFocus(cid)
  20. local tmp, new = getThingPos(cid), {x = math.random(32320, 32321), y = math.random(32212, 32216), z = 6}
  21. doTeleportThing(cid, new)
  22. doSendMagicEffect(tmp, CONST_ME_TELEPORT)
  23. doSendMagicEffect(new, CONST_ME_TELEPORT)
  24.  
  25. return true
  26. end
  27.  
  28. keywordHandler:addKeyword({'kick'}, kick, {})
  29.  
  30.  
  31. -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
  32.  
  33. local travelNode = keywordHandler:addKeyword({'carlin'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32387, y=31820, z=6} })
  34. local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32311, y=32210, z=6} })
  35. local travelNode = keywordHandler:addKeyword({'ab\'dendriel'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32734, y=31668, z=6} })
  36. local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33173, y=31764, z=6} })
  37. local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32954, y=32022, z=6} })
  38. local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32527, y=32784, z=6} })
  39. local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32341, y=31108, z=6} })
  40. local travelNode = keywordHandler:addKeyword({'liberty bay'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32285, y=32892, z=6} })
  41. local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32816, y=31272, z=6} })
  42. local travelNode = keywordHandler:addKeyword({'oken'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=25584, y=32338, z=6} })
  43. local travelNode = keywordHandler:addKeyword({'pyre'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=21617, y=32211, z=6} })
  44. local travelNode = keywordHandler:addKeyword({'heniguam'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=31403, y=32836, z=6} })
  45. local travelNode = keywordHandler:addKeyword({'kirrien'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=31789, y=32382, z=8} })
  46. local travelNode = keywordHandler:addKeyword({'weronia'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=31268, y=31921, z=6} })
  47.  
  48. keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? To Carlin, Ab\'Dendriel, Edron, Heniguam, Pyre, Oken, Venore, Port Hope, Liberty Bay, Yalahar, Svargrond and Weronia.'})
  49. keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
  50. keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
  51.  
  52.  
  53. npcHandler:addModule(FocusModule:new())
Add Comment
Please, Sign In to add comment