Advertisement
Guest User

Untitled

a guest
Dec 30th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 39.02 KB | None | 0 0
  1. RANK_NONE = 0
  2. RANK_HUNTSMAN = 1
  3. RANK_RANGER = 2
  4. RANK_BIGGAMEHUNTER = 3
  5. RANK_TROPHYHUNTER = 4
  6. RANK_ELITEHUNTER = 5
  7. REWARD_MONEY = 1
  8. REWARD_EXP = 2
  9. REWARD_ACHIEVEMENT = 3
  10. REWARD_STORAGE = 4
  11. REWARD_POINT = 5
  12. REWARD_ITEM = 6
  13. QUESTSTORAGE_BASE = 71500
  14. KILLSSTORAGE_BASE = 72500
  15. REPEATSTORAGE_BASE = 73500
  16. POINTSSTORAGE = 72500
  17. tasks =
  18. {
  19.  
  20.     [6] = {killsRequired = 1500, raceName = "Carniphilas", level = {1, 99999}, premium = true, creatures = {"carniphila"}, rewards = {
  21.                                                                                                                                         {type = "exp", value = {2500}},
  22.                                                                                                                                         {type = "achievement", value = {"Rootless Behaviour"}},
  23.                                                                                                                                         {type = "storage", value = {35002, 1}},
  24.                                                                                                                                         {type = "money", value = {45000}},
  25.                                                                                                                                         {type = "item", value = {5015, 1}},
  26.                                                                                                                                         {type = "points", value = {3}}
  27.                                                                                                                                     }},
  28.                                                                                                                                
  29.                                                                                                                                
  30.                                                                                                                                     --Taks for level 80 to 129.
  31.     [25] = {killsRequired = 600, raceName = "Underwater Quara", level = {1, 99999}, premium = true, creatures = {"quara hydromancer", "quara predator", "quara constrictor", "quara mantassin", "quara pincher"}, rewards = {
  32.                                                                                                                                         {type = "exp", value = {15000}},
  33.                                                                                                                                         {type = "achievement", value = {"Back into the Abyss"}},
  34.                                                                                                                                         {type = "storage", value = {35009, 1}},
  35.                                                                                                                                         {type = "points", value = {3}}
  36.                                                                                                                                     }},
  37.     [26] = {killsRequired = 500, raceName = "Giant Spiders", level = {1, 99999}, premium = true, creatures = {"giant spider"}, rewards = {
  38.                                                                                                                                         {type = "exp", value = {20000}},
  39.                                                                                                                                         {type = "achievement", value = {"Choking on Her Venom"}},
  40.                                                                                                                                         {type = "storage", value = {35010, 1}},
  41.                                                                                                                                         {type = "points", value = {3}}
  42.                                                                                                                                     }},
  43.  
  44.     [28] = {killsRequired = 1500, raceName = "Nightmares", level = {1, 99999}, premium = true, creatures = {"nightmare", "nightmare scion"}, rewards = {
  45.                                                                                                                                         {type = "exp", value = {50000}},
  46.                                                                                                                                         {type = "achievement", value = {"Dream is Over"}},
  47.                                                                                                                                         {type = "storage", value = {35012, 1}},
  48.                                                                                                                                         {type = "money", value = {100000}},
  49.                                                                                                                                         {type = "points", value = {3}}
  50.                                                                                                                                     }},  
  51.     [29] = {killsRequired = 2000, raceName = "Hellspawns", level = {1, 99999}, premium = true, creatures = {"hellspawn"}, rewards = {
  52.                                                                                                                                         {type = "exp", value = {25000}},
  53.                                                                                                                                         {type = "achievement", value = {"Scorched Flames"}},
  54.                                                                                                                                         {type = "storage", value = {35013, 1}}
  55.                                                                                                                                     }},
  56.     [30] = {killsRequired = 8000, raceName = "High Class Lizards", level = {1, 99999}, premium = true, creatures = {"lizard chosen", "lizard dragon priest", "lizard high guard", "lizard legionnaire"}, rewards = {
  57.                                                                                                                                         {type = "exp", value = {30000}},
  58.                                                                                                                                         {type = "achievement", value = {"Zzztill Zzztanding!"}},
  59.                                                                                                                                         {type = "storage", value = {35014, 1}},
  60.                                                                                                                                         {type = "item", value = {6527, 7}},
  61.                                                                                                                                         {type = "money", value = {1500000}},
  62.                                                                                                                                         {type = "points", value = {3}}
  63.                                                                                                                                     }},
  64.     [31] = {killsRequired = 600, raceName = "Stampors", level = {1, 99999}, premium = true, creatures = {"stampor"}, rewards = {
  65.                                                                                                                                         {type = "exp", value = {20000}},
  66.                                                                                                                                         {type = "achievement", value = {"Stepped on a Big Toe"}},
  67.                                                                                                                                         {type = "storage", value = {35015, 1}},
  68.                                                                                                                                         {type = "points", value = {3}}
  69.                                                                                                                                     }},  
  70.     [32] = {killsRequired = 500, raceName = "Brimstone Bugs", level = {1, 99999}, premium = true, creatures = {"brimstone bug"}, rewards = {
  71.                                                                                                                                         {type = "exp", value = {15000}},
  72.                                                                                                                                         {type = "achievement", value = {"Something Smells"}},
  73.                                                                                                                                         {type = "storage", value = {35016, 1}},
  74.                                                                                                                                         {type = "points", value = {3}}
  75.                                                                                                                                     }},
  76.     [33] = {killsRequired = 400, raceName = "Mutated Bats", level = {1, 99999}, premium = true, creatures = {"mutated bat"}, rewards = {
  77.                                                                                                                                         {type = "exp", value = {20000}},
  78.                                                                                                                                         {type = "achievement", value = {"Kapow!"}},
  79.                                                                                                                                         {type = "storage", value = {35017, 1}},
  80.                                                                                                                                         {type = "points", value = {2}}
  81.                                                                                                                                     }},  
  82.     --Tasks for level 130+                                                                                                
  83.     [34] = {killsRequired = 750, raceName = "Hydras", level = {1, 9999}, premium = true, creatures = {"hydra"}, rewards = {
  84.                                                                                                                                         {type = "exp", value = {200000}},
  85.                                                                                                                                         {type = "achievement", value = {"One Less"}},
  86.                                                                                                                                         {type = "storage", value = {35018, 1}},
  87.                                                                                                                                         {type = "item", value = {10523, 1}},
  88.                                                                                                                                         {type = "money", value = {100000}},
  89.                                                                                                                                         {type = "points", value = {3}}
  90.                                                                                                                                     }},
  91.     [35] = {killsRequired = 7000, raceName = "Serpent Spawns", level = {1, 9999}, premium = true, creatures = {"serpent spawn"}, rewards = {
  92.                                                                                                                                         {type = "exp", value = {1700000}},
  93.                                                                                                                                         {type = "achievement", value = {"Hissing Downfall"}},
  94.                                                                                                                                         {type = "storage", value = {35019, 1}},
  95.                                                                                                                                         {type = "money", value = {100000}},
  96.                                                                                                                                         {type = "points", value = {4}}
  97.                                                                                                                                     }},  
  98.     [36] = {killsRequired = 5000, raceName = "Medusae", level = {1, 9999}, premium = true, creatures = {"medusa"}, rewards = {
  99.                                                                                                                                         {type = "exp", value = {1700000}},
  100.                                                                                                                                         {type = "achievement", value = {"The Serpent's Bride"}},
  101.                                                                                                                                         {type = "storage", value = {35020, 1}},
  102.                                                                                                                                         {type = "item", value = {6527, 1}},
  103.                                                                                                                                         {type = "money", value = {100000}},
  104.                                                                                                                                         {type = "points", value = {5}}
  105.                                                                                                                                     }},
  106.     [37] = {killsRequired = 2000, raceName = "Behemoths", level = {1, 9999}, premium = true, creatures = {"behemoth"}, rewards = {
  107.                                                                                                                                         {type = "exp", value = {500000}},
  108.                                                                                                                                         {type = "achievement", value = {"Just Cracked Me Up!"}},
  109.                                                                                                                                         {type = "storage", value = {35021, 1}},
  110.                                                                                                                                         {type = "money", value = {100000}},
  111.                                                                                                                                         {type = "points", value = {4}}
  112.                                                                                                                                     }},
  113.     [38] = {killsRequired = 2000, raceName = "Sea Serpents and Young Sea Serpents", level = {1, 9999}, premium = true, creatures = {"sea serpent", "young sea serpent"}, rewards = {
  114.                                                                                                                                         {type = "exp", value = {50000}},
  115.                                                                                                                                         {type = "achievement", value = {"The Drowned Sea God"}},
  116.                                                                                                                                         {type = "storage", value = {35022, 1}},
  117.                                                                                                                                         {type = "money", value = {100000}},
  118.                                                                                                                                         {type = "points", value = {4}}
  119.                                                                                                                                     }},  
  120.     [39] = {killsRequired = 1550, raceName = "Hellhounds", level = {1, 9999}, premium = true, creatures = {"hellhound"}, rewards = {
  121.                                                                                                                                         {type = "exp", value = {3500000}},
  122.                                                                                                                                         {type = "achievement", value = {"The Gates of Hell"}},
  123.                                                                                                                                         {type = "storage", value = {35023, 1}},
  124.                                                                                                                                         {type = "item", value = {6527, 7}},
  125.                                                                                                                                         {type = "money", value = {300000}},
  126.                                                                                                                                         {type = "points", value = {5}}
  127.                                                                                                                                     }},  
  128.     [40] = {killsRequired = 3000, raceName = "Ghastly Dragons", level = {1, 9999}, premium = true, creatures = {"ghastly dragon"}, rewards = {
  129.                                                                                                                                         {type = "exp", value = {3000000}},
  130.                                                                                                                                         {type = "achievement", value = {"Beautiful Agony"}},
  131.                                                                                                                                         {type = "storage", value = {35024, 1}},
  132.                                                                                                                                         {type = "item", value = {6527, 7}},
  133.                                                                                                                                         {type = "money", value = {300000}},
  134.                                                                                                                                         {type = "points", value = {5}}
  135.                                                                                                                                     }},  
  136.     [41] = {killsRequired = 2500, raceName = "Drakens", level = {1, 9999}, premium = true, creatures = {"draken spellweaver", "draken warmaster", "draken abomination", "draken elite"} , rewards = {
  137.                                                                                                                                         {type = "exp", value = {3000000}},
  138.                                                                                                                                         {type = "achievement", value = {"Enter zze Draken!"}},
  139.                                                                                                                                         {type = "storage", value = {35025, 1}},
  140.                                                                                                                                         {type = "item", value = {6527, 7}},
  141.                                                                                                                                         {type = "money", value = {2500000}},
  142.                                                                                                                                         {type = "points", value = {3}}
  143.                                                                                                                                     }},
  144.     [42] = {killsRequired = 2000, raceName = "Destroyers", level = {1, 9999}, premium = true, creatures = {"destroyer"}, rewards = {
  145.                                                                                                                                         {type = "exp", value = {30000}},
  146.                                                                                                                                         {type = "achievement", value = {"Best there was!"}},
  147.                                                                                                                                         {type = "storage", value = {35026, 1}},
  148.                                                                                                                                         {type = "item", value = {6527, 2}},
  149.                                                                                                                                         {type = "money", value = {100000}},
  150.                                                                                                                                         {type = "points", value = {4}}
  151.                                                                                                                                     }},      
  152.     [43] = {killsRequired = 600, raceName = "Undead Dragons", level = {1, 9999}, premium = true, creatures = {"undead dragon"}, rewards = {
  153.                                                                                                                                         {type = "exp", value = {3000000}},
  154.                                                                                                                                         {type = "achievement", value = {"Back from the Dead"}},
  155.                                                                                                                                         {type = "storage", value = {35027, 1}},
  156.                                                                                                                                         {type = "item", value = {6527, 6}},
  157.                                                                                                                                         {type = "money", value = {500000}},
  158.                                                                                                                                         {type = "points", value = {6}}
  159.                                                                                                                                     }},
  160.     [51] = {killsRequired = 10000, raceName = "Grim Reaper", level = {1, 9999}, premium = true, creatures = {"grim reaper"}, rewards = {
  161.                                                                                                                                         {type = "exp", value = {3500000}},
  162.                                                                                                                                         {type = "achievement", value = {"Back from the Dead"}},
  163.                                                                                                                                         {type = "storage", value = {35034, 1}},
  164.                                                                                                                                         {type = "item", value = {6527, 10}},
  165.                                                                                                                                         {type = "money", value = {2500000}},
  166.                                                                                                                                         {type = "points", value = {6}}
  167.                                                                                                                                     }},
  168.      [52] = {killsRequired = 2000, raceName = "Dragons", level = {1, 9999}, premium = true, creatures = {"dragon", "dragon lord","frost dragon"}, rewards = {
  169.                                                                                                                                         {type = "achievement", value = {"Beautiful Agony"}},
  170.                                                                                                                                         {type = "storage", value = {35024, 1}},
  171.                                                                                                                                         {type = "item", value = {5919, 1}},
  172.                                                                                                                                         {type = "points", value = {5}}
  173.                                                                                                                                     }},
  174.      [53] = {killsRequired = 8000, raceName = "Dark Torturer", level = {1, 9999}, premium = true, creatures = {"dark torturer"}, rewards = {
  175.                                                                                                                                         {type = "exp", value = {4000000}},
  176.                                                                                                                                         {type = "achievement", value = {"Back from the Dead"}},
  177.                                                                                                                                         {type = "storage", value = {35032, 1}},
  178.                                                                                                                                         {type = "item", value = {6527, 10}},
  179.                                                                                                                                         {type = "money", value = {2500000}},
  180.                                                                                                                                         {type = "points", value = {6}}
  181.                                                                                                                                     }},
  182.      [53] = {killsRequired = 2000, raceName = "Juggernaut", level = {1, 9999}, premium = true, creatures = {"juggernaut"}, rewards = {
  183.                                                                                                                                         {type = "exp", value = {5000000}},
  184.                                                                                                                                         {type = "achievement", value = {"Back from the Dead"}},
  185.                                                                                                                                         {type = "storage", value = {35030, 1}},
  186.                                                                                                                                         {type = "item", value = {6527, 10}},
  187.                                                                                                                                         {type = "points", value = {6}}
  188.                                                                                                                                     }},
  189.  
  190.     --Special tasks.
  191.     [44] = {killsRequired = 6666, raceName = "Demons", level = {1, 9999},  premium = true, creatures = {"demon"}, rewards = {
  192.                                                                                                                                         {type = "exp", value = {6000000}},
  193.                                                                                                                                         {type = "storage", value = {41300, 1}}, --Storage that let's you to start Demon Oak
  194.                                                                                                                                         {type = "item", value = {6527, 15}},
  195.                                                                                                                                         {type = "item", value = {9737, 1}}
  196.                                                                                                                                        
  197.                                                                                                                                     }},
  198.     [45] = {killsRequired = 500, raceName = "Green Djinns or Efreets", level = {1, 9999}, storage = {12500, 1}, premium = true, creatures = {"green djinn", "efreet"}, rewards = { --Requires an storage (Gained on The Djinn War - Marid Faction)
  199.                                                                                                                                         {type = "exp", value = {10000}},
  200.                                                                                                                                         {type = "money", value = {5000}},
  201.                                                                                                                                         {type = "storage", value = {35028, 1}}
  202.                                                                                                                                     }},
  203.     [46] = {killsRequired = 500, raceName = "Blue Djinns or Marids", level = {1, 9999}, storage = {12501, 1}, premium = true, creatures = {"blue djinn", "marid"}, rewards = { --Requires an storage (Gained on The Djinn War - Efreet Faction)
  204.                                                                                                                                         {type = "exp", value = {10000}},
  205.                                                                                                                                         {type = "money", value = {5000}},
  206.                                                                                                                                         {type = "storage", value = {35029, 1}}
  207.                                                                                                                                     }},  
  208.    -- [47] = {killsRequired = 3000, raceName = "Pirates", level = {1, 9999}, storage = {12600, 1}, premium = true, creatures = {"pirate ghost", "pirate marauder", "pirate cutthroad", "pirate buccaneer", "pirate corsair", "pirate skeleton"}, rewards = { --Requires an storage (Gained on The Shattered Isles Quest)
  209.     --                                                                                                                                    {type = "exp", value = {10000}},
  210.      --                                                                                                                                   {type = "money", value = {5000}},
  211.      --                                                                                                                                   {type = "storage", value = {35030, 1}}
  212.          --                                                                                                                           }},
  213.     [48] = {killsRequired = 3000, raceName = "Pirates second task", level = {1, 9999}, storage = {REPEATSTORAGE_BASE + 47, 3}, norepeatable = true, premium = true, creatures = {"pirate ghost", "pirate marauder", "pirate cutthroad", "pirate buccaneer", "pirate corsair", "pirate skeleton"}, rewards = { --Requires an storage (Gained completing Raymond Striker's first task three times.) NOTE: The required storage to start this task is: base + first pirate task id (47)
  214.                                                                                                                                         {type = "exp", value = {10000}},
  215.                                                                                                                                         {type = "money", value = {5000}},
  216.                                                                                                                                         {type = "storage", value = {35031, 1}}
  217.                                                                                                                                     }},
  218.     --[49] = {killsRequired = 5000, raceName = "Minotaurs", level = {1, 40}, storage = {12700, 1}, norepeatable = true, premium = false, creatures = {"minotaur", "minotaur mage", "minotaur archer"}, rewards = { --Requires an storage (Gained on To Outfox a Fox Quest)
  219.       --                                                                                                                                  {type = "storage", value = {35032, 1}}
  220.       --                                                                                                                              }},
  221.     [50] = {killsRequired = 4000, raceName = "Necromancers and Priestess", level = {1, 9999}, norepeatable = true, premium = true, creatures = {"necromancer", "priestess"}, rewards = { --Requires an storage (Gained on To Outfox a Fox Quest)
  222.                                                                                                                                         {type = "storage", value = {35033, 1}},
  223.                                                                                                                                         {type = "item", value = {5809, 1}},
  224.                                                                                                                                         {type = "exp", value = {20000}},
  225.                                                                                                                                         {type = "money", value = {20000}},
  226.                                                                                                                                         {type = "storage", value = {12800, 1}} --storage to stark the second Necromancers and Priestess task.
  227.                                                                                                                                     }},
  228.     [49] = {killsRequired = 1000, name = "Necromancers and Priestess second task", raceName = "Necromancers and Priestess", level = {60, 9999}, storage = {12800, 1}, norepeatable = true, premium = true, creatures = {"necromancer", "priestess"}, rewards = { --Requires an storage (Gained on To Outfox a Fox Quest)
  229.                                                                                                                                         {type = "exp", value = {40000}},
  230.                                                                                                                                         {type = "storage", value = {35033, 1}}
  231.                                                                                                                                     }},                                                                                                                                  
  232. }
  233. tasksByPlayer = 5
  234. repeatTimes = 100
  235. function getPlayerRank(cid)
  236.     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)
  237. end
  238. function getTaskByName(name, table)
  239.     local t = (table and table or tasks)
  240.     for k, v in pairs(t) do
  241.         if v.name then
  242.             if v.name:lower() == name:lower() then
  243.                 return k
  244.             end
  245.         else
  246.             if v.raceName:lower() == name:lower() then
  247.                 return k
  248.             end
  249.         end
  250.     end
  251.     return false
  252. end
  253. function getTasksByPlayer(cid)
  254.     local canmake = {}
  255.     local able = {}
  256.     for k, v in pairs(tasks) do
  257.         if getCreatureStorage(cid, QUESTSTORAGE_BASE + k) < 1 and getCreatureStorage(cid, REPEATSTORAGE_BASE + k) < repeatTimes then
  258.             able[k] = true
  259.             if getPlayerLevel(cid) < v.level[1] or getPlayerLevel(cid) > v.level[2] then
  260.                 able[k] = false
  261.             end
  262.             if v.storage and getCreatureStorage(cid, v.storage[1]) < v.storage[2] then
  263.                 able[k] = false
  264.             end
  265.             if v.rank then
  266.                 if getPlayerRank(cid) < v.rank then
  267.                     able[k] = false
  268.                 end
  269.             end
  270.             if v.premium then
  271.                 if not isPremium(cid) then
  272.                     able[k] = false
  273.                 end
  274.             end
  275.             if able[k] then
  276.                 table.insert(canmake, k)
  277.             end
  278.         end
  279.     end
  280.     return canmake
  281. end
  282. function canStartTask(cid, name, table)
  283.     local v = ""
  284.     local id = 0
  285.     local t = (table and table or tasks)
  286.     for k, i in pairs(t) do
  287.         if i.name then
  288.             if i.name:lower() == name:lower() then
  289.                 v = i
  290.                 id = k
  291.                 break
  292.             end
  293.         else
  294.             if i.raceName:lower() == name:lower() then
  295.                 v = i
  296.                 id = k
  297.                 break
  298.             end
  299.         end
  300.     end
  301.     if v == "" then
  302.         return false
  303.     end
  304.     if getCreatureStorage(cid, QUESTSTORAGE_BASE + id) > 0 then
  305.         return false
  306.     end
  307.     if (getCreatureStorage(cid, REPEATSTORAGE_BASE +  id) >= repeatTimes) or (v.norepeatable and getCreatureStorage(cid, REPEATSTORAGE_BASE +  id) > 0) then
  308.         return false
  309.     end
  310.     if getPlayerLevel(cid) >= v.level[1] and getPlayerLevel(cid) <= v.level[2] then
  311.         if v.premium then
  312.             if isPremium(cid) then
  313.                 if v.rank then
  314.                     if getPlayerRank(cid) >= v.rank then
  315.                         if v.storage then
  316.                             if getCreatureStorage(cid, v.storage[1]) >= v.storage[2] then
  317.                                 return true
  318.                             end
  319.                         else
  320.                             return true
  321.                         end
  322.                     end
  323.                 else
  324.                     return true
  325.                 end
  326.             end
  327.         else
  328.             return true
  329.         end
  330.     end
  331.     return false
  332. end
  333. function getPlayerStartedTasks(cid)
  334.     local tmp = {}
  335.     for k, v in pairs(tasks) do
  336.         if getCreatureStorage(cid, QUESTSTORAGE_BASE + k) > 0 and getCreatureStorage(cid, QUESTSTORAGE_BASE + k) < 2 then
  337.             table.insert(tmp, k)
  338.         end
  339.     end
  340.     return tmp
  341. end
  342. function isSummon(cid)
  343.     return getCreatureMaster(cid) ~= nil
  344. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement