RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Emote.java
1package com.osroyale.content.emote;
2
3import com.osroyale.game.action.impl.EmoteAction;
4import com.osroyale.game.world.entity.mob.player.Player;
5import com.osroyale.game.world.items.Item;
6import com.osroyale.game.world.items.containers.equipment.Equipment;
7import com.osroyale.net.packet.out.SendMessage;
8import com.osroyale.util.generic.BooleanInterface;
9
10import java.util.Arrays;
11import java.util.Optional;
12
38
39public enum Emote implements BooleanInterface<Player> {
40 YES(168, 855, -1, -1) {
41 @Override
42 public boolean activated(Player player) {
43 return true;
44 }
45 },
46 NO(169, 856, -1, -1) {
47 @Override
48 public boolean activated(Player player) {
49 return true;
50 }
51 },
52 BOW(164, 858, -1, -1) {
53 @Override
54 public boolean activated(Player player) {
55 return true;
56 }
57 },
58 ANGRY(167, 864, -1, -1) {
59 @Override
60 public boolean activated(Player player) {
61 return true;
62 }
63 },
64 THINK(162, 857, -1, -1) {
65 @Override
66 public boolean activated(Player player) {
67 return true;
68 }
69 },
70 WAVE(163, 863, -1, -1) {
71 @Override
72 public boolean activated(Player player) {
73 return true;
74 }
75 },
76 SHRUG(13370, 2113, -1, -1) {
77 @Override
78 public boolean activated(Player player) {
79 return true;
80 }
81 },
82 CHEER(171, 862, -1, -1) {
83 @Override
84 public boolean activated(Player player) {
85 return true;
86 }
87 },
88 BECKON(165, 859, -1, -1) {
89 @Override
90 public boolean activated(Player player) {
91 return true;
92 }
93 },
94 LAUGH(170, 861, -1, -1) {
95 @Override
96 public boolean activated(Player player) {
97 return true;
98 }
99 },
100 JUMP_FOR_JOY(13366, 2109, -1, -1) {
101 @Override
102 public boolean activated(Player player) {
103 return true;
104 }
105 },
106 YAWN(13368, 2111, -1, -1) {
107 @Override
108 public boolean activated(Player player) {
109 return true;
110 }
111 },
112 DANCE(166, 866, -1, -1) {
113 @Override
114 public boolean activated(Player player) {
115 return true;
116 }
117 },
118 JIG(13363, 2106, -1, -1) {
119 @Override
120 public boolean activated(Player player) {
121 return true;
122 }
123 },
124 TWIRL(13364, 2107, -1, -1) {
125 @Override
126 public boolean activated(Player player) {
127 return true;
128 }
129 },
130 HEADBANG(13365, 2108, -1, -1) {
131 @Override
132 public boolean activated(Player player) {
133 return true;
134 }
135 },
136 CRY(161, 860, -1, -1) {
137 @Override
138 public boolean activated(Player player) {
139 return true;
140 }
141 },
142 BLOW_KISS(11100, 0x558, -1, -1) {
143 @Override
144 public boolean activated(Player player) {
145 return true;
146 }
147 },
148 PANIC(13362, 2105, -1, -1) {
149 @Override
150 public boolean activated(Player player) {
151 return true;
152 }
153 },
154 RASBERRY(13367, 2110, -1, -1) {
155 @Override
156 public boolean activated(Player player) {
157 return true;
158 }
159 },
160 CLAP(172, 865, -1, -1) {
161 @Override
162 public boolean activated(Player player) {
163 return true;
164 }
165 },
166 SALUTE(13369, 2112, -1, -1) {
167 @Override
168 public boolean activated(Player player) {
169 return true;
170 }
171 },
172 GOBLIN_BOW(13383, 0x84F, -1, -1) {
173 @Override
174 public boolean activated(Player player) {
175 return true;
176 }
177 },
178 GOBLIN_SALUTE(13384, 0x850, -1, -1) {
179 @Override
180 public boolean activated(Player player) {
181 return true;
182 }
183 },
184
185 GLASS_BOX(18717, 0x46B, -1, 1117) {
186 @Override
187 public boolean activated(Player player) {
188 return player.emoteUnlockable.contains(EmoteUnlockable.GLASS_BOX);
189 }
190 },
191 CLIMB_ROPE(18718, 0x46A, -1, 1118) {
192 @Override
193 public boolean activated(Player player) {
194 return player.emoteUnlockable.contains(EmoteUnlockable.CLIMB_ROPE);
195 }
196 },
197 LEAN(18719, 0x469, -1, 1119) {
198 @Override
199 public boolean activated(Player player) {
200 return player.emoteUnlockable.contains(EmoteUnlockable.LEAN);
201 }
202 },
203 GLASS_WALL(18720, 0x468, -1, 1120) {
204 @Override
205 public boolean activated(Player player) {
206 return player.emoteUnlockable.contains(EmoteUnlockable.GLASS_WALL);
207 }
208 },
209
210 IDEA(18700, 4276, 712, 1100) {
211 @Override
212 public boolean activated(Player player) {
213 return player.emoteUnlockable.contains(EmoteUnlockable.IDEA);
214 }
215 },
216 STOMP(18701, 4278, -1, 1101) {
217 @Override
218 public boolean activated(Player player) {
219 return player.emoteUnlockable.contains(EmoteUnlockable.STOMP);
220 }
221 },
222 FLAP(18702, 4280, -1, 1102) {
223 @Override
224 public boolean activated(Player player) {
225 return player.emoteUnlockable.contains(EmoteUnlockable.FLAP);
226 }
227 },
228 SLAP_HEAD(18703, 4275, -1, 1103) {
229 @Override
230 public boolean activated(Player player) {
231 return player.emoteUnlockable.contains(EmoteUnlockable.SLAP);
232 }
233 },
234 ZOMBIE_WALK(18704, 3544, -1, 1104) {
235 @Override
236 public boolean activated(Player player) {
237 return player.emoteUnlockable.contains(EmoteUnlockable.ZOMBIE_WALK);
238 }
239 },
240 ZOMBIE_DANCE(18705, 3543, -1, 1105) {
241 @Override
242 public boolean activated(Player player) {
243 return player.emoteUnlockable.contains(EmoteUnlockable.ZOMBIE_DANCE);
244 }
245 },
246 SCARED(18706, 2836, -1, 1106) {
247 @Override
248 public boolean activated(Player player) {
249 return player.emoteUnlockable.contains(EmoteUnlockable.SCARED);
250 }
251 },
252 RABBIT_HOP(18707, 6111, -1, 1107) {
253 @Override
254 public boolean activated(Player player) {
255 return player.emoteUnlockable.contains(EmoteUnlockable.BUNNY_HOP);
256 }
257 },
258 SIT_UP(18708, 2763, -1, 1108) {
259 @Override
260 public boolean activated(Player player) {
261 return player.emoteUnlockable.contains(EmoteUnlockable.SIT_UP);
262 }
263 },
264 PUSH_UP(18709, 2756, -1, 1109) {
265 @Override
266 public boolean activated(Player player) {
267 return player.emoteUnlockable.contains(EmoteUnlockable.PUSH_UP);
268 }
269 },
270 STAR_JUMP(18710, 2761, -1, 1110) {
271 @Override
272 public boolean activated(Player player) {
273 return player.emoteUnlockable.contains(EmoteUnlockable.JUMPING_JACK);
274 }
275 },
276 JOG(18711, 2764, -1, 1111) {
277 @Override
278 public boolean activated(Player player) {
279 return player.emoteUnlockable.contains(EmoteUnlockable.JOG);
280 }
281 },
282 ZOMBIE_HAND(18712, 4513, 320, 1112) {
283 @Override
284 public boolean activated(Player player) {
285 return player.emoteUnlockable.contains(EmoteUnlockable.DEMON_HAND);
286 }
287 },
288 HYPERMOBILE_DRINKER(18713, 7131, -1, 1113) {
289 @Override
290 public boolean activated(Player player) {
291 return player.emoteUnlockable.contains(EmoteUnlockable.DRINK);
292 }
293 },
294 AIR_GUITAR(18715, -1, 1239, 1115) {
295 @Override
296 public boolean activated(Player player) {
297 return player.emoteUnlockable.contains(EmoteUnlockable.GUITAR);
298 }
299 },
300 URI_TRANSFORM(18716, -1, -1, 1116) {
301 @Override
302 public boolean activated(Player player) {
303 return player.emoteUnlockable.contains(EmoteUnlockable.URI);
304 }
305 };
306
308 private final int button;
309
311 private final int animation;
312
314 private final int graphic;
315
317 private final int config;
318
320 Emote(int button, int animation, int graphic, int config) {
321 this.button = button;
322 this.animation = animation;
323 this.graphic = graphic;
324 this.config = config;
325 }
326
327 public static void skillcape(Player player) {
328 Item item = player.equipment.get(Equipment.CAPE_SLOT);
329
330 if (item == null) {
331 player.send(new SendMessage("You must be wearing a skillcape to perform this emote!"));
332 return;
333 }
334
335 Skillcape skillcape = Skillcape.forId(item.getId());
336
337 if (skillcape == null) {
338 player.send(new SendMessage("You must be wearing a skillcape to perform this emote!"));
339 return;
340 }
341 player.locking.lock(30);
342 execute(player, skillcape.getAnimation(), skillcape.getGraphic());
343 player.locking.unlock();
344 }
345
346 public static void execute(Player player, int animation, int graphic) {
347 player.locking.lock(30);
348 player.action.execute(new EmoteAction(player, animation, graphic), false);
349 player.locking.unlock();
350 }
351
353 public int getButton() {
354 return button;
355 }
356
358 public int getAnimation() {
359 return animation;
360 }
361
363 public int getGraphic() {
364 return graphic;
365 }
366
368 public int getConfig() {
369 return config;
370 }
371
373 public static Optional<Emote> forId(int button) {
374 return Arrays.stream(values()).filter(a -> a.button == button).findAny();
375 }
376}
static Optional< Emote > forId(int button)
Definition Emote.java:373
Emote(int button, int animation, int graphic, int config)
Definition Emote.java:320