Advertisement
ped_so

Untitled

May 25th, 2020
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.96 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. function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end
  10.  
  11.  
  12. local node1 = keywordHandler:addKeyword({'magia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Me fale agora qual é a sua vocação.'})
  13.  
  14. local node2 = keywordHandler:addKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
  15. node2:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 1, price = 170, level = 10})
  16. node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
  17.  
  18. local node3 = keywordHandler:addKeyword({'master sorcerer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
  19. node3:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 5, price = 170, level = 10})
  20. node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
  21.  
  22. local node12 = keywordHandler:addKeyword({'infernalist'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
  23. node12:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 11, price = 170, level = 10})
  24. node12:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
  25.  
  26. local node13 = keywordHandler:addKeyword({'master infernalist'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
  27. node13:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 12, price = 170, level = 10})
  28. node13:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
  29.  
  30. local node4 = keywordHandler:addKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
  31. node4:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 2, price = 170, level = 10})
  32. node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
  33.  
  34. local node5 = keywordHandler:addKeyword({'elder druid'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
  35. node5:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 6, price = 170, level = 10})
  36. node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
  37.  
  38. local node6 = keywordHandler:addKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
  39. node6:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 3, price = 170, level = 10})
  40. node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
  41.  
  42. local node7 = keywordHandler:addKeyword({'royal paladin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja aprender a magia de "Conjurar Almas" por 480 gps?'})
  43. node7:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'Conjurar Almas', vocation = 7, price = 170, level = 10})
  44. node7:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Volte em breve.', reset = true})
  45.  
  46. local node8 = keywordHandler:addKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Desculpe, eu não tenho nenhuma magia para sua vocação no momento.'})
  47. local node9 = keywordHandler:addKeyword({'elite knight'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Desculpe, eu não tenho nenhuma magia para sua vocação no momento.'})
  48. local node10 = keywordHandler:addKeyword({'drunou'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Desculpe, eu não tenho nenhuma magia para sua vocação no momento.'})
  49. local node11 = keywordHandler:addKeyword({'lord drunou'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Desculpe, eu não tenho nenhuma magia para sua vocação no momento.'})
  50.  
  51. npcHandler:addModule(FocusModule:new())
  52.  
  53.  
  54.  
  55.  
  56. -------
  57.  
  58.  
  59.  
  60. function getPlayerMoney(cid)
  61. gold = getPlayerItemCount(cid,2148)
  62. plat = getPlayerItemCount(cid,2152)*100
  63. crys = getPlayerItemCount(cid,2160)*10000
  64. money = gold + plat + crys
  65. return money
  66. end
  67. local talkState = {}
  68. function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
  69. function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
  70. function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
  71. function onThink() npcHandler:onThink() end
  72. function onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end
  73. function creatureSayCallback(cid, type, msg)
  74. if(not npcHandler:isFocused(cid)) then
  75. return false
  76. end
  77.  
  78.  
  79. if(msgcontains(msg:lower(), "ceremonial ankh") or msgcontains(msg:lower(), "ceremonial") or msgcontains(msg:lower(), "ankh")) then
  80. selfSay('Você quer comprar um ceremonial ankh por 3700gps?', cid)
  81. conversazodon = 1
  82. return true
  83. elseif(msgcontains(msg:lower(), "sim") or msgcontains(msg:lower(), "yes")) and conversazodon == 1 then
  84. if(getPlayerMoney(cid) >= 3700) then
  85. doPlayerRemoveMoney(cid,3700)
  86. doPlayerAddItem(cid, 6561, 1)
  87. selfSay('Aqui está.', cid)
  88. else
  89. selfSay('Você não tem gps suficientes, é necessário 3700 gps.', cid)
  90. end
  91. conversazodon = 0
  92. return true
  93. ------------------------------------------------
  94. ---------------- LUCAS CP EDIT -----------------
  95. ------------------------------------------------
  96. elseif(msgcontains(msg:lower(), "lottery ticket") or msgcontains(msg:lower(), "lottery") or msgcontains(msg:lower(), "ticket")) then
  97. selfSay('Você quer trocar 100 frascos de mana {médio} vazios, ou 70 frascos de mana {grandes} vazios, ou 50 frascos de mana {gigantes} vazios por 1 lottery ticket?', cid)
  98. conversaTicket = 1
  99. return true
  100. elseif(msgcontains(msg:lower(), "médios") or msgcontains(msg:lower(), "medios") or msgcontains(msg:lower(), "médio") or msgcontains(msg:lower(), "medio")) and conversaTicket == 1 then
  101. if(getPlayerItemCount(cid, 7636) >= 100) then
  102. doPlayerRemoveItem(cid,7636, 100)
  103. doPlayerAddItem(cid, 5957, 1)
  104. selfSay('Aqui está.', cid)
  105. else
  106. selfSay('Você não tem frascos suficientes.', cid)
  107. end
  108. conversaTicket = 0
  109. return true
  110. elseif(msgcontains(msg:lower(), "grande") or msgcontains(msg:lower(), "grandes")) and conversaTicket == 1 then
  111. if(getPlayerItemCount(cid, 7634) >= 70) then
  112. doPlayerRemoveItem(cid,7634, 70)
  113. doPlayerAddItem(cid, 5957, 1)
  114. selfSay('Aqui está.', cid)
  115. else
  116. selfSay('Você não tem frascos suficientes.', cid)
  117. end
  118. conversaTicket = 0
  119. return true
  120. elseif(msgcontains(msg:lower(), "gigantes") or msgcontains(msg:lower(), "gigante")) and conversaTicket == 1 then
  121. if(getPlayerItemCount(cid, 7635) >= 50) then
  122. doPlayerRemoveItem(cid,7635, 50)
  123. doPlayerAddItem(cid, 5957, 1)
  124. selfSay('Aqui está.', cid)
  125. else
  126. selfSay('Você não tem frascos suficientes.', cid)
  127. end
  128. conversaTicket = 0
  129. return true
  130. elseif(msgcontains(msg:lower(), "nao") or msgcontains(msg:lower(), "não") or msgcontains(msg:lower(), "no")) and (conversaTicket == 1 or conversazodon == 0) then
  131. selfSay('Tudo bem, volte quando estiver interessado.', cid)
  132. conversaTicket = 0
  133. conversazodon = 0
  134. return true
  135. --------------------------------------------------------------------------
  136. --------------------------------- FIM EDIÇÃO LUCAS CP ---------------------
  137. ----------------------------------------------------------------------------
  138. end
  139. end
  140. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  141. npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement