RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.bloodmoney.BloodMoneyChest Class Reference

The blood money chest manager. More...

Collaboration diagram for com.runehive.content.bloodmoney.BloodMoneyChest:

Static Public Member Functions

static void finish (boolean unlocked)
 Handles finishing the blood money chet.
static String getInformation ()
 The information displayed on information tab.
static void open (Player player)
 Handles opening the blood money chest.
static void spawn ()
 Handles spawning the blood money chest.

Static Public Attributes

static boolean active
 The state of the blood money chest.
static CustomGameObject chest
 The blood money chest object.
static BloodMoneyPosition data
 Blood chest position.
static Npc guardian
 The guardian npc.
static final Stopwatch stopwatch = Stopwatch.start()
 The stopwatch for this event.

Static Private Attributes

static Player viewer
 The current blood money chest viewer.

Detailed Description

The blood money chest manager.

Author
Daniel

Definition at line 17 of file BloodMoneyChest.java.

Member Function Documentation

◆ finish()

void com.runehive.content.bloodmoney.BloodMoneyChest.finish ( boolean unlocked)
static

Handles finishing the blood money chet.

Definition at line 56 of file BloodMoneyChest.java.

56 {
57 active = false;
58 chest.unregister();
59 if (guardian != null && guardian.isRegistered()) {
60 guardian.unregister();
61 }
62
63 if (viewer != null) {
64 if (unlocked) {
65 World.sendMessage("<icon=0><col=FF0000> Blood money chest was unlocked by " + viewer.getName() + "!");
66 // DiscordPlugin.sendSimpleMessage("Blood money chest has been unlocked by " + viewer.getName() + "!");
67 viewer.inventory.addOrDrop(new Item(20608));
68 }
69
70 viewer.interfaceManager.close(4543);
71 viewer = null;
72 return;
73 }
74 World.sendMessage("<icon=0><col=FF0000> Blood money chest has vanished!");
75 }

References active, chest, guardian, com.runehive.game.world.World.sendMessage(), and viewer.

Referenced by com.runehive.content.bloodmoney.BloodChestEvent.execute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInformation()

String com.runehive.content.bloodmoney.BloodMoneyChest.getInformation ( )
static

The information displayed on information tab.

Definition at line 98 of file BloodMoneyChest.java.

98 {
99 return !active ? "Not Active" : data.name;
100 }

References active, and data.

◆ open()

void com.runehive.content.bloodmoney.BloodMoneyChest.open ( Player player)
static

Handles opening the blood money chest.

Definition at line 78 of file BloodMoneyChest.java.

78 {
79 if (guardian != null) {
80 player.dialogueFactory.sendStatement("The stone guardian must be killed!").execute();
81 return;
82 }
83
84 if (viewer != null) {
85 if (!viewer.interfaceManager.isInterfaceOpen(4543)) {
86 viewer = null;
87 } else {
88 player.dialogueFactory.sendStatement("There is already someone unlocking the chest!").execute();
89 return;
90 }
91 }
92
93 viewer = player;
94 player.puzzle.open(PuzzleType.BLOOD_MONEY);
95 }

References com.runehive.content.puzzle.PuzzleType.BLOOD_MONEY, com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.content.dialogue.DialogueFactory.execute(), guardian, com.runehive.content.puzzle.PuzzleDisplay.open(), com.runehive.game.world.entity.mob.player.Player.puzzle, com.runehive.content.dialogue.DialogueFactory.sendStatement(), and viewer.

Here is the call graph for this function:

◆ spawn()

void com.runehive.content.bloodmoney.BloodMoneyChest.spawn ( )
static

Handles spawning the blood money chest.

Definition at line 37 of file BloodMoneyChest.java.

37 {
38 data = Utility.randomElement(BloodMoneyPosition.values());
39
40 chest = new CustomGameObject(27290, data.position);
41 chest.rotate(data.direction);
42 chest.register();
43
44 guardian = new Npc(8066, data.position);
45 guardian.boundaries = Utility.getInnerBoundaries(data.position, 5, 5);
46 guardian.walkingRadius = 3;
47 guardian.register();
48
49 active = true;
50
51 World.sendMessage("<icon=0><col=FF0000> Blood money chest has spawned at: " + data.name + ".");
52 // DiscordPlugin.sendSimpleMessage("Blood money chest has spawned at " + data.name + "!");
53 }

References active, chest, data, com.runehive.util.Utility.getInnerBoundaries(), guardian, com.runehive.util.Utility.randomElement(), and com.runehive.game.world.World.sendMessage().

Referenced by com.runehive.content.bloodmoney.BloodChestEvent.execute().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ active

boolean com.runehive.content.bloodmoney.BloodMoneyChest.active
static

The state of the blood money chest.

Definition at line 19 of file BloodMoneyChest.java.

Referenced by com.runehive.content.bloodmoney.BloodChestEvent.execute(), finish(), getInformation(), and spawn().

◆ chest

CustomGameObject com.runehive.content.bloodmoney.BloodMoneyChest.chest
static

The blood money chest object.

Definition at line 25 of file BloodMoneyChest.java.

Referenced by finish(), and spawn().

◆ data

BloodMoneyPosition com.runehive.content.bloodmoney.BloodMoneyChest.data
static

Blood chest position.

Definition at line 31 of file BloodMoneyChest.java.

Referenced by getInformation(), and spawn().

◆ guardian

Npc com.runehive.content.bloodmoney.BloodMoneyChest.guardian
static

◆ stopwatch

final Stopwatch com.runehive.content.bloodmoney.BloodMoneyChest.stopwatch = Stopwatch.start()
static

The stopwatch for this event.

Definition at line 34 of file BloodMoneyChest.java.

Referenced by com.runehive.content.bloodmoney.BloodChestEvent.execute().

◆ viewer

Player com.runehive.content.bloodmoney.BloodMoneyChest.viewer
staticprivate

The current blood money chest viewer.

Definition at line 22 of file BloodMoneyChest.java.

Referenced by finish(), and open().


The documentation for this class was generated from the following file: