RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.itemaction.impl.DrillDemonBox Class Reference
Inheritance diagram for com.runehive.content.itemaction.impl.DrillDemonBox:
Collaboration diagram for com.runehive.content.itemaction.impl.DrillDemonBox:

Public Member Functions

int delay ()
 The item click delay of the action.
boolean inventory (Player player, Item item, int opcode)
 The execution method of the action.
String message (Item item)
 The message of the action.
String name ()
 The name of the action.
Public Member Functions inherited from com.runehive.content.itemaction.ItemAction
boolean drop (Player player, Item item)
boolean equipment (Player player, Item item, int opcode)
boolean itemOnItem (Player player, Item first, Item second)
String toString ()

Static Private Attributes

static final Item[] CAMO_CLOTHING = {new Item(6656), new Item(6654), new Item(6655)}
static final EmoteUnlockable[] EMOTES = {EmoteUnlockable.SIT_UP, EmoteUnlockable.PUSH_UP, EmoteUnlockable.JUMPING_JACK, EmoteUnlockable.JOG}

Detailed Description

Definition at line 11 of file DrillDemonBox.java.

Member Function Documentation

◆ delay()

int com.runehive.content.itemaction.impl.DrillDemonBox.delay ( )

The item click delay of the action.

Reimplemented from com.runehive.content.itemaction.ItemAction.

Definition at line 28 of file DrillDemonBox.java.

28 {
29 return 2;
30 }

◆ inventory()

boolean com.runehive.content.itemaction.impl.DrillDemonBox.inventory ( Player player,
Item item,
int opcode )

The execution method of the action.

Reimplemented from com.runehive.content.itemaction.ItemAction.

Definition at line 33 of file DrillDemonBox.java.

33 {
34 if (opcode != 1)
35 return false;
36
37 player.inventory.remove(item);
38 int random = Utility.random(1, 5);
39
40 switch (random) {
41 case 1:
42 case 2:
43 if (!EmoteHandler.containsAll(player, EMOTES)) {
44 EmoteUnlockable emote = EmoteHandler.selectRandom(player, EMOTES);
45 player.emoteUnlockable.add(emote);
46 EmoteHandler.refresh(player);
47 player.send(new SendMessage("You have unlocked the " + Utility.formatName(emote.name().toLowerCase().replace("_", "")) + " emote!"));
48 return true;
49 }
50 int random2 = Utility.random(1, 2);
51 if (random2 == 1) {
52 Item clothing = Utility.randomElement(CAMO_CLOTHING);
53 player.inventory.add(clothing);
54 player.send(new SendMessage("You have received the " + clothing.getName() + " item!"));
55 } else {
56 player.inventory.add(new Item(995, 75000));
57 }
58 break;
59 case 3:
60 case 4:
61 player.inventory.add(Utility.randomElement(CAMO_CLOTHING));
62 break;
63 case 5:
64 player.inventory.add(new Item(995, 75000));
65 break;
66 }
67 return true;
68 }

References com.runehive.game.world.items.containers.ItemContainer.add(), CAMO_CLOTHING, com.runehive.content.emote.EmoteHandler.containsAll(), EMOTES, com.runehive.game.world.entity.mob.player.Player.emoteUnlockable, com.runehive.util.Utility.formatName(), com.runehive.game.world.items.Item.getName(), com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.util.Utility.random(), com.runehive.util.Utility.randomElement(), com.runehive.content.emote.EmoteHandler.refresh(), com.runehive.game.world.items.containers.ItemContainer.remove(), com.runehive.content.emote.EmoteHandler.selectRandom(), and com.runehive.game.world.entity.mob.player.Player.send().

Here is the call graph for this function:

◆ message()

String com.runehive.content.itemaction.impl.DrillDemonBox.message ( Item item)

The message of the action.

Reimplemented from com.runehive.content.itemaction.ItemAction.

Definition at line 23 of file DrillDemonBox.java.

23 {
24 return "You open the Drill demon box...";
25 }

◆ name()

String com.runehive.content.itemaction.impl.DrillDemonBox.name ( )

The name of the action.

Reimplemented from com.runehive.content.itemaction.ItemAction.

Definition at line 18 of file DrillDemonBox.java.

18 {
19 return "Drill demon box";
20 }

Member Data Documentation

◆ CAMO_CLOTHING

final Item [] com.runehive.content.itemaction.impl.DrillDemonBox.CAMO_CLOTHING = {new Item(6656), new Item(6654), new Item(6655)}
staticprivate

Definition at line 15 of file DrillDemonBox.java.

15{new Item(6656), new Item(6654), new Item(6655)};

Referenced by inventory().

◆ EMOTES

final EmoteUnlockable [] com.runehive.content.itemaction.impl.DrillDemonBox.EMOTES = {EmoteUnlockable.SIT_UP, EmoteUnlockable.PUSH_UP, EmoteUnlockable.JUMPING_JACK, EmoteUnlockable.JOG}
staticprivate

Definition at line 13 of file DrillDemonBox.java.

13{EmoteUnlockable.SIT_UP, EmoteUnlockable.PUSH_UP, EmoteUnlockable.JUMPING_JACK, EmoteUnlockable.JOG};

Referenced by inventory().


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