Yes that is
GatherManager
Moved
Total Downloads: 59,075 - First Release: Oct 23, 2014 - Last Update: Aug 27, 2017
- 4.93893/5, 131 likes
-
-
-
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, 10); int HQ = 10; if(HQ < 0) { var gatherRate = 1; if (GatherResourceModifiers.ContainsKey("High Quality Metal Ore")) gatherRate = item.amount = (int)(item.amount * GatherResourceModifiers["High Quality Metal Ore"]); else if (GatherResourceModifiers.ContainsKey("*")) gatherRate = item.amount = (int)(item.amount * 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; }
-
To
int HQ = 0; -
[DOUBLEPOST=1499197045][/DOUBLEPOST] -
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, 10); int HQ = 0; 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; }
-
-
-
-
The workaround is great, don't get me wrong but will be nice to have plugin fixed. Thanks sami Tip: use a rock to get most HQ if you use this code.
-
-
-
Any guess on how long until the hook?
-
-
working fine here -
Any Solid Solution for high quality metal to be collected from rocks in larger amounts like 100x gather for high quality metal per rock. I cant see all these high gather rate, modded servers have no way of getting tons of highqualitymetal for people to build op bases
[DOUBLEPOST=1499379565][/DOUBLEPOST] -
@sami37 Is is there any way to make for example only 40 HQM from node and not getting by hits? Because if you hit with bone knife you will get a lot of HQ.
Or any solution to this? -
i have set everything to 5x but wish to make it so players only get one skull when destroying a body how would i manage this?
-
I cant seem to get the nodes to give me more than 2HQ on the last strike. My servers running at 100x so i was hoping to get it within that scope but even with the code below it does not budge from 2HQ. I understand the code below dont give me the 100x im looking for but would shoot me in the right direction in regards to getting it to work. Any help would be greatly appreciated!
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, 10);
int HQ = 0;
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;
}
[DOUBLEPOST=1499411055][/DOUBLEPOST]Actually, disregard that. It shows its gathering 2 but in the inventory it its working. Either way thanks