Advertisement
N1E7R4V

drop

Oct 21st, 2023
662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.42 KB | None | 0 0
  1. function getRand(pid)
  2. {
  3.     local rand = rand() % 200 + 1;
  4.     return rand;
  5. }
  6.  
  7. function harvestBonus(pid, resource_id, rewardItem)
  8. {
  9.     local rand = rand() % 100 + 1;
  10.  
  11.     local miner = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_01);
  12.     local agronom = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_02);
  13.     local lesorub = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_03);
  14.     local ribak = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_04);
  15.     local sobiratel = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_05);
  16.     local pos = getPlayerPosition(pid);
  17.     local world = getPlayerWorld(pid);
  18.    
  19.     if(resource_id == 0 ||
  20.     resource_id == 1 ||
  21.     resource_id == 11 ||
  22.     resource_id == 13 ||
  23.     resource_id == 28)
  24.     {
  25.         local getrand = getRand(pid)
  26.         local rand2 = rand + getrand
  27.         if (rand >= 8 && rand <= 10)
  28.         {
  29.             local dropReward = ItemsGround.spawn(Items.id("OOLTYB_ITMI_QUARTZ"), 1, pos.x, pos.y, pos.z, world);
  30.             callClientFunc(pid, "showNotification", "Вы нашли: кварц");
  31.         }
  32.                                
  33.         if (rand >= 11 && rand <= 13)
  34.         {
  35.             local dropReward = ItemsGround.spawn(Items.id("OOLTYB_ITMI_ROCKCRYSTAL"), 1, pos.x, pos.y, pos.z, world);
  36.             callClientFunc(pid, "showNotification", "Вы нашли: горный хрусталь");
  37.         }
  38.                                
  39.         if (rand >= 14 && rand <= 16)
  40.         {
  41.             local dropReward = ItemsGround.spawn(Items.id("OOLTYB_ITMI_SULFUR"), 1, pos.x, pos.y, pos.z, world);
  42.             callClientFunc(pid, "showNotification", "Вы нашли: сера");
  43.         }
  44.  
  45.         if (rand2 >= 100 && rand2 <= 106)
  46.         {
  47.             local dropReward = ItemsGround.spawn(Items.id("ITMI_AMBER"), 1, pos.x, pos.y, pos.z, world);
  48.             callClientFunc(pid, "showNotification", "Вы нашли: янтарь");
  49.         }
  50.  
  51.         if (rand2 >= 106 && rand2 <= 111)
  52.         {
  53.             local dropReward = ItemsGround.spawn(Items.id("ITMI_TOPAZ"), 1, pos.x, pos.y, pos.z, world);
  54.             callClientFunc(pid, "showNotification", "Вы нашли: топаз");
  55.         }
  56.  
  57.         if (rand2 >= 112 && rand2 <= 116)
  58.         {
  59.             local dropReward = ItemsGround.spawn(Items.id("ITMI_SAPPHIRE"), 1, pos.x, pos.y, pos.z, world);
  60.             callClientFunc(pid, "showNotification", "Вы нашли: сапфир");
  61.         }
  62.  
  63.         if (rand2 >= 117 && rand2 <= 120)
  64.         {
  65.             local dropReward = ItemsGround.spawn(Items.id("ITMI_DIAMOND"), 1, pos.x, pos.y, pos.z, world);
  66.             callClientFunc(pid, "showNotification", "Вы нашли: алмаз");
  67.         }
  68.  
  69.         if (rand2 >= 121 && rand2 <= 122)
  70.         {
  71.             local dropReward = ItemsGround.spawn(Items.id("ITMI_RUBY"), 1, pos.x, pos.y, pos.z, world);
  72.             callClientFunc(pid, "showNotification", "Вы нашли: Рубин");
  73.         }
  74.                            
  75.         if (miner != null && getPlayerRangedWeapon(pid) != "BAG_3")
  76.         {              
  77.             if (rand <= 5)
  78.             {
  79.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
  80.                 callClientFunc(pid, "showNotification", "Удача +1");
  81.             }
  82.                                
  83.             if (rand >= 6 && rand <= 8)
  84.             {
  85.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
  86.                 callClientFunc(pid, "showNotification", "Удача +2");
  87.             }
  88.                                
  89.         }
  90.     }
  91.    
  92.     if(resource_id == 2 ||
  93.     resource_id == 25 ||
  94.     resource_id == 26 ||
  95.     resource_id == 29)
  96.     {
  97.    
  98.         if (rand <= 10)
  99.         {
  100.             callClientFunc(pid, "showNotification", "Вы нашли сорняк");
  101.             local dropReward = ItemsGround.spawn(Items.id("PLANTS_WEED"), 1, pos.x, pos.y, pos.z, world);
  102.         }
  103.    
  104.         if (agronom != null && getPlayerRangedWeapon(pid) != "BAG_4")
  105.         {
  106.             if (rand <= 5)
  107.             {
  108.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
  109.                 callClientFunc(pid, "showNotification", "Удача");
  110.             }
  111.                                
  112.             if (rand >= 6 && rand <= 8)
  113.             {
  114.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
  115.                 callClientFunc(pid, "showNotification", "Удача");
  116.             }
  117.            
  118.         }
  119.     }
  120.    
  121.     if(resource_id == 4)
  122.     {
  123.         if (rand <= 20)
  124.         {
  125.             callClientFunc(pid, "showNotification", "Вы нашли смолу");
  126.             local dropReward = ItemsGround.spawn(Items.id("OOLTYB_ITMI_PITCH"), 1, pos.x, pos.y, pos.z, world);
  127.         }
  128.        
  129.         if (lesorub != null && getPlayerRangedWeapon(pid) != "BAG_2")
  130.         {
  131.             if (rand <= 5)
  132.             {
  133.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
  134.                 callClientFunc(pid, "showNotification", "Удача");
  135.             }
  136.                            
  137.             if (rand >= 6 && rand <= 8)
  138.             {
  139.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
  140.                 callClientFunc(pid, "showNotification", "Удача");
  141.             }
  142.         }
  143.     }
  144.    
  145.     if(resource_id == 6 ||
  146.     resource_id == 7 ||
  147.     resource_id == 9 ||
  148.     resource_id == 10 ||
  149.     resource_id == 8)
  150.     {
  151.         if (sobiratel != null && getPlayerRangedWeapon(pid) != "BAG_6")
  152.         {
  153.             if (rand <= 5)
  154.             {
  155.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
  156.                 callClientFunc(pid, "showNotification", "Удача");
  157.             }
  158.                                
  159.             if (rand >= 6 && rand <= 8)
  160.             {
  161.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
  162.                 callClientFunc(pid, "showNotification", "Удача");
  163.             }
  164.         }
  165.     }
  166.    
  167.     if(resource_id == 27)
  168.     {
  169.         if (rand >= 79 && rand <= 89)  
  170.         {
  171.             local dropReward = ItemsGround.spawn(Items.id("RAKUSHKA"), 1, pos.x, pos.y, pos.z, world);
  172.             callClientFunc(pid, "showNotification", "Вы нашли: Ракушка");
  173.         }
  174.         if (rand >= 90 && rand <= 100)
  175.         {
  176.             local dropReward = ItemsGround.spawn(Items.id("USTRICA"), 1, pos.x, pos.y, pos.z, world);
  177.             callClientFunc(pid, "showNotification", "Вы нашли: Моллюск");
  178.         }
  179.            
  180.         if (ribak != null && getPlayerRangedWeapon(pid) != "BAG_1")
  181.         {
  182.             if (rand <= 5)
  183.             {
  184.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
  185.                 callClientFunc(pid, "showNotification", "Удача");
  186.             }
  187.             if (rand <= 3)
  188.             {
  189.                 local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
  190.                 callClientFunc(pid, "showNotification", "Удача");
  191.             }
  192.             if (rand >= 6 && rand <= 10)
  193.             {
  194.                 local dropReward = ItemsGround.spawn(Items.id("RAKUSHKA"), 1, pos.x, pos.y, pos.z, world);
  195.                 callClientFunc(pid, "showNotification", "Вы нашли: Ракушка");
  196.             }
  197.             if (rand >= 11 && rand <= 15)
  198.             {
  199.                 local dropReward = ItemsGround.spawn(Items.id("RAKUSHKA"), 1, pos.x, pos.y, pos.z, world);
  200.                 callClientFunc(pid, "showNotification", "Вы нашли: Ракушка");
  201.             }
  202.         }
  203.     }
  204.    
  205.    
  206. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement