Hey,
So I've been trying to make a class file..
Basically what I'm trying to do:
-I'm trying to create a portal (Object ID = 2465) that brings up multiple teleport options when clicked.
I've added a code in src->com->rs->game->player->dialogues:
Code:
package com.rs.game.player.dialogues;
import com.rs.game.WorldTile;
import com.rs.game.player.content.Magic;
public class 2465Portal extends Dialogue {
private int npcId;
@Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
sendDialogue(SEND_2_OPTIONS, "Where would you like to go?",
"Rock Crabs", "Slayer Tower", "Taverley Dungeon", "Abyss");
stage = 1;
} else if (stage == 1) {
if (componentId == 1) {
teleportPlayer(2673, 3709, 0);
end();
} else if (componentId == 2) {
teleportPlayer(3428, 3538, 0);
end();
} else if (componentId == 3) {
teleportPlayer(2884, 9799, 0);
end();
} else if (componentId == 4) {
teleportPlayer(3039, 4836, 0);
end();
}
}
}
private void teleportPlayer(int x, int y, int z) {
Magic.sendNormalTeleportSpell(player, 0, 0.0D, new WorldTile(x, y, z),
new int[0]);
}
@Override
public void finish() {
}
public void doTrip() {
}
}
I've also added it in objecthandler and such, too lazy to bring them up to get the codes at this time, but they're right.
Now, inside dialoguehandler.java, I have:
Code:
Class<Dialogue> value54 = (Class<Dialogue>) Class
.forName(2465Portal.class.getCanonicalName());
handledDialogues.put("2465Portal", value54);
When I try to compile, I get 5 errors:
Code:
src\com\rs\game\player\dialogues\DialogueHandler.java:179: error: ')' expected
.forName(2465Portal.class.getCanonicalNa
me());
^
src\com\rs\game\player\dialogues\DialogueHandler.java:179: error: illegal start
of expression
.forName(2465Portal.class.getCanonicalNa
me());
^
src\com\rs\game\player\dialogues\DialogueHandler.java:179: error: ';' expected
.forName(2465Portal.class.getCanonicalNa
me());
^
src\com\rs\game\player\dialogues\DialogueHandler.java:179: error: illegal start
of expression
.forName(2465Portal.class.getCanonicalNa
me());
^
src\com\rs\game\player\dialogues\DialogueHandler.java:179: error: ';' expected
.forName(2465Portal.class.getCanonicalNa
me());
^
5 errors
Press any key to continue . . .
I assume this error is because the class file isn't correct, and the dialoguehandler it leads it to the class file. I've made the class file in the correct spot, but it's empty. I've tried removing the code from dialoguehandler.java to get rid of the compiling errors, so it would create the class file with the code, but that didn't work.
Can anyone help?