1package com.runehive.content.triviabot;
3import com.runehive.Config;
4import com.runehive.content.achievement.AchievementHandler;
5import com.runehive.content.achievement.AchievementKey;
6import com.runehive.game.world.World;
7import com.runehive.game.world.entity.mob.player.Player;
8import com.runehive.game.world.entity.mob.player.PlayerRight;
9import com.runehive.net.packet.out.SendMessage;
10import com.runehive.util.Utility;
12import java.util.Arrays;
13import java.util.Collections;
14import java.util.HashSet;
17import static com.runehive.game.world.items.containers.bank.VaultCurrency.BLOOD_MONEY;
18import static com.runehive.game.world.items.containers.bank.VaultCurrency.COINS;
30 private final static Set<TriviaBotData>
DATA =
new HashSet<>();
40 private static final String
COLOR =
"<col=354CE6>";
67 player.
send(
new SendMessage(
COLOR +
"<icon=21> TriviaBot: </col>There is no question currently assigned!"));
71 player.
send(
new SendMessage(
COLOR +
"<icon=21> TriviaBot: </col>You think you're funny, don't you? Guess what? You ain't."));
74 if (Arrays.stream(
CURRENT.getAnswers()).anyMatch(a -> a.equalsIgnoreCase(
answer))) {
79 player.
speak(
"Golly gee! I just entered a wrong trivia answer!");
81 player.
send(
new SendMessage(
COLOR +
"<icon=21> TriviaBot: </col>Sorry, the answer you have entered is incorrect! Try again!"));
93 player.answeredTrivias += 1;
97 player.answeredTrivias += 1;
The class that contains setting-related constants for the server.
static final String[] BAD_STRINGS
Strings that are classified as bad.
Handles the achievements.
static void activate(Player player, AchievementKey achievement)
Activates the achievement for the individual player.
Manages the trivia bot system.
static void declare()
Declares the TriviaBot data.
static final Set< TriviaBotData > DATA
Holds all the bot data.
static void assign()
Assigns a new question.
static TriviaBotData CURRENT
The current question/answer set.
static final String COLOR
Color of the TriviaBot messages.
static void answer(Player player, String answer)
Handles player answering the question.
static void answered(Player player, String answer)
Handles player answering the question successfully.
void speak(String forceChat)
Sets the mob's forced chat.
This class represents a character controlled by a player.
final BankVault bankVault
void send(OutgoingPacket encoder)
boolean triviaBot
The TriviaBot flag.
boolean add(VaultCurrency currency, long amount)
Adds an amount into the player's bank vault with no checks.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Handles miscellaneous methods.
static int random(int bound)
static String formatDigits(final int amount)
Formats digits for integers.
Holds all the trivia bot data.
Holds all the player right data.
static String getColor(PlayerRight right)
static boolean isIronman(Player player)
Checks if the player is an ironman.