Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.00 KB | None | 0 0
  1. local keywordHandler = KeywordHandler:new()
  2. local npcHandler = NpcHandler:new(keywordHandler)
  3. NpcSystem.parseParameters(npcHandler)
  4.  
  5. function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
  6. function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
  7. function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
  8. function onThink() npcHandler:onThink() end
  9.  
  10. local cfg = {
  11. storage = 12122, -- Não precisa Mexer
  12. tasksto = 12123, -- Não precisa Mexer
  13. count = {50, 20}, -- Quantos Thorins
  14. pacote = {id = 2663, count = 1}, -- Pacote Intacto e Quantidade
  15. hydra = {id = 2663, count = 1, city = "nome da city"},
  16. }
  17.  
  18. function creatureSayCallback(cid, type, msg)
  19. if not npcHandler:isFocused(cid) then
  20. return false
  21. end
  22.  
  23. if msgcontains(msg, 'mission') then
  24. if getPlayerStorageValue(cid, cfg.storage) < 1 then
  25. npcHandler:say('You may already know that some people from overseas do not look at us with good eyes, Thorin is afraid that a possible traitor enters his city and destroys his accomplishments, but i belive that not all warriors are like that, and im ready to proove him so, if you agree to perfom certains tasks that proove your skills as a warrior and your loyalty to us. Are you willing to try?')
  26. talk_state = 1
  27. elseif getPlayerStorageValue(cid, cfg.storage) == 1 then
  28. if getPlayerStorageValue(cid, cfg.tasksto) < cfg.count[1] then
  29. npcHandler:say('You killed '..getPlayerStorageValue(cid, cfg.tasksto)..' minotaur furious by now, come back when you kill '..cfg.count[1]..'.')
  30. talk_state = 0
  31. else
  32. npcHandler:say('Congratulations you have successfully completed this mission, i have a task a little more difficult this time, would you do it?')
  33. talk_state = 2
  34. end
  35. elseif getPlayerStorageValue(cid, cfg.storage) == 2 then
  36. if getPlayerStorageValue(cid, cfg.tasksto) < cfg.count[2] then
  37. npcHandler:say('You killed '..getPlayerStorageValue(cid, cfg.tasksto)..' minotaur leaders by now, come back when you kill '..cfg.count[2]..'.')
  38. talk_state = 0
  39. else
  40. npcHandler:say('Congratulations you have successfully completed this mission, i have a task a little more difficult this time, would you do it?')
  41. talk_state = 3
  42. end
  43.  
  44. elseif getPlayerStorageValue(cid, cfg.storage) == 3 then
  45. npcHandler:say('Your mission has already been given, delivered to the npc Sirius at the entrance of the city of Dundeya, 50 horn minotaurs and a dragon scale mail, in return he will give you a package that should not be breached and should be brought to me immediately, I am waiting.')
  46. talk_state = 0
  47.  
  48. elseif getPlayerStorageValue(cid, cfg.storage) == 4 then
  49. npcHandler:say('What takes my young man, I hate to wait, I hope my package is intact, you brought him, correct?')
  50. talk_state = 5
  51.  
  52. elseif getPlayerStorageValue(cid, cfg.storage) == 5 then
  53. npcHandler:say('Trouxe a porra toda?')
  54. talk_state = 6
  55.  
  56. end
  57.  
  58. -- [[ Mino Furious ]] --
  59. elseif msgcontains(msg, 'yes') and talk_state == 1 then
  60. npcHandler:say('I see you have courage, kill 50 Minotaur Furious and if you manage to stay alive Come Back here, and ill give you your second mission.')
  61. setPlayerStorageValue(cid, cfg.storage, 1)
  62. setPlayerStorageValue(cid, cfg.tasksto, 0)
  63. talk_state = 0
  64.  
  65. -- [[ Mino Leaders ]] --
  66. elseif msgcontains(msg, 'yes') and talk_state == 2 then
  67. npcHandler:say('Do you have enough strength to kill 50 minotaurs leaders?')
  68. setPlayerStorageValue(cid, cfg.storage, 2)
  69. setPlayerStorageValue(cid, cfg.tasksto, 0)
  70. talk_state = 0
  71.  
  72. -- [[ Ativando Missão dos Itens ]] --
  73. elseif msgcontains(msg, 'yes') and talk_state == 3 then
  74. npcHandler:say('Its time for you to prove that you are cold-blooded and willing to give up material stuff, delivered to Sirius npc at the entrance to the city of Dundeya, 50 minotaur horn and a dragon scale mail, in exchange he will give you a package that should not Be violated and must be brought to me immediately, can I trust you?')
  75. talk_state = 4
  76.  
  77. elseif msgcontains(msg, 'yes') and talk_state == 4 then
  78. npcHandler:say('Okay, then go.')
  79. setPlayerStorageValue(cid, cfg.storage, 3)
  80. setPlayerStorageValue(cid, cfg.tasksto, 0)
  81. talk_state = 0
  82.  
  83. -- [[ Trazendo Itens ]] --
  84. elseif msgcontains(msg, 'yes') and talk_state == 5 then
  85. if getPlayerItemCount(cid, cfg.pacote.id) >= cfg.pacote.count then
  86. doPlayerRemoveItem(cid, cfg.pacote.id, cfg.pacote.count)
  87. npcHandler:say('All right then, now you have access to the city of Dundeya.')
  88. setPlayerStorageValue(cid, cfg.storage, 5)
  89. talk_state = 0
  90. else
  91. npcHandler:say('Do not try to curl up, wheres the package you promised me?')
  92. talk_state = 0
  93. end
  94.  
  95. -- [[ Finalizando Acesso Cidade ]] --
  96. elseif msgcontains(msg, 'yes') and talk_state == 6 then
  97. if getPlayerItemCount(cid, cfg.hydra.id) >= cfg.hydra.count then
  98. doPlayerRemoveItem(cid, cfg.hydra.id, cfg.hydra.count)
  99. npcHandler:say('All right then, now you have access to the city of '..hydra.city..'.')
  100. setPlayerStorageValue(cid, cfg.storage, 6)
  101. talk_state = 0
  102. else
  103. npcHandler:say('Do not try to curl up, wheres the '..cfg.hydra.count..' '..getItemNameById(cfg.hydra.id)..'?')
  104. talk_state = 0
  105. end
  106. end
  107.  
  108. return true
  109. end
  110.  
  111. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  112. npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement