Introduced new dialogue engine compatible with spinoff revision 578 project
This commit is contained in:
@@ -1,129 +0,0 @@
|
||||
package content.region.misthalin.lumbridge.dialogue;
|
||||
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.dialogue.FacialExpression;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.plugin.Initializable;
|
||||
import core.game.world.GameWorld;
|
||||
|
||||
/**
|
||||
* Represents the dialogue plugin used for the donie npc.
|
||||
* @author 'Vexia
|
||||
* @version 1.00
|
||||
*/
|
||||
@Initializable
|
||||
public final class DonieDialogue extends DialoguePlugin {
|
||||
|
||||
/**
|
||||
* Constructs a new {@code DonieDialogue} {@code Object}.
|
||||
*/
|
||||
public DonieDialogue() {
|
||||
/**
|
||||
* empty.
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code DonieDialogue} {@code Object}.
|
||||
* @param player the player.
|
||||
*/
|
||||
public DonieDialogue(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialoguePlugin newInstance(Player player) {
|
||||
return new DonieDialogue(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hello there, can I help you?");
|
||||
stage = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(int interfaceId, int buttonId) {
|
||||
switch (stage) {
|
||||
case 0:
|
||||
interpreter.sendOptions("Select an Option", "Where am I?", "How are you today?", "Your shoe lace is untied.");
|
||||
stage = 1;
|
||||
break;
|
||||
case 1:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Where am I?");
|
||||
stage = 10;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "How are you today?");
|
||||
stage = 20;
|
||||
break;
|
||||
case 3:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Your shoe lace is untied.");
|
||||
stage = 30;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "This is the town of Lumbridge my friend.");
|
||||
stage = 11;
|
||||
break;
|
||||
case 11:
|
||||
interpreter.sendOptions("Select an Option", "Where am I?", "How are you today?", "Your shoe lace is untied.");
|
||||
stage = 1;
|
||||
break;
|
||||
case 20:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Aye, not too bad thank you. Lovely weather in", "" + GameWorld.getSettings().getName() + " this fine day.");
|
||||
stage = 21;
|
||||
break;
|
||||
case 21:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Weather?");
|
||||
stage = 22;
|
||||
break;
|
||||
case 22:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Yes weather, you know.");
|
||||
stage = 23;
|
||||
break;
|
||||
case 23:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "The state or condition of the atmosphere at a time and", "place, with respect to variables such as temperature,", "moisture, wind velocity, and barometric pressure.");
|
||||
stage = 24;
|
||||
break;
|
||||
case 24:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "...");
|
||||
stage = 25;
|
||||
break;
|
||||
case 25:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Not just a pretty face eh? Ha ha ha.");
|
||||
stage = 26;
|
||||
break;
|
||||
case 26:
|
||||
end();
|
||||
break;
|
||||
case 30:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "No it's not!");
|
||||
stage = 31;
|
||||
break;
|
||||
case 31:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No you're right. I have nothing to back that up.");
|
||||
stage = 32;
|
||||
break;
|
||||
case 32:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Fool! Leave me alone!");
|
||||
stage = 33;
|
||||
break;
|
||||
case 33:
|
||||
end();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIds() {
|
||||
return new int[] { 2238 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package content.region.misthalin.lumbridge.dialogue
|
||||
|
||||
import core.api.*
|
||||
import core.game.dialogue.*
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.world.GameWorld
|
||||
import core.game.world.GameWorld.settings
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
@Initializable
|
||||
class DonieDialogue (player: Player? = null) : DialoguePlugin(player) {
|
||||
override fun newInstance(player: Player): DialoguePlugin {
|
||||
return DonieDialogue(player)
|
||||
}
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
openDialogue(player, DonieDialogueFile(), npc)
|
||||
return false
|
||||
}
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.DONIE_2238)
|
||||
}
|
||||
}
|
||||
|
||||
class DonieDialogueFile : DialogueLabeller() {
|
||||
override fun addConversation() {
|
||||
assignToIds(NPCs.DONIE_2238)
|
||||
|
||||
npc(ChatAnim.FRIENDLY, "Hello there, can I help you?")
|
||||
options(
|
||||
DialogueOption("whereami", "Where am I?", expression = ChatAnim.THINKING),
|
||||
DialogueOption("howareyou", "How are you today?"),
|
||||
DialogueOption("shoelace", "Your shoe lace is untied."),
|
||||
)
|
||||
|
||||
label("whereami")
|
||||
npc("This is the town of Lumbridge my friend.")
|
||||
|
||||
label("howareyou")
|
||||
npc("Aye, not too bad thank you. Lovely weather in", ""+ (GameWorld.settings?.name ?: "2009Scape") +" this fine day.")
|
||||
player("Weather?")
|
||||
npc("Yes weather, you know.")
|
||||
npc("The state or condition of the atmosphere at a time and", "place, with respect to variables such as temperature,", "moisture, wind velocity, and barometric pressure.")
|
||||
player("...")
|
||||
npc("Not just a pretty face eh? Ha ha ha.")
|
||||
|
||||
label("shoelace")
|
||||
npc(ChatAnim.ANGRY, "No it's not!")
|
||||
player("No you're right. I have nothing to back that up.")
|
||||
npc(ChatAnim.ANGRY, "Fool! Leave me alone!")
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user