1package com.runehive.content.activity.impl.fightcaves;
3import com.runehive.content.ActivityLog;
4import com.runehive.content.activity.Activity;
5import com.runehive.content.activity.ActivityDeathType;
6import com.runehive.content.activity.ActivityListener;
7import com.runehive.content.activity.ActivityType;
8import com.runehive.content.activity.panel.ActivityPanel;
9import com.runehive.content.pet.PetData;
10import com.runehive.content.pet.Pets;
11import com.runehive.game.Animation;
12import com.runehive.game.Graphic;
13import com.runehive.game.world.World;
14import com.runehive.game.world.entity.mob.Mob;
15import com.runehive.game.world.entity.mob.npc.Npc;
16import com.runehive.game.world.entity.mob.npc.NpcDeath;
17import com.runehive.game.world.entity.mob.player.Player;
18import com.runehive.game.world.items.Item;
19import com.runehive.game.world.position.Area;
20import com.runehive.game.world.position.Position;
21import com.runehive.net.packet.out.SendMessage;
22import com.runehive.util.RandomUtils;
23import com.runehive.util.Utility;
25import java.util.HashSet;
26import java.util.Optional;
42 public final Set<Npc>
npcs =
new HashSet<>();
60 player.dialogueFactory.sendNpcChat(2180,
"Welcome to the Fight Caves, #name.",
"There are a total of 15 waves, Tz-Tok Jad being the last.",
"Use your activity panel (bottom left tab) for wave information.",
"Good luck!").execute();
73 if (dead.
isNpc() &&
npcs.contains(dead)) {
74 if (dead.
id == 2191) {
77 for (
int index = 0; index < 2; index++) {
79 Npc TzKet =
new Npc(2192, position);
110 if (
player.locking.locked()) {
117 for (
int id :
wave.getMonster()) {
146 player.dialogueFactory.sendNpcChat(2180,
"You have defeated Tztok-Jad, I am most impressed!",
"Please accept this gift, young thug.").execute();
159 player.dialogueFactory.sendNpcChat(2180,
"Better luck next time!",
"Take these tokkuls as a reward.").execute();
166 npcs.forEach(this::remove);
211 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.
boolean canTeleport(Player player)
Called when the player attempts to teleport.
void cleanup()
Cleans up the activity when finished.
FightCaves(Player player, int instance)
Constructs a new FightCaves object for a player and an instance.
final Set< Npc > npcs
A set of npcs in this activity.
ActivityDeathType deathType()
final Player player
The player in the cave.
void onRegionChange(Player player)
Called when the player changes region.
void start()
Starts the next activity stage.
final FightCavesListener listener
The combat listener to add for all mobs.
void finish()
Finishes the activity.
void handleDeath(Mob dead)
Handles what happens to a mob when they die in the activity.
TzhaarData.WaveData wave
The current wave of this activity.
void onDeath(Mob mob)
Called when the player die.
static FightCaves create(Player player)
Optional<? extends ActivityListener<? extends Activity > > getListener()
Gets an Optional of the ActivityListener for this activity.
void update()
The update method.
int tokkuls
The amount of tokkuls the player has acquired.
void onLogout(Player player)
Called when the player logs out.
boolean completed
The activity completed flag.
The FightCaves combat listener for all mobs in the activity.
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
Represents the game world.
static void schedule(Task task)
Submits a new event.
abstract boolean equals(Object obj)
void animate(int animation)
void move(Position position)
Moves the mob to a set position.
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 inFightCaves(Interactable 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.
Created by Daniel on 2018-01-28.
Holds all activity types that are timed.
static WaveData getNext(int current)