Advertisement
Guest User

Module:Rotations addition for Travelling Merchant's Stock

a guest
Oct 14th, 2018
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.69 KB | None | 0 0
  1. --[==========[
  2. --  Travelling Merchant
  3. --]==========]
  4. function p.travelling_merchant()
  5.     return p.slotA() .. '\n' .. p.slotB() .. '\n' .. p.slotC()
  6. end
  7.  
  8. function p.travelling_merchant_items()
  9.     return {
  10.         ['Barrel of bait'] = {
  11. cost = '50,000',
  12. quantity = '1',
  13. use = '10% chance to gain an additional catch for 3 minutes.'
  14. },
  15. ['Tangled fishbowl'] = {
  16. cost = '50,000',
  17. quantity = '1',
  18. use = '5% Fishing experience boost for 3 minutes.'
  19. },
  20. ['Broken fishing rod'] = {
  21. cost = '50,000',
  22. quantity = '1',
  23. use = '5-10% bonus catch rate for 3-30 minutes.'
  24. },
  25. ['Small goebie burial charm'] = {
  26. cost = '50,000',
  27. quantity = '1',
  28. use = '50 [[Reputation (Mazcab)|Goebie Reputation]] or 50 [[Teci]]'
  29. },
  30. ['Goebie burial charm'] = {
  31. cost = '100,000',
  32. quantity = '1',
  33. use = '100 [[Reputation (Mazcab)|Goebie Reputation]] or 100 [[Teci]]'
  34. },
  35. ['Menaphite gift offering (small)'] = {
  36. cost = '100,000',
  37. quantity = '1',
  38. use = 'Variety of rewards, see page'
  39. },
  40. ['Menaphite gift offering (medium)'] = {
  41. cost = '300,000',
  42. quantity = '1',
  43. use = 'Variety of rewards, see page'
  44. },
  45. ['Unstable air rune'] = {
  46. cost = '250,000',
  47. quantity = '1',
  48. use = '5,000 [[Runespan#Rewards|Runespan points]]'
  49. },
  50. ['Anima crystal'] = {
  51. cost = '150,000',
  52. quantity = '1',
  53. use = '500 [[Reputation (Heart of Gielinor)|faction reputation]]'
  54. },
  55. ['Slayer VIP Coupon'] = {
  56. cost = '200,000',
  57. quantity = '1',
  58. use = 'Redeemed for 1-7 [[Slayer VIP ticket]]s'
  59. },
  60. ['D&D token (daily)'] = {
  61. cost = '250,000',
  62. quantity = '1',
  63. use = 'One-time use to reset a daily [[D&D]]'
  64. },
  65. ['Unfocused damage enhancer'] = {
  66. cost = '500,000',
  67. quantity = '1',
  68. use = 'Allows choice of any damage enhancer at the cost of lower charges'
  69. },
  70. ['Sacred clay (Deep Sea Fishing)'] = {
  71. name = '[[Sacred clay (Deep Sea Fishing)|Sacred clay]]',
  72. cost = '600,000',
  73. quantity = '1',
  74. use = '50-100 [[Stealing Creation/Rewards#Reward shop|Stealing Creation points]]'
  75. },
  76. ['Shattered anima'] = {
  77. cost = '750,000',
  78. quantity = '500,000-2,000,000',
  79. use = 'See shop [[Shattered Worlds/Rewards|here]]'
  80. },
  81. ['Advanced pulse core'] = {
  82. cost = '800,000',
  83. quantity = '1-3',
  84. use = '50% extra experience that does not stack with other sources of bonus experience, up to the equivalent of a Medium prismatic lamp.'
  85. },
  86. ['Livid plant (Deep Sea Fishing)'] = {
  87. name = '[[Livid plant (Deep Sea Fishing)|Livid plant]]',
  88. cost = '1,000,000',
  89. quantity = '1',
  90. use = '10,000 to 40,000 [[produce points]]'
  91. },
  92. ['Gift for the Reaper'] = {
  93. cost = '1,250,000',
  94. quantity = '1',
  95. use = '20 [[Reaper points]]'
  96. },
  97. ['Silverhawk down'] = {
  98. cost = '1,500,000',
  99. quantity = '50-100',
  100. use = 'See [[silverhawk down]] for experience calculator'
  101. },
  102. ['Large goebie burial charm'] = {
  103. cost = '150,000',
  104. quantity = '1',
  105. use = '150 [[Reputation (Mazcab)|Goebie Reputation]] or 150 [[Teci]]'
  106. },
  107. ['Message in a bottle (Deep Sea Fishing)'] = {
  108. name  = '[[Message in a bottle (Deep Sea Fishing)|Message in a bottle]]',
  109. cost = '200,000',
  110. quantity = '1',
  111. use = 'One time choice between three [[Deep Sea Fishing]] boosts'
  112. },
  113. ['Dragonkin lamp'] = {
  114. cost = '250,000',
  115. quantity = '1',
  116. use = 'Rewards a set amount of experience and a 1/100 chance to obtain [[Effy]]'
  117. },
  118. ['Dungeoneering Wildcard'] = {
  119. cost = '400,000',
  120. quantity = '1-3',
  121. use = 'Consuming the card inside [[Daemonheim]] rewards 50% extra experience and [[dungeoneering token|token]]s'
  122. },
  123. ['Menaphite gift offering (large)'] = {
  124. cost = '500,000',
  125. quantity = '1',
  126. use = 'Variety of rewards, see page'
  127. },
  128. ['Taijitu'] = {
  129. cost = '800,000',
  130. quantity = '3-5',
  131. use = 'Secondary currency used for the [[Waiko Reward Shop]].'
  132. },
  133. ['D&D token (weekly)'] = {
  134. cost = '400,000',
  135. quantity = '1',
  136. use = 'One-time use to reset a weekly [[D&D]]'
  137. },
  138. ['D&D token (monthly)'] = {
  139. cost = '1,000,000',
  140. quantity = '1',
  141. use = 'One-time use to reset a monthly [[D&D]]'
  142. },
  143. ['Starved ancient effigy'] = {
  144. cost = '1,000,000',
  145. quantity = '1',
  146. use = 'Rewards a set amount of experience in multiple skills and a 1/100 chance to obtain [[Effy]]'
  147. },
  148. ['Harmonic dust'] = {
  149. cost = '2,000,000',
  150. quantity = '500-1000',
  151. use = 'Used for creating [[crystal tool]]s'
  152. },
  153. ['Crystal triskelion'] = {
  154. cost = '2,000,000',
  155. quantity = '1',
  156. use = 'Deposited in a cliff face south of [[Rellekka]] to obtain a [[clue scroll (elite)]] and variety of other rewards'
  157. },
  158. ['Deathtouched dart'] = {
  159. cost = '5,000,000',
  160. quantity = '1',
  161. use = 'Insta-kill majority of all NPCs'
  162. },
  163. ['Unfocused reward enhancer'] = {
  164. cost = '10,000,000',
  165. quantity = '1',
  166. use = 'Allows choice of any reward enhancer at the cost of lower charges'
  167. }
  168.     }
  169. end
  170.  
  171. function p.slotA()
  172.     local rotations = {
  173.         'Slayer VIP Coupon',
  174. 'Unfocused damage enhancer',
  175. 'Gift for the Reaper',
  176. 'Tangled fishbowl',
  177. 'Anima crystal',
  178. 'Menaphite gift offering (small)',
  179. 'Small goebie burial charm',
  180. 'Menaphite gift offering (medium)',
  181. 'Shattered anima',
  182. 'Small goebie burial charm',
  183. 'D&D token (daily)',
  184. 'Slayer VIP Coupon',
  185. 'Sacred clay (Deep Sea Fishing)',
  186. 'Advanced pulse core',
  187. 'Tangled fishbowl',
  188. 'Unstable air rune',
  189. 'Advanced pulse core',
  190. 'Gift for the Reaper',
  191. 'Tangled fishbowl',
  192. 'Broken fishing rod',
  193. 'Menaphite gift offering (small)',
  194. 'Small goebie burial charm',
  195. 'Menaphite gift offering (medium)',
  196. 'Sacred clay (Deep Sea Fishing)',
  197. 'Small goebie burial charm',
  198. 'D&D token (daily)',
  199. 'Sacred clay (Deep Sea Fishing)',
  200. 'Shattered anima',
  201. 'Advanced pulse core',
  202. 'Gift for the Reaper',
  203. 'Unstable air rune',
  204. 'Broken fishing rod',
  205. 'Gift for the Reaper',
  206. 'Tangled fishbowl',
  207. 'Broken fishing rod',
  208. 'Small goebie burial charm',
  209. 'Small goebie burial charm',
  210. 'Menaphite gift offering (medium)',
  211. 'Sacred clay (Deep Sea Fishing)',
  212. 'Shattered anima',
  213. 'D&D token (daily)',
  214. 'Slayer VIP Coupon',
  215. 'Shattered anima',
  216. 'Silverhawk down',
  217. 'Tangled fishbowl',
  218. 'Unstable air rune',
  219. 'Broken fishing rod',
  220. 'Barrel of bait',
  221. 'Tangled fishbowl',
  222. 'Broken fishing rod',
  223. 'Small goebie burial charm',
  224. 'Barrel of bait',
  225. 'Menaphite gift offering (medium)',
  226. 'Sacred clay (Deep Sea Fishing)',
  227. 'Menaphite gift offering (small)',
  228. 'Livid plant (Deep Sea Fishing)',
  229. 'Sacred clay (Deep Sea Fishing)',
  230. 'Shattered anima',
  231. 'Silverhawk down',
  232. 'Unstable air rune',
  233. 'Unstable air rune',
  234. 'Broken fishing rod',
  235. 'Barrel of bait',
  236. 'Gift for the Reaper',
  237. 'Broken fishing rod',
  238. 'Small goebie burial charm',
  239. 'Gift for the Reaper',
  240. 'Goebie burial charm',
  241. 'Sacred clay (Deep Sea Fishing)',
  242. 'Shattered anima',
  243. 'Livid plant (Deep Sea Fishing)',
  244. 'Unstable air rune',
  245. 'Shattered anima',
  246. 'Silverhawk down',
  247. 'Unstable air rune',
  248. 'Slayer VIP Coupon',
  249. 'Broken fishing rod',
  250. 'Barrel of bait',
  251. 'Gift for the Reaper',
  252. 'Goebie burial charm',
  253. 'Small goebie burial charm',
  254. 'Barrel of bait',
  255. 'Goebie burial charm',
  256. 'Shattered anima',
  257. 'Menaphite gift offering (small)',
  258. 'Livid plant (Deep Sea Fishing)',
  259. 'Unstable air rune',
  260. 'Sacred clay (Deep Sea Fishing)',
  261. 'Silverhawk down',
  262. 'Unstable air rune',
  263. 'Slayer VIP Coupon',
  264. 'Unfocused damage enhancer',
  265. 'Barrel of bait',
  266. 'Gift for the Reaper',
  267. 'Anima crystal',
  268. 'Menaphite gift offering (small)',
  269. 'Gift for the Reaper',
  270. 'Goebie burial charm',
  271. 'Shattered anima',
  272. 'Small goebie burial charm',
  273. 'Livid plant (Deep Sea Fishing)',
  274. 'Unstable air rune',
  275. 'Sacred clay (Deep Sea Fishing)',
  276. 'Advanced pulse core',
  277. 'Unstable air rune',
  278. 'Slayer VIP Coupon',
  279. 'Advanced pulse core',
  280. 'Gift for the Reaper',
  281. 'Gift for the Reaper',
  282. 'Goebie burial charm',
  283. 'Menaphite gift offering (small)',
  284. 'Small goebie burial charm',
  285. 'Goebie burial charm',
  286. 'Shattered anima',
  287. 'Small goebie burial charm',
  288. 'D&D token (daily)',
  289. 'Unstable air rune',
  290. 'Sacred clay (Deep Sea Fishing)',
  291. 'Advanced pulse core',
  292. 'Gift for the Reaper'
  293.     }
  294.  
  295. local rotation = p.rotation_days(1, #rotations, 37)
  296. local item = p.travelling_merchant_items()[rotations[rotation]]
  297. local page = rotations[rotation]
  298. local name = item.name or ('[[' .. page .. ']]')
  299. return '| {{plinkp|' .. page .. '}} || ' .. name .. ' || {{Coins|' .. item.cost .. '}} || ' .. item.quantity .. ' || ' .. item.use
  300. end
  301.  
  302. function p.slotB()
  303.     local rotations = {
  304.         'Slayer VIP Coupon',
  305. 'Unfocused damage enhancer',
  306. 'Gift for the Reaper',
  307. 'Menaphite gift offering (small)',
  308. 'Unstable air rune',
  309. 'Broken fishing rod',
  310. 'Goebie burial charm',
  311. 'Shattered anima',
  312. 'Sacred clay (Deep Sea Fishing)',
  313. 'Silverhawk down',
  314. 'Tangled fishbowl',
  315. 'Small goebie burial charm',
  316. 'Slayer VIP Coupon',
  317. 'Unfocused damage enhancer',
  318. 'Broken fishing rod',
  319. 'Menaphite gift offering (small)',
  320. 'Menaphite gift offering (small)',
  321. 'Livid plant (Deep Sea Fishing)',
  322. 'Unstable air rune',
  323. 'Gift for the Reaper',
  324. 'Sacred clay (Deep Sea Fishing)',
  325. 'Advanced pulse core',
  326. 'Unfocused damage enhancer',
  327. 'Small goebie burial charm',
  328. 'Small goebie burial charm',
  329. 'D&D token (daily)',
  330. 'Sacred clay (Deep Sea Fishing)',
  331. 'Tangled fishbowl',
  332. 'Shattered anima',
  333. 'Silverhawk down',
  334. 'Advanced pulse core',
  335. 'Barrel of bait',
  336. 'Barrel of bait',
  337. 'Menaphite gift offering (medium)',
  338. 'Shattered anima',
  339. 'Unstable air rune',
  340. 'Menaphite gift offering (small)',
  341. 'D&D token (daily)',
  342. 'Silverhawk down',
  343. 'Gift for the Reaper',
  344. 'Gift for the Reaper',
  345. 'Goebie burial charm',
  346. 'Menaphite gift offering (small)',
  347. 'Slayer VIP Coupon',
  348. 'Barrel of bait',
  349. 'Menaphite gift offering (medium)',
  350. 'Livid plant (Deep Sea Fishing)',
  351. 'Unstable air rune',
  352. 'Tangled fishbowl',
  353. 'Broken fishing rod',
  354. 'Small goebie burial charm',
  355. 'Sacred clay (Deep Sea Fishing)',
  356. 'Gift for the Reaper',
  357. 'Goebie burial charm',
  358. 'Menaphite gift offering (medium)',
  359. 'Slayer VIP Coupon',
  360. 'Slayer VIP Coupon',
  361. 'Unfocused damage enhancer',
  362. 'Barrel of bait',
  363. 'Menaphite gift offering (small)',
  364. 'Tangled fishbowl',
  365. 'Anima crystal',
  366. 'Goebie burial charm',
  367. 'Sacred clay (Deep Sea Fishing)',
  368. 'Sacred clay (Deep Sea Fishing)',
  369. 'Advanced pulse core',
  370. 'Tangled fishbowl',
  371. 'Small goebie burial charm',
  372. 'Unstable air rune',
  373. 'Broken fishing rod',
  374. 'Anima crystal',
  375. 'Shattered anima',
  376. 'Shattered anima',
  377. 'Silverhawk down',
  378. 'Unstable air rune',
  379. 'Barrel of bait',
  380. 'Slayer VIP Coupon',
  381. 'Advanced pulse core',
  382. 'Broken fishing rod',
  383. 'Menaphite gift offering (small)',
  384. 'Menaphite gift offering (small)',
  385. 'Livid plant (Deep Sea Fishing)',
  386. 'Slayer VIP Coupon',
  387. 'Gift for the Reaper',
  388. 'Shattered anima',
  389. 'Silverhawk down',
  390. 'Unfocused damage enhancer',
  391. 'Barrel of bait',
  392. 'Small goebie burial charm',
  393. 'Menaphite gift offering (medium)',
  394. 'Sacred clay (Deep Sea Fishing)',
  395. 'Tangled fishbowl',
  396. 'Menaphite gift offering (small)',
  397. 'Livid plant (Deep Sea Fishing)',
  398. 'Silverhawk down',
  399. 'Gift for the Reaper',
  400. 'Gift for the Reaper',
  401. 'Goebie burial charm',
  402. 'Shattered anima',
  403. 'Slayer VIP Coupon',
  404. 'Small goebie burial charm',
  405. 'D&D token (daily)',
  406. 'Livid plant (Deep Sea Fishing)',
  407. 'Tangled fishbowl',
  408. 'Tangled fishbowl',
  409. 'Anima crystal',
  410. 'Small goebie burial charm',
  411. 'Sacred clay (Deep Sea Fishing)',
  412. 'Barrel of bait',
  413. 'Menaphite gift offering (medium)',
  414. 'D&D token (daily)',
  415. 'Unstable air rune',
  416. 'Unstable air rune',
  417. 'Broken fishing rod',
  418. 'Barrel of bait',
  419. 'Shattered anima',
  420. 'Gift for the Reaper',
  421. 'Anima crystal',
  422. 'Menaphite gift offering (medium)',
  423. 'Slayer VIP Coupon'
  424.     }
  425.  
  426. local rotation = p.rotation_days(1, #rotations, 37)
  427. local item = p.travelling_merchant_items()[rotations[rotation]]
  428. local page = rotations[rotation]
  429. local name = item.name or ('[[' .. page .. ']]')
  430. return '| {{plinkp|' .. page .. '}} || ' .. name .. ' || {{Coins|' .. item.cost .. '}} || ' .. item.quantity .. ' || ' .. item.use
  431. end
  432.  
  433. function p.slotC()
  434.     local itemNumber = {
  435.         1,
  436. 1,
  437. 2,
  438. 1,
  439. 3,
  440. 4,
  441. 3,
  442. 1,
  443. 5,
  444. 6,
  445. 6,
  446. 6,
  447. 5,
  448. 7,
  449. 8,
  450. 5,
  451. 7,
  452. 9,
  453. 1,
  454. 2,
  455. 4,
  456. 4,
  457. 1,
  458. 4,
  459. 6,
  460. 10,
  461. 4,
  462. 11,
  463. 7,
  464. 2,
  465. 5,
  466. 5,
  467. 9,
  468. 12,
  469. 2,
  470. 9,
  471. 4,
  472. 12,
  473. 4,
  474. 12
  475.     }
  476. local rotation = p.rotation_days(1, #itemNumber, -1)
  477. local itemNumberInCurrentRotation = itemNumber[rotation];
  478.  
  479. local itemOrder = {
  480.         'Dragonkin lamp',
  481. 'D&D token (weekly)',
  482. 'Deathtouched dart',
  483. 'Menaphite gift offering (large)',
  484. 'Starved ancient effigy',
  485. 'Large goebie burial charm',
  486. 'Crystal triskelion',
  487. 'Taijitu',
  488. 'Message in a bottle (Deep Sea Fishing)',
  489. 'Unfocused reward enhancer',
  490. 'Dungeoneering Wildcard',
  491. 'Harmonic dust',
  492. 'D&D token (monthly)'
  493. }
  494.  
  495. local itemIdxPerIndexAtStart = {
  496.     [1] = 12, -- Dust
  497.     [2] = 6, -- Large goebie
  498.     [3] = 1, -- Lamp
  499.     [4] = 5, -- Effigy
  500.     [5] = 2, -- Weekly
  501.     [6] = 9, -- Bottle
  502.     [7] = 8, -- Tai
  503.     [8] = 11, -- Wild
  504.     [9] = 10, -- Reward
  505.     [10] = 13, -- Monthly
  506.     [11] = 7, -- Trisk
  507.     [12] = 3 -- Dart
  508. }
  509.  
  510. local currentEnumeration = p.rotation_days(40, #itemOrder, 79)
  511. local page = itemOrder[(itemIdxPerIndexAtStart[itemNumberInCurrentRotation] + currentEnumeration) % #itemOrder + 1]
  512. local item = p.travelling_merchant_items()[page]
  513. local name = item.name or ('[[' .. page .. ']]')
  514. return '| {{plinkp|' .. page .. '}} || ' .. name .. ' || {{Coins|' .. item.cost .. '}} || ' .. item.quantity .. ' || ' .. item.use
  515. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement