Explorar o código

Randomize the treasure drop amounts instead of always dropping everything

For example, the guaranteed 5 diamonds will now be a 1-5 diamond drop.
TfT_02 %!s(int64=11) %!d(string=hai) anos
pai
achega
748dba41dc

+ 4 - 0
src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java

@@ -485,6 +485,10 @@ public class FishingManager extends SkillManager {
             treasureDrop.setDurability((short) (Misc.getRandom().nextInt(maxDurability)));
         }
 
+        if (treasureDrop.getAmount() > 1) {
+            treasureDrop.setAmount(Misc.getRandom().nextInt(treasureDrop.getAmount()) + 1);
+        }
+
         treasure.setDrop(treasureDrop);
 
         return treasure;