RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
WellOfGoodwillDialogue.java
1package com.osroyale.content.dialogue.impl;
2
3import com.osroyale.content.WellOfGoodwill;
4import com.osroyale.content.dialogue.Dialogue;
5import com.osroyale.content.dialogue.DialogueFactory;
6import com.osroyale.util.Utility;
7
37
38public class WellOfGoodwillDialogue extends Dialogue {
39
40 @Override
41 public void sendDialogues(DialogueFactory factory) {
42 factory.sendStatement("Greetings "+factory.getPlayer().getName()+".", "How may the well be of assistance today?").sendOption("How does this work?", () -> {
43 factory.onAction(() -> {
44 factory.sendStatement(
45 "Players may all contribute as much gold as they desire",
46 "towards the well. In return, once the well reaches",
47 Utility.formatDigits(WellOfGoodwill.MAXIMUM) + " the entire server will be granted").sendStatement(
48 "double experience for 30minutes.",
49 "After those 30 minutes the well will need to be replenished.",
50 "Well data is saved and stores during server restarts and shutdowns.",
51 "Ensuring safety for contributors."
52 ).execute();
53 });
54 }, "Check time left", () -> {
55 if (!WellOfGoodwill.isActive()) {
56 factory.sendStatement("").sendStatement("The well is not active!").execute();
57 return;
58 }
59 factory.sendStatement("").sendStatement("Time left: " + (30 - WellOfGoodwill.activeTime) + " minutes").execute();
60
61 }, "Check current status", () -> {
62 WellOfGoodwill.open(factory.getPlayer());
63 }, "Nevermind", factory::clear).execute();
64 }
65}
static void open(Player player)
final DialogueFactory sendStatement(String... lines)
final DialogueFactory sendOption(String option1, Runnable action1, String option2, Runnable action2)
final DialogueFactory onAction(Runnable action)
static String formatDigits(final int amount)
Definition Utility.java:78