Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 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. }
  16.  
  17. function creatureSayCallback(cid, type, msg)
  18. if not npcHandler:isFocused(cid) then
  19. return false
  20. end
  21.  
  22. if msgcontains(msg, 'mission') then
  23. if getPlayerStorageValue(cid, cfg.storage) < 1 then
  24. 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?')
  25. talk_state = 1
  26. elseif getPlayerStorageValue(cid, cfg.storage) == 1 then
  27. if getPlayerStorageValue(cid, cfg.tasksto) < cfg.count[1] then
  28. npcHandler:say('You killed '..getPlayerStorageValue(cid, cfg.tasksto)..' minotaur furious by now, come back when you kill '..cfg.count[1]..'.')
  29. talk_state = 0
  30. else
  31. npcHandler:say('Congratulations you have successfully completed this mission, i have a task a little more difficult this time, would you do it?')
  32. talk_state = 2
  33. end
  34. elseif getPlayerStorageValue(cid, cfg.storage) == 2 then
  35. if getPlayerStorageValue(cid, cfg.tasksto) < cfg.count[2] then
  36. npcHandler:say('You killed '..getPlayerStorageValue(cid, cfg.tasksto)..' minotaur leaders by now, come back when you kill '..cfg.count[2]..'.')
  37. talk_state = 0
  38. else
  39. npcHandler:say('Congratulations you have successfully completed this mission, i have a task a little more difficult this time, would you do it?')
  40. talk_state = 3
  41. end
  42.  
  43. elseif getPlayerStorageValue(cid, cfg.storage) == 3 then
  44. 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.')
  45. talk_state = 0
  46.  
  47. elseif getPlayerStorageValue(cid, cfg.storage) == 4 then
  48. npcHandler:say('What takes my young man, I hate to wait, I hope my package is intact, you brought him, correct?')
  49. talk_state = 5
  50.  
  51. end
  52.  
  53. -- [[ Mino Furious ]] --
  54. elseif msgcontains(msg, 'yes') and talk_state == 1 then
  55. 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.')
  56. setPlayerStorageValue(cid, cfg.storage, 1)
  57. setPlayerStorageValue(cid, cfg.tasksto, 0)
  58. talk_state = 0
  59.  
  60. -- [[ Mino Leaders ]] --
  61. elseif msgcontains(msg, 'yes') and talk_state == 2 then
  62. npcHandler:say('Do you have enough strength to kill 50 minotaurs leaders?')
  63. setPlayerStorageValue(cid, cfg.storage, 2)
  64. setPlayerStorageValue(cid, cfg.tasksto, 0)
  65. talk_state = 0
  66.  
  67. -- [[ Ativando Missão dos Itens ]] --
  68. elseif msgcontains(msg, 'yes') and talk_state == 3 then
  69. 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?')
  70. talk_state = 4
  71.  
  72. elseif msgcontains(msg, 'yes') and talk_state == 4 then
  73. npcHandler:say('Okay, then go.')
  74. setPlayerStorageValue(cid, cfg.storage, 3)
  75. setPlayerStorageValue(cid, cfg.tasksto, 0)
  76. talk_state = 0
  77.  
  78. -- [[ Trazendo Itens ]] --
  79. elseif msgcontains(msg, 'yes') and talk_state == 5 then
  80. if getPlayerItemCount(cid, cfg.pacote.id) >= cfg.pacote.count then
  81. doPlayerRemoveItem(cid, cfg.pacote.id, cfg.pacote.count)
  82. npcHandler:say('All right then, now you have access to the city of Dundeya.')
  83. setPlayerStorageValue(cid, cfg.storage, 5)
  84. talk_state = 0
  85. else
  86. npcHandler:say('Do not try to curl up, wheres the package you promised me?')
  87. talk_state = 0
  88. end
  89. end
  90.  
  91. return true
  92. end
  93.  
  94. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  95. npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement