1package com.osroyale.content.skill.impl.agility.obstacle.impl;
3import com.osroyale.content.skill.impl.agility.obstacle.ObstacleInteraction;
4import com.osroyale.game.task.Task;
5import com.osroyale.game.world.World;
6import com.osroyale.game.world.entity.mob.player.Player;
7import com.osroyale.game.world.entity.skill.Skill;
8import com.osroyale.game.world.object.ObjectDirection;
9import com.osroyale.game.world.position.Position;
10import com.osroyale.game.world.object.GameObject;
11import com.osroyale.net.packet.out.SendMessage;
13public interface WildernessDoorInteraction
extends ObstacleInteraction {
17 default void start(Player player) {
21 default boolean canExecute(Player player,
int level) {
22 if (player.skills.getLevel(Skill.AGILITY) < level) {
23 player.dialogueFactory.sendStatement(
"You need an agility level of " + level +
" to do this!").execute();
26 GameObject
object = player.attributes.get(
"AGILITY_OBJ", GameObject.class);
27 return object !=
null &&
object.getDirection() == ObjectDirection.SOUTH;
31 default void onExecution(Player player, Position start, Position end) {
32 boolean entering = player.getPosition().equals(
new Position(2998, 3916));
33 Position destination = entering ?
new Position(2998, 3930) : new Position(2998, 3917);
34 Position finalDestination = entering ?
new Position(2998, 3931) : new Position(2998, 3916);
39 player.face(finalDestination);
41 World.schedule(
new Task(2) {
45 public void execute() {
46 if (player.getPosition().equals(destination)) {
47 player.mobAnimation.reset();
54 player.movement.walk(finalDestination);
57 if (player.getPosition().equals(finalDestination)) {
61 player.send(
new SendMessage(
"Welcome the the wilderness agility course. Be careful :)"));
76 player.movement.walk(destination);
79 player.mobAnimation.setWalk(762);
80 player.mobAnimation.setStand(762);
97 default void onCancellation(Player player) {