Advertisement
Guest User

Untitled

a guest
Apr 15th, 2020
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.09 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 getTable()
  11. local list =
  12. {
  13. {name = 'Abyss Hammer', id = 7414, sell = 20000, buy = 0},
  14. {name = 'Amber Staff', id = 7426, sell = 8000, buy = 0},
  15. {name = 'Ancient Amulet', id = 2142, sell = 200, buy = 0},
  16. {name = 'Assassin Dagger', id = 7404, sell = 20000, buy = 0},
  17. {name = 'Bandana', id = 5917, sell = 150, buy = 0},
  18. {name = 'Beastslayer axe', id = 3962, sell = 1500, buy = 0},
  19. {name = 'Beetle Necklace', id = 11374, sell = 1500, buy = 0},
  20. {name = 'Berserker', id = 7403, sell = 40000, buy = 0},
  21. {name = 'Blacksteel Sword', id = 7406, sell = 6000, buy = 0},
  22. {name = 'Blessed Sceptre', id = 7429, sell = 40000, buy = 0},
  23. {name = 'Bone Shield', id = 2541, sell = 80, buy = 0},
  24. {name = 'Bonelord Helmet', id = 3972, sell = 7500, buy = 0},
  25. {name = 'Brutetamer\'s Staff', id = 7379, sell = 1500, buy = 0},
  26. {name = 'Buckle', id = 20109, sell = 7000, buy = 0},
  27. {name = 'Castle Shield', id = 2535, sell = 5000, buy = 0},
  28. {name = 'Chain Bolter', id = 8850, sell = 40000, buy = 0},
  29. {name = 'Chaos Mace', id = 7427, sell = 9000, buy = 0},
  30. {name = 'Cobra Crown', id = 12630, sell = 50000, buy = 0},
  31. {name = 'Coconut Shoes', id = 9931, sell = 500, buy = 0},
  32. {name = 'Composite Hornbow', id = 8855, sell = 25000, buy = 0},
  33. {name = 'Cranial Basher', id = 7415, sell = 30000, buy = 0},
  34. {name = 'Crocodile Boots', id = 3982, sell = 1000, buy = 0},
  35. {name = 'Crystal Crossbow', id = 18453, sell = 35000, buy = 0},
  36. {name = 'Crystal Mace', id = 2445, sell = 12000, buy = 0},
  37. {name = 'Crystal Necklace', id = 2125, sell = 400, buy = 0},
  38. {name = 'Crystal Ring', id = 2124, sell = 250, buy = 0},
  39. {name = 'Crystal Sword', id = 7449, sell = 600, buy = 0},
  40. {name = 'Crystalline Armor', id = 8878, sell = 16000, buy = 0},
  41. {name = 'Daramian Mace', id = 2439, sell = 110, buy = 0},
  42. {name = 'Daramian Waraxe', id = 2440, sell = 1000, buy = 0},
  43. {name = 'Dark Shield', id = 2521, sell = 400, buy = 0},
  44. {name = 'Death Ring', id = 6300, sell = 1000, buy = 0},
  45. {name = 'Demon Shield', id = 2520, sell = 30000, buy = 0},
  46. {name = 'Demonbone Amulet', id = 2136, sell = 32000, buy = 0},
  47. {name = 'Demonrage Sword', id = 7382, sell = 36000, buy = 0},
  48. {name = 'Devil Helmet', id = 2462, sell = 1000, buy = 0},
  49. {name = 'Diamond Sceptre', id = 7387, sell = 3000, buy = 0},
  50. {name = 'Divine Plate', id = 8885, sell = 55000, buy = 0},
  51. {name = 'Djinn Blade', id = 2451, sell = 15000, buy = 0},
  52. {name = 'Doll', id = 2110, sell = 200, buy = 0},
  53. {name = 'Dragon Scale Mail', id = 2492, sell = 40000, buy = 0},
  54. {name = 'Dragon Slayer', id = 7402, sell = 15000, buy = 0},
  55. {name = 'Dragonbone Staff', id = 7430, sell = 3000, buy = 0},
  56. {name = 'Dreaded Cleaver', id = 7419, sell = 10000, buy = 0},
  57. {name = 'Dwarven Armor', id = 2503, sell = 30000, buy = 0},
  58. {name = 'Earth Cranial Basher', id = 7866, sell = 30000, buy = 0},
  59. {name = 'Earth Dragon Slayer', id = 7858, sell = 15000, buy = 0},
  60. {name = 'Earth Headchopper', id = 7862, sell = 6000, buy = 0},
  61. {name = 'Earth Heroic axe', id = 7861, sell = 30000, buy = 0},
  62. {name = 'Earth Mystic Blade', id = 7856, sell = 30000, buy = 0},
  63. {name = 'Earth Orcish Maul', id = 7867, sell = 6000, buy = 0},
  64. {name = 'Earth Relic Sword', id = 7855, sell = 25000, buy = 0},
  65. {name = 'Earth War axe', id = 7863, sell = 12000, buy = 0},
  66. {name = 'Elvish Bow', id = 7438, sell = 2000, buy = 0},
  67. {name = 'Emerald Bangle', id = 2127, sell = 800, buy = 0},
  68. {name = 'Energy Cranial Basher',id = 7881, sell = 30000, buy = 0},
  69. {name = 'Energy Dragon Slayer', id = 7873, sell = 15000, buy = 0},
  70. {name = 'Energy Headchopper', id = 7877, sell = 6000, buy = 0},
  71. {name = 'Energy Heroic axe', id = 7876, sell = 30000, buy = 0},
  72. {name = 'Energy Mystic Blade', id = 7871, sell = 30000, buy = 0},
  73. {name = 'Energy Orcish Maul', id = 7882, sell = 6000, buy = 0},
  74. {name = 'Energy Relic Sword', id = 7870, sell = 25000, buy = 0},
  75. {name = 'Energy War axe', id = 7878, sell = 12000, buy = 0},
  76. {name = 'Epee', id = 2438, sell = 8000, buy = 0},
  77. {name = 'Fiery Cranial Basher', id = 7756, sell = 30000, buy = 0},
  78. {name = 'Fiery Dragon Slayer', id = 7748, sell = 15000, buy = 0},
  79. {name = 'Fiery Headchopper', id = 7752, sell = 6000, buy = 0},
  80. {name = 'Fiery Heroic axe', id = 7751, sell = 30000, buy = 0},
  81. {name = 'Fiery Mystic Blade', id = 7746, sell = 30000, buy = 0},
  82. {name = 'Fiery Orcish Maul', id = 7757, sell = 6000, buy = 0},
  83. {name = 'Fiery Relic Sword', id = 7745, sell = 25000, buy = 0},
  84. {name = 'Fiery War axe', id = 7753, sell = 12000, buy = 0},
  85. {name = 'Flower Dress', id = 9929, sell = 1000, buy = 0},
  86. {name = 'Flower Wreath', id = 9927, sell = 500, buy = 0},
  87. {name = 'Fur Boots', id = 7457, sell = 2000, buy = 0},
  88. {name = 'Furry Club', id = 7432, sell = 1000, buy = 0},
  89. {name = 'Glacier Amulet', id = 7888, sell = 1500, buy = 0},
  90. {name = 'Glacier Kilt', id = 7896, sell = 11000, buy = 0},
  91. {name = 'Glacier Mask', id = 7902, sell = 2500, buy = 0},
  92. {name = 'Glacier Robe', id = 7897, sell = 11000, buy = 0},
  93. {name = 'Glacier Shoes', id = 7892, sell = 2500, buy = 0},
  94. {name = 'Gold Ring', id = 2179, sell = 8000, buy = 0},
  95. {name = 'Golden Armor', id = 2466, sell = 20000, buy = 0},
  96. {name = 'Golden Legs', id = 2470, sell = 30000, buy = 0},
  97. {name = 'Guardian Halberd', id = 2427, sell = 11000, buy = 0},
  98. {name = 'Hammer of Wrath', id = 2444, sell = 30000, buy = 0},
  99. {name = 'Headchopper', id = 7380, sell = 6000, buy = 0},
  100. {name = 'Heavy Mace', id = 2452, sell = 50000, buy = 0},
  101. {name = 'Heavy Machete', id = 2442, sell = 90, buy = 0},
  102. {name = 'Heavy Trident', id = 13838, sell = 2000, buy = 0},
  103. {name = 'Helmet of the Lost', id = 20132, sell = 2000, buy = 0},
  104. {name = 'Heroic axe', id = 7389, sell = 30000, buy = 0},
  105. {name = 'Hibiscus Dress', id = 8873, sell = 3000, buy = 0},
  106. {name = 'Icy Blacksteel Sword', id = 7766, sell = 6000, buy = 0},
  107. {name = 'Icy Cranial Basher', id = 7775, sell = 30000, buy = 0},
  108. {name = 'Icy Dragon Slayer', id = 7767, sell = 15000, buy = 0},
  109. {name = 'Icy Headchopper', id = 7771, sell = 6000, buy = 0},
  110. {name = 'Icy Heroic axe', id = 7770, sell = 30000, buy = 0},
  111. {name = 'Icy Mystic Blade', id = 7765, sell = 30000, buy = 0},
  112. {name = 'Icy Orcish Maul', id = 7776, sell = 6000, buy = 0},
  113. {name = 'Icy Relic Sword', id = 7764, sell = 25000, buy = 0},
  114. {name = 'Icy War axe', id = 7772, sell = 12000, buy = 0},
  115. {name = 'Jade Hammer', id = 7422, sell = 25000, buy = 0},
  116. {name = 'Krimhorn Helmet', id = 7461, sell = 200, buy = 0},
  117. {name = 'Lavos Armor', id = 8877, sell = 16000, buy = 0},
  118. {name = 'Leaf Legs', id = 9928, sell = 500, buy = 0},
  119. {name = 'Leopard Armor', id = 3968, sell = 1000, buy = 0},
  120. {name = 'Leviathan\'s Amulet', id = 10220, sell = 3000, buy = 0},
  121. {name = 'Light Shovel', id = 5710, sell = 300, buy = 0},
  122. {name = 'Lightning Boots', id = 7893, sell = 2500, buy = 0},
  123. {name = 'Lightning Headband', id = 7901, sell = 2500, buy = 0},
  124. {name = 'Lightning Legs', id = 7895, sell = 11000, buy = 0},
  125. {name = 'Lightning Pendant', id = 7889, sell = 1500, buy = 0},
  126. {name = 'Lightning Robe', id = 7898, sell = 11000, buy = 0},
  127. {name = 'Lunar Staff', id = 7424, sell = 5000, buy = 0},
  128. {name = 'Magic Plate Armor', id = 2472, sell = 90000, buy = 0},
  129. {name = 'Magma Amulet', id = 7890, sell = 1500, buy = 0},
  130. {name = 'Magma Boots', id = 7891, sell = 2500, buy = 0},
  131. {name = 'Magma Coat', id = 7899, sell = 11000, buy = 0},
  132. {name = 'Magma Legs', id = 7894, sell = 11000, buy = 0},
  133. {name = 'Magma Monocle', id = 7900, sell = 2500, buy = 0},
  134. {name = 'Mammoth Fur Cape', id = 7463, sell = 6000, buy = 0},
  135. {name = 'Mammoth Fur Shorts', id = 7464, sell = 850, buy = 0},
  136. {name = 'Mammoth Whopper', id = 7381, sell = 300, buy = 0},
  137. {name = 'Mastermind Shield', id = 2514, sell = 50000, buy = 0},
  138. {name = 'Medusa Shield', id = 2536, sell = 9000, buy = 0},
  139. {name = 'Mercenary Sword', id = 7386, sell = 12000, buy = 0},
  140. {name = 'Mycological Bow', id = 18454, sell = 35000, buy = 0},
  141. {name = 'Mystic Blade', id = 7384, sell = 30000, buy = 0},
  142. {name = 'Naginata', id = 2426, sell = 2000, buy = 0},
  143. {name = 'Nightmare Blade', id = 7418, sell = 35000, buy = 0},
  144. {name = 'Noble axe', id = 7456, sell = 10000, buy = 0},
  145. {name = 'Norse Shield', id = 7460, sell = 1500, buy = 0},
  146. {name = 'Orcish Maul', id = 7392, sell = 6000, buy = 0},
  147. {name = 'Pair of Iron Fists', id = 20108, sell = 4000, buy = 0},
  148. {name = 'Paladin Armor', id = 8891, sell = 15000, buy = 0},
  149. {name = 'Patched Boots', id = 2641, sell = 2000, buy = 0},
  150. {name = 'Pharaoh Sword', id = 2446, sell = 23000, buy = 0},
  151. {name = 'Pirate Boots', id = 5462, sell = 3000, buy = 0},
  152. {name = 'Pirate Hat', id = 6096, sell = 1000, buy = 0},
  153. {name = 'Pirate Knee Breeches', id = 5918, sell = 200, buy = 0},
  154. {name = 'Pirate Shirt', id = 6095, sell = 500, buy = 0},
  155. {name = 'Pirate Voodoo Doll', id = 5810, sell = 500, buy = 0},
  156. {name = 'Platinum Amulet', id = 2171, sell = 2500, buy = 0},
  157. {name = 'Ragnir Helmet', id = 7462, sell = 400, buy = 0},
  158. {name = 'Relic Sword', id = 7383, sell = 25000, buy = 0},
  159. {name = 'Ring of the Sky', id = 2123, sell = 30000, buy = 0},
  160. {name = 'Royal axe', id = 7434, sell = 40000, buy = 0},
  161. {name = 'Ruby Necklace', id = 2133, sell = 2000, buy = 0},
  162. {name = 'Ruthless axe', id = 6553, sell = 45000, buy = 0},
  163. {name = 'Sacred Tree Amulet', id = 10219, sell = 3000, buy = 0},
  164. {name = 'Sapphire Hammer', id = 7437, sell = 7000, buy = 0},
  165. {name = 'Scarab Amulet', id = 2135, sell = 200, buy = 0},
  166. {name = 'Scarab Shield', id = 2540, sell = 2000, buy = 0},
  167. {name = 'Shockwave Amulet', id = 10221, sell = 3000, buy = 0},
  168. {name = 'Silver Brooch', id = 2134, sell = 150, buy = 0},
  169. {name = 'Silver Dagger', id = 2402, sell = 500, buy = 0},
  170. {name = 'Skull Helmet', id = 5741, sell = 40000, buy = 0},
  171. {name = 'Skullcracker Armor', id = 8889, sell = 18000, buy = 0},
  172. {name = 'Spiked Squelcher', id = 7452, sell = 5000, buy = 0},
  173. {name = 'Steel Boots', id = 2645, sell = 30000, buy = 0},
  174. {name = 'Swamplair Armor', id = 8880, sell = 16000, buy = 0},
  175. {name = 'Taurus Mace', id = 7425, sell = 500, buy = 0},
  176. {name = 'Tempest Shield', id = 2542, sell = 35000, buy = 0},
  177. {name = 'Terra Amulet', id = 7887, sell = 1500, buy = 0},
  178. {name = 'Terra Boots', id = 7886, sell = 2500, buy = 0},
  179. {name = 'Terra Hood', id = 7903, sell = 2500, buy = 0},
  180. {name = 'Terra Legs', id = 7885, sell = 11000, buy = 0},
  181. {name = 'Terra Mantle', id = 7884, sell = 11000, buy = 0},
  182. {name = 'The Justice Seeker', id = 7390, sell = 40000, buy = 0},
  183. {name = 'Tortoise Shield', id = 6131, sell = 150, buy = 0},
  184. {name = 'Vile axe', id = 7388, sell = 30000, buy = 0},
  185. {name = 'Voodoo Doll', id = 2322, sell = 400, buy = 0},
  186. {name = 'War axe', id = 2454, sell = 12000, buy = 0},
  187. {name = 'War Horn', id = 2079, sell = 8000, buy = 0},
  188. {name = 'Witch Hat', id = 10570, sell = 5000, buy = 0},
  189. {name = 'Wyvern Fang', id = 7408, sell = 1500, buy = 0}
  190. }
  191. return list
  192. end
  193.  
  194. local function creatureSayCallback(cid, type, msg)
  195. if(not npcHandler:isFocused(cid)) then
  196. return false
  197. end
  198. local player = Player(cid)
  199. if(msgcontains(msg, "mission")) then
  200. if(os.date("%A") == "Monday") then
  201. if(player:getStorageValue(Rashid.MissionStart) < 1) then
  202. npcHandler:say("Well, you could attempt the mission to become a recognised trader, but it requires a lot of travelling. Are you willing to try?", cid)
  203. npcHandler.topic[cid] = 1
  204. elseif(player:getStorageValue(Rashid.MissionStart) == 1) then
  205. npcHandler:say("Have you managed to obtain a rare deer trophy for my customer?", cid)
  206. npcHandler.topic[cid] = 3
  207. end
  208. elseif(os.date("%A") == "Tuesday") then
  209. if(player:getStorageValue(Rashid.MissionStart) == 2 and player:getStorageValue(Rashid.MissionStart+1) < 1 ) then
  210. npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
  211. npcHandler.topic[cid] = 4
  212. elseif(player:getStorageValue(Rashid.MissionStart + 1) == 4) then
  213. npcHandler:say("Did you bring me the package?", cid)
  214. npcHandler.topic[cid] = 6
  215. end
  216. elseif(os.date("%A") == "Wednesday") then
  217. if(player:getStorageValue(Rashid.MissionStart + 1) == 5 and player:getStorageValue(Rashid.MissionStart + 2) < 1 ) then
  218. npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
  219. npcHandler.topic[cid] = 7
  220. elseif(player:getStorageValue(Rashid.MissionStart + 2) == 2) then
  221. npcHandler:say("Have you brought the cheese?", cid)
  222. npcHandler.topic[cid] = 9
  223. end
  224. elseif(os.date("%A") == "Thursday") then
  225. if(player:getStorageValue(Rashid.MissionStart + 2) == 3 and player:getStorageValue(Rashid.MissionStart + 3) < 1) then
  226. npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
  227. npcHandler.topic[cid] = 10
  228. elseif(player:getStorageValue(Rashid.MissionStart + 3) == 2) then
  229. npcHandler:say("Have you brought the vase?", cid)
  230. npcHandler.topic[cid] = 12
  231. end
  232. elseif(os.date("%A") == "Friday") then
  233. if(player:getStorageValue(Rashid.MissionStart + 3) == 3 and player:getStorageValue(Rashid.MissionStart + 4) < 1) then
  234. npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
  235. npcHandler.topic[cid] = 13
  236. elseif(player:getStorageValue(Rashid.MissionStart + 4) == 2) then
  237. npcHandler:say("Have you brought a cheap but good crimson sword?", cid)
  238. npcHandler.topic[cid] = 15
  239. end
  240. elseif(os.date("%A") == "Saturday") then
  241. if(player:getStorageValue(Rashid.MissionStart + 4) == 3 and player:getStorageValue(Rashid.MissionStart + 5) < 1) then
  242. npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
  243. npcHandler.topic[cid] = 16
  244. elseif(player:getStorageValue(Rashid.MissionStart + 5) == 1) then
  245. npcHandler:say("Have you brought me a gold fish??", cid)
  246. npcHandler.topic[cid] = 18
  247. end
  248. elseif(os.date("%A") == "Sunday") then
  249. if(player:getStorageValue(Rashid.MissionStart + 5) == 2 and player:getStorageValue(Rashid.MissionStart + 6) < 1) then
  250. npcHandler:say("Ah, right. <ahem> I hereby declare you - one of my recognised traders! Feel free to offer me your wares!", cid)
  251. player:setStorageValue(Rashid.MissionStart + 6, 1)
  252. --player:AddArchie(id or name)
  253. npcHandler.topic[cid] = 0
  254. end
  255. end
  256. elseif(msgcontains(msg, "yes")) then
  257. if(npcHandler.topic[cid] == 1) then
  258.  
  259. npcHandler:say(
  260. {
  261. "Very good! I need talented people who are able to handle my wares with care, find good offers and the like, so I'm going to test you. ...",
  262. "First, I'd like to see if you can dig up rare wares. Something like a ... mastermind shield! ...",
  263. "Haha, just kidding, fooled you there, didn't I? Always control your nerves, that's quite important during bargaining. ...",
  264. "Okay, all I want from you is one of these rare deer trophies. I have a customer here in Svargrond who ordered one, so I'd like you to deliver it tome while I'm in Svargrond. ...",
  265. "Everything clear and understood?"
  266. }, cid)
  267.  
  268. npcHandler.topic[cid] = 2
  269. elseif(npcHandler.topic[cid] == 2) then
  270. npcHandler:say("Fine. Then get a hold of that deer trophy and bring it to me while I'm in Svargrond. Just ask me about your mission.", cid)
  271. player:setStorageValue(Rashid.MissionStart, 1)
  272. npcHandler.topic[cid] = 0
  273. elseif(npcHandler.topic[cid] == 3) then
  274. if(player:getItemCount(7397) >= 1) then
  275. player:removeItem(7397, 1)
  276. npcHandler:say("Well done! I'll take that from you. <snags it> Come see me another day, I'll be busy for a while now. ", cid)
  277. player:setStorageValue(Rashid.MissionStart, 2)
  278. npcHandler.topic[cid] = 0
  279. end
  280. elseif(npcHandler.topic[cid] == 4) then
  281. npcHandler:say(
  282. {
  283. "Alright, that's good to hear. From you as my trader and deliveryman, I expect more than finding rare items. ...",
  284. "You also need to be able to transport heavy wares, weaklings won't get far here. I have ordered a special package from Edron. ...",
  285. "Pick it up from Willard and bring it back to me while I'm in Liberty Bay. Everything clear and understood?"
  286. }, cid)
  287. npcHandler.topic[cid] = 5
  288. elseif(npcHandler.topic[cid] == 5) then
  289. npcHandler:say("Fine. Then off you go, just ask Willard about the 'package for Rashid'.", cid)
  290. player:setStorageValue(Rashid.MissionStart + 1, 1)
  291. npcHandler.topic[cid] = 0
  292. elseif(npcHandler.topic[cid] == 6) then
  293. if(player:getItemCount(7503) >= 1) then
  294. player:removeItem(7503, 1)
  295. npcHandler:say("Great. Just place it over there - yes, thanks, that's it. Come see me another day, I'll be busy for a while now. ", cid)
  296. player:setStorageValue(Rashid.MissionStart + 1, 5)
  297. npcHandler.topic[cid] = 0
  298. end
  299. elseif(npcHandler.topic[cid] == 7) then
  300. npcHandler:say(
  301. {
  302. "Well, that's good to hear. From you as my trader and deliveryman, I expect more than carrying heavy packages. ...",
  303. "You also need to be fast and deliver wares in time. I have ordered a very special cheese wheel made from Darashian milk. ...",
  304. "Unfortunately, the high temperature in the desert makes it rot really fast, so it must not stay in the sun for too long. ...",
  305. "I'm also afraid that you might not be able to use ships because of the smell of the cheese. ...",
  306. "Please get the cheese from Miraia and bring it to me while I'm in Port Hope. Everything clear and understood?"
  307. }, cid)
  308. npcHandler.topic[cid] = 8
  309. elseif(npcHandler.topic[cid] == 8) then
  310. npcHandler:say("Okay, then please find Miraia in Darashia and ask her about the {'scarab cheese'}.", cid)
  311. player:setStorageValue(Rashid.MissionStart + 2, 1)
  312. npcHandler.topic[cid] = 0
  313. elseif(npcHandler.topic[cid] == 9) then
  314. if(player:getItemCount(8112) >= 1) then
  315. player:removeItem(8112, 1)
  316. --if (player:getStorageValue(ExplorerSocietySTORAGE) == 1) then
  317. --player:AddArchie(Just in Time)
  318. --end
  319. npcHandler:say("Mmmhh, the lovely odeur of scarab cheese! I really can't understand why most people can't stand it. Thanks, well done! ", cid)
  320. player:setStorageValue(Rashid.MissionStart + 2, 3)
  321. npcHandler.topic[cid] = 0
  322. end
  323. elseif(npcHandler.topic[cid] == 10) then
  324. npcHandler:say(
  325. {
  326. "Well, that's good to hear. From you as my trader and deliveryman, I expect more than bringing stinky cheese. ...",
  327. "I wonder if you are able to deliver goods so fragile they almost break when looked at. ...",
  328. "I have ordered a special elven vase from Briasol in Ab'Dendriel. Get it from him and don't even touch it, just bring it to me while I'm in Ankrahmun. Everything clear and understood?"
  329. }, cid)
  330. npcHandler.topic[cid] = 11
  331. elseif(npcHandler.topic[cid] == 11) then
  332. npcHandler:say("Okay, then please find {Briasol} in {Ab'Dendriel} and ask for a {'fine vase'}.", cid)
  333. player:setStorageValue(Rashid.MissionStart + 3, 1)
  334. player:addMoney(1000)
  335. npcHandler.topic[cid] = 0
  336. elseif(npcHandler.topic[cid] == 12) then
  337. if(player:getItemCount(8760) >= 1) then
  338. player:removeItem(8760, 1)
  339. npcHandler:say("I'm surprised that you managed to bring this vase without a single crack. That was what I needed to know, thank you. ", cid)
  340. player:setStorageValue(Rashid.MissionStart + 3, 3)
  341. npcHandler.topic[cid] = 0
  342. end
  343. elseif(npcHandler.topic[cid] == 13) then
  344. npcHandler:say(
  345. {
  346. "Fine! There's one more skill that I need to test and which is cruicial for a successful trader. ...",
  347. "Of course you must be able to haggle, else you won't survive long in this business. To make things as hard as possible for you, I have the perfect trade partner for you. ...",
  348. "Dwarves are said to be the most stubborn of all traders. Travel to {Kazordoon} and try to get the smith {Uzgod} to sell a {crimson sword} to you. ...",
  349. "Of course, it has to be cheap. Don't come back with anything more expensive than 400 gold. ...",
  350. "And the quality must not suffer, of course! Everything clear and understood?",
  351. "Dwarves are said to be the most stubborn of all traders. Travel to Kazordoon and try to get the smith Uzgod to sell a crimson sword to you. ..."
  352. }, cid)
  353. npcHandler.topic[cid] = 14
  354. elseif(npcHandler.topic[cid] == 14) then
  355. npcHandler:say("Okay, I'm curious how you will do with {Uzgod}. Good luck!", cid)
  356. player:setStorageValue(Rashid.MissionStart + 4, 1)
  357. npcHandler.topic[cid] = 0
  358. elseif(npcHandler.topic[cid] == 15) then
  359. if(player:getItemCount(7385) >= 1) then
  360. player:removeItem(7385, 1)
  361. npcHandler:say("Ha! You are clever indeed, well done! I'll take this from you. Come see me tomorrow, I think we two might get into business after all.", cid)
  362. player:setStorageValue(Rashid.MissionStart + 4, 3)
  363. npcHandler.topic[cid] = 0
  364. end
  365. elseif(npcHandler.topic[cid] == 16) then
  366. npcHandler:say(
  367. {
  368. "My friend, it seems you have already learnt a lot about the art of trading. I think you are more than worthy to become a recognised trader. ...",
  369. "There is just one little favour that I would ask from you... something personal, actually, forgive my boldness. ...",
  370. "I have always dreamed to have a small pet, one that I could take with me and which wouldn't cause problems. ...",
  371. "Could you - just maybe - bring me a small goldfish in a bowl? I know that you would be able to get one, wouldn't you?"
  372. }, cid)
  373. npcHandler.topic[cid] = 17
  374. elseif(npcHandler.topic[cid] == 17) then
  375. npcHandler:say("Thanks so much! I'll be waiting eagerly for your return then.", cid)
  376. player:setStorageValue(Rashid.MissionStart + 5, 1)
  377. npcHandler.topic[cid] = 0
  378. elseif(npcHandler.topic[cid] == 18) then
  379. if(player:getItemCount(8766) >= 1) then
  380. player:removeItem(8766, 1)
  381. npcHandler:say("Thank you!! Ah, this makes my day! I'll take the rest of the day off to get to know this little guy. Come see me tomorrow, if you like.", cid)
  382. player:setStorageValue(Rashid.MissionStart + 5, 2)
  383. npcHandler.topic[cid] = 0
  384. end
  385. end
  386. end
  387. return true
  388. end
  389.  
  390. local function onTradeRequest(cid)
  391. TradeRequest(cid, npcHandler, getTable(), Rashid, 1)
  392. end
  393.  
  394.  
  395. npcHandler:setCallback(CALLBACK_ONTRADEREQUEST, onTradeRequest)
  396. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  397. npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement