1package com.osroyale.content.activity.inferno;
3import com.osroyale.content.ActivityLog;
4import com.osroyale.content.activity.Activity;
5import com.osroyale.content.activity.ActivityListener;
6import com.osroyale.content.activity.ActivityType;
7import com.osroyale.content.activity.panel.ActivityPanel;
8import com.osroyale.content.pet.PetData;
9import com.osroyale.content.pet.Pets;
10import com.osroyale.game.Animation;
11import com.osroyale.game.Graphic;
12import com.osroyale.game.world.entity.mob.Mob;
13import com.osroyale.game.world.entity.mob.npc.Npc;
14import com.osroyale.game.world.entity.mob.player.Player;
15import com.osroyale.game.world.items.Item;
16import com.osroyale.game.world.position.Area;
17import com.osroyale.game.world.position.Position;
18import com.osroyale.net.packet.out.SendMessage;
19import com.osroyale.util.RandomUtils;
20import com.osroyale.util.Utility;
22import java.util.HashSet;
23import java.util.Optional;
66 private final Player player;
69 private boolean completed;
78 public final Set<Npc>
npcs =
new HashSet<>();
84 private final InfernoCavesListener listener =
new InfernoCavesListener(
this);
90 private Inferno(
Player player,
int instance) {
99 player.dialogueFactory.
sendNpcChat(5567,
"Welcome to the Inferno, #name.",
100 "There are a total of 69 waves, TzKal-Zuk being the last.",
101 "Use your activity panel (bottom left tab) for wave information.",
"Good luck!").
execute();
102 minigame.time = System.currentTimeMillis();
103 minigame.
add(player);
109 void handleDeath(
Mob dead) {
110 if (dead.
isPlayer() && dead.equals(player)) {
114 if (dead.
isNpc() &&
npcs.contains(dead)) {
115 if (dead.id == 3162) {
118 for (
int index = 0; index < 2; index++) {
121 Npc roc =
new Npc(763, position);
124 roc.getCombat().attack(player);
125 dead.animate(Animation.RESET,
true);
126 dead.graphic(Graphic.RESET,
true);
133 rewards += Utility.random(250, 1000);
134 if (
npcs.isEmpty()) {
135 wave = InfernoWaveData.WaveData.getNext(wave.ordinal());
138 player.send(
new SendMessage(
"You have finished the activity!"));
140 player.send(
new SendMessage(
"The next wave will commence soon."));
154 if (player.locking.locked()) {
161 for (
int id : wave.getMonster()) {
162 Npc npc =
new Npc(
id, RandomUtils.random(boundaries));
175 player.message(
"WAVE 69 is here!!");
180 public static void finalWave() {
189 player.move(
new Position(3086, 3501, 0));
192 player.dialogueFactory.sendNpcChat(5567,
"You have defeated Inferno, I am most impressed!",
193 "Please accept this gift, young thug.").execute();
195 player.inventory.addOrDrop(
new Item(7775, rewards));
196 player.message(
"<img=9>You now have @red@" + rewards +
" Inferno Tickets!");
197 if (
Utility.random(1, 3) == 3) {
198 player.inventory.addOrDrop(
new Item(20211));
200 player.inventory.addOrDrop(
new Item(290));
203 "You have completed the Inferno activity. Final time: @red@" +
Utility.
getTime(time) +
"</col>."));
210 player.inventory.addOrDrop(
new Item(7775, rewards));
211 player.message(
"<img=9>You now have @red@" + rewards +
" Inferno Tickets!");
212 player.dialogueFactory.sendNpcChat(5567,
"Better luck next time!",
"Take these points as a reward.").execute();
219 npcs.forEach(this::remove);
226 "completed the Inferno",
"activity!");
230 if (progress >= 100 && !completed)
234 "</col>Monsters Left: <col=FF5500>" +
npcs.size(),
246 if (!
Area.inInferno(player)) {
249 player.send(
new SendMessage(
"You have lost your current progress as you have teleported."));
265 public Optional<? extends ActivityListener<? extends Activity>>
getListener() {
266 return Optional.of(listener);
final void resetCooldown()
Activity(int cooldown, int instance)
void onLogout(Player player)
boolean canTeleport(Player player)
void onRegionChange(Player player)
Optional<? extends ActivityListener<? extends Activity > > getListener()
static void clear(Player player)
static void update(Player player, int amount, String title, String footer, String... strings)
final DialogueFactory sendNpcChat(int id, String... lines)
final DialogueFactory execute()
static void onReward(Player player, int item, int chance)
void move(Position position)
void face(GameObject object)
Combat< Npc > getCombat()
static String formatDigits(final int amount)
static double getPercentageAmount(int progress, int total)