Hi, I have made 6 portals, and just finished adding code telling them where to tele to. But now they all tele to the where the last portal is supposed to take you.
Here is ObjectDef
Code:
switch(i) {
case 2465: //ID for portal
objectDef.name = "Rock Crab Portal";
objectDef.actions[0] = "Enter"; // These are the different right click options
objectDef.actions[1] = null;
objectDef.actions[2] = null;
objectDef.actions[3] = null;
objectDef.actions[4] = null;
objectDef.description = "A portal to genetically modified Rock Crabs.".getBytes();
break;
}
switch(i) {
case 2466: //ID for portal
objectDef.name = "Slayer Tower Portal";
objectDef.actions[0] = "Enter"; // These are the different right click options
objectDef.actions[1] = null;
objectDef.actions[2] = null;
objectDef.actions[3] = null;
objectDef.actions[4] = null;
objectDef.description = "A portal to Slayer Tower.".getBytes();
break;
}
switch(i) {
case 2467: //ID for portal
objectDef.name = "Dagganoth Kings Portal";
objectDef.actions[0] = "Enter"; // These are the different right click options
objectDef.actions[1] = null;
objectDef.actions[2] = null;
objectDef.actions[3] = null;
objectDef.actions[4] = null;
objectDef.description = "Come Prepared!".getBytes();
break;
}
switch(i) {
case 2468: //ID for portal
objectDef.name = "Mining Portal";
objectDef.actions[0] = "Enter"; // These are the different right click options
objectDef.actions[1] = null;
objectDef.actions[2] = null;
objectDef.actions[3] = null;
objectDef.actions[4] = null;
objectDef.description = "A portal to the mining area.".getBytes();
break;
}
switch(i) {
case 2469: //ID for portal
objectDef.name = "TzHaar City Portal";
objectDef.actions[0] = "Enter"; // These are the different right click options
objectDef.actions[1] = null;
objectDef.actions[2] = null;
objectDef.actions[3] = null;
objectDef.actions[4] = null;
objectDef.description = "Can you defeat Jad?".getBytes();
break;
}
switch(i) {
case 2470: //ID for portal
objectDef.name = "Woodcutting Portal";
objectDef.actions[0] = "Enter"; // These are the different right click options
objectDef.actions[1] = null;
objectDef.actions[2] = null;
objectDef.actions[3] = null;
objectDef.actions[4] = null;
objectDef.description = "A portal to the woodcutting area.".getBytes();
break;
}
Here is ActionHandler
Code:
case 2465:
{c.getPA().movePlayer(2677, 3717, 0);
}
case 2466:
{c.getPA().movePlayer(3423, 3538, 0);
}
case 2467:
{c.getPA().movePlayer(1912, 4367, 0);
}
case 2468:
{c.getPA().movePlayer(3043, 9781, 0);
}
case 2469:
{c.getPA().movePlayer(2445, 5178, 0);
}
case 2470:
{c.getPA().movePlayer(2702, 3397, 0);
}
Thanks in advance.