RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
WarriorGuildUtility.java
1package com.osroyale.content.activity.impl.warriorguild;
2
3import com.osroyale.net.packet.out.SendMessage;
4import com.osroyale.game.world.entity.mob.player.Player;
5
36
37* This class handles util methods for the Warrior's activity.
38 *
39 * @author Daniel
40 */
41public class WarriorGuildUtility {
42
44 static final int[][] ARMOUR = {{1155, 1117, 1075}, {1153, 1115, 1067}, {1157, 1119, 1069}, {1165, 1125, 1077}, {1159, 1121, 1071}, {1161, 1123, 1073}, {1163, 1127, 1079}};
45
47 private static final int[] DEFENDER = new int[]{8844, 8845, 8846, 8847, 8848, 8849, 8850, 12954};
48
50 static final int[] ANIMATED = {2450, 2451, 2452, 2453, 2454, 2455, 2456};
51
53 public static final int[] CYCLOPS = {2463, 2464, 2465, 2466, 2467, 2468};
54
56 static int getDefenderIndex(Player player) {
57 int foundIndex = 0;
58 for (int index = 0; index < DEFENDER.length; index++) {
59 if (player.inventory.contains(DEFENDER[index]) || player.equipment.contains(DEFENDER[index]))
60 foundIndex = index;
61 }
62 return foundIndex;
63 }
64
66 public static int getDefender(Player player) {
67 int foundIndex = -1;
68 for (int i = 0; i < DEFENDER.length; i++) {
69 if (player.inventory.contains(DEFENDER[i]) || player.equipment.contains(DEFENDER[i]))
70 foundIndex = i;
71 }
72 if (foundIndex != 7)
73 foundIndex++;
74 return DEFENDER[foundIndex];
75 }
76
78 public static int contains(Player player, int itemId) {
79 int itemIndex = -1;
80 for (int index = 0; index < ARMOUR.length; index++) {
81 for (int j = 0; j < ARMOUR[index].length; j++) {
82 if (itemId == ARMOUR[index][j]) {
83 itemIndex = index;
84 for (int k = 0; k < ARMOUR[index].length; k++) {
85 if (!player.inventory.contains(ARMOUR[index][k])) {
86 player.send(new SendMessage("You need a complete armour set to do this!"));
87 return -1;
88 }
89 }
90 break;
91 }
92 }
93 }
94 return itemIndex;
95 }
96}