1package com.runehive.content.skill.impl.agility.obstacle;
3import com.runehive.Config;
4import com.runehive.content.achievement.AchievementHandler;
5import com.runehive.content.achievement.AchievementKey;
6import com.runehive.content.activity.randomevent.RandomEventHandler;
7import com.runehive.content.clanchannel.content.ClanTaskKey;
8import com.runehive.content.skill.impl.agility.Agility;
9import com.runehive.game.Animation;
10import com.runehive.game.task.Task;
11import com.runehive.game.world.World;
12import com.runehive.game.world.entity.mob.MobAnimation;
13import com.runehive.game.world.entity.mob.UpdateFlag;
14import com.runehive.game.world.entity.mob.data.LockType;
15import com.runehive.game.world.entity.mob.player.Player;
16import com.runehive.game.world.entity.skill.Skill;
17import com.runehive.game.world.items.Item;
18import com.runehive.game.world.items.ground.GroundItem;
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.Utility;
24import java.util.concurrent.TimeUnit;
53 private boolean started =
false;
54 private Obstacle nextObstacle = next;
57 protected void onSchedule() {
74 if (nextObstacle.
getNext() ==
null) {
79 nextObstacle = nextObstacle.
getNext();
81 if (nextObstacle !=
null) {
89 if (nextObstacle.
getNext() !=
null) {
91 nextObstacle = nextObstacle.
getNext();
108 player.
send(
new SendMessage(
"<col=C60DDE>There appears to be a wild Grace mark near you."));
115 protected void onCancel(
boolean logout) {
128 int i = player.
attributes.
get(
"AGILITY_FLAGS", Integer.class) | (1 << ordinal);
145 player.mobAnimation = ANIMATION;
149 Position nextPosition = nextObstacle !=
null ? nextObstacle.
getEnd() : end;
151 player.
move(nextPosition);
169 default boolean rewards(
Player player, String course,
int flags,
float bonus) {
170 int flag = player.
attributes.
get(
"AGILITY_FLAGS", Integer.class);
171 if ((flag & flags) != flags) {
176 player.
send(
new SendMessage(
"You have completed the " + course +
" course and receive 5 tickets."));
The class that contains setting-related constants for the server.
static final double AGILITY_MODIFICATION
The experience modification for agility.
Handles the achievements.
static void activate(Player player, AchievementKey achievement)
Activates the achievement for the individual player.
static void trigger(Player player)
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
final DialogueFactory sendStatement(String... lines)
Appends a StatementDialogue to the current dialogue chain.
Created by Daniel on 2017-11-02.
static final int ARDOUGNE_FLAGS
static final int WILDERNESS_FLAGS
static final int SEERS_FLAGS
static final int BARBARIAN_FLAGS
static final int GNOME_FLAGS
Class that models a single animation used by an entity.
A game representing a cyclic unit of work.
Represents the game world.
static void schedule(Task task)
Submits a new event.
boolean locked()
Checks if the mob is locked.
MobAnimation mobAnimation
final SkillManager skills
final EnumSet< UpdateFlag > updateFlags
final GenericAttributes attributes
void animate(int animation)
void move(Position position)
Moves the mob to a set position.
boolean isRunning()
Checks if any running flag is set.
void setRunningToggled(boolean runToggled)
Sets the run toggled flag.
void activateSkilling(int amount)
This class represents a character controlled by a player.
final Inventory inventory
void forClan(Consumer< ClanChannel > action)
String getName()
Gets the name of this entity.
DialogueFactory dialogueFactory
void send(OutgoingPacket encoder)
Combat< Player > getCombat()
The combat of the mob.
final PlayerAssistant playerAssistant
Represents a trainable and usable skill.
static final int AGILITY
The agility skill id.
void addExperience(int id, double experience)
Adds experience to a given skill.
int getLevel(int id)
Gets the level of a skill.
The container class that represents an item that can be interacted with.
void addOrDrop(List< Item > items)
Attempts to deposit an item to the players inventory, if there is no space it'll bank the item instea...
Represents a single Ground item on the world map.
static GroundItem create(Player player, Item item)
Creates a new GroundItem object for a player and an item.
Handles checking if mobs are in a certain area.
static boolean inArdougneCourse(Interactable entity)
static boolean inSeersCourse(Interactable entity)
static boolean inBarbarianCourse(Interactable entity)
static boolean inWildernessCourse(Interactable entity)
static boolean inGnomeCourse(Interactable entity)
static boolean inWildernessResource(Interactable entity)
Represents a single tile on the game world.
boolean equals(Object obj)
The OutgoingPacket that sends a message to a Players chatbox in the client.
Handles miscellaneous methods.
static int random(int bound)
public< K, E > E get(K key)
Gets a generic attribute.
public< K, E > void set(K key, E attribute)
Sets a generic attribute.
ObstacleInteraction getInteraction()
Holds all the lock types.
default void start(Player player)
void onExecution(Player player, Position start, Position end)
default boolean canExecute(Player player, int level)
default boolean rewards(Player player, String course, int flags, float bonus)
default void execute(Player player, Obstacle next, Position start, Position end, int level, float experience, int ordinal)
default void onCancellation(Player player)