From f22b9553c641b74eb1b9df963e9626183a3bc4c1 Mon Sep 17 00:00:00 2001 From: Olivier <75835176+JohnsonMichaels123@users.noreply.github.com> Date: Mon, 15 Feb 2021 08:17:51 -0800 Subject: [PATCH] Added Random Dialogue for Man and Woman NPCs (#476) * Update DialogueHandler.java * Update NpcActions.java * Update DialogueHandler.java --- .../game/dialogues/DialogueHandler.java | 22 +++++++++++++++++++ .../com/rebotted/game/npcs/NpcActions.java | 14 ++++++++++++ 2 files changed, 36 insertions(+) diff --git a/2006Redone Server/src/main/java/com/rebotted/game/dialogues/DialogueHandler.java b/2006Redone Server/src/main/java/com/rebotted/game/dialogues/DialogueHandler.java index 366b5727..ce9281ed 100644 --- a/2006Redone Server/src/main/java/com/rebotted/game/dialogues/DialogueHandler.java +++ b/2006Redone Server/src/main/java/com/rebotted/game/dialogues/DialogueHandler.java @@ -7400,6 +7400,28 @@ public class DialogueHandler { player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "Enjoy your stay here. May it be spiritually uplifting!"); player.getDialogueHandler().endDialogue(); break; + case 3869: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.DEFAULT, "Hello, how's it going?"); + player.nextChat = 3870; + break; + case 3870: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "I'm fine how are you?"); + player.nextChat = 3871; + break; + case 3871: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.DEFAULT, "Very well thank you."); + player.getDialogueHandler().endDialogue(); + break; + case 3872: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.DEFAULT, "Hello, how's it going?"); + player.nextChat = 3873; + break; + case 3873: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "Hello there! Nice weather we've been having."); + player.getDialogueHandler().endDialogue(); + break; + + } } public void chatboxText(String text, String text1, String text2, diff --git a/2006Redone Server/src/main/java/com/rebotted/game/npcs/NpcActions.java b/2006Redone Server/src/main/java/com/rebotted/game/npcs/NpcActions.java index 12e6343c..08454f0b 100644 --- a/2006Redone Server/src/main/java/com/rebotted/game/npcs/NpcActions.java +++ b/2006Redone Server/src/main/java/com/rebotted/game/npcs/NpcActions.java @@ -38,6 +38,20 @@ public class NpcActions { } } switch (npcType) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: //1-3 Man, 4-6 Woman - We are playing random dialogues here + if (Misc.random(10) <= 5) + { + player.getDialogueHandler().sendDialogues(3869, npcType); + } + else { + player.getDialogueHandler().sendDialogues(3872, npcType); + } + break; case 389 : //thormac player.getDialogueHandler().sendDialogues(3574, npcType); break;