RuneHive-Game
Loading...
Searching...
No Matches
DerwenUtility.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#6732
12 */
13public class DerwenUtility {
14
15 public static Npc generatederwenSpawn() {
17 Npc derwen = new Npc(7859, spawn.position, 10, Direction.NORTH);
18 World.sendMessage("<col=8714E6> Derwen has just spawned! He is located at " + spawn.location + "!");
19 World.sendBroadcast(1, "The Derwen boss has spawned!" + spawn.location + "!", true);
20 derwen.register();
21 derwen.definition.setRespawnTime(-1);
22 derwen.definition.setAggressive(true);
23 derwen.speak("Darkness is here to penetrate your souls!");
24 return derwen;
25 }
26
27 public static void defeated(Npc jusiticar, Player player) {
28
29 boolean hasClan = player.clanChannel != null;
30
31 if (hasClan) {
32 World.sendMessage("<col=8714E6> Derwen has been defeated by " + player.getName() + "!");
33 } else {
34 World.sendMessage("<col=8714E6> Derwen has been defeated by " + player.getName()
35 + ", a solo individual with balls of steel!");
36 }
37
38 jusiticar.unregister();
39 }
40
41 public enum SpawnData {
42 LEVEL_19("lvl 15 wild near dark warrior's fortress", new Position(3009, 3637, 0)),
43 LEVEL_28("lvl 54 wild near wilderness resource area", new Position(3184, 3948, 0)),
44 LEVEL_41("lvl 52 wild near Rouges Castle", new Position(3270, 3933, 0)),
45 LEVEL_53("lvl 19 wild near graveyard of shadows", new Position(3146, 3672, 0));
46
47 public final String location;
48 public final Position position;
49
51 this.location = location;
52 this.position = position;
53 }
54
55 public static SpawnData generate() {
56 return Utility.randomElement(values());
57 }
58 }
59}
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
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.