Quote from Venom on April 24, 2022, 5:11 pmThis simple line of code will make it so that if any of the NPC's in your world don't have a predetermined conversation pathway, they're able to use the responses listed in "Dialogues.RANDOM_RESPONSES". I'm using Nocturne SRC for testing, but I'm sure with a little brain power you can apply this to your own revision!
Find NPCHandler.java and look for:
Code:default: // player.getPackets().sendGameMessage("Nothing // interesting happens.");
add after.
Code:player.getDialogueManager().startDialogue("SimpleNPCMessage", npc.getId(), Dialogue.RANDOM_RESPONSES[(int)(System.currentTimeMillis() % Dialogue.RANDOM_RESPONSES.length)]);
Annnnd, here's an example of my Random_Responses array:
Code:public static final String[] RANDOM_RESPONSES = { "Good day to you, adventurer.", "Well met, adventurer.", "Well, hello there." , "Get away from me" , "*nods head*", "*shakes hand*", "*stares*", "My mother always told me not to talk to strangers", "What's that!? *points*", "Hi", "Goodbye", "I used to be an adventure too", "You remind me of great uncle Auntie", "I'm gonna need a drink first", "I knew an ogre once... oh wait, THAT was Grandma!", "That tree talks to you if you eat enough of these.", "Did you pass a bag of green herbs on the road?", "Did you happen to find my flowers?", "I fucked a fairy once... *sips beer*", "Add me on Xbox", "I'm looking for the Muffin Man..", "Have you seen the Muffin Man?"};
This simple line of code will make it so that if any of the NPC's in your world don't have a predetermined conversation pathway, they're able to use the responses listed in "Dialogues.RANDOM_RESPONSES". I'm using Nocturne SRC for testing, but I'm sure with a little brain power you can apply this to your own revision!
Find NPCHandler.java and look for:
default:
// player.getPackets().sendGameMessage("Nothing
// interesting happens.");
add after.
player.getDialogueManager().startDialogue("SimpleNPCMessage", npc.getId(), Dialogue.RANDOM_RESPONSES[(int)(System.currentTimeMillis() % Dialogue.RANDOM_RESPONSES.length)]);
Annnnd, here's an example of my Random_Responses array:
public static final String[] RANDOM_RESPONSES = { "Good day to you, adventurer.", "Well met, adventurer.",
"Well, hello there." , "Get away from me" , "*nods head*", "*shakes hand*", "*stares*", "My mother always told me not to talk to strangers",
"What's that!? *points*", "Hi", "Goodbye", "I used to be an adventure too", "You remind me of great uncle Auntie", "I'm gonna need a drink first",
"I knew an ogre once... oh wait, THAT was Grandma!", "That tree talks to you if you eat enough of these.", "Did you pass a bag of green herbs on the road?", "Did you happen to find my flowers?",
"I fucked a fairy once... *sips beer*", "Add me on Xbox", "I'm looking for the Muffin Man..", "Have you seen the Muffin Man?"};