1package com.runehive.content.activity.impl.magearena;
3import com.runehive.content.ActivityLog;
4import com.runehive.content.activity.Activity;
5import com.runehive.content.activity.ActivityDeathType;
6import com.runehive.content.activity.ActivityType;
7import com.runehive.content.activity.panel.ActivityPanel;
8import com.runehive.content.skill.impl.magic.teleport.Teleportation;
9import com.runehive.content.skill.impl.magic.teleport.TeleportationData;
10import com.runehive.game.Animation;
11import com.runehive.game.Graphic;
12import com.runehive.game.world.World;
13import com.runehive.game.world.entity.combat.hit.Hit;
14import com.runehive.game.world.entity.mob.Direction;
15import com.runehive.game.world.entity.mob.Mob;
16import com.runehive.game.world.entity.mob.npc.Npc;
17import com.runehive.game.world.entity.mob.npc.NpcDeath;
18import com.runehive.game.world.entity.mob.player.Player;
19import com.runehive.game.world.items.Item;
20import com.runehive.game.world.pathfinding.TraversalMap;
21import com.runehive.game.world.position.Area;
22import com.runehive.game.world.position.Position;
23import com.runehive.net.packet.out.SendMessage;
24import com.runehive.util.Utility;
26import java.util.HashMap;
27import java.util.HashSet;
58 private Map<Integer, Npc>
monsters =
new HashMap<>();
90 Set<Position>
meteors =
new HashSet<>();
99 if (
player.getPosition().equals(meteor))
110 for (
int index = 0; index < 3; index++) {
111 int id = index == 0 ? 1157 : (index == 1 ? 1160 : 1158);
122 if (!monster.getCombat().isAttacking(
player)) {
123 monster.getCombat().attack(
player);
127 monster.speak(
"ARGHHH!");
157 player.completedMageArena =
true;
160 player.mageArenaPoints +=
points;
191 String clock =
"Time: <col=FF5500>" +
Utility.
getTime(System.currentTimeMillis() -
player.gameRecord.time) +
"</col>";
192 String remain =
"Monsters Left: <col=FF5500>" + (3 -
killed) +
"</col>";
193 String gained =
"Points Gained: <col=FF5500>" +
points +
"</col>";
final int cooldown
The sequencing cooldown.
Activity(int cooldown, int instance)
Constructs a new SequencedMinigame object.
final void resetCooldown()
Resets the remaining ticks to the cached cooldown ticks.
static final int FINISH
The 'finish' cooldown id.
int instance
The activity instance level.
int getInstance()
Gets this activity's instance level.
void add(Mob mob)
Adds a mob to the activity.
void finish()
Finishes the activity.
final Player player
The player instance.
int killed
The amount of npcs the player has killed.
Stage stage
Activity completion flag.
Map< Integer, Npc > monsters
Holds all the monsters of the activity.
int points
The amount of points the player has been awarded.
void meteors()
Handles the meteors.
Position getAvailablePosition()
Gets the next best available position.
void onDeath(Mob mob)
Called when the player die.
void cleanup()
Cleans up the activity when finished.
void onRegionChange(Player player)
Called when the player changes region.
ActivityDeathType deathType()
void update()
The update method.
void onLogout(Player player)
Called when the player logs out.
MageArena(Player player, int instance)
Constructs a new MageArena.
static MageArena create(Player player)
Creates a new MageArena activity.
boolean canTeleport(Player player)
Called when the player attempts to teleport.
static final Position[] BOUNDARIES
The spawn boundaries.
void start()
Starts the next activity stage.
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 a player teleporting.
static void activateOverride(Mob mob, Position position, TeleportationData teleport)
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.
static void sendGraphic(Graphic graphic, Position position, int instance)
Sends a graphic to the world.
A Hit object holds the damage amount and hitsplat data.
void animate(int animation)
final boolean isPlayer()
Check if an entity is a player.
Optional< Graphic > graphic
Represents a non-player character in the in-game world.
This class represents a character controlled by a player.
The container class that represents an item that can be interacted with.
Contains traversal data for a set of regions.
static boolean isTraversable(Position from, Direction direction, int size)
Tests whether or not a specified position is traversable in the specified direction.
Handles checking if mobs are in a certain area.
static boolean inkolodionArena(Entity entity)
Represents a single tile on the game world.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Handles miscellaneous methods.
static int random(int bound)
static double getPercentageAmount(int progress, int total)
Gets a percentage amount.
static< T > T randomElement(Collection< T > collection)
Picks a random element out of any array type.
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.
The stages of the activity.
Created by Daniel on 2018-02-07.
Represents the enumerated directions an entity can walk or face.