1package com.runehive.content.dialogue.impl;
3import com.runehive.content.dialogue.Dialogue;
4import com.runehive.content.dialogue.DialogueFactory;
5import com.runehive.content.dialogue.Expression;
6import com.runehive.content.store.Store;
7import com.runehive.game.world.World;
8import com.runehive.game.world.entity.mob.player.Player;
9import com.runehive.net.packet.out.SendInputAmount;
10import com.runehive.net.packet.out.SendURL;
11import com.runehive.util.Utility;
25 factory.
sendOption(
"Would you want to know what are some of the benefits of voting are?", () -> {
27 factory.
sendNpcChat(7481,
"Voting results in attracting new players!",
"In return, you'll receive",
"vote points that you can use to buy",
"items from the vote store.");
28 },
"Exchange vote token", () -> {
30 },
"Show me your voting store!", () -> {
31 Store.
STORES.get(
"osroyale Vote Store").open(player);
32 },
"I would like to vote to support this great server!", () -> {
35 },
"Nevermind, I don't want to do anything for this server.", () -> {
51 if (amount > tokenAmount)
59 player.votePoints += amount;
Represents a factory class that contains important functions for building dialogues.
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
void clear()
Clears the current dialogue chain.
final DialogueFactory sendPlayerChat(String... lines)
Appends a PlayerDialogue to the current dialogue chain.
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 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 vote dialogue.
void exchange(DialogueFactory factory, int amount)
Handles redeeming vote tokens.
void sendDialogues(DialogueFactory factory)
Sends a player a 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.
Represents the game world.
static void schedule(Task task)
Submits a new event.
This class represents a character controlled by a player.
final Inventory inventory
String getName()
Gets the name of this entity.
void send(OutgoingPacket encoder)
final int computeAmountForId(int id)
Computes the total quantity of the Items in this container with id.
boolean remove(Item item)
Attempts to withdraw item from this container.
The OutgoingPacket that opens a URL from client.
Handles miscellaneous methods.
static String formatDigits(final int amount)
Formats digits for integers.
Represents the expressions of entities for dialogue.