1package com.runehive.content.skill.impl;
3import com.runehive.net.packet.out.SendMessage;
4import com.runehive.game.action.policy.WalkablePolicy;
5import com.runehive.game.world.entity.mob.Mob;
6import com.runehive.content.skill.SkillAction;
7import com.runehive.game.world.items.Item;
8import com.runehive.game.world.items.ItemDefinition;
9import com.runehive.game.world.position.Position;
10import com.runehive.util.RandomGen;
12import java.util.Optional;
45 getMob().getPlayer().send(
new SendMessage(
"You do not have any " + name +
" in your inventory."));
56 double boost = (factor * 0.01);
SkillAction(Mob mob, Optional< Position > position, int delay, boolean instant)
Creates a new Action randomevent.
final Optional< Position > position
The position we should face.
abstract double experience()
The experience given from this action.
abstract int skill()
The skill we should hand to experience to.
final WalkablePolicy getWalkablePolicy()
Gets the WalkablePolicy of this action.
DestructionSkillAction(Mob mob, Optional< Position > position, boolean instant)
Creates a new DestructionSkillAction.
static final int SUCCESS_FACTOR
abstract double successFactor()
boolean prioritized()
Determines if this action is prioritized.
void onDestruct(boolean success)
The method executed upon destruction of the item.
abstract Item destructItem()
The item that will be removed upon destruction.
final void onExecute()
The method which is called on intervals of the specified #delay;.
boolean canRun()
Determines if the task can be ran.
T getMob()
Gets the player.
final T mob
The Mob associated with this ActionEvent.
synchronized final void cancel()
Cancels all subsequent executions.
final boolean instant
If execution happens instantly upon being scheduled.
Represents all of an in-game Item's attributes.
static ItemDefinition get(int id)
Gets an item definition.
String getName()
Gets the item name.
The container class that represents an item that can be interacted with.
The OutgoingPacket that sends a message to a Players chatbox in the client.
The ThreadLocalRandom wrapper that provides additional functionality for generating pseudo-random num...
A queue policy determines whether the action can occur while walking.
NON_WALKABLE
This indicates actions cannot occur while walking.