1package com.runehive.content.dialogue.impl;
3import com.runehive.content.clanchannel.ClanMember;
4import com.runehive.content.clanchannel.channel.ClanChannel;
5import com.runehive.content.clanchannel.content.ClanLevel;
6import com.runehive.content.clanchannel.content.ClanTask;
7import com.runehive.content.clanchannel.content.ClanViewer;
8import com.runehive.content.dialogue.Dialogue;
9import com.runehive.content.dialogue.DialogueFactory;
10import com.runehive.content.store.Store;
11import com.runehive.game.world.entity.mob.player.Player;
12import com.runehive.net.packet.out.SendItemOnInterface;
13import com.runehive.net.packet.out.SendScrollbar;
14import com.runehive.net.packet.out.SendString;
15import com.runehive.util.Difficulty;
16import com.runehive.util.Utility;
18import java.util.Optional;
30 factory.
sendNpcChat(3841,
"Ello mate!",
"What can I do you for today?");
35 "Nevermind", factory::clear);
45 "What are clan perks?", () ->
clanPerks(factory),
46 "Nevermind", factory::clear);
50 factory.
sendNpcChat(3841,
"A clan is a united group or syndicate of players",
51 "who work together to complete various tasks depending on the",
"clan type. Clans members can identify one another",
52 "by the purple dot on the minimap or their clan tag.");
57 "I offer many perks and items to be used for clans.",
58 "Clan perks affect all online clan members when used.",
59 "These perks vary from rewarding everyone with",
60 "random experience in a random skill to having a drop modifier");
61 factory.
sendNpcChat(3841,
"for a certain amount of time.");
69 if (channel ==
null) {
70 factory.
sendNpcChat(3841,
"You must be in a clan in order to do this!");
76 if (!member.isPresent() || !channel.
canManage(member.get())) {
77 factory.
sendNpcChat(3841,
"You do not have the proper authorization to manage",
"the clan " + channel.
getName() +
"! If you want to manage your own clan",
"please join your own clan and then speak to me again.");
81 factory.
sendOption(
"View store", () ->
Store.
STORES.get(
"The Clanmaster's Store").open(player),
"Manage tasks", () ->
clanTask(channel, factory),
"Nevermind", factory::clear);
89 factory.
sendStatement(
"Your clan currently does not have a task assigned!");
94 },
"Obtain Clan Task", () -> {
96 factory.
sendNpcChat(3841,
"Your clan currently has a task assigned!",
"Cancel or complete it to obtain another one.");
100 },
"Cancel Clan Task (<col=FF2929>5 CP</col>)", () -> {
102 factory.
sendStatement(
"Your clan currently does not have a task assigned!");
113 },
"Nevermind", factory::clear);
119 for (
int index = 0,
string = 37111; index < size; index++) {
121 String color =
"<col=" + level.
getColor() +
">";
126 player.
send(
new SendString(experience +
" <col=000000>|</col> " + points,
string));
Handles the clan chat channel.
Optional< ClanMember > getMember(String name)
boolean canManage(ClanMember member)
void receiveTask(Difficulty difficulty)
void message(Object... messages)
Handles messaging all the members in the clan channel.
int points
The clan channel points.
Handles viewing clan information.
Represents a factory class that contains important functions for building dialogues.
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
Player getPlayer()
The player that owns this factory.
final DialogueFactory sendNpcChat(int id, String... lines)
Appends an NpcDialogue to the current dialogue chain.
final DialogueFactory sendStatement(String... lines)
Appends a StatementDialogue 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 an abstract dialogue, in which extending classes will be able to construct and send dialog...
Handles the clan master dialogue.
void clanManagement(DialogueFactory factory)
The clan management dialogue.
void clanInformation(DialogueFactory factory)
The clan information dialogue.
void sendDialogues(DialogueFactory factory)
Sends a player a dialogue.
void clanLevel(Player player)
Displays all the clan level information.
void clanDefinition(DialogueFactory factory)
void mainOptions(DialogueFactory factory)
void clanPerks(DialogueFactory factory)
void clanTask(ClanChannel channel, DialogueFactory factory)
The clan task 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.
void open(int identification)
Opens an interface for the player.
This class represents a character controlled by a player.
String getName()
Gets the name of this entity.
final InterfaceManager interfaceManager
final ClanViewer clanViewer
void send(OutgoingPacket encoder)
The OutgoingPacket that sends a string to a Players itemcontainer in the client.
Handles miscellaneous methods.
static String formatDigits(final int amount)
Formats digits for integers.
static String formatEnum(final String string)
Formats name of enum.
Handles the clan levels (based off the total experience earned).
int getPoints()
Gets the points rewarded for leveling up.
long getExperience()
Gets the experience of the clan level.
String getColor()
Gets the clan level color.
Holds all the clan task data.
String getName(ClanChannel channel)
Created by Daniel on 2017-11-27.