Advertisement
Sonicover

Untitled

Jan 4th, 2024
1,074
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.05 KB | Gaming | 0 0
  1. def chooseRandomItem(qty=1)
  2.   #Item Groups
  3.   groups = [
  4.   :MEDICINE,
  5.   :POKEBALL,
  6.   :EVOLUTION,
  7.   :UTILITY
  8.   ]
  9.  
  10.   #Array of items
  11.   commonMeds = [
  12.   :POTION,
  13.   :BURNHEAL,
  14.   :AWAKENING
  15.   ]
  16.  
  17.   commonBalls = [
  18.   :POKEBALL,
  19.   :NESTBALL,
  20.   :NETBALL
  21.   ]
  22.  
  23.   commonEvo = [
  24.   :STRAWBERRYSWEET,
  25.   :WATERSTONE,
  26.   :FIRESTONE,
  27.   :THUNDERSTONE,
  28.   :LEAFSTONE
  29.   ]
  30.  
  31.   commonUtil = [
  32.   :REPEL
  33.   ]  
  34.  
  35.   uncommonMeds = [
  36.   :SUPERPOTION,
  37.   :ANTIDOTE,
  38.   :PARALYZEHEAL,
  39.   :FULLHEAL
  40.   ]
  41.  
  42.   uncommonBalls = [
  43.   :GREATBALL,
  44.   :DIVEBALL,
  45.   :HEALBALL,
  46.   :DUSKBALL
  47.   ]
  48.  
  49.   uncommonEvo = [
  50.   :METALCOAT,
  51.   :KINGSROCK,
  52.   :REAPERCLOTH,
  53.   :CHIPPEDPOT,
  54.   :CRACKEDPOT,
  55.   :LINKCABLE,
  56.   :LEADERSCREST,
  57.   :MASTERPIECETEACUP,
  58.   :UNREMARKABLETEACUP,
  59.   :MOONSTONE,
  60.   :SUNSTONE,
  61.   :ICESTONE
  62.   ]  
  63.  
  64.   uncommonUtil = [
  65.   :SUPERREPEL
  66.   ]  
  67.  
  68.   epicMeds = [
  69.   :HYPERPOTION,
  70.   :ICEHEAL
  71.   ]
  72.  
  73.   epicBalls = [
  74.   :ULTRABALL,
  75.   :QUICKBALL,
  76.   :REPEATBALL
  77.   ]
  78.  
  79.  
  80.   epicEvo = [
  81.   :DEEPSEATOOTH,
  82.   :DEEPSEASCALE,
  83.   :OVALSTONE,
  84.   :GALARICACUFF,
  85.   :GALARICAWREATH,
  86.   :SCROLLOFWATERS,
  87.   :SCROLLOFDARKNESS
  88.   ]
  89.  
  90.   epicUtil = [
  91.   :MAXREPEL
  92.   ]  
  93.  
  94.   legendaryMeds = [
  95.   :MAXPOTION,
  96.   :FULLRESTORE
  97.   ]
  98.  
  99.   legendaryBalls = [
  100.   :MASTERBALL
  101.   ]
  102.  
  103.  
  104.   legendaryEvo = [
  105.   :SWEETAPPLE,
  106.   :DRAGONSCALE,
  107.   :UPGRADE,
  108.   :DUBIOUSDISK,
  109.   :PROTECTOR,
  110.   :ELECTRIZER,
  111.   :MAGMARIZER,
  112.   :RAZORFANG,
  113.   :RAZORCLAW,
  114.   :PRISMSCALE,
  115.   :WHIPPEDDREAM,
  116.   :SACHET,
  117.   :TARTAPPLE,
  118.   :SWEETAPPLE,
  119.   :BLACKAUGURITE,
  120.   :PEATBLOCK,
  121.   :AUSPICIOUSARMOR,
  122.   :MALICIOUSARMOR,
  123.   :SYRUPAPPLE,
  124.   :DAWNSTONE,
  125.   :DUSKSTONE,
  126.   :SHINYSTONE
  127.   ]
  128.  
  129.  
  130.   #Randomly select Group
  131.   itemtype = rand(4)
  132.   itemrarity = rand(10)
  133.     if itemtype == 1
  134.         if itemrarity < 1
  135.             pbMessage(_INTL("You received a Legendary Medicine loot drop!"))
  136.             pbReceiveItem(legendaryMeds[rand(0...legendaryMeds.length)],qty)
  137.         elsif itemrarity <2
  138.             pbMessage(_INTL("You received an Epic Medicine loot drop!"))   
  139.             pbReceiveItem(epicMeds[rand(0...epicMeds.length)],qty)
  140.         elsif itemrarity <4
  141.             pbMessage(_INTL("You received an Uncommon Medicine loot drop!"))
  142.             pbReceiveItem(uncommonMeds[rand(0...uncommonMeds.length)],qty)   
  143.         else
  144.             pbMessage(_INTL("You received a Common Medicine loot drop!"))  
  145.             pbReceiveItem(commonMeds[rand(0...commonMeds.length)],qty)
  146.         end
  147.     elsif itemtype == 2
  148.         if itemrarity < 1
  149.             pbMessage(_INTL("You received a Legendary Pokeball loot drop!"))
  150.             pbReceiveItem(legendaryBalls[rand(0...legendaryBalls.length)],qty)
  151.         elsif itemrarity < 2
  152.             pbMessage(_INTL("You received an Epic Pokeball loot drop!"))   
  153.             pbReceiveItem(epicBalls[rand(0...epicBalls.length)],qty)
  154.         elsif itemrarity < 4
  155.             pbMessage(_INTL("You received an Uncommon Pokeball loot drop!"))
  156.             pbReceiveItem(uncommonBalls[rand(0...uncommonBalls.length)],qty)     
  157.         else
  158.             pbMessage(_INTL("You received a Common Pokeball loot drop!"))  
  159.             pbReceiveItem(commonBalls[rand(0...commonBalls.length)],qty)
  160.         end
  161.     elsif itemtype == 3
  162.         if itemrarity < 1
  163.             pbMessage(_INTL("You received a Legendary Evolution loot drop!"))
  164.             pbReceiveItem(legendaryEvo[rand(0...legendaryEvo.length)],qty)
  165.         elsif itemrarity < 2
  166.             pbMessage(_INTL("You received an Epic Evolution loot drop!"))  
  167.             pbReceiveItem(epicEvo[rand(0...epicEvo.length)],qty)
  168.         elsif itemrarity < 4
  169.             pbMessage(_INTL("You received an Uncommon Evolution loot drop!"))
  170.             pbReceiveItem(uncommonEvo[rand(0...uncommonEvo.length)],qty)     
  171.         else
  172.             pbMessage(_INTL("You received a Common Evolution loot drop!")) 
  173.             pbReceiveItem(commonEvo[rand(0...commonEvo.length)],qty)
  174.         end
  175.     else #itemtype == 4
  176.         if itemrarity < 2
  177.             pbMessage(_INTL("You received an Epic Utility loot drop!"))
  178.             pbReceiveItem(epicUtil[rand(0...epicUtil.length)],qty)
  179.         elsif itemrarity < 4
  180.             pbMessage(_INTL("You received an Uncommon Utility loot drop!"))
  181.             pbReceiveItem(uncommonUtil[rand(0...uncommonUtil.length)],qty)   
  182.         else
  183.             pbMessage(_INTL("You received a Common Utility loot drop!"))   
  184.             pbReceiveItem(commonUtil[rand(0...commonUtil.length)],qty)
  185.         end
  186.     end
  187. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement