RuneHive-Game
Loading...
Searching...
No Matches
ConstructionDialogue.java
Go to the documentation of this file.
1package com.runehive.content.dialogue.impl;
2
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.content.dialogue.Dialogue;
5import com.runehive.content.dialogue.DialogueFactory;
6import com.runehive.content.dialogue.Expression;
7import com.runehive.content.skill.impl.construction.BuildableMap;
8
9public class ConstructionDialogue extends Dialogue {
10
11 private final int id = 5419;
12
13 @Override
14 public void sendDialogues(DialogueFactory factory) {
15 Player player = factory.getPlayer();
16
17 factory.sendNpcChat(id, Expression.HAPPY, "Hello #name, how may I assist you?").sendOption("I would like to purchase a house (<col=ff0000>1m coins</col>)", () -> {
18 factory.onAction(() -> {
19 player.house.purchase();
20 });
21
22 }, "I want to change my house location", () -> {
23
24 factory.onAction(() -> {
25 factory.sendNpcChat(id, Expression.HAPPY, "Be advised, changing home location will result", "in you <col=ff0000>losing</col> all house object.").sendOption("Small cave (100,000gp)", () -> {
26 factory.onAction(() -> {
28 });
29
30 }, "Throne room (15,000,000gp)", () -> {
31 factory.onAction(() -> {
33 });
34 }).execute();
35 });
36
37 }, "Nevermind", () -> {
38 factory.onAction(() -> {
39 player.interfaceManager.close();
40 });
41
42 }).execute();
43 }
44}
Represents a factory class that contains important functions for building dialogues.
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 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.
This class represents a character controlled by a player.
Definition Player.java:125
Represents the expressions of entities for dialogue.