50public abstract class Area {
52 private static final Area[] SAFEZONE = {
53 new SquareArea(
"Edgeville Bank", 3091, 3488, 3098, 3499),
54 new SquareArea(
"Edgeville Bank", 3091, 3507, 3100, 3513) };
56 private static final Area DZ =
new SquareArea(
"Donator Zone", 2462, 10422, 2493, 10463);
57 private static final Area SDZ =
new SquareArea(
"Super Donator Zone", 2398, 10404, 2444, 10440);
59 private static final Area BANDOS_ROOM =
new SquareArea(
"General Graardor room", 2864, 5351, 2876, 5369, 2);
60 private static final Area SARADOMIN_ROOM =
new SquareArea(
"Saradomin room", 2889, 5258, 2907, 5275, 0);
61 private static final Area ZAMORAK_ROOM =
new SquareArea(
"Zamorak room", 2918, 5318, 2936, 5331, 2);
62 private static final Area ARMADYL_ROOM =
new SquareArea(
"Armadyl room", 2824, 5296, 2842, 5308, 2);
65 public static final Area[] INFERNO = {
new SquareArea(
"Arena Zone", 2243, 5314, 2300, 5372) };
69 private static final Area RFD_MINIGAME =
new SquareArea(
"RFD Minigame", 1889, 5345, 1910, 5366, 2);
75 private static final Area[] ZULRAH = {
new SquareArea(
"Zulrah", 2235, 3050, 2288, 3083) };
78 private static final Area[] KBD = {
new SquareArea(
"King Black Dragon lair", 2256, 4680, 2287, 4711) };
80 private static final Area[] LMS_LOBBY = {
new SquareArea(
"LMS Lobby", 3138, 3639, 3145, 3645) };
82 private static final Area[] LMS_BUILDING = {
new SquareArea(
"LMS Lobby", 3140, 3632, 3144, 3638) };
84 private static final Area[] FEROX_ENCLAVE = {
85 new SquareArea(3125, 3618, 3143, 3639),
86 new SquareArea(3123, 3622, 3124, 3632),
87 new SquareArea(3144, 3627, 3153, 3640),
88 new SquareArea(3138, 3640, 3145, 3645),
89 new SquareArea(3148, 3641, 3155, 3646),
90 new SquareArea(3130, 3617, 3139, 3617),
91 new SquareArea(3153, 3636, 3155, 3640),
92 new SquareArea(3153, 3627, 3155, 3633),
93 new SquareArea(3143, 3618, 3146, 3626),
94 new SquareArea(3146, 3622, 3151, 3626)
98 private static final Area[] KRAKEN = {
new SquareArea(
"Kraken Cave", 2268, 10022, 2292, 10046) };
99 private static final Area[] LMS_GAME = {
new SquareArea(
"LMS Game", 3392, 5760, 3519, 5893) };
100 private static final Area[] PEST_CONTROL_GAME = {
new SquareArea(
"Pest Control Game", 2622, 2558, 2693, 2627) };
102 private static final Area[] EVENT_ARENA = {
new SquareArea(
"Event Arena", 3082, 3506, 3089, 3513) };
104 private static final Area[] BARROWS = {
105 new SquareArea(
"Barrows", 3533, 3261, 3585, 3328),
106 new SquareArea(
"Barrows Underground", 3523, 9672, 3591, 9725, 3) };
108 private static final Area[] CATACOMBS = {
new SquareArea(
"Catacombs", 1591, 9982, 1736, 10111) };
111 private static final Area[] DUEL_ARENA_LOBBY = {
112 new SquareArea(
"Lobby", 3353, 3263, 3388, 3287),
113 new SquareArea(
"Lobby Altar", 3374, 3280, 3379, 3286),
114 new SquareArea(
"Lobby east bank", 3380, 3267, 3388, 3273) };
117 private static final Area[] MULTI_COMBAT_ZONES = {
118 new SquareArea(
"Lizard shamans", 1408, 3692, 1457, 3729),
119 new SquareArea(
"Al-kahrid Warrior", 3281, 3158, 3304, 3178),
120 new SquareArea(
"Smoke devils", 2378, 9421, 2429, 9465),
121 new SquareArea(
"Rock Crab", 2660, 3711, 2743, 3739),
122 new SquareArea(
"Skotizo", 2255, 5646, 2290, 5680),
123 new SquareArea(
"Wilderness Resource", 3174, 3924, 3196, 3944),
124 new SquareArea(
"Start of Varrock Wilderness", 3134, 3525, 3327, 3607),
125 new SquareArea(
"North of GE, near gravestones", 3190, 3648, 3327, 3839),
126 new SquareArea(
"Near Chaos Elemental", 3200, 3840, 3390, 3967),
127 new SquareArea(
"Near wilderness agility course", 2992, 3912, 3007, 3967),
128 new SquareArea(
"West wilderness altar", 2946, 3816, 2959, 3831),
129 new SquareArea(
"Deep wilderness 1", 3008, 3856, 3199, 3903),
130 new SquareArea(
"Near wilderness castle", 3008, 3600, 3071, 3711),
131 new SquareArea(
"North of varrock lumbermill", 3072, 3608, 3327, 3647),
132 new SquareArea(
"Pest control", 2624, 2550, 2690, 2619),
133 new SquareArea(
"Fight caves", 2371, 5062, 2422, 5117),
134 new SquareArea(
"Fight arena", 2896, 3595, 2927, 3630),
135 new SquareArea(
"Inferno", 2243, 5314, 2300, 5372),
136 new SquareArea(
"Scorpia lair", 3218, 10329, 3248, 10353),
137 new SquareArea(
"Corporeal Beast lair", 2964, 4360, 3001, 4399),
138 new SquareArea(
"Revenant Cave", 3168, 10047, 3290, 10143),
139 new SquareArea(
"Catacombs of Kourend 1", 1588, 9982, 1747, 10068),
140 new SquareArea(
"Catacombs of Kourend 2", 1641, 9982, 1734, 10110),
141 new SquareArea(
"Dagannoth lair", 2890, 4425, 2942, 4466) };
143 private static final SquareArea[] DUEL_ARENAS = {
144 new SquareArea(
"Arena", 3327, 3203, 3389, 3290)
147 private static final SquareArea[] DUEL_OBSTICLE_ARENAS = {
148 new SquareArea(
"South East Obstacle Arena", 3362, 3205, 3390, 3221),
149 new SquareArea(
"West Obstacle Arena", 3331, 3224, 3359, 3240),
150 new SquareArea(
"North East Obstacle Arena", 3362, 3243, 3390, 3259) };
153 private static final Area[] WILDERNESS = {
154 new SquareArea(
"Wilderness 1", 2941, 3525, 3392, 3966),
155 new SquareArea(
"Wilderness 2", 2941, 9920, 3392, 10366),
156 new SquareArea(
"Wilderness 3", 2250, 4672, 2296, 4721) };
158 public static boolean inEdgeville(Interactable entity) {
159 return inArea(entity,
new Position(3075, 3457, 0),
new Position(3116, 3518, 0));
162 public static boolean inCerberus(Interactable entity) {
163 return inArea(entity,
new Position(1217, 1223, 0),
new Position(1262, 1264, 0));
166 public static boolean inFightCaves(Interactable entity) {
167 return inArea(entity,
new Position(2368, 5057, 0),
new Position(2428, 5120, 0));
170 public static boolean inGodwars(Interactable entity) {
171 return inArea(entity,
new Position(2810, 5250, entity.getHeight()),
new Position(2950, 5370, entity.getHeight()));
173 public static boolean inWarriorGuild(Interactable entity) {
174 return inArea(entity,
new Position(2838, 3535, 0),
new Position(2875, 3555, 0));
177 public static boolean inCyclops(Interactable entity) {
178 return inArea(entity,
new Position(2847, 3532, 2),
new Position(2876, 3542, 2)) ||
179 inArea(entity,
new Position(2838, 3543, 2),
new Position(2877, 3577, 2));
182 public static boolean inkolodionArena(Entity entity) {
183 return entity.instance != Mob.DEFAULT_INSTANCE && inArea(entity,
new Position(3092, 3921, entity.getHeight()),
new Position(3117, 3947, entity.getHeight()));
185 public static boolean inSuperDonatorZone(Interactable entity) {
186 return SDZ.inArea(entity.getPosition());
188 public static boolean inRegularDonatorZone(Interactable entity) {
189 return DZ.inArea(entity.getPosition());
192 public static boolean inGnomeCourse(Interactable entity) {
193 return inArea(entity,
new Position(2464, 3412, entity.getHeight()),
new Position(2490, 3444, entity.getHeight()));
196 public static boolean inBarbarianCourse(Interactable entity) {
197 return inArea(entity,
new Position(2529, 3542, entity.getHeight()),
new Position(2553, 3559, entity.getHeight()));
200 public static boolean inSeersCourse(Interactable entity) {
201 return inArea(entity,
new Position(2695, 3455, entity.getHeight()),
new Position(2740, 3500, entity.getHeight()));
204 public static boolean inArdougneCourse(Interactable entity) {
205 return inArea(entity,
new Position(2642, 3285, entity.getHeight()),
new Position(2681, 3331, entity.getHeight()));
208 public static boolean inWildernessCourse(Interactable entity) {
209 return inArea(entity,
new Position(2989, 3933, entity.getHeight()),
new Position(3006, 3964, entity.getHeight()));
212 public static boolean inWildernessResource(Interactable entity) {
213 return inArea(entity,
new Position(3714, 3924, entity.getHeight()),
new Position(3196, 3944, entity.getHeight()));
216 public static boolean inBarrowsChamber(Interactable entity) {
217 return inArea(entity,
new Position(3547, 9690, entity.getHeight()),
new Position(3556, 9699, entity.getHeight()));
220 public static boolean inVorkath(Interactable entity) {
221 return inArea(entity,
new Position(2257, 4053, entity.getHeight()),
new Position(2288, 4079, entity.getHeight()));
224 public static boolean inKingBlackDragon(Interactable entity) {
225 for (Area zone : KBD) {
226 if (zone.inArea(entity.getPosition())) {
233 public static boolean inFeroxEnclave(Interactable entity) {
234 for(Area zone : FEROX_ENCLAVE) {
235 if(zone.inArea(entity.getPosition())) {
241 public static boolean inCatacombs(Interactable entity) {
242 for(Area zone : CATACOMBS) {
243 if(zone.inArea(entity.getPosition())) {
251 public static boolean inLMSLobby(Interactable entity) {
252 for(Area zone : LMS_LOBBY) {
253 if(zone.inArea(entity.getPosition())) {
260 public static boolean inLMSBuilding(Interactable entity) {
261 for(Area zone : LMS_BUILDING) {
262 if(zone.inArea(entity.getPosition())) {
270 public static boolean inRFD(Interactable entity) {
271 return RFD_MINIGAME.inArea(entity.getPosition());
274 public static boolean inKraken(Interactable entity) {
275 for (Area zone : KRAKEN) {
276 if (zone.inArea(entity.getPosition())) {
282 public static boolean inInferno(Entity entity) {
283 for (Area zone1 : INFERNO) {
284 if (zone1.inArea(entity.getPosition())) {
291 public static boolean inBarrows(Entity entity) {
292 for (Area zone : BARROWS) {
293 if (zone.inArea(entity.getPosition())) {
300 public static boolean inMulti(Entity entity) {
301 for (Area zone : MULTI_COMBAT_ZONES) {
302 if (zone.inArea(entity.getPosition())) {
306 return inVorkath(entity) || inkolodionArena(entity) || inKraken(entity) || inKingBlackDragon(entity) || inGodwars(entity) || inZulrah(entity);
309 public static boolean inWilderness(Position position) {
310 for (Area wild : WILDERNESS) {
311 if (wild.inArea(position)) {
318 public static boolean inWilderness(Interactable entity) {
319 if (entity ==
null)
return false;
320 if (inKingBlackDragon(entity))
return false;
321 if (inFeroxEnclave(entity) || inLMSLobby(entity) || inLMSBuilding(entity))
return false;
322 for (Area wild : WILDERNESS) {
323 if (wild.inArea(entity.getPosition())) {
330 public static boolean inDuelArenaLobby(Entity entity) {
331 for (Area zone : DUEL_ARENA_LOBBY) {
332 if (zone.inArea(entity.getPosition())) {
339 public static boolean inDuelObsticleArena(Interactable entity) {
340 for (Area zone : DUEL_OBSTICLE_ARENAS) {
341 if (zone.inArea(entity.getPosition())) {
348 public static boolean inDuelArena(Interactable entity) {
349 for (Area zone : DUEL_ARENAS) {
350 if (zone.inArea(entity.getPosition())) {
357 public static boolean inZulrah(Interactable entity) {
358 for (Area zone : ZULRAH) {
359 if (zone.inArea(entity.getPosition())) {
366 public static boolean inPestControl(Interactable entity) {
367 for (Area zone : PEST_CONTROL_GAME) {
368 if (zone.inArea(entity.getPosition())) {
374 public static boolean inLMSGame(Interactable entity) {
375 for (Area zone : LMS_GAME) {
376 if (zone.inArea(entity.getPosition())) {
392 public static boolean inPvP(Interactable entity) {
394 for (Area zone : SAFEZONE) {
395 if (zone.inArea(entity.getPosition())) {
403 public static boolean inBandos(Mob mob) {
404 return BANDOS_ROOM.inArea(mob.getPosition());
407 private static boolean inSaradomin(Mob mob) {
408 return SARADOMIN_ROOM.inArea(mob.getPosition());
411 private static boolean inArmadyl(Mob mob) {
412 return ARMADYL_ROOM.inArea(mob.getPosition());
415 private static boolean inZamorak(Mob mob) {
416 return ZAMORAK_ROOM.inArea(mob.getPosition());
419 public static boolean inGodwarsChambers(Mob mob) {
420 return inBandos(mob) || inSaradomin(mob) || inArmadyl(mob) || inZamorak(mob);
422 public static boolean inRestrictedArea(Mob mob) {
423 return inGodwarsChambers(mob) || inCerberus(mob) || inBarbarianCourse(mob)
424 || inCyclops(mob) || inDuelArena(mob) || inDuelArenaLobby(mob) || inFightCaves(mob) || inDuelObsticleArena(mob)
425 || inGnomeCourse(mob) || inGodwars(mob) || inGodwarsChambers(mob) || inInferno(mob) || inKingBlackDragon(mob)
426 || inkolodionArena(mob) || inKraken(mob) || inLMSBuilding(mob) || inPestControl(mob) || inRFD(mob)
427 || inVorkath(mob) || inVorkath(mob) || inWilderness(mob) || inZulrah(mob) || inLMSGame(mob) || inLMSLobby(mob);
431 private static boolean inArea(Interactable interactable, Position bottomLeft, Position topRight) {
432 return (interactable.getPosition().getX() >= bottomLeft.getX())
433 && (interactable.getPosition().getX() <= topRight.getX())
434 && (interactable.getPosition().getY() >= bottomLeft.getY())
435 && (interactable.getPosition().getY() <= topRight.getY());
438 public static boolean inAllArea(Interactable entity, Area... area) {
439 for (Area zone : area) {
440 if (!zone.inArea(entity.getPosition())) {
447 public static boolean inAnyArea(Interactable entity, Area... area) {
448 for (Area zone : area) {
449 if (zone.inArea(entity.getPosition())) {
457 public abstract boolean inArea(Position position);
459 public abstract Position getRandomLocation();