RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.dialogue.impl.ClanmasterDialogue Class Reference

Handles the clan master dialogue. More...

Inheritance diagram for com.runehive.content.dialogue.impl.ClanmasterDialogue:
Collaboration diagram for com.runehive.content.dialogue.impl.ClanmasterDialogue:

Public Member Functions

void sendDialogues (DialogueFactory factory)
 Sends a player a dialogue.

Private Member Functions

void clanDefinition (DialogueFactory factory)
void clanInformation (DialogueFactory factory)
 The clan information dialogue.
void clanLevel (Player player)
 Displays all the clan level information.
void clanManagement (DialogueFactory factory)
 The clan management dialogue.
void clanPerks (DialogueFactory factory)
void clanTask (ClanChannel channel, DialogueFactory factory)
 The clan task dialogue.
void mainOptions (DialogueFactory factory)

Additional Inherited Members

Static Public Member Functions inherited from com.runehive.content.dialogue.Dialogue
static final boolean isDialogueButton (int button)
 Checks if the button triggered is an optional dialogue button.
Static Public Attributes inherited from com.runehive.content.dialogue.Dialogue
static final ImmutableList< Integer > DIALOGUE_BUTTONS = ImmutableList.of(2461, 2471, 2482, 2462, 2472, 2483, 2473, 2484, 2485, 2494, 2495, 2496, 2497, 2498)
 The action buttons responsible for dialogues.

Detailed Description

Handles the clan master dialogue.

Author
Daniel

Definition at line 25 of file ClanmasterDialogue.java.

Member Function Documentation

◆ clanDefinition()

void com.runehive.content.dialogue.impl.ClanmasterDialogue.clanDefinition ( DialogueFactory factory)
private

Definition at line 49 of file ClanmasterDialogue.java.

49 {
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.");
53 }

References com.runehive.content.dialogue.DialogueFactory.sendNpcChat().

Referenced by clanInformation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clanInformation()

void com.runehive.content.dialogue.impl.ClanmasterDialogue.clanInformation ( DialogueFactory factory)
private

The clan information dialogue.

Definition at line 43 of file ClanmasterDialogue.java.

43 {
44 factory.sendOption("What is a clan?", () -> clanDefinition(factory),
45 "What are clan perks?", () -> clanPerks(factory),
46 "Nevermind", factory::clear);
47 }

References clanDefinition(), clanPerks(), and com.runehive.content.dialogue.DialogueFactory.sendOption().

Referenced by sendDialogues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clanLevel()

void com.runehive.content.dialogue.impl.ClanmasterDialogue.clanLevel ( Player player)
private

Displays all the clan level information.

Definition at line 117 of file ClanmasterDialogue.java.

117 {
118 int size = ClanLevel.values().length;
119 for (int index = 0, string = 37111; index < size; index++) {
120 ClanLevel level = ClanLevel.values()[index];
121 String color = "<col=" + level.getColor() + ">";
122 String experience = "Experience: <col=7A6856>" + Utility.formatDigits(level.getExperience()) + "</col>";
123 String points = "Points: <col=7A6856>" + Utility.formatDigits(level.getPoints()) + "</col>";
124 player.send(new SendString(color + Utility.formatEnum(level.name()), string));
125 string++;
126 player.send(new SendString(experience + " <col=000000>|</col> " + points, string));
127 string++;
128 player.send(new SendString("", string));
129 string++;
130 }
131 player.send(new SendString("", 37107));
132 player.send(new SendString("Clan Levels Information", 37103));
133 player.send(new SendScrollbar(37110, 750));
134 player.send(new SendItemOnInterface(37199));
135 player.interfaceManager.open(37100);
136 }
val index

References com.runehive.util.Utility.formatDigits(), com.runehive.util.Utility.formatEnum(), com.runehive.content.clanchannel.content.ClanLevel.getColor(), com.runehive.content.clanchannel.content.ClanLevel.getExperience(), com.runehive.content.clanchannel.content.ClanLevel.getPoints(), com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.InterfaceManager.open(), and com.runehive.game.world.entity.mob.player.Player.send().

Referenced by sendDialogues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clanManagement()

void com.runehive.content.dialogue.impl.ClanmasterDialogue.clanManagement ( DialogueFactory factory)
private

The clan management dialogue.

Definition at line 65 of file ClanmasterDialogue.java.

65 {
66 Player player = factory.getPlayer();
67 ClanChannel channel = player.clanChannel;
68
69 if (channel == null) {
70 factory.sendNpcChat(3841, "You must be in a clan in order to do this!");
71 return;
72 }
73
74 Optional<ClanMember> member = channel.getMember(player.getName());
75
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.");
78 return;
79 }
80
81 factory.sendOption("View store", () -> Store.STORES.get("The Clanmaster's Store").open(player), "Manage tasks", () -> clanTask(channel, factory), "Nevermind", factory::clear);
82 }

References com.runehive.content.clanchannel.channel.ClanChannel.canManage(), com.runehive.game.world.entity.mob.player.Player.clanChannel, clanTask(), com.runehive.content.clanchannel.channel.ClanChannel.getMember(), com.runehive.content.clanchannel.channel.ClanChannel.getName(), com.runehive.game.world.entity.mob.player.Player.getName(), com.runehive.content.dialogue.DialogueFactory.getPlayer(), com.runehive.content.dialogue.DialogueFactory.sendNpcChat(), com.runehive.content.dialogue.DialogueFactory.sendOption(), and com.runehive.content.store.Store.STORES.

