1package com.runehive.game.action.impl;
3import com.runehive.Config;
4import com.runehive.content.skill.impl.magic.teleport.TeleportationData;
5import com.runehive.game.Animation;
6import com.runehive.game.Graphic;
7import com.runehive.game.action.Action;
8import com.runehive.game.action.ConsecutiveAction;
9import com.runehive.game.action.policy.WalkablePolicy;
10import com.runehive.game.world.entity.mob.Mob;
11import com.runehive.game.world.entity.mob.UpdateFlag;
12import com.runehive.game.world.position.Position;
13import com.runehive.net.packet.out.SendMessage;
14import com.runehive.net.packet.out.SendString;
43 if (
getMob().isPlayer() &&
getMob().getPlayer().isTeleblocked()) {
45 getMob().getPlayer().message(
"You are currently under the affects of a teleblock spell and can not teleport!");
66 if (
action.getMob().isPlayer()) {
67 action.getMob().getPlayer().send(
new SendMessage(
"You can't teleport home while in combat!"));
77 action.getMob().inTeleport =
true;
80 action.getMob().movement.reset();
81 type.getStartAnimation().ifPresent(
action.getMob()::animate);
82 type.getStartGraphic().ifPresent(
action.getMob()::graphic);
84 if (
type.lockMovement()) {
85 action.getMob().locking.lock();
95 type.getEndAnimation().ifPresent(
action.getMob()::animate);
102 action.getMob().inTeleport =
true;
103 action.getMob().teleporting =
true;
105 if (
action.getMob().isPlayer()) {
115 type.getEndGraphic().ifPresent(
action.getMob()::graphic);
116 type.getEndAnimation().ifPresent(
action.getMob()::animate);
118 if (
type.getEndAnimation().isPresent() ||
type.getEndGraphic().isPresent()) {
130 action.getMob().inTeleport =
false;
138 getMob().inTeleport =
false;
139 getMob().teleporting =
false;
142 getMob().getPlayer().pvpInstance =
false;
144 if (
getMob().getPlayer().pet !=
null) {
152 return "teleport_action";
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 an action an entity can execute.
void addFirst(Consumer< Action< T > > action)
Adds an action to the actions list.
ConsecutiveAction(T mob)
Generates a new ConsecutiveAction object.
void add(Consumer< Action< T > > action)
Adds an action to the actions list.
final TeleportationData type
The teleportType.
void start(Action< Mob > action)
void reset(Action< Mob > action)
WalkablePolicy getWalkablePolicy()
void end(Action< Mob > action)
TeleportAction(Mob entity, Position position, TeleportationData type, Runnable onDestination)
Constructs a new TeleportAction object.
void move(Action< Mob > action)
final Position position
The teleport position.
final Runnable onDestination
The destination randomevent.
boolean valid(Action< Mob > action)
void onCancel(boolean logout)
void startTablet(Action< Mob > action)
static final int DEFAULT_INSTANCE
Represents a single tile on the game world.
The OutgoingPacket that sends a message to a Players chatbox in the client.
The OutgoingPacket that sends a string to a Players itemcontainer in the client.
Created by Daniel on 2018-02-07.
A queue policy determines whether the action can occur while walking.
NON_WALKABLE
This indicates actions cannot occur while walking.