GatherManager

Moved

Total Downloads: 59,075 - First Release: Oct 23, 2014 - Last Update: Aug 27, 2017

4.93893/5, 131 likes
  1. As said multiple time now... The function don't give item but it add it directly to the inventory, that why you don't have the gather popup notification.
    I'll probably change the code to display popup...
     
  2. that would be great to add the popup on screen so players know there getting the hqm here is my part of the files as i dont want it to give sky high hqm lol
    this gives a max of 60-72 with a mining level of 22 depends on what level you are you will get more just that popup we need


    Code:
     private void OnDispenserGather(ResourceDispenser dispenser, BaseEntity entity, Item item)
            {
                System.Random rand = new System.Random();
                if (!entity.ToPlayer()) return;            var player = entity.ToPlayer();
                var amount = item.amount;
                var gatherType = dispenser.gatherType.ToString("G");            if (GatherResourceModifiers.ContainsKey(item.info.displayName.english))
                    item.amount = (int)(item.amount * GatherResourceModifiers[item.info.displayName.english]);
                else if (GatherResourceModifiers.ContainsKey("*"))
                    item.amount = (int)(item.amount * GatherResourceModifiers["*"]);
                if(item.info.displayName.english.Contains("Metal"))
                {
                var rands = rand.Next(1, 4);
                int HQ = 4;
                if(HQ <= 0)
                {
                    var gatherRate = 1;
                    if (GatherResourceModifiers.ContainsKey("High Quality Metal Ore"))
                        gatherRate = (int)GatherResourceModifiers["High Quality Metal Ore"];
                    else if (GatherResourceModifiers.ContainsKey("*"))
                        gatherRate = (int)GatherResourceModifiers["*"];
                    HQ = 1 * gatherRate;
                }
                player.inventory.GiveItem(ItemManager.CreateByItemID(2133577942, HQ), player.inventory.containerMain);
                }
                    if (!GatherDispenserModifiers.ContainsKey(gatherType)) return;                var dispenserModifier = GatherDispenserModifiers[gatherType];                dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount += amount - item.amount / dispenserModifier;                if (dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount < 0)
                        item.amount += (int)dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount;
            }
     
  3. My first code was used to get a random value from 1 to 10% of gathered metal ore
     
  4. y
    that was giving me a total of 50 ish per hit on the node i ended up with like 500+ hqm so i had to tone it down so it would only give less that 100 per total node
     
  5. You can always use the code and divid the result
     
  6. won't increase the rate for high Qual
     
  7. Are there any plans for an update to support the changes to nodes?
     
  8. Bumping this
     
  9. As said multiple time the problem isn't from the plugin but from rust, they changed the loot and a new hook must be created for it.
     
  10. I guess the proper question would be, from your history while dealing with this sort of issue, about how long typically before new hooks are created?
     
    Last edited by a moderator: Jul 9, 2017
  11. So ive just come to realize that once the code was in and working, the gather on the quarry, pickup ore's, and items have stopped working. This just me?
     
  12. how do i do so all the recources is times 3
     
  13. Wulf

    Wulf Community Admin

    Whenever someone feels like contributing one. ;)
     
  14. I'm having an issue with helicopters. If I have the ore dispenser at more than 3 then someone can shoot down a helicopter and mine it forever.. but having nodes on 3 means its 3 hits total to remove the entire node so that sucks.. anyone else had this issue or know anything i can do to solve it?

    Currently I have these settings :
    "Options": {
    "GatherDispenserModifiers": {
    "Flesh": 4.0,
    "Ore": 9.0,
    "Tree": 10.0
    },

    which means helicopters are unlimited to mine :(
     
  15. Hello, after some test and research i'm able to give you the proper way to get gather bonus multiplied by your config.
    Here you go :

    Code:
            private void OnDispenserGather(ResourceDispenser dispenser, BaseEntity entity, Item item)
            {
                if (!entity.ToPlayer()) return;            var gatherType = dispenser.gatherType.ToString("G");
                var amount = item.amount;            if (GatherResourceModifiers.ContainsKey(item.info.displayName.english))
                {
                    foreach(var finishBonusList in dispenser.finishBonus)
                    {
                        finishBonusList.amount = 2 * GatherResourceModifiers[item.info.displayName.english];
                    }
                    item.amount = (int)(item.amount * GatherResourceModifiers[item.info.displayName.english]);
                }
                else if (GatherResourceModifiers.ContainsKey("*"))
                {
                    foreach(var finishBonusList in dispenser.finishBonus)
                    {
                        finishBonusList.amount = 2 * GatherResourceModifiers["*"];
                    }
                    item.amount = (int)(item.amount * GatherResourceModifiers["*"]);
                }            if (!GatherDispenserModifiers.ContainsKey(gatherType)) return;            var dispenserModifier = GatherDispenserModifiers[gatherType];            dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount += amount - item.amount / dispenserModifier;            if (dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount < 0)
                    item.amount += (int)dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount;
            }
    
    @Mughisi you are free to update/use code until you are ready to sort a new hook for it.

    To all other, if you want to increase the amount, you may change this line :
    Code:
    finishBonusList.amount = 2 * ............
     
  16. ETA for this new hook for bonus and highqual rates ect being added?
     
  17. the bonus seems to be working with the last zLevels update. you'd have to increase the gather rate within the zlevels config though and adjust the gathermanager config.
    when i set the resourcemultiplier within zlevels to 10 for Mining, the finishing bonus was around 10x. it was probably a bit more because of the 'on hit' bonus i added as well from above.
     
  18. Metal ore nodes are not being modified while gathering it with a metal pickaxe but its fine when gathering with a salvaged pick
     
    Last edited by a moderator: Jul 12, 2017
  19. Is there a way to increase all gather rates at the same time or must I do it all manually?
     
  20. Yeah by reading overview :)