RuneHive-Game
Loading...
Searching...
No Matches
NpcDropChance.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.mob.npc.drop;
2
3import com.runehive.util.Utility;
4
5/**
6 * The enumerated type whose elements represent a set of constants used to differ between
7 * {@link NpcDrop} rarities.
8 * @author <a href="http://www.rune-server.org/members/stand+up/">Stand Up</a>
9 * @since 29-1-2017.
10 */
11public enum NpcDropChance {
12 ALWAYS(1, 0),
13 COMMON(2, 10),
14 UNCOMMON(3, 50),
15 RARE(4, 250),
16 VERY_RARE(5, 500);
17
18 /** The tier of this drop chance. */
19 public final int tier;
20
21 /** The denominator which is the divisor of a nominator of 1. */
22 public final int weight;
23
24 /** Constructs a new {@link NpcDropChance}. */
26 this.weight = weight;
27 this.tier = tier;
28 }
29
30 @Override
31 public String toString() {
32 return Utility.formatEnum(name());
33 }
34}
Handles miscellaneous methods.
Definition Utility.java:27
static String formatEnum(final String string)
Formats name of enum.
Definition Utility.java:89
final int weight
The denominator which is the divisor of a nominator of 1.
NpcDropChance(int tier, int weight)
Constructs a new NpcDropChance.