using Oxide.Core.Plugins; using UnityEngine; namespace Oxide.Plugins { [Info("ExcavatorGatherMultiplier", "LLC", "1.0.3")] [Description("Set the global resource collection rate for the excavator")] public class ExcavatorGatherMultiplier : RustPlugin { private class PluginConfig { public float Multiplier { get; set; } = 10f; public float PlayerMiningQuarryGlobalRate { get; set; } = 5f; } private PluginConfig config; protected override void LoadDefaultConfig() { Config.WriteObject(new PluginConfig(), true); } private void Init() { LoadConfigValues(); SaveConfig(); } private void LoadConfigValues() { config = Config.ReadObject(); if (config.Multiplier <= 0) { config.Multiplier = 10f; } if (config.PlayerMiningQuarryGlobalRate <= 0) { config.PlayerMiningQuarryGlobalRate = 5f; } } private void OnExcavatorGather(ExcavatorArm arm, Item item) { if (arm == null || item == null) return; item.amount = (int)(item.amount * config.Multiplier); item.MarkDirty(); } private void OnQuarryGather(MiningQuarry quarry, Item item) { if (quarry == null || item == null) return; item.amount = Mathf.CeilToInt(item.amount * config.PlayerMiningQuarryGlobalRate); item.MarkDirty(); } } }