Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. local keywordHandler = KeywordHandler:new()
  2. local npcHandler = NpcHandler:new(keywordHandler)
  3. NpcSystem.parseParameters(npcHandler)
  4. local talkState = {}
  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 creatureSayCallback(cid, type, msg)
  10. if(not npcHandler:isFocused(cid)) then
  11. return false
  12. end
  13. local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
  14.  
  15.  
  16. if(msgcontains(msg, 'outfits')) then
  17. selfSay('Vendo {Retro Warrior} por {20 pontos}.', cid)
  18. selfSay('Vendo {Retro Mage} por {20 pontos}.', cid)
  19. selfSay('Vendo {Retro Knight} por {20 pontos}.', cid)
  20. selfSay('Vendo {Retro Citizen} por {20 pontos}.', cid)
  21. selfSay('Vendo {Retro Hunter} por {20 pontos}.', cid)
  22. end
  23.  
  24. -- [Retro Warrior Outfits]
  25. if(msgcontains(msg, 'Retro Warrior')) then
  26. selfSay('Quer mesmo comprar {Retro Warrior} por {20 pontos}? {yes}', cid)
  27. talkState[talkUser] = 1
  28. elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
  29. if getPoints(cid) >= 20 then
  30. doPlayerRemovePoints(cid, 20)
  31. doSendMagicEffect(getCreaturePosition(cid), 30)
  32. selfSay('Você recebeu {Retro Warrior}', cid)
  33. setPlayerStorageValue(cid,010711,1) else
  34. selfSay('Ops... você precisa de {20 pontos} para comprar essa outfits!', cid)
  35. end
  36. end
  37.  
  38. -- [Retro Mage]
  39. if(msgcontains(msg, 'Retro Mage')) then
  40. selfSay('Quer mesmo comprar {Retro Mage} por {20 pontos}? {yes}', cid)
  41. talkState[talkUser] = 2
  42. elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
  43. if getPoints(cid) >= 20 then
  44. doPlayerRemovePoints(cid, 20)
  45. doSendMagicEffect(getCreaturePosition(cid), 30)
  46. selfSay('Você recebeu {Retro Mage}', cid)
  47. setPlayerStorageValue(cid,010811,1) else
  48. selfSay('Ops... você precisa de {20 pontos} para comprar essa!', cid)
  49. end
  50. end
  51.  
  52. -- [Retro Knight]
  53. if(msgcontains(msg, 'Retro Knight')) then
  54. selfSay('Quer mesmo comprar {Retro Knight} por {20 pontos}? {yes}', cid)
  55. talkState[talkUser] = 3
  56. elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then
  57. if getPoints(cid) >= 20 then
  58. doPlayerRemovePoints(cid, 20)
  59. doSendMagicEffect(getCreaturePosition(cid), 30)
  60. selfSay('Você recebeu {Retro Knight}', cid)
  61. setPlayerStorageValue(cid,010911,1) else
  62. selfSay('Ops... você precisa de {20 pontos} para comprar essa!', cid)
  63. end
  64. end
  65.  
  66. -- [Retro Citizen]
  67. if(msgcontains(msg, 'Retro Citizen')) then
  68. selfSay('Quer mesmo comprar {Retro Citizen} por {20 pontos}? {yes}', cid)
  69. talkState[talkUser] = 4
  70. elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 4) then
  71. if getPoints(cid) >= 20 then
  72. doPlayerRemovePoints(cid, 20)
  73. doSendMagicEffect(getCreaturePosition(cid), 30)
  74. selfSay('Você recebeu {Retro Citizen}', cid)
  75. setPlayerStorageValue(cid,011011) else
  76. selfSay('Ops... você precisa de {20 pontos} para comprar essa!', cid)
  77. end
  78. end
  79.  
  80. -- [Retro Hunter]
  81. if(msgcontains(msg, 'Retro Hunter')) then
  82. selfSay('Quer mesmo comprar {Retro Hunter} por {20 pontos}? {yes}', cid)
  83. talkState[talkUser] = 5
  84. elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 5) then
  85. if getPoints(cid) >= 20 then
  86. doPlayerRemovePoints(cid, 20)
  87. doSendMagicEffect(getCreaturePosition(cid), 30)
  88. selfSay('Você recebeu {Retro Hunter}', cid)
  89. setPlayerStorageValue(cid,011111,1) else
  90. selfSay('Ops... você precisa de {20 pontos} para comprar essa!', cid)
  91. end
  92. end
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. end
  102.  
  103.  
  104. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  105. npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement