RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
CrystalChest.java
1
package
com.osroyale.content;
2
3
import
com.osroyale.game.world.entity.mob.player.Player;
4
import
com.osroyale.game.world.items.Item;
5
import
com.osroyale.util.chance.Chance;
6
import
com.osroyale.util.chance.WeightedChance;
7
8
import
java.util.Arrays;
9
48
49
public
class
CrystalChest
{
50
52
public
static
final
Item[]
KEY_HALVES
= {
new
Item(985),
new
Item(987)};
53
55
public
static
final
Item
KEY
=
new
Item(989);
56
58
public
static
void
createKey
(
Player
player) {
59
if
(player.inventory.
containsAll
(
KEY_HALVES
)) {
60
player.inventory.
remove
(
KEY_HALVES
[0]);
61
player.inventory.
remove
(
KEY_HALVES
[1]);
62
player.inventory.
add
(
KEY
);
63
player.dialogueFactory.sendItem(
"Crystal Key"
,
"You have combined the two parts to form a key."
,
KEY
.getId()).
execute
();
64
}
65
}
66
68
public
static
Item
getReward
() {
69
return
ITEMS.next();
70
}
71
73
private
static
final
Chance<Item>
ITEMS =
new
Chance<>
(Arrays.asList(
74
new
WeightedChance<>
(8,
new
Item(1163, 1)),
// RUNE_FULL_HELM
75
new
WeightedChance<>
(6,
new
Item(1147, 1)),
// RUNE_MED_HELM
76
new
WeightedChance<>
(6,
new
Item(1127, 1)),
// RUNE_PLATEBODY
77
new
WeightedChance<>
(6,
new
Item(1093, 1)),
// RUNE_PLATESKIRT
78
new
WeightedChance<>
(6,
new
Item(1201, 1)),
// RUNE_KITESHIELD
79
new
WeightedChance<>
(6,
new
Item(1185, 1)),
// RUNE_SQ_SHIELD
80
new
WeightedChance<>
(6,
new
Item(1333, 1)),
// RUNE_SCIMITAR
81
new
WeightedChance<>
(6,
new
Item(1079, 1)),
// RUNE_PLATELEGS
82
new
WeightedChance<>
(5,
new
Item(10828, 1)),
// HELM_OF_NEITZ
83
new
WeightedChance<>
(5,
new
Item(1632, 1)),
// UNCUT_DAGONSTONE
84
new
WeightedChance<>
(5,
new
Item(4099, 1)),
// MYSTIC_HAT
85
new
WeightedChance<>
(5,
new
Item(4089, 1)),
// MYSTIC_HAT
86
new
WeightedChance<>
(5,
new
Item(4109, 1)),
// MYSTIC_HAT
87
new
WeightedChance<>
(5,
new
Item(4101, 1)),
// MYSTIC_TOP
88
new
WeightedChance<>
(5,
new
Item(4091, 1)),
// MYSTIC_TOP
89
new
WeightedChance<>
(5,
new
Item(4111, 1)),
// MYSTIC_TOP
90
new
WeightedChance<>
(5,
new
Item(4103, 1)),
// MYSTIC_BOTTOM
91
new
WeightedChance<>
(5,
new
Item(4093, 1)),
// MYSTIC_BOTTOM
92
new
WeightedChance<>
(5,
new
Item(4113, 1)),
// MYSTIC_BOTTOM
93
new
WeightedChance<>
(4,
new
Item(995, 35000)),
// COINS
94
new
WeightedChance<>
(3.5,
new
Item(13307, 350)),
// BLOOD_MONEY
95
new
WeightedChance<>
(3.5,
new
Item(4153, 1)),
// GRANITE_MAUL
96
new
WeightedChance<>
(3.5,
new
Item(10589, 1)),
// GRANITE_HELM
97
new
WeightedChance<>
(3.5,
new
Item(10564, 1)),
// GRANITE_BODY
98
new
WeightedChance<>
(3.5,
new
Item(6809, 1)),
// GRANITE_LEGS
99
new
WeightedChance<>
(3.5,
new
Item(21643, 1)),
// GRANITE_BOOTS
100
new
WeightedChance<>
(3.5,
new
Item(21646, 1)),
// GRANITE_LONGSWORD
101
new
WeightedChance<>
(3,
new
Item(1149, 1)),
// DRAGON_MED_HELM
102
new
WeightedChance<>
(3,
new
Item(1187, 1)),
// DRAGON_SQ_SHIELD
103
new
WeightedChance<>
(3,
new
Item(1215, 1)),
// DRAGON_DAGGER
104
new
WeightedChance<>
(3,
new
Item(4587, 1)),
// DRAGON_SCIMITAR
105
new
WeightedChance<>
(3,
new
Item(4087, 1)),
// DRAGON_PLATELEGS
106
new
WeightedChance<>
(3,
new
Item(1434, 1)),
// DRAGON_MACE
107
new
WeightedChance<>
(3,
new
Item(4585, 1)),
// DRAGON_PLATESKIRT
108
new
WeightedChance<>
(3,
new
Item(3204, 1)),
// DRAGON_HALBERD
109
new
WeightedChance<>
(3,
new
Item(1249, 1)),
// DRAGON_SPEAR
110
new
WeightedChance<>
(3,
new
Item(1305, 1)),
// DRAGON_LONGSWORD
111
new
WeightedChance<>
(3,
new
Item(1377, 1)),
// DRAGON_BATTLEAXE
112
new
WeightedChance<>
(2,
new
Item(7158, 1)),
// DRAGON_2H_SWORD
113
new
WeightedChance<>
(1.5,
new
Item(6199, 1)),
// BRONZE_MYSTERY_BOX
114
new
WeightedChance<>
(1,
new
Item(11840, 1)),
// DRAGON_BOOTS
115
new
WeightedChance<>
(5,
new
Item(13307, 1500)),
// BLOOD_MONEY
116
new
WeightedChance<>
(0.5,
new
Item(6571, 1))
// UNCUT_ONYX
117
));
118
}
com.osroyale.content.CrystalChest
Definition
CrystalChest.java:49
com.osroyale.content.CrystalChest.getReward
static Item getReward()
Definition
CrystalChest.java:68
com.osroyale.content.CrystalChest.createKey
static void createKey(Player player)
Definition
CrystalChest.java:58
com.osroyale.content.CrystalChest.KEY
static final Item KEY
Definition
CrystalChest.java:55
com.osroyale.content.CrystalChest.KEY_HALVES
static final Item[] KEY_HALVES
Definition
CrystalChest.java:52
com.osroyale.content.dialogue.DialogueFactory.execute
final DialogueFactory execute()
Definition
DialogueFactory.java:196
com.osroyale.game.world.entity.mob.player.Player
Definition
Player.java:162
com.osroyale.game.world.items.containers.ItemContainer.add
boolean add(Item item)
Definition
ItemContainer.java:195
com.osroyale.game.world.items.containers.ItemContainer.containsAll
final boolean containsAll(int... identifiers)
Definition
ItemContainer.java:773
com.osroyale.game.world.items.containers.ItemContainer.remove
boolean remove(Item item)
Definition
ItemContainer.java:348
com.osroyale.util.chance.Chance
Definition
Chance.java:39
com.osroyale.util.chance.WeightedChance
Definition
WeightedChance.java:10