RuneHive-Game
Loading...
Searching...
No Matches
WarriorGuildUtility.java
Go to the documentation of this file.
1package com.runehive.content.activity.impl.warriorguild;
2
3import com.runehive.net.packet.out.SendMessage;
4import com.runehive.game.world.entity.mob.player.Player;
5
6/**
7 * This class handles util methods for the Warrior's activity.
8 *
9 * @author Daniel
10 */
11public class WarriorGuildUtility {
12
13 /** The warrior guild animator armour data .*/
14 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}};
15
16 /** The warrior guild defenders. */
17 private static final int[] DEFENDER = new int[]{8844, 8845, 8846, 8847, 8848, 8849, 8850, 12954};
18
19 /** The warrior guild animated npcs. */
20 static final int[] ANIMATED = {2450, 2451, 2452, 2453, 2454, 2455, 2456};
21
22 /** The warrior guild cyclops npcs. */
23 public static final int[] CYCLOPS = {2463, 2464, 2465, 2466, 2467, 2468};
24
25 /** Gets the defender tier index. */
26 static int getDefenderIndex(Player player) {
27 int foundIndex = 0;
28 for (int index = 0; index < DEFENDER.length; index++) {
29 if (player.inventory.contains(DEFENDER[index]) || player.equipment.contains(DEFENDER[index]))
30 foundIndex = index;
31 }
32 return foundIndex;
33 }
34
35 /** Gets the defender index to drop for the player. */
36 public static int getDefender(Player player) {
37 int foundIndex = -1;
38 for (int i = 0; i < DEFENDER.length; i++) {
39 if (player.inventory.contains(DEFENDER[i]) || player.equipment.contains(DEFENDER[i]))
40 foundIndex = i;
41 }
42 if (foundIndex != 7)
43 foundIndex++;
44 return DEFENDER[foundIndex];
45 }
46
47 /** Checks if the player has a complete armour set to activate the animator. */
48 public static int contains(Player player, int itemId) {
49 int itemIndex = -1;
50 for (int index = 0; index < ARMOUR.length; index++) {
51 for (int j = 0; j < ARMOUR[index].length; j++) {
52 if (itemId == ARMOUR[index][j]) {
53 itemIndex = index;
54 for (int k = 0; k < ARMOUR[index].length; k++) {
55 if (!player.inventory.contains(ARMOUR[index][k])) {
56 player.send(new SendMessage("You need a complete armour set to do this!"));
57 return -1;
58 }
59 }
60 break;
61 }
62 }
63 }
64 return itemIndex;
65 }
66}
This class handles util methods for the Warrior's activity.
static final int[] ANIMATED
The warrior guild animated npcs.
static int getDefender(Player player)
Gets the defender index to drop for the player.
static int contains(Player player, int itemId)
Checks if the player has a complete armour set to activate the animator.
static final int[] CYCLOPS
The warrior guild cyclops npcs.
static int getDefenderIndex(Player player)
Gets the defender tier index.
static final int[][] ARMOUR
The warrior guild animator armour data .
This class represents a character controlled by a player.
Definition Player.java:125
boolean contains(int id)
Determines if this container contains id.
boolean contains(int[] bowsWithNoArrowsRequired)
The OutgoingPacket that sends a message to a Players chatbox in the client.