Referenced by sendDialogues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clanPerks()

void com.runehive.content.dialogue.impl.ClanmasterDialogue.clanPerks ( DialogueFactory factory)
private

Definition at line 55 of file ClanmasterDialogue.java.

55 {
56 factory.sendNpcChat(3841,
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.");
62 }

References com.runehive.content.dialogue.DialogueFactory.sendNpcChat().

Referenced by clanInformation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clanTask()

void com.runehive.content.dialogue.impl.ClanmasterDialogue.clanTask ( ClanChannel channel,
DialogueFactory factory )
private

The clan task dialogue.

Definition at line 85 of file ClanmasterDialogue.java.

85 {
86 ClanTask task = channel.getDetails().clanTask;
87 factory.sendOption("Task Information", () -> {
88 if (task == null) {
89 factory.sendStatement("Your clan currently does not have a task assigned!");
90 return;
91 }
92
93 factory.sendStatement("Your current task is to:", task.getName(channel));
94 }, "Obtain Clan Task", () -> {
95 if (task != null) {
96 factory.sendNpcChat(3841, "Your clan currently has a task assigned!", "Cancel or complete it to obtain another one.");
97 return;
98 }
99 factory.sendOption("Easy Task - <col=255>2 CP</col> Reward", () -> channel.receiveTask(Difficulty.EASY), "Medium Task - <col=255>3 CP</col> Reward", () -> channel.receiveTask(Difficulty.MEDIUM), "Hard Task - <col=255>5 CP</col> Reward", () -> channel.receiveTask(Difficulty.HARD));
100 }, "Cancel Clan Task (<col=FF2929>5 CP</col>)", () -> {
101 if (task == null) {
102 factory.sendStatement("Your clan currently does not have a task assigned!");
103 return;
104 }
105 if (channel.getDetails().points < 5) {
106 factory.sendStatement("You do not have enough points to cancel your task.", "Current CP: " + channel.getDetails().points);
107 return;
108 }
109 channel.getDetails().points -= 5;
110 channel.getDetails().taskAmount = -1;
111 channel.getDetails().clanTask = null;
112 channel.message("Our clan task was cancelled for 25 CP. We have <col=255>" + Utility.formatDigits(channel.getDetails().points) + "</col> remaining.");
113 }, "Nevermind", factory::clear);
114 }

References com.runehive.content.clanchannel.channel.ClanDetails.clanTask, com.runehive.util.Difficulty.EASY, com.runehive.util.Utility.formatDigits(), com.runehive.content.clanchannel.channel.ClanChannel.getDetails(), com.runehive.content.clanchannel.content.ClanTask.getName(), com.runehive.util.Difficulty.HARD, com.runehive.util.Difficulty.MEDIUM, com.runehive.content.clanchannel.channel.ClanChannel.message(), com.runehive.content.clanchannel.channel.ClanDetails.points, com.runehive.content.clanchannel.channel.ClanChannel.receiveTask(), com.runehive.content.dialogue.DialogueFactory.sendNpcChat(), com.runehive.content.dialogue.DialogueFactory.sendOption(), com.runehive.content.dialogue.DialogueFactory.sendStatement(), and com.runehive.content.clanchannel.channel.ClanDetails.taskAmount.

Referenced by clanManagement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mainOptions()

void com.runehive.content.dialogue.impl.ClanmasterDialogue.mainOptions ( DialogueFactory factory)
private

Definition at line 39 of file ClanmasterDialogue.java.

39 {
40 }

◆ sendDialogues()

void com.runehive.content.dialogue.impl.ClanmasterDialogue.sendDialogues ( DialogueFactory factory)

Sends a player a dialogue.

Parameters
factoryThe factory for this dialogue.

Reimplemented from com.runehive.content.dialogue.Dialogue.

Definition at line 28 of file ClanmasterDialogue.java.

28 {
29 Player player = factory.getPlayer();
30 factory.sendNpcChat(3841, "Ello mate!", "What can I do you for today?");
31 factory.sendOption("Information on Clans", () -> clanInformation(factory),
32 "World Clan List", () -> player.clanViewer.open(ClanViewer.ClanTab.OVERVIEW),
33 "Clan Management", () -> clanManagement(factory),
34 "Clan Levels", () -> clanLevel(factory.getPlayer()),
35 "Nevermind", factory::clear);
36 factory.execute();
37 }

References clanInformation(), clanLevel(), clanManagement(), com.runehive.game.world.entity.mob.player.Player.clanViewer, com.runehive.content.dialogue.DialogueFactory.execute(), com.runehive.content.dialogue.DialogueFactory.getPlayer(), com.runehive.content.clanchannel.content.ClanViewer.open(), com.runehive.content.clanchannel.content.ClanViewer.ClanTab.OVERVIEW, com.runehive.content.dialogue.DialogueFactory.sendNpcChat(), and com.runehive.content.dialogue.DialogueFactory.sendOption().

Here is the call graph for this function:

The documentation for this class was generated from the following file: