Berntan

Queen Eloise.lua

Nov 27th, 2023 (edited)
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.23 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 function creatureSayCallback(cid, type, msg)
  11. if not npcHandler:isFocused(cid) then
  12. return false
  13. end
  14.  
  15. local player = Player(cid)
  16. if player:getStorageValue(Storage.OutfitQuest.GoldenBaseOutfit) < 1 then
  17. if (msg == "outfit") or (msg == "addon") then
  18. npcHandler:say("In exchange for a truly generous donation, I will offer a special outfit. Do you want to make a donation?", cid)
  19. npcHandler.topic[cid] = 1
  20. end
  21. elseif player:getStorageValue(Storage.OutfitQuest.GoldenFirstAddon) < 1 or player:getStorageValue(Storage.OutfitQuest.GoldenSecondAddon) < 1 and player:getStorageValue(Storage.OutfitQuest.GoldenBaseOutfit) == 1 then
  22. if (msg == "outfit") or (msg == "addon") then
  23. npcHandler:say("In exchange for a truly generous donation, I will offer a special outfit. Do you want to make a donation?", cid)
  24. npcHandler.topic[cid] = 3
  25. end
  26. end
  27. if(msgcontains(msg, "yes")) and npcHandler.topic[cid] == 1 then
  28. npcHandler:say({
  29. "Excellent! Now, let me explain. If you donate 1.000.000.000 gold pieces, you will be entitled to wear a unique outfit. ...",
  30. "You will be entitled to wear the {armor} for 500.000.000 gold pieces, {boots} for an additional 250.000.000 and the {helmet} for another 250.000.000 gold pieces. ...",
  31. "What will it be?"
  32. }, cid)
  33. npcHandler.topic[cid] = 2
  34. elseif (msgcontains(msg, "yes")) and npcHandler.topic[cid] == 3 then
  35. npcHandler:say({
  36. "Excellent! Now, let me explain. If you donate 1.000.000.000 gold pieces, you will be entitled to wear a unique outfit. ...",
  37. "You will be entitled to wear the {armor} for 500.000.000 gold pieces, {boots} for an additional 250.000.000 and the {helmet} for another 250.000.000 gold pieces. ...",
  38. "What will it be?"
  39. }, cid)
  40. npcHandler.topic[cid] = 4
  41. end
  42. -- armor (golden outfit)
  43. if player:getStorageValue(Storage.OutfitQuest.GoldenBaseOutfit) < 1 and npcHandler.topic[cid] == 5 and (msgcontains(msg, "yes")) then
  44. if player:getMoney() + player:getBankBalance() >= 500000000 then
  45. npcHandler:say("Take this armor as a token of great gratitude. Let us forever remember this day, my friend!", cid)
  46. player:removeMoneyNpc(500000000)
  47. player:addOutfit(1211)
  48. player:addOutfit(1210)
  49. player:setStorageValue(Storage.OutfitQuest.GoldenBaseOutfit, 1)
  50. npcHandler.topic[cid] = 0
  51. else
  52. npcHandler:say("You do not have enough money to donate that amount.", cid)
  53. end
  54. -- boots addon
  55. elseif (msgcontains(msg, "yes")) and npcHandler.topic[cid] == 6 and player:getStorageValue(Storage.OutfitQuest.GoldenFirstAddon) < 1 then
  56. if player:getMoney() + player:getBankBalance() >= 250000000 and player:getStorageValue(Storage.OutfitQuest.GoldenBaseOutfit) == 1 then
  57. npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", cid)
  58. npcHandler.topic[cid] = 0
  59. player:addOutfitAddon(1210, 2)
  60. player:addOutfitAddon(1211, 2)
  61. player:removeMoneyNpc(250000000)
  62. player:setStorageValue(Storage.OutfitQuest.GoldenFirstAddon, 1)
  63. else
  64. npcHandler:say("You do not have enough money to donate that amount.", cid)
  65. end
  66. -- helmet addon
  67. elseif npcHandler.topic[cid] == 7 and (msgcontains(msg, "yes")) then
  68. if player:getMoney() + player:getBankBalance() >= 250000000 and player:getStorageValue(Storage.OutfitQuest.GoldenBaseOutfit) == 1 and player:getStorageValue(Storage.OutfitQuest.GoldenSecondAddon) < 1 then
  69. npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", cid)
  70. npcHandler.topic[cid] = 0
  71. player:removeMoneyNpc(250000000)
  72. player:addOutfitAddon(1210, 1)
  73. player:addOutfitAddon(1211, 1)
  74. player:setStorageValue(Storage.OutfitQuest.GoldenSecondAddon, 1)
  75. else
  76. npcHandler:say("Do not have money helmet", cid)
  77. end
  78. end
  79. if msgcontains(msg, "armor") and npcHandler.topic[cid] == 2 and player:getStorageValue(Storage.OutfitQuest.GoldenBaseOutfit) < 1 then
  80. npcHandler:say("So you wold like to donate 500.000.000 gold pieces which in return will entitle you to wear a unique armor?", cid)
  81. npcHandler.topic[cid] = 5
  82. elseif(msgcontains(msg, "boots")) and (npcHandler.topic[cid] == 4 and player:getStorageValue(Storage.OutfitQuest.GoldenBaseOutfit) == 1 and player:getStorageValue(Storage.OutfitQuest.GoldenFirstAddon) < 1) then
  83. npcHandler:say("So you would like to donate 250.000.000 gold pieces which in return will entitle you to wear unique boots?", cid)
  84. npcHandler.topic[cid] = 6
  85. elseif(msgcontains(msg, "helmet")) and (npcHandler.topic[cid] == 4 and player:getStorageValue(Storage.OutfitQuest.GoldenBaseOutfit) == 1 and player:getStorageValue(Storage.OutfitQuest.GoldenSecondAddon) < 1) then
  86. npcHandler:say("So you would like to donate 250.000.000 gold pieces which in return will entitle you to wear a unique helmet?", cid)
  87. npcHandler.topic[cid] = 7
  88. end
  89. return true
  90. end
  91.  
  92. -- Promotion
  93. local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
  94. node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
  95. node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
  96. -- Postman
  97. keywordHandler:addKeyword({'uniforms'}, StdModule.say, {npcHandler = npcHandler, text = 'I remember about those uniforms, they had a camouflage inlay so they could be worn the inside out too. I will send some color samples via mail to Mr. Postner.'},
  98. function(player) return player:getStorageValue(Storage.postman.Mission06) == 5 end,
  99. function(player) player:setStorageValue(Storage.postman.Mission06, 6) end
  100. )
  101.  
  102. keywordHandler:addKeyword({'uniforms'}, StdModule.say, {npcHandler = npcHandler, text = 'The uniforms of our guards and soldiers are of unparraleled quality of course.'})
  103.  
  104. -- Basic
  105. keywordHandler:addKeyword({'subject'}, StdModule.say, {npcHandler = npcHandler, text = 'I am {Queen} Eloise. It is my duty to reign over this marvellous {city} and the {lands} of the north.'})
  106. keywordHandler:addAliasKeyword({'job'})
  107. keywordHandler:addKeyword({'justice'}, StdModule.say, {npcHandler = npcHandler, text = 'We women try to bring justice and wisdom to all, even to males.'})
  108. keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, text = 'I am Queen Eloise. For you it\'s \'My Queen\' or \'Your Majesty\', of course.'})
  109. keywordHandler:addKeyword({'news'}, StdModule.say, {npcHandler = npcHandler, text = 'I don\'t care about gossip like a simpleminded male would do.'})
  110. keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, text = 'Soon the whole land will be ruled by women at last!'})
  111. keywordHandler:addAliasKeyword({'land'})
  112. keywordHandler:addKeyword({'how', 'are', 'you'}, StdModule.say, {npcHandler = npcHandler, text = 'Thank you, I\'m fine.'})
  113. keywordHandler:addKeyword({'castle'}, StdModule.say, {npcHandler = npcHandler, text = 'It\'s my humble domain.'})
  114. keywordHandler:addKeyword({'sell'}, StdModule.say, {npcHandler = npcHandler, text = 'Sell? Your question shows that you are a typical member of your gender!'})
  115. keywordHandler:addKeyword({'god'}, StdModule.say, {npcHandler = npcHandler, text = 'We honor the gods of good in our fair city, especially Crunor, of course.'})
  116. keywordHandler:addKeyword({'citizen'}, StdModule.say, {npcHandler = npcHandler, text = 'All citizens of Carlin are my subjects. I see them more as my childs, though, epecially the male population.'})
  117. keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, text = 'This beast scared my cat away on my last diplomatic mission in this filthy town.'})
  118. keywordHandler:addKeyword({'ferumbras'}, StdModule.say, {npcHandler = npcHandler, text = 'He is the scourge of the whole continent!'})
  119. keywordHandler:addKeyword({'treasure'}, StdModule.say, {npcHandler = npcHandler, text = 'The royal treasure is hidden beyond the grasps of any thieves by magical means.'})
  120. keywordHandler:addKeyword({'monster'}, StdModule.say, {npcHandler = npcHandler, text = 'Go and hunt them! For queen and country!'})
  121. keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, text = 'Visit the church or the townguards for help.'})
  122. keywordHandler:addKeyword({'quest'}, StdModule.say, {npcHandler = npcHandler, text = 'I will call for heroes as soon as the need arises again.'})
  123. keywordHandler:addAliasKeyword({'mission'})
  124. keywordHandler:addKeyword({'gold'}, StdModule.say, {npcHandler = npcHandler, text = 'Our city is rich and prospering.'})
  125. keywordHandler:addAliasKeyword({'money'})
  126. keywordHandler:addAliasKeyword({'tax'})
  127. keywordHandler:addKeyword({'sewer'}, StdModule.say, {npcHandler = npcHandler, text = 'I don\'t want to talk about \'sewers\'.'})
  128. keywordHandler:addKeyword({'dungeon'}, StdModule.say, {npcHandler = npcHandler, text = 'Dungeons are places where males crawl around and look for trouble.'})
  129. keywordHandler:addKeyword({'equipment'}, StdModule.say, {npcHandler = npcHandler, text = 'Feel free to visit our town\'s magnificent shops.'})
  130. keywordHandler:addAliasKeyword({'food'})
  131. keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, text = 'Don\'t worry about time in the presence of your Queen.'})
  132. keywordHandler:addKeyword({'hero'}, StdModule.say, {npcHandler = npcHandler, text = 'We need the assistance of heroes now and then. Even males prove useful now and then.'})
  133. keywordHandler:addAliasKeyword({'adventure'})
  134. keywordHandler:addKeyword({'collector'}, StdModule.say, {npcHandler = npcHandler, text = 'The taxes in Carlin are not high, more a symbol than a sacrifice.'})
  135. keywordHandler:addKeyword({'queen'}, StdModule.say, {npcHandler = npcHandler, text = 'I am the Queen, the only rightful ruler on the continent!'})
  136. keywordHandler:addKeyword({'army'}, StdModule.say, {npcHandler = npcHandler, text = 'Ask one of the soldiers about that.'})
  137. keywordHandler:addKeyword({'enemy'}, StdModule.say, {npcHandler = npcHandler, text = 'Our enemies are numerous. We have to fight vile monsters and have to watch this silly king in the south carefully.'})
  138. keywordHandler:addAliasKeyword({'enemies'})
  139. keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, text = 'They dare to reject my reign over them!'})
  140. keywordHandler:addAliasKeyword({'south'})
  141. keywordHandler:addKeyword({'carlin'}, StdModule.say, {npcHandler = npcHandler, text = 'Isn\'t our city marvellous? Have you noticed the lovely gardens on the roofs?'})
  142. keywordHandler:addAliasKeyword({'city'})
  143. keywordHandler:addKeyword({'shop'}, StdModule.say, {npcHandler = npcHandler, text = 'My subjects maintain many fine shops. Go and have a look at their wares.'})
  144. keywordHandler:addKeyword({'merchant'}, StdModule.say, {npcHandler = npcHandler, text = 'Ask around about them.'})
  145. keywordHandler:addAliasKeyword({'craftsmen'})
  146. keywordHandler:addKeyword({'guild'}, StdModule.say, {npcHandler = npcHandler, text = 'The four major guilds are the Knights, the Paladins, the Druids, and the Sorcerers.'})
  147. keywordHandler:addKeyword({'minotaur'}, StdModule.say, {npcHandler = npcHandler, text = 'They haven\'t troubled our city lately. I guess, they fear the wrath of our druids.'})
  148. keywordHandler:addKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, text = 'The paladins are great hunters.'})
  149. keywordHandler:addAliasKeyword({'legola'})
  150. keywordHandler:addKeyword({'elane'}, StdModule.say, {npcHandler = npcHandler, text = 'It\'s a shame that the High Paladin does not reside in Carlin.'})
  151. keywordHandler:addKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, text = 'The knights of Carlin are the bravest.'})
  152. keywordHandler:addAliasKeyword({'trisha'})
  153. keywordHandler:addKeyword({'sorc'}, StdModule.say, {npcHandler = npcHandler, text = 'The sorcerers have a small isle for their guild. So if they blow something up it does not burn the whole city to ruins.'})
  154. keywordHandler:addAliasKeyword({'lea'})
  155. keywordHandler:addKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, text = 'The druids of Carlin are our protectors and advisors. Their powers provide us with wealth and food.'})
  156. keywordHandler:addAliasKeyword({'padreia'})
  157. keywordHandler:addKeyword({'good'}, StdModule.say, {npcHandler = npcHandler, text = 'Carlin is a center of the forces of good, of course.'})
  158. keywordHandler:addKeyword({'evil'}, StdModule.say, {npcHandler = npcHandler, text = 'The forces of evil have a firm grip on this puny city to the south.'})
  159. keywordHandler:addKeyword({'order'}, StdModule.say, {npcHandler = npcHandler, text = 'The order, Crunor gives the world, is essential for survival.'})
  160. keywordHandler:addKeyword({'chaos'}, StdModule.say, {npcHandler = npcHandler, text = 'Chaos is common in the southern regions, where they allow a man to reign over a realm.'})
  161. keywordHandler:addKeyword({'excalibug'}, StdModule.say, {npcHandler = npcHandler, text = 'A mans tale ... that means \'nonsense\', of course.'})
  162. keywordHandler:addKeyword({'reward'}, StdModule.say, {npcHandler = npcHandler, text = 'If you want a reward, go and bring me something this silly King Tibianus wants dearly!'})
  163. keywordHandler:addKeyword({'tbi'}, StdModule.say, {npcHandler = npcHandler, text = 'A dusgusting organisation, which could be only created by men.'})
  164. keywordHandler:addKeyword({'eremo'}, StdModule.say, {npcHandler = npcHandler, text = 'It is said that he lives on a small island near Edron. Maybe the people there know more about him.'})
  165.  
  166. npcHandler:setMessage(MESSAGE_GREET, 'I greet thee, my loyal {subject}.')
  167. npcHandler:setMessage(MESSAGE_WALKAWAY, 'Farewell, |PLAYERNAME|!')
  168.  
  169. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  170.  
  171. local focusModule = FocusModule:new()
  172. focusModule:addGreetMessage('hail queen')
  173. focusModule:addGreetMessage('salutations queen')
  174. npcHandler:addModule(focusModule)
  175.  
Add Comment
Please, Sign In to add comment