1package com.runehive.content.activity.impl.barrows;
3import com.runehive.content.activity.Activity;
4import com.runehive.content.activity.ActivityDeathType;
5import com.runehive.content.activity.ActivityType;
6import com.runehive.content.activity.panel.ActivityPanel;
7import com.runehive.content.dialogue.DialogueFactory;
8import com.runehive.content.event.impl.NpcInteractionEvent;
9import com.runehive.content.event.impl.ObjectInteractionEvent;
10import com.runehive.game.world.World;
11import com.runehive.game.world.entity.mob.Mob;
12import com.runehive.game.world.entity.mob.npc.Npc;
13import com.runehive.game.world.entity.mob.npc.NpcDeath;
14import com.runehive.game.world.entity.mob.player.Player;
15import com.runehive.game.world.items.Item;
16import com.runehive.game.world.position.Area;
17import com.runehive.game.world.position.Position;
18import com.runehive.net.packet.out.SendEntityHintArrow;
19import com.runehive.net.packet.out.SendMessage;
20import com.runehive.util.Utility;
40 if (
player.barrowKills[brother.ordinal()]) {
41 player.dialogueFactory.sendPlayerChat(
"I have already killed this brother.").execute();
45 player.dialogueFactory.sendPlayerChat(
"Maybe I should finish killing the other one first.").execute();
48 if (
player.hiddenBrother == brother &&
player.barrowsKillCount != 5) {
49 player.dialogueFactory.sendPlayerChat(
"I should return when I've killed the others.").execute();
51 }
else if (
player.hiddenBrother == brother &&
player.barrowsKillCount == 5) {
52 player.dialogueFactory.sendOption(
"Enter the tunnel.", () -> {
54 },
"No, I'm not ready yet.", () -> {
55 player.dialogueFactory.clear();
61 brotherNpc.speak(
"How dare you disturb my rest!");
85 player.barrowsKillCount += 1;
86 player.barrowKills[bro.ordinal()] =
true;
87 if (
player.barrowsKillCount == 1) {
127 player.barrowsKillCount = 0;
128 player.barrowKills =
new boolean[
BrotherData.values().length];
129 player.hiddenBrother =
null;
135 int killed =
player.barrowsKillCount;
138 String ahrim =
player.barrowKills[
BrotherData.
AHRIM.ordinal()] ?
"@red@Ahrim the Blighted" :
"@gre@Ahrim the Blighted";
139 String dharok =
player.barrowKills[
BrotherData.
DHAROK.ordinal()] ?
"@red@Dharok the Wretched" :
"@gre@Dharok the Wretched";
140 String guthan =
player.barrowKills[
BrotherData.
GUTHAN.ordinal()] ?
"@red@Guthan the Infested" :
"@gre@Guthan the Infested";
141 String karil =
player.barrowKills[
BrotherData.
KARIL.ordinal()] ?
"@red@Karil the Tainted" :
"@gre@Karil the Tainted";
142 String torag =
player.barrowKills[
BrotherData.
TORAG.ordinal()] ?
"@red@Torag the Corrupted" :
"@gre@Torag the Corrupted";
143 String verac =
player.barrowKills[
BrotherData.
VERAC.ordinal()] ?
"@red@Verac the Defiled" :
"@gre@Verac the Defiled";
144 ActivityPanel.
update(
player, percentage,
"Barrows",
new Item(19629, 0),
"Killed: <col=FF5500>" + killed +
"</col> - Remaining: <col=FF5500>" + (total - killed) +
"</col>", ahrim, dharok, guthan, karil, torag, verac);
154 if (
event.getOpcode() == 0 &&
event.getNpc().id == 1671) {
157 factory.
sendNpcChat(1671,
"Hello #name,",
"would you like me to reset your barrows?");
160 factory.
sendNpcChat(1671,
"I have reset your barrows!");
161 },
"No thanks", factory::execute);
170 int id =
event.getObject().getId();
173 if (
player.barrowsKillCount == 6) {
174 if (
player.inventory.getFreeSlots() < 5) {
175 player.dialogueFactory.sendPlayerChat(
"I should free up some inventory slots first.").execute();
180 player.send(
new SendMessage(
"You have completed the barrows minigame, well done!"));
182 }
else if (
player.barrowsKillCount == 5) {
186 brotherNpc.speak(
"How dare you disturb my slumber!");
188 brotherNpc.owner =
player;
Activity(int cooldown, int instance)
Constructs a new SequencedMinigame object.
void add(Mob mob)
Adds a mob to the activity.
boolean clickNpc(Player player, NpcInteractionEvent event)
void summon(BrotherData brother)
void start()
Starts the next activity stage.
boolean canTeleport(Player player)
Called when the player attempts to teleport.
void move(Position position)
void onDeath(Mob mob)
Called when the player die.
void onLogout(Player player)
Called when the player logs out.
void finish()
Finishes the activity.
void cleanup()
Cleans up the activity when finished.
ActivityDeathType deathType()
void update()
The update method.
static Barrows create(Player player)
boolean clickObject(Player player, ObjectInteractionEvent event)
void onRegionChange(Player player)
Called when the player changes region.
static void generateRewards(Player player)
static BrotherData getHiddenBrother(Player player)
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.
Represents a factory class that contains important functions for building dialogues.
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
final DialogueFactory sendNpcChat(int id, String... lines)
Appends an NpcDialogue to the current dialogue chain.
final DialogueFactory sendOption(String option1, Runnable action1, String option2, Runnable action2)
Appends the OptionDialogue onto the current dialogue chain.
Represents the game world.
static void schedule(Task task)
Submits a new event.
static final int DEFAULT_INSTANCE
abstract boolean equals(Object obj)
final boolean isNpc()
Check if an entity is an npc.
final boolean isPlayer()
Check if an entity is a player.
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.
Handles checking if mobs are in a certain area.
static boolean inBarrows(Entity 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.
int getNpcId()
Gets the npc id of the barrows brother.
static BrotherData getBarrowsBrother(Npc mob)