1package com.runehive.content.activity.inferno;
3import com.runehive.content.ActivityLog;
4import com.runehive.content.activity.Activity;
5import com.runehive.content.activity.ActivityListener;
6import com.runehive.content.activity.ActivityType;
7import com.runehive.content.activity.panel.ActivityPanel;
8import com.runehive.content.pet.PetData;
9import com.runehive.content.pet.Pets;
10import com.runehive.game.Animation;
11import com.runehive.game.Graphic;
12import com.runehive.game.world.entity.mob.Mob;
13import com.runehive.game.world.entity.mob.npc.Npc;
14import com.runehive.game.world.entity.mob.player.Player;
15import com.runehive.game.world.items.Item;
16import com.runehive.game.world.position.Area;
17import com.runehive.game.world.position.Position;
18import com.runehive.net.packet.out.SendMessage;
19import com.runehive.util.RandomUtils;
20import com.runehive.util.Utility;
22import java.util.HashSet;
23import java.util.Optional;
41 public final Set<Npc>
npcs =
new HashSet<>();
62 player.dialogueFactory.sendNpcChat(5567,
"Welcome to the Inferno, #name.",
63 "There are a total of 69 waves, TzKal-Zuk being the last.",
64 "Use your activity panel (bottom left tab) for wave information.",
"Good luck!").execute();
65 minigame.time = System.currentTimeMillis();
77 if (dead.
isNpc() &&
npcs.contains(dead)) {
78 if (dead.
id == 3162) {
81 for (
int index = 0; index < 2; index++) {
84 Npc roc =
new Npc(763, position);
117 if (
player.locking.locked()) {
124 for (
int id :
wave.getMonster()) {
138 player.message(
"WAVE 69 is here!!");
155 player.dialogueFactory.sendNpcChat(5567,
"You have defeated Inferno, I am most impressed!",
156 "Please accept this gift, young thug.").execute();
159 player.message(
"<img=9>You now have @red@" +
rewards +
" Inferno Tickets!");
166 "You have completed the Inferno activity. Final time: @red@" +
Utility.
getTime(
time) +
"</col>."));
174 player.message(
"<img=9>You now have @red@" +
rewards +
" Inferno Tickets!");
175 player.dialogueFactory.sendNpcChat(5567,
"Better luck next time!",
"Take these points as a reward.").execute();
182 npcs.forEach(this::remove);
189 "completed the Inferno",
"activity!");
197 "</col>Monsters Left: <col=FF5500>" +
npcs.size(),
212 player.send(
new SendMessage(
"You have lost your current progress as you have teleported."));
228 public Optional<? extends ActivityListener<? extends Activity>>
getListener() {
Activity(int cooldown, int instance)
Constructs a new SequencedMinigame object.
final void resetCooldown()
Resets the remaining ticks to the cached cooldown ticks.
int instance
The activity instance level.
final void pause()
Sets the cooldown flag to PAUSE.
void add(Mob mob)
Adds a mob to the activity.
Inferno(Player player, int instance)
Constructs a new Inferno object for a player and an instance.
final InfernoCavesListener listener
The combat listener to add for all mobs.
void onRegionChange(Player player)
Called when the player changes region.
void cleanup()
Cleans up the activity when finished.
final Set< Npc > npcs
A set of npcs in this activity.
int rewards
The amount of rewards the player has acquired.
final Player player
The player in the Inferno.
void start()
Starts the next activity stage.
void finish()
Finishes the activity.
boolean completed
The activity completed flag.
InfernoWaveData.WaveData wave
The current wave of this activity.
static Inferno create(Player player)
void onLogout(Player player)
Called when the player logs out.
void handleDeath(Mob dead)
Handles what happens to a mob when they die in the activity.
long time
The time it took to complete the activity.
Optional<? extends ActivityListener<? extends Activity > > getListener()
Gets an Optional of the ActivityListener for this activity.
boolean canTeleport(Player player)
Called when the player attempts to teleport.
void update()
The update method.
Handles the activity panel.
static void update(Player player, int amount, String title, String footer, String... strings)
Sends all the information for the activity panel.
static void clear(Player player)
Clears the activity panel.
Handles spawning, rewarding and picking up of pets.
static void onReward(Player player, int item, int chance)
Handles calculating the chance of a player receiving a skilling pet.
Class that models a single animation used by an entity.
static final Animation RESET
Represents a single graphic that can be used by entities.
static final Graphic RESET
abstract boolean equals(Object obj)
void unlock()
Unlocks the mob.
void animate(int animation)
void face(GameObject object)
Sets the client update flag to face a certain direction.
final boolean isNpc()
Check if an entity is an npc.
final boolean isPlayer()
Check if an entity is a player.
Optional< Graphic > graphic
Represents a non-player character in the in-game world.
Combat< Npc > getCombat()
The combat of the mob.
This class represents a character controlled by a player.
The container class that represents an item that can be interacted with.
Handles checking if mobs are in a certain area.
static boolean inInferno(Entity entity)
Represents a single tile on the game world.
The OutgoingPacket that sends a message to a Players chatbox in the client.
A static-util class that provides additional functionality for generating pseudo-random numbers.
static< T > T random(T[] array)
Pseudo-randomly retrieves a element from array.
Handles miscellaneous methods.
static int random(int bound)
static String formatDigits(final int amount)
Formats digits for integers.
static double getPercentageAmount(int progress, int total)
Gets a percentage amount.
static Position[] getInnerBoundaries(Position position, int width, int length)
static String getTime()
Gets the current server time and formats it.
Holds all activity types that are timed.
static WaveData getNext(int current)