Advertisement
Xyberviri

airdrop_settings.lua

Mar 29th, 2015
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 26.64 KB | None | 0 0
  1. PLUGIN.Name         = "Airdrop Settings"
  2. PLUGIN.Title        = "Airdrop Settings"
  3. PLUGIN.Description  = "Allows to change the airdrop settings"
  4. PLUGIN.Url          = "http://amx-x.ru"
  5. PLUGIN.Version      = V(1, 0, 0)
  6. PLUGIN.Author       = "t0pdevice"
  7. PLUGIN.HasConfig    = true
  8. PLUGIN.ResourceID   = 785
  9.  
  10. local CanDrop = false
  11. local Timer
  12. local VectorZero
  13. local Looting = {}
  14. local AirdropLoot = {}
  15.  
  16. function PLUGIN:Init()
  17.     command.AddChatCommand("airdrop_min", self.Plugin, "CmdMinimumPlayers")
  18.     command.AddChatCommand("airdrop_freq", self.Plugin, "CmdDropFrequency")
  19.     command.AddChatCommand("airdrop_stay", self.Plugin, "CmdSupplyStayTime")
  20.     command.AddChatCommand("airdrop_reset", self.Plugin, "CmdLootReset")
  21.     command.AddConsoleCommand("airdrop.run", self.Plugin, "CmdAirdropRun")
  22.     command.AddConsoleCommand("airdrop.min", self.Plugin, "CmdMinimumPlayersConsole")  
  23.     command.AddConsoleCommand("airdrop.freq", self.Plugin, "CmdDropFrequencyConsole")
  24.     command.AddConsoleCommand("airdrop.stay", self.Plugin, "CmdSupplyStayTimeConsole")
  25.     command.AddConsoleCommand("airdrop.reset", self.Plugin, "CmdLootResetConsole")
  26.    
  27.     self:CheckConfig()
  28.    
  29.     if (self.Config.AirdropSettings.DropFrequency > 0) then
  30.         Timer = timer.Repeat(self.Config.AirdropSettings.DropFrequency * 60, 0, function() self:SpawnPlane() end)
  31.     end
  32.    
  33.     VectorZero = new(UnityEngine.Vector3._type, nil)
  34.     VectorZero.x = 0
  35.     VectorZero.y = 0
  36.     VectorZero.z = 0
  37.    
  38.     Looting.Container = {}
  39.     self:LoadAirdropLoot()
  40. end
  41.  
  42. function PLUGIN:FormatString(Text, Parameter, Value)
  43.     return string.gsub(Text, Parameter, Value)
  44. end
  45.  
  46. function PLUGIN:AllowDrop()
  47.     if (self.Config.AirdropSettings.ManualRunDrop) then
  48.         CanDrop = true
  49.     end
  50. end
  51.  
  52. function PLUGIN:LoadAirdropLoot()
  53.     AirdropLoot = datafile.GetDataTable("airdrop_settings") or {}
  54.    
  55.     if (not AirdropLoot.Settings) then
  56.         self:CreateDefaultLoot()
  57.         self:SaveAirdropLoot()
  58.     end
  59. end
  60.  
  61. function PLUGIN:SaveAirdropLoot()
  62.     datafile.SaveDataTable("airdrop_settings")
  63. end
  64.  
  65. function PLUGIN:CmdAirdropRun(Args)
  66.     if (self.Config.AirdropSettings.ManualRunDrop) then
  67.         self:SpawnPlane()
  68.     end
  69. end
  70.  
  71. function PLUGIN:CmdLootResetConsole(Args)
  72.     local Player
  73.    
  74.     if (not Args.connection) then
  75.         Player = nil
  76.     else
  77.         Player = Args.connection.player
  78.     end
  79.    
  80.     self:CmdLootReset(Player, Args.cmd, Args.Args)
  81. end
  82.  
  83. function PLUGIN:CmdLootReset(Player, Cmd, Args)
  84.     if (Player and Player.net.connection.authLevel < 2) then
  85.         self:MessageToPlayer(Player, self.Config.Messages.DontHaveAccess)
  86.         return
  87.     end
  88.  
  89.     self:CreateDefaultLoot()
  90.     self:SaveAirdropLoot()
  91.     AirdropLoot = datafile.GetDataTable("airdrop_settings") or {}
  92.    
  93.     if (Player) then
  94.         self:MessageToPlayer(Player, self.Config.Messages.LootReset)
  95.     else
  96.         self:MessageToServer(self.Config.Messages.LootReset)
  97.     end
  98. end
  99.  
  100. function PLUGIN:CmdMinimumPlayersConsole(Args)
  101.     local Player
  102.    
  103.     if (not Args.connection) then
  104.         Player = nil
  105.     else
  106.         Player = Args.connection.player
  107.     end
  108.    
  109.     self:CmdMinimumPlayers(Player, Args.cmd, Args.Args)
  110. end
  111.  
  112. function PLUGIN:CmdMinimumPlayers(Player, Cmd, Args)
  113.     if (Player and Player.net.connection.authLevel == 0) then
  114.         self:MessageToPlayer(Player, self.Config.Messages.DontHaveAccess)
  115.         return
  116.     end
  117.  
  118.     if (not Args or Args.Length == 0) then
  119.         if (Player) then
  120.             self:MessageToPlayer(Player, self.Config.Messages.MinNumberExplain)
  121.         else
  122.             self:MessageToServer(self.Config.Messages.MinNumberExplain)
  123.         end
  124.         return
  125.     end
  126.    
  127.     local MinPlayers = tonumber(Args[0])
  128.    
  129.     if (not MinPlayers) then
  130.         return
  131.     end
  132.  
  133.     self.Config.AirdropSettings.MinimumPlayers = MinPlayers
  134.     self:SaveConfig()
  135.    
  136.     if (Player) then
  137.         self:MessageToPlayer(Player, self:FormatString(self.Config.Messages.MinNumberChanged, "{number}", MinPlayers))
  138.     else
  139.         self:MessageToServer(self:FormatString(self.Config.Messages.MinNumberChanged, "{number}", MinPlayers))
  140.     end
  141. end
  142.  
  143. function PLUGIN:CmdSupplyStayTimeConsole(Args)
  144.     local Player
  145.    
  146.     if (not Args.connection) then
  147.         Player = nil
  148.     else
  149.         Player = Args.connection.player
  150.     end
  151.    
  152.     self:CmdSupplyStayTime(Player, Args.cmd, Args.Args)
  153. end
  154.  
  155. function PLUGIN:CmdSupplyStayTime(Player, Cmd, Args)
  156.     if (Player and Player.net.connection.authLevel == 0) then
  157.         self:MessageToPlayer(Player, self.Config.Messages.DontHaveAccess)
  158.         return
  159.     end
  160.  
  161.     if (not Args or Args.Length == 0) then
  162.         if (Player) then
  163.             self:MessageToPlayer(Player, self.Config.Messages.SupplyRemoveExplain)
  164.         else
  165.             self:MessageToServer(self.Config.Messages.SupplyRemoveExplain)
  166.         end
  167.         return
  168.     end
  169.    
  170.     local Time = tonumber(Args[0])
  171.    
  172.     if (not Time) then
  173.         return
  174.     end
  175.  
  176.     self.Config.AirdropSettings.SupplyStayTime = Time
  177.     self:SaveConfig()
  178.    
  179.     if (Player) then
  180.         self:MessageToPlayer(Player, self:FormatString(self.Config.Messages.SupplyRemoveChanged, "{number}", Time))
  181.     else
  182.         self:MessageToServer(self:FormatString(self.Config.Messages.SupplyRemoveChanged, "{number}", Time))
  183.     end
  184. end
  185.  
  186. function PLUGIN:CmdDropFrequencyConsole(Args)
  187.     local Player
  188.    
  189.     if (not Args.connection) then
  190.         Player = nil
  191.     else
  192.         Player = Args.connection.player
  193.     end
  194.    
  195.     self:CmdDropFrequency(Player, Args.cmd, Args.Args)
  196. end
  197.  
  198. function PLUGIN:CmdDropFrequency(Player, Cmd, Args)
  199.     if (Player and Player.net.connection.authLevel == 0) then
  200.         self:MessageToPlayer(Player, self.Config.Messages.DontHaveAccess)
  201.        return
  202.     end
  203.    
  204.     if (not Args or Args.Length == 0) then
  205.         if (Player) then
  206.             self:MessageToPlayer(Player, self.Config.Messages.DropFrequencyExplain)
  207.         else
  208.             self:MessageToServer(self.Config.Messages.DropFrequencyExplain)
  209.         end
  210.         return
  211.     end
  212.    
  213.     local Frequency = tonumber(Args[0])
  214.  
  215.     if (not Frequency) then
  216.         return
  217.     end
  218.    
  219.     self.Config.AirdropSettings.DropFrequency = Frequency
  220.     self:SaveConfig()
  221.    
  222.     if (Player) then
  223.         self:MessageToPlayer(Player, self:FormatString(self.Config.Messages.DropFrequencyChanged, "{number}", Frequency))
  224.     else
  225.         self:MessageToServer(self:FormatString(self.Config.Messages.DropFrequencyChanged, "{number}", Frequency))
  226.     end
  227. end
  228.  
  229. function PLUGIN:MessageToPlayer(Player, Message)
  230.     rust.SendChatMessage(Player, self.Config.PluginSettings.Title, tostring(Message))
  231. end
  232.  
  233. function PLUGIN:MessageToAll(Message)
  234.     rust.BroadcastChat(self.Config.PluginSettings.Title, tostring(Message))
  235. end
  236.  
  237. function PLUGIN:MessageToServer(Message)
  238.     print("[" .. self.Config.PluginSettings.Title .. "] " .. tostring(Message))
  239. end
  240.  
  241. function PLUGIN:SpawnPlane()
  242.     CanDrop = true
  243.    
  244.     local Entity = global.GameManager.server:CreateEntity("events/cargo_plane", new(UnityEngine.Vector3._type, nil), new(UnityEngine.Quaternion._type, nil))
  245.    
  246.     if (Entity) then
  247.         self:MessageToServer(self.Config.Messages.PlaneSpawned)
  248.         Entity:Spawn(true)
  249.     end
  250. end
  251.  
  252. function PLUGIN:OnPlayerLoot(Inventory, Entity)
  253.     if (not Entity) then
  254.         return
  255.     end
  256.    
  257.     if (not string.find(tostring(Entity.name), "supply_drop")) then
  258.         return
  259.     end
  260.    
  261.     local Container = Entity:GetComponent("StorageContainer").inventory
  262.    
  263.     if (not Container) then
  264.         return
  265.     end
  266.  
  267.     local Player = Inventory:GetComponent("BasePlayer")
  268.    
  269.     if (not Player) then
  270.         return
  271.     end
  272.    
  273.     local UserID = rust.UserIDFromPlayer(Player)
  274.     Looting[UserID] = Entity
  275.    
  276.     if (self.Config.AirdropSettings.CustomSupplyLoot) then
  277.    
  278.         if (Looting.Container) then
  279.             for i, Loot in pairs(Looting.Container) do
  280.                 if (Loot[1] == Entity) then
  281.                     Entity:GetComponent("StorageContainer").inventory = Looting.Container[i][2]
  282.                     return
  283.                 end
  284.             end
  285.         end
  286.        
  287.         self:BuildLoot(Entity, Container)
  288.     end
  289. end
  290.  
  291. function PLUGIN:BuildLoot(Entity, Container)
  292.     Container.itemList:Clear()
  293.     Container.capacity = AirdropLoot.Settings.Capacity
  294.    
  295.     self:AddRandomItem(AirdropLoot.Blueprint, AirdropLoot.Count.Blueprint, Container, true)
  296.     self:AddRandomItem(AirdropLoot.Weapon, AirdropLoot.Count.Weapon, Container, false)
  297.     self:AddRandomItem(AirdropLoot.Item, AirdropLoot.Count.Item, Container, false)
  298.     self:AddRandomItem(AirdropLoot.Outerwear, AirdropLoot.Count.Outerwear, Container, false)
  299.     self:AddRandomItem(AirdropLoot.Underwear, AirdropLoot.Count.Underwear, Container, false)
  300.     self:AddRandomItem(AirdropLoot.Gloves, AirdropLoot.Count.Gloves, Container, false)
  301.     self:AddRandomItem(AirdropLoot.Boots, AirdropLoot.Count.Boots, Container, false)
  302.     self:AddRandomItem(AirdropLoot.Helmet, AirdropLoot.Count.Helmet, Container, false)
  303.     self:AddRandomItem(AirdropLoot.Tool, AirdropLoot.Count.Tool, Container, false)
  304.     self:AddRandomItem(AirdropLoot.Medical, AirdropLoot.Count.Medical, Container, false)
  305.     self:AddRandomItem(AirdropLoot.Food, AirdropLoot.Count.Food, Container, false)
  306.     self:AddRandomItem(AirdropLoot.Ammo, AirdropLoot.Count.Ammo, Container, false)
  307.     self:AddRandomItem(AirdropLoot.Resource, AirdropLoot.Count.Resource, Container, false)
  308.    
  309.     local Info = { Entity, Container }
  310.     table.insert(Looting.Container, Info)  
  311. end
  312.  
  313. function PLUGIN:AddRandomItem(Loot, MaxCount, Container, IsBlueprint)
  314.     local Name, MinAmount, MaxAmount, Chance, Amount, Random, Item, IsStacked, IsFinded, i
  315.     local Count = 0
  316.    
  317.     if (not Loot) then
  318.         return
  319.     end
  320.    
  321.     if (MaxCount == 0) then
  322.         return
  323.     end
  324.    
  325.     repeat
  326.         if (Container.capacity == Container.itemList.Count) then
  327.             return
  328.         end
  329.            
  330.         i = math.random(1, #Loot)  
  331.        
  332.         Name = Loot[i]["name"]
  333.         MinAmount = Loot[i]["min_amount"]
  334.         MaxAmount = Loot[i]["max_amount"]
  335.         Chance = Loot[i]["chance"]
  336.        
  337.         if (Chance > 0) then               
  338.             if (MinAmount and MaxAmount) then
  339.                 Amount = math.random(MinAmount, MaxAmount)
  340.                 IsStacked = true
  341.             else
  342.                 Amount = 1
  343.                 IsStacked = false
  344.             end
  345.            
  346.             if (Amount == 0) then
  347.                 Amount = 1
  348.             end
  349.            
  350.             Random = math.random(1, 100)
  351.            
  352.             if (Random <= Chance) then
  353.                 Item = global.ItemManager.CreateByName(Name, Amount)
  354.                
  355.                 if Item then
  356.                     if (IsBlueprint) then
  357.                         Item.isBlueprint = true
  358.                     end
  359.                    
  360.                     if (IsStacked) then
  361.                         IsFinded = Container:FindItemByItemID(Item.info.itemid)
  362.                     end
  363.                    
  364.                     if (not IsFinded) then
  365.                         Count = Count + 1  
  366.                         Item:MoveToContainer(Container, -1, IsStacked)
  367.                     end
  368.                 end
  369.             else
  370.                 if (not AirdropLoot.Settings.FillCount) then
  371.                     Count = Count + 1
  372.                 end
  373.             end
  374.         end
  375.     until (Count == MaxCount)
  376. end
  377.  
  378. function PLUGIN:OnEntitySpawn(Entity)
  379.     if (not Entity) then
  380.         return
  381.     end
  382.    
  383.     if (Entity:GetComponentInParent(global.SupplyDrop._type)) then
  384.         timer.Once(1, function() self:CheckSupplyLanded(Entity) end)
  385.     end
  386.    
  387.     if (not Entity:GetComponentInParent(global.CargoPlane._type)) then
  388.         return
  389.     end
  390.    
  391.     if (global.BasePlayer.activePlayerList.Count < self.Config.AirdropSettings.MinimumPlayers) then
  392.         self:MessageToServer(self:FormatString(self.Config.Messages.PlaneRemovedMin, "{number}", self.Config.AirdropSettings.MinimumPlayers ))
  393.         self:RemoveEntity(Entity)
  394.         return
  395.     end
  396.    
  397.     if (not CanDrop) then
  398.         self:MessageToServer(self.Config.Messages.PlaneRemovedTrigger)
  399.         self:RemoveEntity(Entity)
  400.         return 
  401.     end
  402.    
  403.     if (self.Config.AirdropSettings.NotifyAirdropStart) then
  404.         self:MessageToAll(self.Config.Messages.PlaneLaunched)
  405.     end
  406.    
  407.     CanDrop = false
  408. end
  409.  
  410. function PLUGIN:CheckSupplyLanded(SupplyDrop)
  411.     if (SupplyDrop) then
  412.         local ParachuteField = global.SupplyDrop._type:GetField("parachute", rust.PrivateBindingFlag())
  413.        
  414.         if (ParachuteField) then
  415.             local Parachute = ParachuteField:GetValue(SupplyDrop)
  416.            
  417.             if (Parachute) then
  418.                 timer.Once(1, function() self:CheckSupplyLanded(SupplyDrop) end)
  419.             else
  420.                 if (self.Config.AirdropSettings.SupplyStayTime > 0) then
  421.                     timer.Once(self.Config.AirdropSettings.SupplyStayTime * 60, function() self:RemoveEntity(SupplyDrop) end)
  422.                 end
  423.                
  424.                 if (self.Config.AirdropSettings.NotifySupplyLanded) then
  425.                     local Message
  426.                     local x = string.format("%.2f", SupplyDrop.transform.position.x)
  427.                     local y = string.format("%.2f", SupplyDrop.transform.position.y)
  428.                     local z = string.format("%.2f", SupplyDrop.transform.position.z)
  429.                    
  430.                     Message = self:FormatString(self.Config.Messages.SupplyLanded, "{x}", x)
  431.                     Message = self:FormatString(Message, "{y}", y)
  432.                     Message = self:FormatString(Message, "{z}", z)
  433.  
  434.                     self:MessageToAll(Message)
  435.                 end
  436.  
  437.                 if (self.Config.AirdropSettings.ArrowEnabled) then
  438.                     local StartPos = new(UnityEngine.Vector3._type, nil)
  439.                     StartPos.x = SupplyDrop.transform.position.x
  440.                     StartPos.y = SupplyDrop.transform.position.y + 5 + self.Config.AirdropSettings.ArrowLength
  441.                     StartPos.z = SupplyDrop.transform.position.z
  442.                    
  443.                     local EndPos = new(UnityEngine.Vector3._type, nil)
  444.                     EndPos.x = SupplyDrop.transform.position.x
  445.                     EndPos.y = SupplyDrop.transform.position.y + 5
  446.                     EndPos.z = SupplyDrop.transform.position.z
  447.    
  448.                     local ArrowParams = util.TableToArray({ self.Config.AirdropSettings.ArrowTime, System.ConsoleColor.White, StartPos, EndPos, self.Config.AirdropSettings.ArrowSize })
  449.                     global.ConsoleSystem.Broadcast("ddraw.arrow", ArrowParams)
  450.                 end            
  451.             end
  452.         end
  453.     end
  454. end
  455.  
  456. function PLUGIN:RemoveEntity(Entity)
  457.     if (Entity) then
  458.         if (Looting.Container) then
  459.             for i, Loot in pairs(Looting.Container) do
  460.                 if (Loot[1] == Entity) then
  461.                     Looting.Container[i] = {}
  462.                 end
  463.             end
  464.         end
  465.    
  466.         Entity:KillMessage()
  467.     end
  468. end
  469.  
  470. function PLUGIN:LoadDefaultConfig()
  471.     self.Config.PluginSettings =
  472.     {
  473.         Title = "Airdrop Settings",
  474.         Version = "1.0.0"
  475.     }
  476.  
  477.     self.Config.AirdropSettings =
  478.     {
  479.         MinimumPlayers = 3,
  480.         DropFrequency = 60,
  481.         SupplyStayTime = 60,
  482.         ManualRunDrop = true,
  483.         CustomSupplyLoot = true,
  484.         NotifyAirdropStart = true,
  485.         NotifySupplyLanded = true,
  486.         ArrowEnabled = true,
  487.         ArrowLength = 15,
  488.         ArrowSize = 4,
  489.         ArrowTime = 60
  490.     }
  491.    
  492.     self.Config.Messages =
  493.     {
  494.         DontHaveAccess = "You don't have access!",
  495.         LootReset = "Custom loot successfully reset to the default settings.",
  496.         MinNumberExplain = "Specify the minimum number of players. Example: /airdrop_min 3",
  497.         MinNumberChanged = "Minimum number of players successfully changed to {number}.",
  498.         SupplyRemoveExplain = "Time in minutes after which the supply is removed. Example: /airdrop_stay 30",
  499.         SupplyRemoveChanged = "Time after which the supply is removed changed to {number}.",
  500.         DropFrequencyExplain = "Specify the frequency drop supplies in minutes. Example: /airdrop_freq 60",
  501.         DropFrequencyChanged = "Frequency drop supplies successfully changed to {number}.",
  502.         PlaneSpawned = "Cargo Plane has spawned.",
  503.         PlaneRemovedMin = "Cargo Plane has removed. Minimum number of players: {number}.",
  504.         PlaneRemovedTrigger = "Cargo Plane has removed. The event was triggered not by timer.",
  505.         PlaneLaunched = "Cargo Plane has launched!",
  506.         SupplyLanded = "Supply has landed at coordinates X: {x} Y: {y} Z: {z}"
  507.     }
  508. end
  509.  
  510. function PLUGIN:CheckConfig()
  511.     if self.Config.PluginSettings.Version ~= "1.0.0" then
  512.         self:UpdateConfig()
  513.     end
  514. end
  515.  
  516. function PLUGIN:UpdateConfig()
  517.     self:LoadDefaultConfig()
  518.     self:SaveConfig()
  519. end
  520.  
  521. function PLUGIN:Unload()
  522.     if (Timer) then
  523.         Timer:Destroy()
  524.     end
  525. end
  526.  
  527. function PLUGIN:CreateDefaultLoot()
  528.     AirdropLoot.Settings =
  529.     {
  530.         Capacity = 24,
  531.         FillCount = true
  532.     }
  533.    
  534.     AirdropLoot.Count =
  535.     {
  536.         Blueprint = 2,
  537.         Weapon = 2,
  538.         Item = 1,
  539.         Outerwear = 1,
  540.         Underwear = 1,
  541.         Gloves = 1,
  542.         Boots = 1,
  543.         Helmet = 1,
  544.         Tool = 2,
  545.         Medical = 3,
  546.         Food = 3,
  547.         Ammo = 2,
  548.         Resource = 4
  549.     }
  550.    
  551.     AirdropLoot.Blueprint =
  552.     {
  553.         {
  554.             ["name"] = "bow_hunting",
  555.             ["chance"] = 80
  556.         },
  557.         {
  558.             ["name"] = "knife_bone",
  559.             ["chance"] = 0
  560.         },
  561.         {
  562.             ["name"] = "pistol_eoka",
  563.             ["chance"] = 70
  564.         },
  565.         {
  566.             ["name"] = "pistol_revolver",
  567.             ["chance"] = 60
  568.         },
  569.         {
  570.             ["name"] = "rifle_ak",
  571.             ["chance"] = 20
  572.         },
  573.         {
  574.             ["name"] = "rifle_bolt",
  575.             ["chance"] = 30
  576.         },
  577.         {
  578.             ["name"] = "shotgun_waterpipe",
  579.             ["chance"] = 40
  580.         },
  581.         {
  582.             ["name"] = "smg_thompson",
  583.             ["chance"] = 40
  584.         },
  585.         {
  586.             ["name"] = "spear_stone",
  587.             ["chance"] = 80
  588.         },
  589.         {
  590.             ["name"] = "spear_wooden",
  591.             ["chance"] = 0
  592.         },
  593.         {
  594.             ["name"] = "building_planner",
  595.             ["chance"] = 0
  596.         },
  597.         {
  598.             ["name"] = "cupboard.tool",
  599.             ["chance"] = 0
  600.         },
  601.         {
  602.             ["name"] = "lock.code",
  603.             ["chance"] = 50
  604.         },
  605.         {
  606.             ["name"] = "lock.key",
  607.             ["chance"] = 0
  608.         },
  609.         {
  610.             ["name"] = "box_wooden",
  611.             ["chance"] = 0
  612.         },
  613.         {
  614.             ["name"] = "box_wooden_large",
  615.             ["chance"] = 70
  616.         },
  617.         {
  618.             ["name"] = "campfire",
  619.             ["chance"] = 0
  620.         },
  621.         {
  622.             ["name"] = "furnace",
  623.             ["chance"] = 0
  624.         },
  625.         {
  626.             ["name"] = "lantern",
  627.             ["chance"] = 80
  628.         },
  629.         {
  630.             ["name"] = "sleepingbag",
  631.             ["chance"] = 0
  632.         },
  633.         {
  634.             ["name"] = "gunpowder",
  635.             ["chance"] = 50
  636.         },
  637.         {
  638.             ["name"] = "lowgradefuel",
  639.             ["chance"] = 0
  640.         },
  641.         {
  642.             ["name"] = "paper",
  643.             ["chance"] = 0
  644.         },
  645.         {
  646.             ["name"] = "bucket_helmet",
  647.             ["chance"] = 40
  648.         },
  649.         {
  650.             ["name"] = "burlap_gloves",
  651.             ["chance"] = 50
  652.         },
  653.         {
  654.             ["name"] = "burlap_shirt",
  655.             ["chance"] = 0
  656.         },
  657.         {
  658.             ["name"] = "burlap_shoes",
  659.             ["chance"] = 0
  660.         },
  661.         {
  662.             ["name"] = "burlap_trousers",
  663.             ["chance"] = 0
  664.         },
  665.         {
  666.             ["name"] = "coffeecan_helmet",
  667.             ["chance"] = 40
  668.         },
  669.         {
  670.             ["name"] = "hazmat_boots",
  671.             ["chance"] = 50
  672.         },
  673.         {
  674.             ["name"] = "hazmat_gloves",
  675.             ["chance"] = 50
  676.         },
  677.         {
  678.             ["name"] = "hazmat_helmet",
  679.             ["chance"] = 40
  680.         },
  681.         {
  682.             ["name"] = "hazmat_jacket",
  683.             ["chance"] = 40
  684.         },
  685.         {
  686.             ["name"] = "hazmat_pants",
  687.             ["chance"] = 40
  688.         },
  689.         {
  690.             ["name"] = "jacket_snow",
  691.             ["chance"] = 30
  692.         },
  693.         {
  694.             ["name"] = "jacket_snow2",
  695.             ["chance"] = 30
  696.         },
  697.         {
  698.             ["name"] = "jacket_snow3",
  699.             ["chance"] = 30
  700.         },
  701.         {
  702.             ["name"] = "metal_facemask",
  703.             ["chance"] = 30
  704.         },
  705.         {
  706.             ["name"] = "metal_plate_torso",
  707.             ["chance"] = 20
  708.         },
  709.         {
  710.             ["name"] = "urban_boots",
  711.             ["chance"] = 0
  712.         },
  713.         {
  714.             ["name"] = "urban_jacket",
  715.             ["chance"] = 50
  716.         },
  717.         {
  718.             ["name"] = "urban_pants",
  719.             ["chance"] = 0
  720.         },
  721.         {
  722.             ["name"] = "urban_shirt",
  723.             ["chance"] = 50
  724.         },
  725.         {
  726.             ["name"] = "vagabond_jacket",
  727.             ["chance"] = 30
  728.         },
  729.         {
  730.             ["name"] = "axe_salvaged",
  731.             ["chance"] = 30
  732.         },
  733.         {
  734.             ["name"] = "hammer",
  735.             ["chance"] = 0
  736.         },
  737.         {
  738.             ["name"] = "hammer_salvaged",
  739.             ["chance"] = 30
  740.         },
  741.         {
  742.             ["name"] = "hatchet",
  743.             ["chance"] = 60
  744.         },
  745.         {
  746.             ["name"] = "icepick_salvaged",
  747.             ["chance"] = 30
  748.         },
  749.         {
  750.             ["name"] = "pickaxe",
  751.             ["chance"] = 50
  752.         },
  753.         {
  754.             ["name"] = "stonehatchet",
  755.             ["chance"] = 0
  756.         },
  757.         {
  758.             ["name"] = "torch",
  759.             ["chance"] = 0
  760.         },
  761.         {
  762.             ["name"] = "bandage",
  763.             ["chance"] = 0
  764.         },
  765.         {
  766.             ["name"] = "largemedkit",
  767.             ["chance"] = 30
  768.         },
  769.         {
  770.             ["name"] = "syringe_medical",
  771.             ["chance"] = 40
  772.         },
  773.         {
  774.             ["name"] = "ammo_pistol",
  775.             ["chance"] = 40
  776.         },
  777.         {
  778.             ["name"] = "ammo_rifle",
  779.             ["chance"] = 20
  780.         },
  781.         {
  782.             ["name"] = "ammo_shotgun",
  783.             ["chance"] = 30
  784.         },
  785.         {
  786.             ["name"] = "arrow_wooden",
  787.             ["chance"] = 80
  788.         },
  789.         {
  790.             ["name"] = "trap_bear",
  791.             ["chance"] = 70
  792.         },
  793.         {
  794.             ["name"] = "door_key",
  795.             ["chance"] = 70
  796.         },
  797.         {
  798.             ["name"] = "longsleeve_tshirt_blue",
  799.             ["chance"] = 40
  800.         },
  801.         {
  802.             ["name"] = "explosives",
  803.             ["chance"] = 30
  804.         },
  805.         {
  806.             ["name"] = "explosive.timed",
  807.             ["chance"] = 10
  808.         },
  809.         {
  810.             ["name"] = "shotgun_pump",
  811.             ["chance"] = 40
  812.         }
  813.     }
  814.    
  815.     AirdropLoot.Weapon =
  816.     {
  817.         {
  818.             ["name"] = "bow_hunting",
  819.             ["chance"] = 90
  820.         },
  821.         {
  822.             ["name"] = "knife_bone",
  823.             ["chance"] = 80
  824.         },
  825.         {
  826.             ["name"] = "pistol_eoka",
  827.             ["chance"] = 70
  828.         },
  829.         {
  830.             ["name"] = "pistol_revolver",
  831.             ["chance"] = 60
  832.         },
  833.         {
  834.             ["name"] = "rifle_ak",
  835.             ["chance"] = 30
  836.         },
  837.         {
  838.             ["name"] = "rifle_bolt",
  839.             ["chance"] = 50
  840.         },
  841.         {
  842.             ["name"] = "shotgun_waterpipe",
  843.             ["chance"] = 60
  844.         },
  845.         {
  846.             ["name"] = "smg_thompson",
  847.             ["chance"] = 50
  848.         },
  849.         {
  850.             ["name"] = "spear_stone",
  851.             ["chance"] = 80
  852.         },
  853.         {
  854.             ["name"] = "spear_wooden",
  855.             ["chance"] = 80
  856.         },
  857.         {
  858.             ["name"] = "trap_bear",
  859.             ["chance"] = 90
  860.         },
  861.         {
  862.             ["name"] = "explosive.timed",
  863.             ["chance"] = 30
  864.         },
  865.         {
  866.             ["name"] = "shotgun_pump",
  867.             ["chance"] = 50
  868.         }
  869.     }
  870.    
  871.     AirdropLoot.Item =
  872.     {
  873.         {
  874.             ["name"] = "bed",
  875.             ["chance"] = 0
  876.         },
  877.         {
  878.             ["name"] = "box_wooden",
  879.             ["chance"] = 90
  880.         },
  881.         {
  882.             ["name"] = "box_wooden_large",
  883.             ["chance"] = 80
  884.         },
  885.         {
  886.             ["name"] = "campfire",
  887.             ["chance"] = 0
  888.         },
  889.         {
  890.             ["name"] = "furnace",
  891.             ["chance"] = 50
  892.         },
  893.         {
  894.             ["name"] = "lantern",
  895.             ["chance"] = 60
  896.         },
  897.         {
  898.             ["name"] = "sleepingbag",
  899.             ["chance"] = 0
  900.         },
  901.         {
  902.             ["name"] = "flare",
  903.             ["chance"] = 0
  904.         }
  905.     }
  906.    
  907.     AirdropLoot.Outerwear =
  908.     {
  909.         {
  910.             ["name"] = "burlap_shirt",
  911.             ["chance"] = 80
  912.         },
  913.         {
  914.             ["name"] = "hazmat_jacket",
  915.             ["chance"] = 70
  916.         },
  917.         {
  918.             ["name"] = "jacket_snow",
  919.             ["chance"] = 60
  920.         },
  921.         {
  922.             ["name"] = "jacket_snow2",
  923.             ["chance"] = 60
  924.         },
  925.         {
  926.             ["name"] = "jacket_snow3",
  927.             ["chance"] = 60
  928.         },
  929.         {
  930.             ["name"] = "urban_jacket",
  931.             ["chance"] = 80
  932.         },
  933.         {
  934.             ["name"] = "urban_shirt",
  935.             ["chance"] = 80
  936.         },
  937.         {
  938.             ["name"] = "vagabond_jacket",
  939.             ["chance"] = 40
  940.         },
  941.         {
  942.             ["name"] = "metal_plate_torso",
  943.             ["chance"] = 40
  944.         },
  945.         {
  946.             ["name"] = "longsleeve_tshirt_blue",
  947.             ["chance"] = 30
  948.         }
  949.     }
  950.    
  951.     AirdropLoot.Underwear =
  952.     {
  953.         {
  954.             ["name"] = "burlap_trousers",
  955.             ["chance"] = 80
  956.         },
  957.         {
  958.             ["name"] = "hazmat_pants",
  959.             ["chance"] = 60
  960.         },
  961.         {
  962.             ["name"] = "urban_pants",
  963.             ["chance"] = 80
  964.         }
  965.     }
  966.    
  967.     AirdropLoot.Gloves =
  968.     {
  969.         {
  970.             ["name"] = "burlap_gloves",
  971.             ["chance"] = 70
  972.         },
  973.         {
  974.             ["name"] = "hazmat_gloves",
  975.             ["chance"] = 60
  976.         }
  977.     }
  978.    
  979.     AirdropLoot.Boots =
  980.     {
  981.         {
  982.             ["name"] = "burlap_shoes",
  983.             ["chance"] = 80
  984.         },
  985.         {
  986.             ["name"] = "hazmat_boots",
  987.             ["chance"] = 60
  988.         },
  989.         {
  990.             ["name"] = "urban_boots",
  991.             ["chance"] = 80
  992.         }
  993.     }
  994.    
  995.     AirdropLoot.Helmet =
  996.     {
  997.         {
  998.             ["name"] = "bucket_helmet",
  999.             ["chance"] = 70
  1000.         },
  1001.         {
  1002.             ["name"] = "coffeecan_helmet",
  1003.             ["chance"] = 60
  1004.         },
  1005.         {
  1006.             ["name"] = "hazmat_helmet",
  1007.             ["chance"] = 60
  1008.         },
  1009.         {
  1010.             ["name"] = "metal_facemask",
  1011.             ["chance"] = 50
  1012.         }
  1013.     }
  1014.    
  1015.     AirdropLoot.Tool =
  1016.     {
  1017.         {
  1018.             ["name"] = "axe_salvaged",
  1019.             ["chance"] = 40
  1020.         },
  1021.         {
  1022.             ["name"] = "hammer",
  1023.             ["chance"] = 80
  1024.         },
  1025.         {
  1026.             ["name"] = "hammer_salvaged",
  1027.             ["chance"] = 40
  1028.         },
  1029.         {
  1030.             ["name"] = "hatchet",
  1031.             ["chance"] = 80
  1032.         },
  1033.         {
  1034.             ["name"] = "icepick_salvaged",
  1035.             ["chance"] = 40
  1036.         },
  1037.         {
  1038.             ["name"] = "pickaxe",
  1039.             ["chance"] = 50
  1040.         },
  1041.         {
  1042.             ["name"] = "rock",
  1043.             ["chance"] = 0
  1044.         },
  1045.         {
  1046.             ["name"] = "stonehatchet",
  1047.             ["chance"] = 90
  1048.         },
  1049.         {
  1050.             ["name"] = "torch",
  1051.             ["chance"] = 0
  1052.         }
  1053.     }
  1054.    
  1055.     AirdropLoot.Medical =
  1056.     {
  1057.         {
  1058.             ["name"] = "antiradpills",
  1059.             ["chance"] = 70
  1060.         },
  1061.         {
  1062.             ["name"] = "bandage",
  1063.             ["chance"] = 90
  1064.         },
  1065.         {
  1066.             ["name"] = "blood",
  1067.             ["chance"] = 60
  1068.         },
  1069.         {
  1070.             ["name"] = "largemedkit",
  1071.             ["chance"] = 40
  1072.         },
  1073.         {
  1074.             ["name"] = "syringe_medical",
  1075.             ["chance"] = 60
  1076.         }
  1077.     }
  1078.    
  1079.     AirdropLoot.Food =
  1080.     {
  1081.         {
  1082.             ["name"] = "apple",
  1083.             ["chance"] = 90
  1084.         },
  1085.         {
  1086.             ["name"] = "apple_spoiled",
  1087.             ["chance"] = 0
  1088.         },
  1089.         {
  1090.             ["name"] = "bearmeat",
  1091.             ["chance"] = 0
  1092.         },
  1093.         {
  1094.             ["name"] = "black",
  1095.             ["chance"] = 0
  1096.         },
  1097.         {
  1098.             ["name"] = "blueberries",
  1099.             ["chance"] = 80
  1100.         },
  1101.         {
  1102.             ["name"] = "can_beans",
  1103.             ["chance"] = 70
  1104.         },
  1105.         {
  1106.             ["name"] = "can_tuna",
  1107.             ["chance"] = 70
  1108.         },
  1109.         {
  1110.             ["name"] = "chicken_burned",
  1111.             ["chance"] = 0
  1112.         },
  1113.         {
  1114.             ["name"] = "chicken_cooked",
  1115.             ["chance"] = 0
  1116.         },
  1117.         {
  1118.             ["name"] = "chicken_raw",
  1119.             ["chance"] = 0
  1120.         },
  1121.         {
  1122.             ["name"] = "chicken_spoiled",
  1123.             ["chance"] = 0
  1124.         },
  1125.         {
  1126.             ["name"] = "chocholate",
  1127.             ["chance"] = 70
  1128.         },
  1129.         {
  1130.             ["name"] = "granolabar",
  1131.             ["chance"] = 60
  1132.         },
  1133.         {
  1134.             ["name"] = "humanmeat_burned",
  1135.             ["chance"] = 0
  1136.         },
  1137.         {
  1138.             ["name"] = "humanmeat_cooked",
  1139.             ["chance"] = 0
  1140.         },
  1141.         {
  1142.             ["name"] = "humanmeat_raw",
  1143.             ["chance"] = 0
  1144.         },
  1145.         {
  1146.             ["name"] = "humanmeat_spoiled",
  1147.             ["chance"] = 0
  1148.         },
  1149.         {
  1150.             ["name"] = "smallwaterbottle",
  1151.             ["chance"] = 50
  1152.         },
  1153.         {
  1154.             ["name"] = "wolfmeat_burned",
  1155.             ["chance"] = 0
  1156.         },
  1157.         {
  1158.             ["name"] = "wolfmeat_cooked",
  1159.             ["chance"] = 0
  1160.         },
  1161.         {
  1162.             ["name"] = "wolfmeat_raw",
  1163.             ["chance"] = 0
  1164.         },
  1165.         {
  1166.             ["name"] = "wolfmeat_spoiled",
  1167.             ["chance"] = 0
  1168.         },
  1169.         {
  1170.             ["name"] = "black raspberries",
  1171.             ["chance"] = 50
  1172.         }
  1173.     }
  1174.    
  1175.     AirdropLoot.Ammo =
  1176.     {
  1177.         {
  1178.             ["name"] = "ammo_pistol",
  1179.             ["min_amount"] = 50,
  1180.             ["max_amount"] = 100,
  1181.             ["chance"] = 60
  1182.         },
  1183.         {
  1184.             ["name"] = "ammo_rifle",
  1185.             ["min_amount"] = 50,
  1186.             ["max_amount"] = 100,
  1187.             ["chance"] = 50
  1188.         },
  1189.         {
  1190.             ["name"] = "ammo_shotgun",
  1191.             ["min_amount"] = 50,
  1192.             ["max_amount"] = 100,
  1193.             ["chance"] = 70
  1194.         },
  1195.         {
  1196.             ["name"] = "arrow_wooden",
  1197.             ["min_amount"] = 50,
  1198.             ["max_amount"] = 100,
  1199.             ["chance"] = 90
  1200.         }
  1201.     }
  1202.    
  1203.     AirdropLoot.Resource =
  1204.     {
  1205.         {
  1206.             ["name"] = "battery_small",
  1207.             ["chance"] = 0
  1208.         },
  1209.         {
  1210.             ["name"] = "bone_fragments",
  1211.             ["min_amount"] = 100,
  1212.             ["max_amount"] = 200,
  1213.             ["chance"] = 80
  1214.         },
  1215.         {
  1216.             ["name"] = "charcoal",
  1217.             ["min_amount"] = 200,
  1218.             ["max_amount"] = 800,
  1219.             ["chance"] = 70
  1220.         },
  1221.         {
  1222.             ["name"] = "cloth",
  1223.             ["min_amount"] = 100,
  1224.             ["max_amount"] = 200,
  1225.             ["chance"] = 50
  1226.         },
  1227.         {
  1228.             ["name"] = "fat_animal",
  1229.             ["min_amount"] = 100,
  1230.             ["max_amount"] = 200,
  1231.             ["chance"] = 50
  1232.         },
  1233.         {
  1234.             ["name"] = "gunpowder",
  1235.             ["min_amount"] = 100,
  1236.             ["max_amount"] = 300,
  1237.             ["chance"] = 50
  1238.         },
  1239.         {
  1240.             ["name"] = "lowgradefuel",
  1241.             ["min_amount"] = 50,
  1242.             ["max_amount"] = 100,
  1243.             ["chance"] = 50
  1244.         },
  1245.         {
  1246.             ["name"] = "metal_fragments",
  1247.             ["min_amount"] = 500,
  1248.             ["max_amount"] = 1000,
  1249.             ["chance"] = 40
  1250.         },
  1251.         {
  1252.             ["name"] = "metal_ore",
  1253.             ["min_amount"] = 500,
  1254.             ["max_amount"] = 1000,
  1255.             ["chance"] = 60
  1256.         },
  1257.         {
  1258.             ["name"] = "metal_refined",
  1259.             ["min_amount"] = 500,
  1260.             ["max_amount"] = 1000,
  1261.             ["chance"] = 60
  1262.         },
  1263.         {
  1264.             ["name"] = "paper",
  1265.             ["chance"] = 80
  1266.         },
  1267.         {
  1268.             ["name"] = "skull_human",
  1269.             ["min_amount"] = 50,
  1270.             ["max_amount"] = 100,
  1271.             ["chance"] = 80
  1272.         },
  1273.         {
  1274.             ["name"] = "skull_wolf",
  1275.             ["min_amount"] = 50,
  1276.             ["max_amount"] = 100,
  1277.             ["chance"] = 80
  1278.         },
  1279.         {
  1280.             ["name"] = "stones",
  1281.             ["min_amount"] = 500,
  1282.             ["max_amount"] = 1000,
  1283.             ["chance"] = 90
  1284.         },
  1285.         {
  1286.             ["name"] = "sulfur",
  1287.             ["min_amount"] = 500,
  1288.             ["max_amount"] = 1000,
  1289.             ["chance"] = 70
  1290.         },
  1291.         {
  1292.             ["name"] = "sulfur_ore",
  1293.             ["min_amount"] = 500,
  1294.             ["max_amount"] = 1000,
  1295.             ["chance"] = 70
  1296.         },
  1297.         {
  1298.             ["name"] = "wood",
  1299.             ["min_amount"] = 1000,
  1300.             ["max_amount"] = 5000,
  1301.             ["chance"] = 90
  1302.         },
  1303.         {
  1304.             ["name"] = "explosives",
  1305.             ["min_amount"] = 10,
  1306.             ["max_amount"] = 100,
  1307.             ["chance"] = 30
  1308.         }
  1309.     }
  1310. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement