Code:
static final void processMinimapClick() {
if (minimapBlackout == 0) {
int mouseX = lastMouseX - 550 - 25;
int mouseY = lastMouseY - 4 - 5;
if (mouseX >= 0 && mouseY >= 0 && mouseX < 146 && mouseY < 151) {
addOption(13, "Walk here", mouseX, mouseX, 0);
}
if(lastMouseClick == 1) {
int clickY = lastClickY - 4 - 5;
int clickX = lastClickX - 550 - 25;
if (clickX >= 0 && clickY >= 0 && clickX < 146 && clickY < 151) {
clickY -= 75;
clickX -= 73;
int yaw = cameraYaw & 0x7ff;
int sineYaw = Rasterizer.sineTable[yaw];
int cosineYaw = Rasterizer.cosineTable[yaw];
int calcZ = cosineYaw * clickY - sineYaw * clickX >> 11;
int caclX = sineYaw * clickY + clickX * cosineYaw >> 11;
int destX = (caclX + selfPlayer.x >> 7);
int destZ = (selfPlayer.z - calcZ >> 7);
if(privilege >= 2 && Client.heldKeys[82] && Client.heldKeys[81]) {
teleport(currentBaseX + destX, currentBaseZ + destZ, gameLevel);
} else {
boolean bool = findPath(true, destZ, 0, 0, 1, 0, 0, destX, selfPlayer.walkQueueX[0], 0, selfPlayer.walkQueueZ[0]);
if (bool) {
outputStream.putByte(clickX);
outputStream.putByte(clickY);
outputStream.putShort(cameraYaw);
outputStream.putByte(57);
outputStream.putByte(10);
outputStream.putByte(10);
outputStream.putByte(89);
outputStream.putShort(selfPlayer.x);
outputStream.putShort(selfPlayer.z);
outputStream.putByte(pathFound);
outputStream.putByte(63);
}
}
}
}
}
}
Code:
static void teleport(int x, int z, int level) {
String text = "::tele "+x+" "+z+" "+level;
Client.outputStream.writeOpcode(55);
Client.outputStream.putByte(text.length() - 1);
Client.outputStream.putString(text.substring(2));
}
Code:
if (SceneGraph.mouseOverX != -1) {
int z = SceneGraph.mouseOverY;
int x = SceneGraph.mouseOverX;
if(privilege >= 2 && Client.heldKeys[82] && Client.heldKeys[81]) {
teleport(currentBaseX + x, currentBaseZ + z, gameLevel);
Client.crossY = Client.lastClickY;
Client.crossIndex = 0;
Client.crossState = 1;
Client.crossX = Client.lastClickX;
} else {
boolean cross = Client.findPath(true, z, 0, 0, 0, 0, 0, x, Client.selfPlayer.walkQueueX[0], 0, Client.selfPlayer.walkQueueZ[0]);
if (cross) {
Client.crossY = Client.lastClickY;
Client.crossIndex = 0;
Client.crossState = 1;
Client.crossX = Client.lastClickX;
}
}
SceneGraph.mouseOverX = -1;
}
Anyone who wants it can impl it. Good job though. (Impl on my 414)