Hi guys, this is my first time making a dialogue. The issue is, it doesn't continue ;c
Been trying to fix it for a couple hours ;s
Yes, I added the basic things in Dialoguehandler.java
SpiritTreeD.java
Code:
package com.rs.game.player.dialogues;
import com.rs.cache.loaders.NPCDefinitions;
import com.rs.game.player.content.SpiritTree;
public class SpiritTreeD extends Dialogue {
public static int npcId = 3637;
@Override
public void start() {
sendEntityDialogue(
SEND_3_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"If you are a friend of the gnome people, you are a friend",
"of mine. Do you wish to travel, or do you wish to ask",
"about the evil tree?" }, IS_NPC, npcId, 9827);
}
@Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
sendDialogue(SEND_3_OPTIONS,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"What would you like to ask about?", "Travel.",
"Evil tree.", "Nothing." });
stage = 1;
} else if (stage == 1) {
if (componentId == 1) {
sendEntityDialogue(SEND_2_TEXT_CHAT, new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"Gnome-friend, would you like to travel to the home of the"
+ "tree gnomes?" }, IS_NPC, npcId, 9827);
stage = 2;
} else if (componentId == 2) {
sendEntityDialogue(
SEND_1_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"The taint of the evil tree is currently not on the land." },
IS_NPC, npcId, 9827);
stage = 3;
} else if (componentId == 3) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"Nothing, thanks." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 7;
}
} else if (stage == 3) {
sendEntityDialogue(
SEND_2_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"I can help you to find the where it will spawn, but my"
+ "knowledge outside of the anima mundi is limited." },
IS_NPC, npcId, 9827);
stage = 4;
} else if (stage == 4) {
sendEntityDialogue(
SEND_1_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"It can be found close to a collection of yew trees." },
IS_NPC, npcId, 9827);
stage = 5;
} else if (stage == 5) {
sendEntityDialogue(SEND_3_OPTIONS,
new String[] { player.getDisplayName(), "Select an option",
"What is this 'evil tree'?, Goodbye." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 9;
} else if (stage == 2) {
sendEntityDialogue(SEND_3_OPTIONS,
new String[] { player.getDisplayName(), "Select an option",
"Yes please.", "No, thank you." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 6;
} else if (stage == 6) {
if (componentId == 1) {
sendEntityDialogue(
SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), "Yes please." },
IS_PLAYER, player.getIndex(), 9827);
stage = 8;
}
} else if (componentId == 2) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), "No, thank you." },
IS_PLAYER, player.getIndex(), 9827);
stage = 7;
} else if (stage == 7) {
end();
} else if (stage == 8) {
SpiritTree.sendSpiritTreeTeleport(player,
SpiritTree.MAIN_SPIRIT_TREE);
end();
} else if (stage == 9) {
if (componentId == 1) {
sendEntityDialogue(
SEND_4_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"It is an abomination of nature that must be destroyed as",
"quickly as possible. We do not know where it will appear,",
"but, when it does, you should go out to it immediately and help",
"out!" }, IS_NPC, npcId, 9827);
stage = 7;
}
if (componentId == 2) {
sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"Goodbye." }, IS_NPC, npcId, 9827);
stage = 7;
}
}
}
@Override
public void finish() {
}
}
MainSpiritTreeD.java
Code:
package com.rs.game.player.dialogues;
import com.rs.cache.loaders.NPCDefinitions;
import com.rs.game.player.content.SpiritTree;
public class MainSpiritTreeD extends Dialogue {
public static int npcId = 3637;
@Override
public void start() {
sendEntityDialogue(
SEND_3_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"If you are a friend of the gnome people, you are a friend",
"of mine. Do you wish to travel, or do you wish to ask",
"about the evil tree?" }, IS_NPC, npcId, 9827);
}
@Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
sendDialogue(SEND_3_OPTIONS,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"What would you like to ask about?", "Travel.",
"Evil tree.", "Nothing." });
stage = 1;
} else if (stage == 1) {
if (componentId == 1) {
sendEntityDialogue(SEND_2_TEXT_CHAT, new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"You can travel to trees related to me. Where do you"
+ "wish to travel, whisperer?" }, IS_NPC, npcId, 9827);
stage = 8;
} else if (componentId == 2) {
sendEntityDialogue(
SEND_1_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"The taint of the evil tree is currently not on the land." },
IS_NPC, npcId, 9827);
stage = 3;
} else if (componentId == 3) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"Nothing, thanks." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 7;
}
} else if (stage == 3) {
sendEntityDialogue(
SEND_2_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"I can help you to find the where it will spawn, but my"
+ "knowledge outside of the anima mundi is limited." },
IS_NPC, npcId, 9827);
stage = 4;
} else if (stage == 4) {
sendEntityDialogue(
SEND_1_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"It can be found close to a collection of yew trees." },
IS_NPC, npcId, 9827);
stage = 5;
} else if (stage == 5) {
sendEntityDialogue(SEND_3_OPTIONS,
new String[] { player.getDisplayName(), "Select an option",
"What is this 'evil tree'?, Goodbye." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 6;
} else if (stage == 6) {
if (componentId == 1) {
sendEntityDialogue(
SEND_4_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"It is an abomination of nature that must be destroyed as",
"quickly as possible. We do not know where it will appear,",
"but, when it does, you should go out to it immediately and help",
"out!" }, IS_NPC, npcId, 9827);
stage = 7;
}
if (componentId == 2) {
sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"Goodbye." }, IS_NPC, npcId, 9827);
stage = 7;
}
} else if (stage == 7) {
end();
} else if (stage == 8) {
SpiritTree.sendSpiritTreeInterface(player);
end();
}
}
@Override
public void finish() {
}
}
Thanks in advance.