Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.52 KB | None | 0 0
  1. -- TASK
  2.  
  3.  
  4. RANK_NONE = 0
  5. RANK_HUNTSMAN = 1
  6. RANK_RANGER = 2
  7. RANK_BIGGAMEHUNTER = 3
  8. RANK_TROPHYHUNTER = 4
  9. RANK_ELITEHUNTER = 5
  10.  
  11. REWARD_MONEY = 1
  12. REWARD_EXP = 2
  13. REWARD_ACHIEVEMENT = 3
  14. REWARD_STORAGE = 4
  15. REWARD_POINT = 5
  16. REWARD_ITEM = 6
  17.  
  18. QUESTSTORAGE_BASE = 1500
  19. KILLSSTORAGE_BASE = 65000
  20. REPEATSTORAGE_BASE = 48950
  21. POINTSSTORAGE = 2500
  22. tasks =
  23. {
  24. [1] = {bossName = "mickey", killsRequired = 5, raceName = "rats", level = {1, 666}, premium = false, creatures = {"rat", "cave rat", "spider", "poison spider", "bug"}, rewards = {
  25. {type = "exp", value = {8000}},
  26. {type = "money", value = {5000}},
  27. {type = "points", value = {1}}
  28. --{type = "storage", value = {81500,1}}
  29. }},
  30. [2] = {killsRequired = 50, raceName = "Orcs", level = {1, 666}, premium = false, creatures = {"orc", "orc warrior", "orc spearman", "orc berserker", "orc leader"}, rewards = {
  31. {type = "exp", value = {10000}},
  32. {type = "money", value = {3500}},
  33. {type = "points", value = {1}}
  34. }},
  35. [3] = {bossName = "the snapper", killsRequired = 300, raceName = "Crocodiles", level = {1, 666}, premium = false, creatures = {"crocodile"}, rewards = {
  36. {type = "exp", value = {20000}},
  37. {type = "item", value = {2536,1}},
  38. {type = "points", value = {1}},
  39. {type = "storage", value = {81500,3}}
  40. }},
  41. [4] = {bossName = "hide", killsRequired = 300, raceName = "Tarantulas", level = {1, 666}, premium = false, creatures = {"tarantula"}, rewards = {
  42. {type = "exp", value = {30000}},
  43. {type = "points", value = {1}},
  44. {type = "storage", value = {81500,4}}
  45. }},
  46. [5] = {bossName = "tiquanda's revenge", killsRequired = 150, raceName = "Carniphilas", level = {1, 666}, premium = false, creatures = {"carniphila"}, rewards = {
  47. {type = "exp", value = {30000}},
  48. {type = "item", value = {2477,1}},
  49. {type = "points", value = {1}},
  50. {type = "storage", value = {81500,5}}
  51. }},
  52. [6] = {killsRequired = 200, raceName = "Stone Golems", level = {1, 666}, premium = false, creatures = {"stone golem"}, rewards = {
  53. {type = "exp", value = {30000}},
  54. {type = "points", value = {1}}
  55. }},
  56. [7] = {killsRequired = 300, raceName = "Gargoyles", level = {1, 666}, premium = false, creatures = {"gargoyle"}, rewards = {
  57. {type = "exp", value = {40000}},
  58. {type = "points", value = {2}}
  59. }},
  60. [8] = {killsRequired = 250, raceName = "Ancient Scarabs", level = {1, 666}, premium = false, creatures = {"ancient scarab"}, rewards = {
  61. {type = "exp", value = {60000}},
  62. {type = "money", value = {10000}},
  63. {type = "points", value = {2}}
  64. }},
  65. [9] = {killsRequired = 300, raceName = "Bonebeasts", level = {1, 666}, premium = false, creatures = {"bonebeast"}, rewards = {
  66. {type = "exp", value = {40000}},
  67. {type = "item", value = {2488,1}},
  68. {type = "points", value = {2}}
  69. }},
  70. [10] = {bossName = "the old widow", killsRequired = 500, raceName = "Giant Spiders", level = {1, 666}, premium = false, creatures = {"giant spider"}, rewards = {
  71. {type = "exp", value = {80000}},
  72. {type = "item", value = {2195,1}},
  73. {type = "points", value = {3}},
  74. {type = "storage", value = {81500,10}}
  75. }},
  76. [11] = {bossName = "the many", killsRequired = 650, raceName = "Hydras", level = {1, 666}, premium = false, creatures = {"hydra"}, rewards = {
  77. {type = "exp", value = {120000}},
  78. {type = "item", value = {2498,1}},
  79. {type = "points", value = {3}},
  80. {type = "storage", value = {81500,11}}
  81. }},
  82. [12] = {bossName = "the noxious spawn", killsRequired = 800, raceName = "Serpent Spawns", level = {1, 9999}, premium = false, creatures = {"serpent spawn"}, rewards = {
  83. {type = "exp", value = {120000}},
  84. {type = "points", value = {3}},
  85. {type = "storage", value = {81500,12}}
  86. }},
  87. [13] = {bossName = "stonecracker", killsRequired = 700, raceName = "Behemoths", level = {1, 9999}, premium = false, creatures = {"behemoth"}, rewards = {
  88. {type = "exp", value = {120000}},
  89. {type = "item", value = {2645,1}},
  90. {type = "points", value = {3}},
  91. {type = "storage", value = {81500,13}}
  92. }},
  93. [14] = {killsRequired = 1666, raceName = "Demons", level = {1, 9999}, rank = RANK_ELITEHUNTER, premium = false, creatures = {"demon"}, rewards = {
  94. {type = "item", value = {2390, 1}},
  95. {type = "points", value = {5}}
  96. }},
  97. [15] = {bossName = "The Horned Fox", killsRequired = 250, raceName = "Minotaurs", level = {1, 999}, premium = false, creatures = {"minotaur", "minotaur mage", "minotaur archer", "minotaur guard"}, rewards = {
  98. {type = "exp", value = {40000}},
  99. {type = "money", value = {7000}},
  100. {type = "points", value = {1}},
  101. {type = "storage", value = {81500,15}}
  102. }},
  103. [16] = {bossName = "Necropharus", killsRequired = 600, raceName = "Necromancers and Priestess", level = {1, 9999}, norepeatable = true, premium = false, creatures = {"necromancer", "priestess"}, rewards = {
  104. {type = "exp", value = {50000}},
  105. {type = "item", value = {2195, 1}},
  106. {type = "points", value = {3}},
  107. {type = "storage", value = {81500,16}}
  108. }},
  109. [17] = {bossName = "Demodras", killsRequired = 400, raceName = "Dragons", level = {1, 999}, premium = false, creatures = {"dragon", "dragon lord", "dragon hatchling", "dragon lord hatchling", "frost dragon", "frost dragon hatchling"}, rewards = {
  110. {type = "exp", value = {80000}},
  111. {type = "item", value = {2160,3}},
  112. {type = "points", value = {2}},
  113. {type = "storage", value = {81500,17}}
  114. }},
  115. [18] = {killsRequired = 400, raceName = "Larvas", level = {1, 999}, premium = false, creatures = {"larva"}, rewards = {
  116. {type = "exp", value = {20000}},
  117. {type = "points", value = {1}}
  118. }},
  119. [19] = {killsRequired = 200, raceName = "Wasps", level = {1, 999}, premium = false, creatures = {"Wasp"}, rewards = {
  120. {type = "exp", value = {10000}},
  121. {type = "points", value = {1}}
  122. }},
  123. [20] = {killsRequired = 300, raceName = "Heros", level = {1, 999}, premium = false, creatures = {"Hero"}, rewards = {
  124. {type = "exp", value = {75000}},
  125. {type = "points", value = {2}}
  126. }},
  127. [21] = {killsRequired = 500, raceName = "Rotworms", level = {1, 999}, premium = false, creatures = {"rotworm"}, rewards = {
  128. {type = "exp", value = {21000}},
  129. {type = "points", value = {1}}
  130. }},
  131. [22] = {killsRequired = 3000, raceName = "Tombs", level = {1, 999}, premium = false, creatures = {"Ghoul","Skeleton","Demon Skeleton","Ghost","Scarab","Larva","lion","poison spider","spider","Snake","cobra","scorpion","mummy","slime","stone golem","crypt shambler","stalker","gargoyle","vampire","beholder","bonebeast","ancient scarab","necromancer"}, rewards = {
  132. {type = "exp", value = {65000}},
  133. {type = "points", value = {2}}
  134. }},
  135. [23] = {killsRequired = 500, raceName = "Vampires", level = {1, 999}, premium = false, creatures = {"Vampire"}, rewards = {
  136. {type = "exp", value = {60000}},
  137. {type = "points", value = {2}}
  138. }},
  139. [24] = {killsRequired = 300, raceName = "Black Knights", level = {1, 999}, premium = false, creatures = {"Black Knight"}, rewards = {
  140. {type = "exp", value = {90000}},
  141. {type = "item", value = {2536,1}},
  142. {type = "points", value = {2}}
  143. }},
  144. [25] = {killsRequired = 500, raceName = "Cyclops", level = {1, 999}, premium = false, creatures = {"Cyclops", "Cyclops Drone", "Cyclops Smith"}, rewards = {
  145. {type = "exp", value = {65000}},
  146. {type = "points", value = {1}}
  147. }},
  148. [26] = {killsRequired = 1000, raceName = "Warlocks", level = {1, 999}, premium = false, creatures = {"Warlock"}, rewards = {
  149. {type = "exp", value = {180000}},
  150. {type = "points", value = {3}}
  151. }},
  152. [27] = {killsRequired = 700, raceName = "Dwarfs", level = {1, 999}, premium = false, creatures = {"Dwarf","Dwarf Guard","Dwarf Soldier"}, rewards = {
  153. {type = "exp", value = {30000}},
  154. {type = "points", value = {2}}
  155. }},
  156. [28] = {killsRequired = 400, raceName = "Banshees", level = {1, 999}, premium = false, creatures = {"Banshee"}, rewards = {
  157. {type = "exp", value = {40000}},
  158. {type = "points", value = {3}}
  159. }},
  160. [29] = {killsRequired = 300, raceName = "Slimes", level = {1, 999}, premium = false, creatures = {"Slime"}, rewards = {
  161. {type = "exp", value = {10000}},
  162. {type = "points", value = {2}}
  163. }},
  164. [30] = {killsRequired = 400, raceName = "Demon Skeletons", level = {1, 999}, premium = false, creatures = {"Demon Skeleton"}, rewards = {
  165. {type = "exp", value = {20000}},
  166. {type = "points", value = {2}}
  167. }},
  168. [31] = {killsRequired = 500, raceName = "Ghouls", level = {1, 999}, premium = false, creatures = {"Ghoul"}, rewards = {
  169. {type = "exp", value = {21300}},
  170. {type = "points", value = {2}}
  171. }},
  172. [32] = {killsRequired = 500, raceName = "Scarabs", level = {1, 999}, premium = false, creatures = {"Scarab"}, rewards = {
  173. {type = "exp", value = {21300}},
  174. {type = "points", value = {2}}
  175. }},
  176. [33] = {killsRequired = 300, raceName = "Stalkers", level = {1, 999}, premium = false, creatures = {"Stalker"}, rewards = {
  177. {type = "exp", value = {10000}},
  178. {type = "points", value = {2}}
  179. }},
  180. [34] = {killsRequired = 300, raceName = "Lions", level = {1, 999}, premium = false, creatures = {"Lion"}, rewards = {
  181. {type = "exp", value = {10000}},
  182. {type = "points", value = {2}}
  183. }},
  184. [35] = {killsRequired = 300, raceName = "Deers", level = {1, 999}, premium = false, creatures = {"Deer"}, rewards = {
  185. {type = "exp", value = {7000}},
  186. {type = "points", value = {4}}
  187. }},
  188. [36] = {killsRequired = 500, raceName = "Wolves", level = {1, 999}, premium = false, creatures = {"Wolf"}, rewards = {
  189. {type = "exp", value = {7000}},
  190. {type = "points", value = {2}}
  191. }},
  192. [37] = {killsRequired = 600, raceName = "Apes", level = {1, 999}, premium = false, creatures = {"Kongra","Merlkin","Sibang"}, rewards = {
  193. {type = "exp", value = {38000}},
  194. {type = "points", value = {2}}
  195. }},
  196. [38] = {killsRequired = 600, raceName = "Orcs High", level = {1, 999}, premium = false, creatures = {"Orc Berserker","Orc Warlord","Orc Warrior","Orc Spearman"}, rewards = {
  197. {type = "exp", value = {50000}},
  198. {type = "points", value = {2}}
  199. }},
  200. [39] = {killsRequired = 350, raceName = "Amazon", level = {1, 999}, premium = false, creatures = {"Amazon","Valkyrie"}, rewards = {
  201. {type = "exp", value = {35000}},
  202. {type = "points", value = {2}}
  203. }},
  204. [40] = {killsRequired = 350, raceName = "Elfs", level = {1, 999}, premium = false, creatures = {"Elf Arcanist","Elf","Elf Scout"}, rewards = {
  205. {type = "exp", value = {35000}},
  206. {type = "points", value = {2}}
  207. }},
  208. [41] = {killsRequired = 100, raceName = "Inquisition", level = {1, 999}, norepeatable = true, premium = false, creatures = {"Annihilon","Golgordan","Hellgorak","Latrivan","Madareth","Ushuriel","Zugurosh"}, rewards = {
  209. {type = "exp", value = {300000}},
  210. {type = "points", value = {20}}
  211. }},
  212. [42] = {killsRequired = 500, raceName = "Quara", level = {1, 999}, premium = false, creatures = {"quara pincher","quara hydromancer","quara predator","quara constrictor","quara constrictor scout","quara hydromancer scout","quara mantassin","quara mantassin scout", "quara pincher scout","quara predator scout"}, rewards = {
  213. {type = "exp", value = {50000}},
  214. {type = "points", value = {5}}
  215. }},
  216. [43] = {killsRequired = 500, raceName = "Icy", level = {1, 999}, premium = false, creatures = {"Ice Golem","Crystal Spider","hand of cursed fate"}, rewards = {
  217. {type = "exp", value = {100000}},
  218. {type = "points", value = {5}}
  219. }},
  220. [44] = {killsRequired = 666, raceName = "Hell", level = {1, 999}, premium = false, creatures = {"Hellfire Fighter","Hellhound","Fury","Lost Soul","Undead Dragon","Juggernaut","hand of cursed fate","diabolic imp","dark torturer","undead dragon","betrayed wraith"}, rewards = {
  221. {type = "exp", value = {350666}},
  222. {type = "points", value = {10}}
  223. }},
  224. [45] = {killsRequired = 500, raceName = "Lizards", level = {1, 999}, premium = false, creatures = {"Lizard Sentinel", "Lizard Snakecharmer", "Lizard Templar"}, rewards = {
  225. {type = "exp", value = {55000}},
  226. {type = "points", value = {3}}
  227. }},
  228.  
  229.  
  230.  
  231.  
  232.  
  233. [46] = {killsRequired = 300, raceName = "Tortoise", level = {1, 999}, premium = false, creatures = {"Tortoise", "Thornback Tortoises"}, rewards = {
  234. {type = "exp", value = {35000}},
  235. {type = "points", value = {2}}
  236. }},
  237.  
  238. [47] = {killsRequired = 1200, raceName = "Mutateds", level = {1, 999}, premium = false, creatures = {"Mutated Rat", "Mutated Bat", "Mutated Human", "Mutated Tiger"}, rewards = {
  239. {type = "exp", value = {130000}},
  240. {type = "points", value = {4}}
  241. }},
  242.  
  243. [48] = {killsRequired = 500, raceName = "Wyvern", level = {1, 999}, premium = false, creatures = {"Wyvern"}, rewards = {
  244. {type = "exp", value = {80000}},
  245. {type = "points", value = {3}}
  246. }},
  247.  
  248. [49] = {killsRequired = 500, raceName = "Werewolves", level = {1, 999}, premium = false, creatures = {"Werewold"}, rewards = {
  249. {type = "exp", value = {70000}},
  250. {type = "points", value = {3}}
  251. }},
  252.  
  253. [50] = {killsRequired = 500, raceName = "Hellspawn", level = {1, 999}, premium = false, creatures = {"Hellspawn"}, rewards = {
  254. {type = "exp", value = {110000}},
  255. {type = "points", value = {3}}
  256. }},
  257.  
  258. [51] = {killsRequired = 500, raceName = "Nightmare", level = {1, 999}, premium = false, creatures = {"Nightmare", "Nightmare Scion"}, rewards = {
  259. {type = "exp", value = {100000}},
  260. {type = "points", value = {3}}
  261. }},
  262.  
  263. [52] = {killsRequired = 800, raceName = "Grim Reaper", level = {1, 999}, premium = false, creatures = {"Grim Reaper"}, rewards = {
  264. {type = "exp", value = {200000}},
  265. {type = "points", value = {5}}
  266. }},
  267.  
  268. [53] = {killsRequired = 500, raceName = "Bog Raider", level = {1, 999}, premium = false, creatures = {"Bog Raider"}, rewards = {
  269. {type = "exp", value = {100000}},
  270. {type = "points", value = {3}}
  271. }},
  272.  
  273. [54] = {killsRequired = 500, raceName = "Blobs", level = {1, 999}, premium = false, creatures = {"Acid Blob", "Death Blob", "Mercury Blob"}, rewards = {
  274. {type = "exp", value = {100000}},
  275. {type = "points", value = {3}}
  276. }},
  277.  
  278. [55] = {killsRequired = 900, raceName = "Pirates", level = {1, 999}, premium = false, creatures = {"Pirate Buccaneer", "Pirate Corsair", "Pirate Cutthroat", "Pirate Ghost", "Pirate Marauder", "Pirate Skeleton"}, rewards = {
  279. {type = "exp", value = {120000}},
  280. {type = "points", value = {3}}
  281. }},
  282.  
  283. [56] = {killsRequired = 300, raceName = "Zombies", level = {1, 999}, premium = false, creatures = {"Zombie"}, rewards = {
  284. {type = "exp", value = {60000}},
  285. {type = "points", value = {2}}
  286. }},
  287.  
  288. [57] = {killsRequired = 300, raceName = "Barbarian", level = {1, 999}, premium = false, creatures = {"Barbarian Bloodwalker","Barbarian Brutetamer","Barbarian Headsplitter", "Barbarian Skullhunter"}, rewards = {
  289. {type = "exp", value = {80000}},
  290. {type = "points", value = {3}}
  291. }},
  292.  
  293. [58] = {killsRequired = 800, raceName = "Magicians", level = {1, 999}, premium = false, creatures = {"Infernalist","Dark Apprentice","Dark Magician", "Acolyte of the Cult", "Adept of the Cult"}, rewards = {
  294. {type = "exp", value = {130000}},
  295. {type = "points", value = {4}}
  296. }},
  297.  
  298. [59] = {killsRequired = 800, raceName = "Golems", level = {1, 999}, premium = false, creatures = {"War Golem","Worker Golem"}, rewards = {
  299. {type = "exp", value = {130000}},
  300. {type = "points", value = {4}}
  301. }}
  302.  
  303. -- dragons, cyclops, quaras
  304. }
  305.  
  306. tasksByPlayer = 3
  307. repeatTimes = 3
  308.  
  309. function getPlayerRank(cid)
  310. return (getPlayerStorageValue(cid, POINTSSTORAGE) >= 100 and RANK_ELITEHUNTER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 70 and RANK_TROPHYHUNTER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 40 and RANK_BIGGAMEHUNTER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 20 and RANK_RANGER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 10 and RANK_HUNTSMAN or RANK_NONE)
  311. end
  312.  
  313. function getTaskByName(name, table)
  314. local t = (table and table or tasks)
  315. for k, v in pairs(t) do
  316. if v.name then
  317. if v.name:lower() == name:lower() then
  318. return k
  319. end
  320. else
  321. if v.raceName:lower() == name:lower() then
  322. return k
  323. end
  324. end
  325. end
  326. return false
  327. end
  328.  
  329. function getTasksByPlayer(cid)
  330. local canmake = {}
  331. local able = {}
  332. for k, v in pairs(tasks) do
  333. if getCreatureStorage(cid, QUESTSTORAGE_BASE + k) < 1 and getCreatureStorage(cid, REPEATSTORAGE_BASE + k) < repeatTimes then
  334. able[k] = true
  335. if getPlayerLevel(cid) < v.level[1] or getPlayerLevel(cid) > v.level[2] then
  336. able[k] = false
  337. end
  338. if v.storage and getCreatureStorage(cid, v.storage[1]) < v.storage[2] then
  339. able[k] = false
  340. end
  341.  
  342. if v.rank then
  343. if getPlayerRank(cid) < v.rank then
  344. able[k] = false
  345. end
  346. end
  347.  
  348. if v.premium then
  349. if not isPremium(cid) then
  350. able[k] = false
  351. end
  352. end
  353.  
  354. if able[k] then
  355. table.insert(canmake, k)
  356. end
  357. end
  358. end
  359. return canmake
  360. end
  361.  
  362.  
  363. function canStartTask(cid, name, table)
  364. local v = ""
  365. local id = 0
  366. local t = (table and table or tasks)
  367. for k, i in pairs(t) do
  368. if i.name then
  369. if i.name:lower() == name:lower() then
  370. v = i
  371. id = k
  372. break
  373. end
  374. else
  375. if i.raceName:lower() == name:lower() then
  376. v = i
  377. id = k
  378. break
  379. end
  380. end
  381. end
  382. if v == "" then
  383. return false
  384. end
  385. if getCreatureStorage(cid, QUESTSTORAGE_BASE + id) > 0 then
  386. return false
  387. end
  388. if (getCreatureStorage(cid, REPEATSTORAGE_BASE + id) >= repeatTimes) or (v.norepeatable and getCreatureStorage(cid, REPEATSTORAGE_BASE + id) > 0) then
  389. return false
  390. end
  391. if getPlayerLevel(cid) >= v.level[1] and getPlayerLevel(cid) <= v.level[2] then
  392. if v.premium then
  393. if isPremium(cid) then
  394. if v.rank then
  395. if getPlayerRank(cid) >= v.rank then
  396. if v.storage then
  397. if getCreatureStorage(cid, v.storage[1]) >= v.storage[2] then
  398. return true
  399. end
  400. else
  401. return true
  402. end
  403. end
  404. else
  405. return true
  406. end
  407. end
  408. else
  409. return true
  410. end
  411. end
  412. return false
  413. end
  414.  
  415. function getPlayerStartedTasks(cid)
  416.  
  417. local tmp = {}
  418. for k, v in pairs(tasks) do
  419. if getCreatureStorage(cid, QUESTSTORAGE_BASE + k) > 0 and getCreatureStorage(cid, QUESTSTORAGE_BASE + k) < 2 then
  420. table.insert(tmp, k)
  421. end
  422. end
  423. return tmp
  424. end
  425.  
  426. function isSummon(cid)
  427. return getCreatureMaster(cid) ~= cid or false
  428. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement