1package com.runehive.content.activity.impl.warriorguild;
3import com.runehive.Config;
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.collectionlog.CollectionLog;
9import com.runehive.content.collectionlog.CollectionLogData;
10import com.runehive.content.dialogue.impl.KamfreenaDialogue;
11import com.runehive.content.event.impl.ItemOnObjectInteractionEvent;
12import com.runehive.content.event.impl.NpcInteractionEvent;
13import com.runehive.content.event.impl.ObjectInteractionEvent;
14import com.runehive.content.event.impl.PickupItemInteractionEvent;
15import com.runehive.content.skillcape.SkillCape;
16import com.runehive.content.store.Store;
17import com.runehive.game.Animation;
18import com.runehive.game.UpdatePriority;
19import com.runehive.game.task.Task;
20import com.runehive.game.task.impl.WarriorGuildCyclopEvent;
21import com.runehive.game.world.World;
22import com.runehive.game.world.entity.mob.Mob;
23import com.runehive.game.world.entity.mob.data.LockType;
24import com.runehive.game.world.entity.mob.npc.Npc;
25import com.runehive.game.world.entity.mob.npc.NpcDeath;
26import com.runehive.game.world.entity.mob.player.Player;
27import com.runehive.game.world.items.Item;
28import com.runehive.game.world.position.Area;
29import com.runehive.game.world.position.Position;
30import com.runehive.net.packet.out.SendEntityHintArrow;
31import com.runehive.net.packet.out.SendMessage;
32import com.runehive.util.Utility;
34import java.util.Optional;
79 boolean walk_state =
player.movement.isRunningToggled();
86 player.movement.setRunningToggled(
false);
97 protected void execute() {
100 player.send(
new SendMessage(
"You place the armour pieces inside the animator..."));
101 }
else if (count == 2) {
102 player.send(
new SendMessage(
"The animator begins to hum, something appears to be working..."));
104 }
else if (count == 7) {
118 protected void onCancel(
boolean logout) {
119 player.blockFace =
false;
122 player.movement.setRunningToggled(walk_state);
148 int object =
event.getObject().getId();
149 if (
object == 16671) {
153 if (
object == 24303) {
157 if (
object == 24306 ||
object == 24309) {
160 if (!
player.inventory.contains(
new Item(8851, 25))) {
161 player.dialogueFactory.sendStatement(
"You need at least 25 warrior guild tokens to enter.").execute();
180 int npc =
event.getNpc().id;
195 player.dialogueFactory.sendStatement(
"You already have an animated armour spawned!").execute();
199 int object =
event.getObject().getId();
201 if (
object != 23955) {
205 Item used =
event.getItem();
208 if (armourIndex == -1) {
214 if (!animator.isPresent()) {
218 if (!
player.getPosition().equals(animator.get().standPosition)) {
219 player.dialogueFactory.sendStatement(
"Please stand in front of the animator!").execute();
223 summon(armourIndex, animator.get());
249 player.send(
new SendMessage(
"The animated armour vanishes as you have leave the region, taking your armour"));
278 ActivityPanel.
update(
player, progress,
"Warrior Guild", defender,
"Cyclops will be dropping:",
"<col=FF5500>" + defender.
getName(),
"Chance: <col=FF5500>1/20</col>");
The class that contains setting-related constants for the server.
static final Position DEFAULT_POSITION
The default, i.e.
Activity(int cooldown, int instance)
Constructs a new SequencedMinigame object.
void add(Mob mob)
Adds a mob to the activity.
Handles the warrior guild activity combat listener.
final WarriorGuildActivityListener listener
The warrior guild activity listener for this activity.
WarriorGuild(Player player)
Contructs a new WarriorGuild.
static WarriorGuild create(Player player)
Handes creating a new warrior guild activity for the player.
void onLogout(Player player)
Called when the player logs out.
ActivityDeathType deathType()
boolean useItem(Player player, ItemOnObjectInteractionEvent event)
final Player player
The player in the warrior guild activity.
boolean clickNpc(Player player, NpcInteractionEvent event)
void update()
The update method.
void summon(int index, AnimatorData animator)
Handles summoning the animated npc.
void end()
Handles ending the activity.
void cleanup()
Cleans up the activity when finished.
boolean clickObject(Player player, ObjectInteractionEvent event)
void start()
Starts the next activity stage.
WarriorGuildState state
The warrior guild state for this activity.
void sequence()
Sequences the activity.
Optional< WarriorGuildActivityListener > getListener()
Gets an Optional of the ActivityListener for this activity.
boolean canTeleport(Player player)
Called when the player attempts to teleport.
void finish()
Finishes the activity.
boolean pickupItem(Player player, PickupItemInteractionEvent event)
void onDeath(Mob mob)
Called when the player die.
Npc animated
The animated npc.
void onRegionChange(Player player)
Called when the player changes region.
This class handles util methods for the Warrior's activity.
static final int[] ANIMATED
The warrior guild animated npcs.
static int getDefender(Player player)
Gets the defender index to drop for the player.
static int contains(Player player, int itemId)
Checks if the player has a complete armour set to activate the animator.
static int getDefenderIndex(Player player)
Gets the defender tier index.
static final int[][] ARMOUR
The warrior guild animator armour data .
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.
static void logItem(Player player, CollectionLogData data, int item, int amount)
Handles the kamfreena dialogue.
The class which holds support for further abstraction for shops.
static Map< String, Store > STORES
A mapping of each shop by it's name.
Class that models a single animation used by an entity.
A game representing a cyclic unit of work.
An randomevent which handles the warrior guild cyclops randomevent.
Represents the game world.
static void schedule(Task task)
Submits a new event.
static final int DEFAULT_INSTANCE
void move(Position position)
Moves the mob to a set position.
final boolean isNpc()
Check if an entity is an npc.
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.
final int getId()
Gets the identification of this item.
Handles checking if mobs are in a certain area.
static boolean inWarriorGuild(Interactable 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 double getPercentageAmount(int progress, int total)
Gets a percentage amount.
Created by Daniel on 2018-01-28.
Holds all activity types that are timed.
final Position walkToPosition
The animator walk to position.
final Position objectPosition
The animator object position.
static Optional< AnimatorData > getAnimator(Position position)
Gets the animator data based on the object position.
Data of all possible warrior guild states.
static boolean isEquipped(Player player, SkillCape cape)
Represents different priorities for updating.
Holds all the lock types.