67 private static final List<Integer> SKILLING_ITEMS =
new ArrayList<>();
68 private static final List<Integer> HERBLORE_ITEMS =
new ArrayList<>();
69 private static final List<Integer> BONE_ITEMS =
new ArrayList<>();
71 private static final List<Integer> ESSENCE_ITEMS =
new ArrayList<>();
75 private static final Position[] HUNTER_SPAWN_POSITION = {
87 for (
Position position : HUNTER_SPAWN_POSITION) {
90 if (RandomUtils.success(.50)) {
99 for (
int[] IMPLING : IMPLINGS) {
125 private static void declareItems() {
127 SKILLING_ITEMS.add(tree.item);
129 for (OreData ore : OreData.values()) {
130 SKILLING_ITEMS.add(ore.ore);
132 for (Fishable fish : Fishable.values()) {
133 SKILLING_ITEMS.add(fish.getRawFishId());
135 for (GrimyHerb herb : GrimyHerb.values()) {
136 HERBLORE_ITEMS.add(herb.getCleanID());
138 for (GrimyHerb herb : GrimyHerb.values()) {
139 HERBLORE_ITEMS.add(herb.getGrimyID());
141 for (BoneData bones : BoneData.values()) {
142 BONE_ITEMS.add(bones.getId2());
146 public static boolean isSkillingItem(
int item) {
147 for (
int id : SKILLING_ITEMS) {
153 public static boolean isHerbloreItem(
int item) {
154 for (
int id : SKILLING_ITEMS) {
161 public static boolean isBones(
int item) {
162 for (
int id : BONE_ITEMS) {
170 public static boolean isSuccess(
int skill,
int levelRequired) {
171 double successChance = Math.ceil(((
double) skill * 50.0D - (
double) levelRequired * 15.0D) / (
double) levelRequired / 3.0D * 4.0D);
172 int roll = Utility.random(99);
173 return successChance >= roll;
176 public static boolean isSuccess(Player p,
int skillId,
int levelRequired,
boolean usingDragonHarpoon) {
177 double level = p.skills.getMaxLevel(skillId);
178 double successChance = Math.ceil((((level * 50.0D) - ((
double) levelRequired * 15.0D)) / (
double) levelRequired / 3.0D) * 4.0D);
179 int roll = usingDragonHarpoon ? Utility.random(79) : Utility.random(99);
180 return successChance >= roll;
183 public static boolean isSuccess(Player p,
int skill,
int levelRequired,
int toolLevelRequired) {
184 double level = (p.skills.getMaxLevel(skill) + toolLevelRequired) / 2.0D;
185 double successChance = Math.ceil((((level * 50.0D) - ((
double) levelRequired * 15.0D)) / (
double) levelRequired / 3.0D) * 4.0D);
186 int roll = Utility.random(99);
187 return successChance >= roll;
190 public static final int[][] IMPLINGS = {