RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
StarterKit.java
1
package
com.osroyale.content;
2
3
import
com.osroyale.game.world.entity.mob.UpdateFlag;
4
import
com.osroyale.game.world.entity.mob.player.Player;
5
import
com.osroyale.game.world.entity.mob.player.PlayerRight;
6
import
com.osroyale.game.world.items.Item;
7
import
com.osroyale.net.packet.out.SendConfig;
8
import
com.osroyale.net.packet.out.SendItemOnInterface;
9
import
com.osroyale.net.packet.out.SendRunEnergy;
10
import
com.osroyale.net.packet.out.SendString;
11
12
import
java.util.Arrays;
13
44
45
public
class
StarterKit
{
47
public
static
void
open
(
Player
player) {
48
player.locking.lock();
49
refresh
(player,
KitData
.NORMAL);
50
player.interfaceManager.
open
(45000);
51
}
52
54
public
static
void
refresh
(
Player
player,
StarterKit
.
KitData
kit) {
55
player.attributes.set(
"STARTER_KEY"
, kit);
56
for
(
int
index = 0,
string
= 45004; index < 4; index++,
string
+= 1) {
57
String desc = index >= kit.getDescription().length ?
""
: kit.getDescription()[index];
58
player.send(
new
SendString
(desc,
string
));
59
}
60
61
player.equipment.
clear
();
62
player.movement.
setRunningToggled
(
true
);
63
player.send(
new
SendRunEnergy
());
64
if
(kit.equipment ==
null
) {
65
player.equipment.
clear
();
66
player.updateFlags.add(
UpdateFlag
.APPEARANCE);
67
}
else
{
68
Arrays.stream(kit.getEquipment()).forEach(player.equipment::manualWear);
69
}
70
71
player.equipment.
refresh
();
72
player.send(
new
SendConfig
(1085, kit.ordinal()));
73
player.send(
new
SendItemOnInterface
(45021, kit.getItems()));
74
}
75
77
public
enum
KitData
{
78
NORMAL(
PlayerRight
.PLAYER,
new
String[]{
79
"Play Tarnish as a casual player."
,
80
"This game mode has no restrictions at all."
,
81
"You will be given a pre-made bank containing welfare equipment."
82
},
null
,
83
new
Item(995, 100000)
84
),
85
IRONMAN(
PlayerRight
.IRONMAN,
new
String[]{
86
"Playing as an ironman will restrict you from trading, picking up drops from other"
,
87
"player's kills including pvp or if another player has dealt any damage to a npc,"
,
88
"access to certain shops, access from using the marketplace, and playing certain minigames"
,
89
"which include duel arena. You will have access to ironman armour and a distinct rank. "
90
},
new
Item[]{new Item(12810), new Item(12812), new Item(12811), new Item(1277), new Item(1173), new Item(4119)},
91
new
Item(995, 10000),
new
Item(1351, 1),
new
Item(590, 1),
new
Item(303, 1),
92
new
Item(315, 1),
new
Item(1925, 1),
new
Item(1931, 1),
93
new
Item(2309, 1),
new
Item(1265, 1),
new
Item(1205, 1),
94
new
Item(1277, 1),
new
Item(1171, 1),
new
Item(841, 1),
95
new
Item(882, 250),
new
Item(556, 250),
new
Item(558, 250),
96
new
Item(555, 250),
new
Item(557, 250),
new
Item(559, 250)
97
),
98
ULTIMATE_IRONMAN(
PlayerRight
.ULTIMATE_IRONMAN,
new
String[]{
99
"In addition to all the regular ironman rules the following conditions apply as well:"
,
100
"The use of banking (they are still able to use noted items on bank booths to unnote them)"
,
101
"Keep any item on death nor use the Protect Item prayer "
,
102
},
new
Item[]{new Item(12813), new Item(12814), new Item(12815), new Item(1277), new Item(1173), new Item(4119)},
103
new
Item(995, 10000),
new
Item(1351, 1),
new
Item(590, 1),
new
Item(303, 1),
104
new
Item(315, 1),
new
Item(1925, 1),
new
Item(1931, 1),
105
new
Item(2309, 1),
new
Item(1265, 1),
new
Item(1205, 1),
106
new
Item(1277, 1),
new
Item(1171, 1),
new
Item(841, 1),
107
new
Item(882, 250),
new
Item(556, 250),
new
Item(558, 250),
108
new
Item(555, 250),
new
Item(557, 250),
new
Item(559, 250)
109
),
110
HARDCORE_IRONMAN(
PlayerRight
.HARDCORE_IRONMAN,
new
String[]{
111
"Hardcore Ironman players will only have one life, in addition to the standard restrictions"
,
112
"given to all ironmen. If a hardcore ironman dies, they will be converted to a Ironman"
,
113
"chat badge standard ironman. Safe deaths, such as those in minigames, will not cause"
,
114
"the player to become a standard ironman."
,
115
},
new
Item[]{new Item(20792), new Item(20794), new Item(20796), new Item(1277), new Item(1173), new Item(4119)},
116
new
Item(995, 10000),
new
Item(1351, 1),
new
Item(590, 1),
new
Item(303, 1),
117
new
Item(315, 1),
new
Item(1925, 1),
new
Item(1931, 1),
118
new
Item(2309, 1),
new
Item(1265, 1),
new
Item(1205, 1),
119
new
Item(1277, 1),
new
Item(1171, 1),
new
Item(841, 1),
120
new
Item(882, 25),
new
Item(556, 25),
new
Item(558, 15),
121
new
Item(555, 6),
new
Item(557, 4),
new
Item(559, 2)
122
);
123
125
private
final
PlayerRight
right;
126
128
private
final
String[] description;
129
131
private
final
Item[] equipment;
132
134
private
final
Item[] items;
135
137
KitData
(
PlayerRight
right, String[] description, Item[] equipment, Item... items) {
138
this.right = right;
139
this.description = description;
140
this.equipment = equipment;
141
this.items = items;
142
}
143
144
public
PlayerRight
getRight() {
145
return
right;
146
}
147
148
public
String[] getDescription() {
149
return
description;
150
}
151
152
public
Item[] getEquipment() {
153
return
equipment;
154
}
155
156
public
Item[] getItems() {
157
return
items;
158
}
159
160
}
161
162
}
com.osroyale.content.StarterKit
Definition
StarterKit.java:45
com.osroyale.content.StarterKit.open
static void open(Player player)
Definition
StarterKit.java:47
com.osroyale.content.StarterKit.refresh
static void refresh(Player player, StarterKit.KitData kit)
Definition
StarterKit.java:54
com.osroyale.game.world.entity.mob.movement.Movement.setRunningToggled
void setRunningToggled(boolean runToggled)
Definition
Movement.java:124
com.osroyale.game.world.entity.mob.player.InterfaceManager.open
void open(int identification)
Definition
InterfaceManager.java:66
com.osroyale.game.world.entity.mob.player.Player
Definition
Player.java:162
com.osroyale.game.world.items.containers.equipment.Equipment.refresh
void refresh()
Definition
Equipment.java:521
com.osroyale.game.world.items.containers.equipment.Equipment.clear
void clear()
Definition
Equipment.java:535
com.osroyale.net.packet.out.SendConfig
Definition
SendConfig.java:36
com.osroyale.net.packet.out.SendItemOnInterface
Definition
SendItemOnInterface.java:33
com.osroyale.net.packet.out.SendRunEnergy
Definition
SendRunEnergy.java:24
com.osroyale.net.packet.out.SendString
Definition
SendString.java:39
com.osroyale.content.StarterKit.KitData
Definition
StarterKit.java:77
com.osroyale.content.StarterKit.KitData.KitData
KitData(PlayerRight right, String[] description, Item[] equipment, Item... items)
Definition
StarterKit.java:137
com.osroyale.game.world.entity.mob.UpdateFlag
Definition
UpdateFlag.java:36
com.osroyale.game.world.entity.mob.player.PlayerRight
Definition
PlayerRight.java:52