RuneHive-Game
Loading...
Searching...
No Matches
NieveDialogue.java
Go to the documentation of this file.
1package com.runehive.content.dialogue.impl;
2
3import com.runehive.content.skill.impl.slayer.SlayerOfferings;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.content.dialogue.Dialogue;
6import com.runehive.content.dialogue.DialogueFactory;
7import com.runehive.content.dialogue.Expression;
8import com.runehive.content.skill.impl.slayer.SlayerTab;
9
10public class NieveDialogue extends Dialogue {
11
12
13 @Override
14 public void sendDialogues(DialogueFactory factory) {
15 Player player = factory.getPlayer();
16
17 factory.sendNpcChat(6797, Expression.HAPPY, "Hello adventurer, how may I help you?").sendOption("Offer slayer items", () -> sell(factory), "Open slayer manager", () -> factory.onAction(() -> player.slayer.open(SlayerTab.MAIN)), "Nevermind", () -> factory.onAction(player.interfaceManager::close));
18 factory.execute();
19 }
20
21 private void sell(DialogueFactory factory) {
22 factory.sendOption("What do I get for my offerings?", () -> {
23 factory.sendNpcChat(6797, "You will get slayer experience and points!");
24 }, "What items can be offered?", () -> {
25 factory.sendStatement("Ensouled heads", "Ancient shards & Dark Totem pieces");
26 }, "Offer all items", () -> {
27 factory.onAction(() -> SlayerOfferings.offer(factory.getPlayer()));
28 }, "Nevermind", factory::clear);
29 }
30
31}
Represents a factory class that contains important functions for building dialogues.
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
final DialogueFactory onAction(Runnable action)
Sets an action so this action can be executed after dialogues are done.
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...
Definition Dialogue.java:11
void sendDialogues(DialogueFactory factory)
Sends a player a dialogue.
void open(SlayerTab tab)
Opens the slayer itemcontainer.
Definition Slayer.java:66
This class represents a character controlled by a player.
Definition Player.java:125
Represents the expressions of entities for dialogue.
MAIN
The main itemcontainer - all the general information.