RuneHive-Game
Loading...
Searching...
No Matches
JusticarUtility.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.strategy.npc.boss.magearena;
2
3import com.runehive.game.world.World;
4import com.runehive.game.world.entity.mob.Direction;
5import com.runehive.game.world.entity.mob.npc.Npc;
6import com.runehive.game.world.entity.mob.player.Player;
7import com.runehive.game.world.position.Position;
8import com.runehive.util.Utility;
9
10/**
11 * Created by TJ#5762 Jusiticar Utility Class, handles the spawning &
12 * generate
13 */
14public class JusticarUtility {
15
16 public static SpawnData2 spawn;
17
18 public static boolean activated = false;
19
20 public static boolean justicarbutton;
21
22 public static Npc generateSpawn() {
23 activated = true;
25 Npc jusiticar = new Npc(7858, spawn.position, 10, Direction.NORTH);
26 World.sendMessage("<col=8714E6> Justicar has just spawned! He is located at " + spawn.location + "!");
27 World.sendBroadcast(1, "The Justicar boss has spawned!" + spawn.location + "!", true);
28 jusiticar.register();
29 jusiticar.definition.setRespawnTime(-1);
30 jusiticar.definition.setAggressive(true);
31 jusiticar.speak("Darkness is here to penetrate your souls!");
32 return jusiticar;
33 }
34
35 /** Identification of all loot, it selects the loot */
36
37 public static int[] ALWAYSLOOT = { 1, 1, 1, 1, 1, 2, 3, 4, 5 };
38 public static int[] COMMONLOOT = { 6199, 989, 3140, 4087, 11732, 989, 12878, 6585, 4675 };
39 public static int[] RARELOOT = { 11834, 11832, 11828, 11830, 11836, 11773, 13239, 13237, 13235, 11772, 11771, 11770,
40 20143, 20002 };
41 public static int[] SUPERRARELOOT = { 11862, 12817, 12825, 12821, 20997, 13652, 11802, 13576, 11785, 19481, 11791,
42 12904, };
43
44 public static void defeated(Npc justicar, Player player) {
45 boolean hasClan = player.clanChannel != null;
46
47 if (hasClan) {
48 World.sendMessage("<col=8714E6> Skotizo has been defeated by " + player.getName() + " !");
49 } else {
50 World.sendMessage("<col=8714E6> Skotizo has been defeated by " + player.getName()
51 + ", a solo individual with balls of steel!");
52 }
53
54 justicar.unregister();
55 activated = false;
56 }
57
58 public enum SpawnData2 {
59 LEVEL_46("lvl 46 wild near Spider Hill", new Position(3135, 3888, 0), new Position(3132, 3881, 0)),
60 LEVEL_16("lvl 16 wild near Bone Yard", new Position(3273, 3648, 0), new Position(3267, 3654, 0)),
61 LEVEL_51("lvl 51 wild near Rogues Castle", new Position(3266, 3924, 0), new Position(3266, 3927, 0)),
62 LEVEL_41("lvl 19 wild near graveyard of shadows", new Position(3197, 3670, 0), new Position(3194, 3666, 0)),
63 LEVEL_47("lvl 47 wild near obelisk", new Position(3308, 3892, 0), new Position(3305, 3888, 0)),
64 LEVEL_53("lvl 53 wild near scorpia's cave entrance", new Position(3211, 3944, 0), new Position(3208, 3940, 0));
65
66 public final String location;
67 public final Position position;
68 public final Position tsunami;
69
71 this.location = location;
72 this.position = position;
73 this.tsunami = tsunami;
74 }
75
76 public static SpawnData2 generate() {
77 return Utility.randomElement(values());
78 }
79
80 public String getLocation() {
81 return location;
82 }
83
85 return position;
86 }
87
89 return tsunami;
90 }
91
92 }
93
94}
Represents the game world.
Definition World.java:46
static void sendBroadcast(int time, String message, boolean countdown)
Sends a game message.
Definition World.java:420
static void sendMessage(String... messages)
Sends a global message.
Definition World.java:396
Created by TJ#5762 Jusiticar Utility Class, handles the spawning & generate.
static int[] ALWAYSLOOT
Identification of all loot, it selects the loot.
void speak(String forceChat)
Sets the mob's forced chat.
Definition Mob.java:127
Represents a non-player character in the in-game world.
Definition Npc.java:29
void register()
Registers an entity to the World.
Definition Npc.java:112
void unregister()
Unregisters an entity from the World.
Definition Npc.java:126
This class represents a character controlled by a player.
Definition Player.java:125
Represents a single tile on the game world.
Definition Position.java:14
Handles miscellaneous methods.
Definition Utility.java:27
static< T > T randomElement(Collection< T > collection)
Picks a random element out of any array type.
Definition Utility.java:248
Represents the enumerated directions an entity can walk or face.