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

Handles opening the crystal chest. More...

Collaboration diagram for com.runehive.content.CrystalChest:

Static Public Member Functions

static void createKey (Player player)
 Handles creating a key.
static Item getReward ()
 Handles getting an item reward from the chest.

Static Public Attributes

static final Item KEY = new Item(989)
 The item key to enter the crystal chest.
static final Item[] KEY_HALVES = {new Item(985), new Item(987)}
 The two item key halves.

Static Private Attributes

static final Chance< ItemITEMS
 Holds all the crystal chest rewards.

Detailed Description

Handles opening the crystal chest.

Author
Daniel

Definition at line 15 of file CrystalChest.java.

Member Function Documentation

◆ createKey()

void com.runehive.content.CrystalChest.createKey ( Player player)
static

Handles creating a key.

Definition at line 24 of file CrystalChest.java.

24 {
25 if (player.inventory.containsAll(KEY_HALVES)) {
26 player.inventory.remove(KEY_HALVES[0]);
27 player.inventory.remove(KEY_HALVES[1]);
28 player.inventory.add(KEY);
29 player.dialogueFactory.sendItem("Crystal Key", "You have combined the two parts to form a key.", KEY.getId()).execute();
30 }
31 }

References com.runehive.game.world.items.containers.ItemContainer.add(), com.runehive.game.world.items.containers.ItemContainer.containsAll(), com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.content.dialogue.DialogueFactory.execute(), com.runehive.game.world.entity.mob.player.Player.inventory, KEY, KEY_HALVES, com.runehive.game.world.items.containers.ItemContainer.remove(), and com.runehive.content.dialogue.DialogueFactory.sendItem().

Here is the call graph for this function:

◆ getReward()

Item com.runehive.content.CrystalChest.getReward ( )
static

Handles getting an item reward from the chest.

Definition at line 34 of file CrystalChest.java.

34 {
35 return ITEMS.next();
36 }

References ITEMS.

Member Data Documentation

◆ ITEMS

final Chance<Item> com.runehive.content.CrystalChest.ITEMS
staticprivate

Holds all the crystal chest rewards.

Definition at line 39 of file CrystalChest.java.

Referenced by getReward().

◆ KEY

final Item com.runehive.content.CrystalChest.KEY = new Item(989)
static

The item key to enter the crystal chest.

Definition at line 21 of file CrystalChest.java.

Referenced by createKey().

◆ KEY_HALVES

final Item [] com.runehive.content.CrystalChest.KEY_HALVES = {new Item(985), new Item(987)}
static

The two item key halves.

Definition at line 18 of file CrystalChest.java.

18{new Item(985), new Item(987)};

Referenced by createKey(), com.runehive.game.world.entity.mob.npc.drop.NpcDropManager.drop(), and com.runehive.game.world.entity.mob.npc.drop.NpcDropManager.handleMiscDrops().


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