Superaust
June 18th, 2010, 03:21
%100 CREDIT FOR THIS TUTORIAL GOES TO BING
Warning this will be very long...
Step 1. Add this to client.java anywhere:
public void method13(byte abyte0[], byte abyte1[][], byte abyte2[][],
byte abyte3[][]) {
for (int i = 0; i < abyte0.length;) {
int k = (abyte0[i++] & 0xff) * 64 - anInt111;
int l = (abyte0[i++] & 0xff) * 64 - anInt112;
if (k > 0 && l > 0 && k + 64 < anInt113 && l + 64 < anInt114) {
for (int i1 = 0; i1 < 64; i1++) {
byte abyte4[] = abyte1[i1 + k];
byte abyte5[] = abyte2[i1 + k];
byte abyte6[] = abyte3[i1 + k];
int l1 = anInt114 - l - 1;
for (int i2 = -64; i2 < 0; i2++) {
do {
int j = abyte0[i++] & 0xff;
if (j == 0)
break;
if (j < 29)
abyte4[l1] = (byte) j;
else if (j < 160) {
abyte5[l1] = (byte) (j - 28);
} else {
abyte6[l1] = (byte) (j - 159);
selectedIconXOffsets[anInt137] = i1 + k;
selectedIconYOffsets[anInt137] = l1;
selectedIconIds[anInt137] = j - 160;
anInt137++;
}
} while (true);
l1--;
}
}
} else {
for (int j1 = 0; j1 < 64; j1++) {
for (int k1 = -64; k1 < 0; k1++) {
byte byte0;
do
byte0 = abyte0[i++];
while (byte0 != 0);
}
}
}
}
}
public void method14(byte abyte0[], byte abyte1[][]) {
for (int i = 0; i < abyte0.length;) {
int j = (abyte0[i++] & 0xff) * 64 - anInt111;
int k = (abyte0[i++] & 0xff) * 64 - anInt112;
if (j > 0 && k > 0 && j + 64 < anInt113 && k + 64 < anInt114) {
for (int l = 0; l < 64; l++) {
byte abyte2[] = abyte1[l + j];
int i1 = anInt114 - k - 1;
for (int j1 = -64; j1 < 0; j1++)
abyte2[i1--] = abyte0[i++];
}
} else {
i += 4096;
}
}
}
public void method15(byte abyte0[], int ai[][], byte abyte1[][]) {
for (int i = 0; i < abyte0.length;) {
int j = (abyte0[i++] & 0xff) * 64 - anInt111;
int k = (abyte0[i++] & 0xff) * 64 - anInt112;
if (j > 0 && k > 0 && j + 64 < anInt113 && k + 64 < anInt114) {
for (int l = 0; l < 64; l++) {
int ai1[] = ai[l + j];
byte abyte2[] = abyte1[l + j];
int j1 = anInt114 - k - 1;
for (int k1 = -64; k1 < 0; k1++) {
byte byte0 = abyte0[i++];
if (byte0 != 0) {
abyte2[j1] = abyte0[i++];
int l1 = 0;
if (byte0 > 0)
l1 = anIntArray116[byte0];
ai1[j1--] = l1;
} else {
ai1[j1--] = 0;
}
}
}
} else {
for (int i1 = -4096; i1 < 0; i1++) {
byte byte1 = abyte0[i++];
if (byte1 != 0)
i++;
}
}
}
}
public void method16(byte abyte0[][], int ai[][]) {
int i = anInt113;
int j = anInt114;
int ai1[] = new int[j];
for (int k = 0; k < j; k++)
ai1[k] = 0;
for (int l = 5; l < i - 5; l++) {
byte abyte1[] = abyte0[l + 5];
byte abyte2[] = abyte0[l - 5];
for (int i1 = 0; i1 < j; i1++)
ai1[i1] += anIntArray115[abyte1[i1] & 0xff]
- anIntArray115[abyte2[i1] & 0xff];
if (l > 10 && l < i - 10) {
int j1 = 0;
int k1 = 0;
int l1 = 0;
int ai2[] = ai[l];
for (int i2 = 5; i2 < j - 5; i2++) {
int j2 = ai1[i2 - 5];
int k2 = ai1[i2 + 5];
j1 += (k2 >> 20) - (j2 >> 20);
k1 += (k2 >> 10 & 0x3ff) - (j2 >> 10 & 0x3ff);
l1 += (k2 & 0x3ff) - (j2 & 0x3ff);
if (l1 > 0)
ai2[i2] = method17((double) j1 / 8533D,
(double) k1 / 8533D, (double) l1 / 8533D);
}
}
}
}
public int method17(double d, double d1, double d2) {
double d3 = d2;
double d4 = d2;
double d5 = d2;
if (d1 != 0.0D) {
double d6;
if (d2 < 0.5D)
d6 = d2 * (1.0D + d1);
else
d6 = (d2 + d1) - d2 * d1;
double d7 = 2D * d2 - d6;
double d8 = d + 0.33333333333333331D;
if (d8 > 1.0D)
d8--;
double d9 = d;
double d10 = d - 0.33333333333333331D;
if (d10 < 0.0D)
d10++;
if (6D * d8 < 1.0D)
d3 = d7 + (d6 - d7) * 6D * d8;
else if (2D * d8 < 1.0D)
d3 = d6;
else if (3D * d8 < 2D)
d3 = d7 + (d6 - d7) * (0.66666666666666663D - d8) * 6D;
else
d3 = d7;
if (6D * d9 < 1.0D)
d4 = d7 + (d6 - d7) * 6D * d9;
else if (2D * d9 < 1.0D)
d4 = d6;
else if (3D * d9 < 2D)
d4 = d7 + (d6 - d7) * (0.66666666666666663D - d9) * 6D;
else
d4 = d7;
if (6D * d10 < 1.0D)
d5 = d7 + (d6 - d7) * 6D * d10;
else if (2D * d10 < 1.0D)
d5 = d6;
else if (3D * d10 < 2D)
d5 = d7 + (d6 - d7) * (0.66666666666666663D - d10) * 6D;
else
d5 = d7;
}
int i = (int) (d3 * 256D);
int j = (int) (d4 * 256D);
int k = (int) (d5 * 256D);
int l = (i << 16) + (j << 8) + k;
return l;
}
public void nullLoader1() {
try {
anIntArray115 = null;
anIntArray116 = null;
anIntArrayArray117 = null;
anIntArrayArray118 = null;
aByteArrayArray119 = null;
aByteArrayArray120 = null;
aByteArrayArray121 = null;
aByteArrayArray122 = null;
mapScenes = null;
mapFunction = null;
boldFont = null;
mapfuntionXOffsets = null;
mapfunctionYOffsets = null;
mapfunctionIds = null;
selectedIconXOffsets = null;
selectedIconYOffsets = null;
selectedIconIds = null;
overviewSprite = null;
maplocationNames = null;
anIntArray166 = null;
anIntArray167 = null;
anIntArray168 = null;
mapIdentifiers = null;
System.gc();
return;
} catch (Throwable _ex) {
return;
}
}
public void processLoop() {
if (super.keyArray[1] == 1) {
anInt171 = (int) ((double) anInt171 - 16D / aDouble169);
aBoolean109 = true;
}
if (super.keyArray[2] == 1) {
anInt171 = (int) ((double) anInt171 + 16D / aDouble169);
aBoolean109 = true;
}
if (super.keyArray[3] == 1) {
anInt172 = (int) ((double) anInt172 - 16D / aDouble169);
aBoolean109 = true;
}
if (super.keyArray[4] == 1) {
anInt172 = (int) ((double) anInt172 + 16D / aDouble169);
aBoolean109 = true;
}
for (int action = 1; action > 0;) {
action = super.readChar(0);
if (action == 49) {
zoomLevel = 3D;
aBoolean109 = true;
}
if (action == 50) {
zoomLevel = 4D;
aBoolean109 = true;
}
if (action == 51) {
zoomLevel = 6D;
aBoolean109 = true;
}
if (action == 52) {
zoomLevel = 8D;
aBoolean109 = true;
}
if (action == 107 || action == 75) {
showLocationKey = !showLocationKey;
aBoolean109 = true;
}
if (action == 111 || action == 79) {
overviewVisible = !overviewVisible;
aBoolean109 = true;
}
if (super.gameFrame != null && action == 101) {// write world map
// image
System.out.println("Starting export...");
Sprite image = new Sprite(anInt113 * 2, anInt114 * 2);
image.initSpriteDrawingArea();
method19(0, 0, anInt113, anInt114, 0, 0, anInt113 * 2,
anInt114 * 2);
super.fullGameScreen.initDrawingArea();
int area = image.imagePixels.length;
byte pixelData[] = new byte[area * 3];
int offset = 0;
for (int l2 = 0; l2 < area; l2++) {
int color = image.imagePixels[l2];
pixelData[offset++] = (byte) (color >> 16);
pixelData[offset++] = (byte) (color >> 8);
pixelData[offset++] = (byte) color;
}
System.out.println("Saving to disk");
try {
BufferedOutputStream bufferedoutputstream = new BufferedOutputStream(
new FileOutputStream("map-" + anInt113 * 2 + "-"
+ anInt114 * 2 + "-rgb.raw"));
bufferedoutputstream.write(pixelData);
bufferedoutputstream.close();
} catch (Exception exception) {
exception.printStackTrace();
}
System.out.println("Done export: " + anInt113 * 2 + ","
+ anInt114 * 2);
}
}
if (super.clickMode3 == 1) {
if (super.clickX >= 765 - 20 - 5
&& super.clickX <= 760
&& super.clickY >= 0
&& super.clickY <= 50) {
worldMap = false;
resetImageProducers2();
}
anInt158 = super.clickX;
anInt159 = super.clickY;
anInt160 = anInt171;
anInt161 = anInt172;
if (super.clickX > 170 && super.clickX < 219 && super.clickY > 481
&& super.clickY < 500) {
zoomLevel = 3D;
anInt158 = -1;
}// Zoom 37
if (super.clickX > 230 && super.clickX < 280 && super.clickY > 481
&& super.clickY < 503) {
zoomLevel = 4D;
anInt158 = -1;
}// Zoom 50
if (super.clickX > 290 && super.clickX < 340 && super.clickY > 481
&& super.clickY < 503) {
zoomLevel = 6D;
anInt158 = -1;
}// Zoom 75
if (super.clickX > 350 && super.clickX < 400 && super.clickY > 481
&& super.clickY < 503) {
zoomLevel = 8D;
anInt158 = -1;
}// Zoom 100
if (super.clickX > locationKeyPanelX
&& super.clickY > locationKeyPanelY + locationPanelHeight
&& super.clickX < locationKeyPanelX + locationPanelWidth
&& super.clickY < 503) {// Hide/Show Location
showLocationKey = !showLocationKey;
anInt158 = -1;
}
if (super.clickX > overviewPanelX
&& super.clickY > overViewPanelY + overviewPanelHeight
&& super.clickX < overviewPanelX + overviewPanelWidth
&& super.clickY < 503) {// Hide/Show Overview
overviewVisible = !overviewVisible;
anInt158 = -1;
}
if (showLocationKey) {
if (super.clickX > locationKeyPanelX
&& super.clickY > locationKeyPanelY
&& super.clickX < locationKeyPanelX
+ locationPanelWidth
&& super.clickY < locationKeyPanelY
+ locationPanelHeight) {
anInt158 = -1;
}
if (super.clickX > locationKeyPanelX
&& super.clickY > locationKeyPanelY
&& super.clickX < locationKeyPanelX
+ locationPanelWidth
&& super.clickY < locationKeyPanelY + 18
&& locationListPosition > 0) {
locationListPosition -= 25;
}// Previous Page
if (super.clickX > locationKeyPanelX
&& super.clickY > (locationKeyPanelY + locationPanelHeight) - 18
&& super.clickX < locationKeyPanelX
+ locationPanelWidth
&& super.clickY < locationKeyPanelY
+ locationPanelHeight
&& locationListPosition < 50) {
locationListPosition += 25;
}// Next Page
}
aBoolean109 = true;
}
if (showLocationKey) {
hoveredLocationKey = -1;
if (super.xDragged > locationKeyPanelX
&& super.xDragged < locationKeyPanelX + locationPanelWidth) {
int j = locationKeyPanelY + 21 + 5;
for (int j1 = 0; j1 < 25; j1++)
if (j1 + anInt145 >= mapIdentifiers.length
|| !mapIdentifiers[j1 + anInt145].equals("???")) {
if (super.yDragged >= j && super.yDragged < j + 17) {
hoveredLocationKey = j1 + anInt145;
if (super.clickMode3 == 1) {
selectedIcon = j1 + anInt145;
anInt151 = 50;
}
}
j += 17;
}
}
if (hoveredLocationKey != anInt149) {
anInt149 = hoveredLocationKey;
aBoolean109 = true;
}
}
if ((super.clickMode2 == 1 || super.clickMode3 == 1) && overviewVisible) {
int k = super.clickX;
int k1 = super.clickY;
if (super.clickMode2 == 1) {
k = super.xDragged;
k1 = super.yDragged;
}
if (k > overviewPanelX && k1 > overViewPanelY
&& k < overviewPanelX + overviewPanelWidth
&& k1 < overViewPanelY + overviewPanelHeight) {
anInt171 = ((k - overviewPanelX) * anInt113)
/ overviewPanelWidth;
anInt172 = ((k1 - overViewPanelY) * anInt114)
/ overviewPanelHeight;
anInt158 = -1;
aBoolean109 = true;
}
}
if (super.clickMode2 == 1 && anInt158 != -1) {
anInt171 = anInt160
+ (int) (((double) (anInt158 - super.xDragged) * 2D) / zoomLevel);
anInt172 = anInt161
+ (int) (((double) (anInt159 - super.yDragged) * 2D) / zoomLevel);
aBoolean109 = true;
}
if (aDouble169 < zoomLevel) {
aBoolean109 = true;
aDouble169 += aDouble169 / 30D;
if (aDouble169 > zoomLevel)
aDouble169 = zoomLevel;
}
if (aDouble169 > zoomLevel) {
aBoolean109 = true;
aDouble169 -= aDouble169 / 30D;
if (aDouble169 < zoomLevel)
aDouble169 = zoomLevel;
}
if (anInt145 < locationListPosition) {
aBoolean109 = true;
anInt145++;
}
if (anInt145 > locationListPosition) {
aBoolean109 = true;
anInt145--;
}
if (anInt151 > 0) {
aBoolean109 = true;
anInt151--;
}
int l = anInt171 - (int) (765D / aDouble169);
int l1 = anInt172 - (int) (503D / aDouble169);
int i2 = anInt171 + (int) (765D / aDouble169);
int k2 = anInt172 + (int) (503D / aDouble169);
if (l < 48)
anInt171 = 48 + (int) (765D / aDouble169);
if (l1 < 48)
anInt172 = 48 + (int) (503D / aDouble169);
if (i2 > anInt113 - 48)
anInt171 = anInt113 - 48 - (int) (765D / aDouble169);
if (k2 > anInt114 - 48)
anInt172 = anInt114 - 48 - (int) (503D / aDouble169);
}
public boolean hoveredLogout = false;
Sprite[] close = new Sprite[2];
public void drawWorldMap() {
if (aBoolean109) {
aBoolean109 = false;
anInt110 = 0;
DrawingArea.setAllPixelsToZero();
int i = anInt171 - (int) (765D / aDouble169);
int j = anInt172 - (int) (503D / aDouble169);
int k = anInt171 + (int) (765D / aDouble169);
int l = anInt172 + (int) (503D / aDouble169);
method19(i, j, k, l, 0, 0, 765, 503);
if (overviewVisible) {
overviewSprite.drawTransparentSprite1(overviewPane lX,
overViewPanelY);
DrawingArea.fillBoxAlpha(overviewPanelX
+ (overviewPanelWidth * i) / anInt113, overViewPanelY
+ (overviewPanelHeight * j) / anInt114,
((k - i) * overviewPanelWidth) / anInt113,
((l - j) * overviewPanelHeight) / anInt114, 0xff0000,
128);
DrawingArea.drawBox(overviewPanelX + (overviewPanelWidth * i)
/ anInt113, overViewPanelY + (overviewPanelHeight * j)
/ anInt114, ((k - i) * overviewPanelWidth) / anInt113,
((l - j) * overviewPanelHeight) / anInt114, 0xff0000);
if (anInt151 > 0 && anInt151 % 10 < 5) {
for (int index = 0; index < anInt137; index++)
if (selectedIconIds[index] == selectedIcon) {
int diamondX = overviewPanelX
+ (overviewPanelWidth * selectedIconXOffsets[index])
/ anInt113;
int diamondY = overViewPanelY
+ (overviewPanelHeight * selectedIconYOffsets[index])
/ anInt114;
DrawingArea.drawDiamond(diamondX, diamondY, 2,
0xffff00, 256);// This draws the little
// flashing diamonds on the
// overview
}
}
}
if (showLocationKey) {
drawPanel(locationKeyPanelX, locationKeyPanelY,
locationPanelWidth, 18, 0x999999, 0x777777, 0x555555,
"Prev page");
drawPanel(locationKeyPanelX, locationKeyPanelY + 18,
locationPanelWidth, locationPanelHeight - 36, 0x999999,
0x777777, 0x555555, "");
drawPanel(locationKeyPanelX,
(locationKeyPanelY + locationPanelHeight) - 18,
locationPanelWidth, 18, 0x999999, 0x777777, 0x555555,
"Next page");
int drawY = locationKeyPanelY + 3 + 18;
for (int index = 0; index < 25; index++) {
if (index + anInt145 < newmapFunction.length
&& index + anInt145 < mapIdentifiers.length) {
if (mapIdentifiers[index + anInt145].equals("???"))
continue;
newmapFunction[index + anInt145].drawSprite(
locationKeyPanelX + 3, drawY);
myboldFont.drawText(mapIdentifiers[index + anInt145],
locationKeyPanelX + 21, drawY + 14, 0);
int textColor = 0xffffff;
if (hoveredLocationKey == index + anInt145)
textColor = 0xbbaaaa;
if (anInt151 > 0 && anInt151 % 10 < 5
&& selectedIcon == index + anInt145)
textColor = 0xffff00;
myboldFont.drawText(mapIdentifiers[index + anInt145],
locationKeyPanelX + 20, drawY + 13, textColor);
}
drawY += 17;
}
}
drawPanel(overviewPanelX, overViewPanelY + overviewPanelHeight,
overviewPanelWidth, 18, anInt103, anInt104, anInt105,
"Overview");
drawPanel(locationKeyPanelX, locationKeyPanelY
+ locationPanelHeight, locationPanelWidth, 18, anInt103,
anInt104, anInt105, "Key");
if (zoomLevel == 3D) {
drawPanel(170, 481, 50, 20, anInt106, anInt107, anInt108, "37%");
} else {
drawPanel(170, 481, 50, 20, anInt103, anInt104, anInt105, "37%");
}
if (zoomLevel == 4D) {
drawPanel(230, 481, 50, 20, anInt106, anInt107, anInt108, "50%");
} else {
drawPanel(230, 481, 50, 20, anInt103, anInt104, anInt105, "50%");
}
if (zoomLevel == 6D) {
drawPanel(290, 481, 50, 20, anInt106, anInt107, anInt108, "75%");
} else {
drawPanel(290, 481, 50, 20, anInt103, anInt104, anInt105, "75%");
}
if (zoomLevel == 8D) {
drawPanel(350, 481, 50, 20, anInt106, anInt107, anInt108,
"100%");
} else {
drawPanel(350, 481, 50, 20, anInt103, anInt104, anInt105,
"100%");
}
}
anInt110--;
if (anInt110 <= 0) {
super.fullGameScreen.drawGraphics(0, super.graphics, 0);
anInt110 = 50;
}
}
public void stupidMethodThatDoesNothing() {
anInt110 = 0;
}
public void drawPanel(int i, int j, int k, int l, int i1, int color,
int k1, String s) {
DrawingArea.drawBox(i, j, k, l, 0);
i++;
j++;
k -= 2;
l -= 2;
DrawingArea.fillBox(i, j, k, l, color);
DrawingArea.drawHorizontalLine(i, j, k, i1);
DrawingArea.drawVerticalLine(i, j, l, i1);
DrawingArea.drawHorizontalLine(i, (j + l) - 1, k, k1);
DrawingArea.drawVerticalLine((i + k) - 1, j, l, k1);
myboldFont.method55(s, i + k / 2 + 1, j + l / 2 + 1 + 4, 0);
myboldFont.method55(s, i + k / 2, j + l / 2 + 4, 0xffffff);
}
public void method19(int i, int j, int k, int l, int i1, int j1, int k1,
int l1) {
int i2 = k - i;
int j2 = l - j;
int k2 = (k1 - i1 << 16) / i2;
int l2 = (l1 - j1 << 16) / j2;
for (int i3 = 0; i3 < i2; i3++) {
int j3 = k2 * i3 >> 16;
int l3 = k2 * (i3 + 1) >> 16;
int j4 = l3 - j3;
if (j4 > 0) {
j3 += i1;
l3 += i1;
int ai[] = anIntArrayArray117[i3 + i];
int ai1[] = anIntArrayArray118[i3 + i];
byte abyte0[] = aByteArrayArray119[i3 + i];
for (int j7 = 0; j7 < j2; j7++) {
int i8 = l2 * j7 >> 16;
int l8 = l2 * (j7 + 1) >> 16;
int l9 = l8 - i8;
if (l9 > 0) {
i8 += j1;
l8 += j1;
int l10 = ai1[j7 + j];
if (l10 == 0) {
DrawingArea.fillBox(j3, i8, l3 - j3, l8 - i8, ai[j7
+ j]);
} else {
byte byte0 = abyte0[j7 + j];
int l11 = byte0 & 0xfc;
if (l11 == 0 || j4 <= 1 || l9 <= 1)
DrawingArea.fillBox(j3, i8, j4, l9, l10);
else
method20(DrawingArea.pixels, i8
* DrawingArea.width + j3, ai[j7 + j],
l10, j4, l9, l11 >> 2, byte0 & 3);
}
}
}
}
}
if (k - i > k1 - i1)
return;
int mapfunctionCount = 0;
for (int i4 = 0; i4 < i2; i4++) {
int k4 = k2 * i4 >> 16;
int i5 = k2 * (i4 + 1) >> 16;
int i6 = i5 - k4;
if (i6 > 0) {
byte abyte1[] = aByteArrayArray120[i4 + i];
byte abyte2[] = aByteArrayArray122[i4 + i];
byte abyte3[] = aByteArrayArray121[i4 + i];
for (int i9 = 0; i9 < j2; i9++) {
int i10 = l2 * i9 >> 16;
int i11 = l2 * (i9 + 1) >> 16;
int k11 = i11 - i10;
if (k11 > 0) {
int i12 = abyte1[i9 + j] & 0xff;
if (i12 != 0) {
int k12;
if (i6 == 1)
k12 = k4;
else
k12 = i5 - 1;
int j13;
if (k11 == 1)
j13 = i10;
else
j13 = i11 - 1;
int i14 = 0xcccccc;
if (i12 >= 5 && i12 <= 8 || i12 >= 13 && i12 <= 16
|| i12 >= 21 && i12 <= 24 || i12 == 27
|| i12 == 28) {
i14 = 0xcc0000;
i12 -= 4;
}
if (i12 == 1)
DrawingArea.drawVerticalLine(k4, i10, k11, i14);
else if (i12 == 2)
DrawingArea
.drawHorizontalLine(k4, i10, i6, i14);
else if (i12 == 3)
DrawingArea
.drawVerticalLine(k12, i10, k11, i14);
else if (i12 == 4)
DrawingArea
.drawHorizontalLine(k4, j13, i6, i14);
else if (i12 == 9) {
DrawingArea.drawVerticalLine(k4, i10, k11,
0xffffff);
DrawingArea
.drawHorizontalLine(k4, i10, i6, i14);
} else if (i12 == 10) {
DrawingArea.drawVerticalLine(k12, i10, k11,
0xffffff);
DrawingArea
.drawHorizontalLine(k4, i10, i6, i14);
} else if (i12 == 11) {
DrawingArea.drawVerticalLine(k12, i10, k11,
0xffffff);
DrawingArea
.drawHorizontalLine(k4, j13, i6, i14);
} else if (i12 == 12) {
DrawingArea.drawVerticalLine(k4, i10, k11,
0xffffff);
DrawingArea
.drawHorizontalLine(k4, j13, i6, i14);
} else if (i12 == 17)
DrawingArea.drawHorizontalLine(k4, i10, 1, i14);
else if (i12 == 18)
DrawingArea
.drawHorizontalLine(k12, i10, 1, i14);
else if (i12 == 19)
DrawingArea
.drawHorizontalLine(k12, j13, 1, i14);
else if (i12 == 20)
DrawingArea.drawHorizontalLine(k4, j13, 1, i14);
else if (i12 == 25) {
for (int j14 = 0; j14 < k11; j14++)
DrawingArea.drawHorizontalLine(k4 + j14,
j13 - j14, 1, i14);
} else if (i12 == 26) {
for (int k14 = 0; k14 < k11; k14++)
DrawingArea.drawHorizontalLine(k4 + k14,
i10 + k14, 1, i14);
}
}
int l12 = abyte2[i9 + j] & 0xff;
if (l12 != 0)
newmapScenes[l12 - 1].drawSprite(k4 - i6 / 2, i10
- k11 / 2);
try {
// newmapScenes[l12 - 1].method50(k4 - i6 / 2, i10 -
// k11
// / 2, i6 * 2, k11 * 2);
} catch (Exception e) {
e.printStackTrace();
}
int k13 = abyte3[i9 + j] & 0xff;
if (k13 != 0) {
mapfunctionIds[mapfunctionCount] = k13 - 1;
mapfuntionXOffsets[mapfunctionCount] = k4 + i6 / 2;
mapfunctionYOffsets[mapfunctionCount] = i10 + k11
/ 2;
mapfunctionCount++;
}
}
}
}
}
try {
for (int index = 0; index < mapfunctionCount; index++)
if (newmapFunction[mapfunctionIds[index]] != null)
newmapFunction[mapfunctionIds[index]].drawSprite(
mapfuntionXOffsets[index] - 7,
mapfunctionYOffsets[index] - 7);
if (anInt151 > 0) {
for (int index = 0; index < mapfunctionCount; index++)
if (mapfunctionIds[index] == selectedIcon) {
newmapFunction[mapfunctionIds[index]].drawSprite(
mapfuntionXOffsets[index] - 7,
mapfunctionYOffsets[index] - 7);
if (anInt151 % 10 < 5) {
DrawingArea.drawDiamond(mapfuntionXOffsets[index],
mapfunctionYOffsets[index], 15, 0xffff00,
128);
DrawingArea.drawDiamond(mapfuntionXOffsets[index],
mapfunctionYOffsets[index], 7, 0xffffff,
256);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
if (aDouble169 == zoomLevel && aBoolean162) {
for (int index = 0; index < anInt163; index++) {
int j6 = anIntArray166[index];
int l6 = anIntArray167[index];
j6 -= anInt111;
l6 = (anInt112 + anInt114) - l6;
int k7 = i1 + ((k1 - i1) * (j6 - i)) / (k - i);
int j8 = j1 + ((l1 - j1) * (l6 - j)) / (l - j);
int j9 = anIntArray168[index];
int j10 = 0xffffff;
ScaledFont class1_sub1_sub1_sub1 = aSprite_126;
if (j9 == 0) {
if (aDouble169 == 3D)
class1_sub1_sub1_sub1 = aSprite_126;
if (aDouble169 == 4D)
class1_sub1_sub1_sub1 = aSprite_127;
if (aDouble169 == 6D)
class1_sub1_sub1_sub1 = aSprite_128;
if (aDouble169 == 8D)
class1_sub1_sub1_sub1 = aSprite_129;
}
if (j9 == 1) {
if (aDouble169 == 3D)
class1_sub1_sub1_sub1 = aSprite_128;
if (aDouble169 == 4D)
class1_sub1_sub1_sub1 = aSprite_129;
if (aDouble169 == 6D)
class1_sub1_sub1_sub1 = aSprite_130;
if (aDouble169 == 8D)
class1_sub1_sub1_sub1 = aSprite_131;
}
if (j9 == 2) {
j10 = 0xffaa00;
if (aDouble169 == 3D)
class1_sub1_sub1_sub1 = aSprite_130;
if (aDouble169 == 4D)
class1_sub1_sub1_sub1 = aSprite_131;
if (aDouble169 == 6D)
class1_sub1_sub1_sub1 = aSprite_132;
if (aDouble169 == 8D)
class1_sub1_sub1_sub1 = aSprite_133;
}
if (class1_sub1_sub1_sub1 != null) {
String s = maplocationNames[index];
int j12 = 1;
for (int i13 = 0; i13 < s.length(); i13++)
if (s.charAt(i13) == '/')
j12++;
j8 -= (class1_sub1_sub1_sub1.method40() * (j12 - 1)) / 2;
j8 += class1_sub1_sub1_sub1.method44() / 2;
do {
int l13 = s.indexOf("/");
if (l13 == -1) {
class1_sub1_sub1_sub1
.method38(s, k7, j8, j10, true);
break;
}
String s1 = s.substring(0, l13);
class1_sub1_sub1_sub1.method38(s1, k7, j8, j10, true);
j8 += class1_sub1_sub1_sub1.method40();
s = s.substring(l13 + 1);
} while (true);
}
}
}
if (aBoolean102) {
for (int l5 = anInt111 / 64; l5 < (anInt111 + anInt113) / 64; l5++) {
for (int k6 = anInt112 / 64; k6 < (anInt112 + anInt114) / 64; k6++) {
int i7 = l5 * 64;
int l7 = k6 * 64;
i7 -= anInt111;
l7 = (anInt112 + anInt114) - l7;
int k8 = i1 + ((k1 - i1) * (i7 - i)) / (k - i);
int k9 = j1 + ((l1 - j1) * (l7 - 64 - j)) / (l - j);
int k10 = i1 + ((k1 - i1) * ((i7 + 64) - i)) / (k - i);
int j11 = j1 + ((l1 - j1) * (l7 - j)) / (l - j);
DrawingArea.drawBox(k8, k9, k10 - k8, j11 - k9, 0xffffff);
myboldFont.method54(l5 + "_" + k6, k10 - 5, j11 - 5,
0xffffff);
if (l5 == 33 && k6 >= 71 && k6 <= 73)
myboldFont.method55("u_pass", (k10 + k8) / 2,
(j11 + k9) / 2, 0xff0000);
}
}
}
}
public void method20(int ai[], int i, int j, int k, int l, int i1, int j1,
int k1) {
int l1 = DrawingArea.width - l;
if (j1 == 9) {
j1 = 1;
k1 = k1 + 1 & 3;
}
if (j1 == 10) {
j1 = 1;
k1 = k1 + 3 & 3;
}
if (j1 == 11) {
j1 = 8;
k1 = k1 + 3 & 3;
}
if (j1 == 1) {
if (k1 == 0) {
for (int i2 = 0; i2 < i1; i2++) {
for (int i10 = 0; i10 < l; i10++)
if (i10 <= i2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j2 = i1 - 1; j2 >= 0; j2--) {
for (int j10 = 0; j10 < l; j10++)
if (j10 <= j2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k2 = 0; k2 < i1; k2++) {
for (int k10 = 0; k10 < l; k10++)
if (k10 >= k2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l2 = i1 - 1; l2 >= 0; l2--) {
for (int l10 = 0; l10 < l; l10++)
if (l10 >= l2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 2) {
if (k1 == 0) {
for (int i3 = i1 - 1; i3 >= 0; i3--) {
for (int i11 = 0; i11 < l; i11++)
if (i11 <= i3 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j3 = 0; j3 < i1; j3++) {
for (int j11 = 0; j11 < l; j11++)
if (j11 >= j3 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k3 = 0; k3 < i1; k3++) {
for (int k11 = l - 1; k11 >= 0; k11--)
if (k11 <= k3 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l3 = i1 - 1; l3 >= 0; l3--) {
for (int l11 = l - 1; l11 >= 0; l11--)
if (l11 >= l3 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 3) {
if (k1 == 0) {
for (int i4 = i1 - 1; i4 >= 0; i4--) {
for (int i12 = l - 1; i12 >= 0; i12--)
if (i12 <= i4 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j4 = i1 - 1; j4 >= 0; j4--) {
for (int j12 = 0; j12 < l; j12++)
if (j12 >= j4 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k4 = 0; k4 < i1; k4++) {
for (int k12 = 0; k12 < l; k12++)
if (k12 <= k4 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l4 = 0; l4 < i1; l4++) {
for (int l12 = l - 1; l12 >= 0; l12--)
if (l12 >= l4 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 4) {
if (k1 == 0) {
for (int i5 = i1 - 1; i5 >= 0; i5--) {
for (int i13 = 0; i13 < l; i13++)
if (i13 >= i5 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j5 = 0; j5 < i1; j5++) {
for (int j13 = 0; j13 < l; j13++)
if (j13 <= j5 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k5 = 0; k5 < i1; k5++) {
for (int k13 = l - 1; k13 >= 0; k13--)
if (k13 >= k5 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l5 = i1 - 1; l5 >= 0; l5--) {
for (int l13 = l - 1; l13 >= 0; l13--)
if (l13 <= l5 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 5) {
if (k1 == 0) {
for (int i6 = i1 - 1; i6 >= 0; i6--) {
for (int i14 = l - 1; i14 >= 0; i14--)
if (i14 >= i6 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j6 = i1 - 1; j6 >= 0; j6--) {
for (int j14 = 0; j14 < l; j14++)
if (j14 <= j6 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k6 = 0; k6 < i1; k6++) {
for (int k14 = 0; k14 < l; k14++)
if (k14 >= k6 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l6 = 0; l6 < i1; l6++) {
for (int l14 = l - 1; l14 >= 0; l14--)
if (l14 <= l6 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 6) {
if (k1 == 0) {
for (int i7 = 0; i7 < i1; i7++) {
for (int i15 = 0; i15 < l; i15++)
if (i15 <= l / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j7 = 0; j7 < i1; j7++) {
for (int j15 = 0; j15 < l; j15++)
if (j7 <= i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k7 = 0; k7 < i1; k7++) {
for (int k15 = 0; k15 < l; k15++)
if (k15 >= l / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l7 = 0; l7 < i1; l7++) {
for (int l15 = 0; l15 < l; l15++)
if (l7 >= i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
}
if (j1 == 7) {
if (k1 == 0) {
for (int i8 = 0; i8 < i1; i8++) {
for (int i16 = 0; i16 < l; i16++)
if (i16 <= i8 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j8 = i1 - 1; j8 >= 0; j8--) {
for (int j16 = 0; j16 < l; j16++)
if (j16 <= j8 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k8 = i1 - 1; k8 >= 0; k8--) {
for (int k16 = l - 1; k16 >= 0; k16--)
if (k16 <= k8 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l8 = 0; l8 < i1; l8++) {
for (int l16 = l - 1; l16 >= 0; l16--)
if (l16 <= l8 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
}
if (j1 == 8) {
if (k1 == 0) {
for (int i9 = 0; i9 < i1; i9++) {
for (int i17 = 0; i17 < l; i17++)
if (i17 >= i9 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j9 = i1 - 1; j9 >= 0; j9--) {
for (int j17 = 0; j17 < l; j17++)
if (j17 >= j9 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k9 = i1 - 1; k9 >= 0; k9--) {
for (int k17 = l - 1; k17 >= 0; k17--)
if (k17 >= k9 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l9 = 0; l9 < i1; l9++) {
for (int l17 = l - 1; l17 >= 0; l17--)
if (l17 >= l9 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
}
}
}
public NamedArchive getMapArchive() {
byte file[] = null;
String s = null;
try {
s = findCache();
file = FileOperations.ReadFile("C:/Files/worldmap317.dat");
// if(!method26(abyte0))
// abyte0 = null;
// if(abyte0 != null)
return new NamedArchive(file);
} catch (Throwable _ex) {
}
file = getFile();
if (s != null && file != null)
try {
writeFile(s + "/worldmap.dat", file);
} catch (Throwable _ex) {
}
return new NamedArchive(file);
}
public static int anIntArray100[] = { 118, -62, 7, 24, 121, -123, -10, -8,
116, 6, -106, 28, -36, 86, 109, 112, -115, -116, -37, -35 };
public static int anInt101;
public byte[] getFile() {
drawLoadingText(0, "Requesting map");
try {
String s = "";
for (int i = 0; i < 10; i++)
s = s + anIntArray100[i];
DataInputStream datainputstream;
if (super.gameFrame != null) {
datainputstream = new DataInputStream(new FileInputStream(
"C:/Files/worldmap317.dat"));
} else {
datainputstream = new DataInputStream((new URL(getCodeBase(),
"C:/Files/worldmap317.dat")).openStream());
}
int j = 0;
int k = 0;
int l = 0x53901;
byte abyte0[] = new byte[l];
while (k < l) {
int i1 = l - k;
if (i1 > 1000)
i1 = 1000;
int length = datainputstream.read(abyte0, k, i1);
if (length < 0)
throw new IOException("End of file");
k += length;
int k1 = (k * 100) / l;
if (k1 != j)
drawLoadingText(k1, "Loading map - " + k1 + "%");
j = k1;
}
datainputstream.close();
return abyte0;
} catch (IOException ioexception) {
System.out.println("Error loading");
ioexception.printStackTrace();
return null;
}
}
public String findCache() {
String as[] = { "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/",
"e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/",
"~/", "/tmp/", "" };
String s = ".file_store_32";
for (int i = 0; i < as.length; i++)
try {
String s1 = as[i];
if (s1.length() > 0) {
File file = new File(s1);
if (!file.exists())
continue;
}
File file1 = new File(s1 + s);
if (file1.exists() || file1.mkdir())
return s1 + s + "/";
} catch (Exception _ex) {
}
return null;
}
public byte[] readFile(String s)// Decompress something?
throws IOException {
File file = new File(s);
if (!file.exists()) {
return null;
} else {
int i = (int) file.length();
byte buffer[] = new byte[i];
DataInputStream datainputstream = new DataInputStream(
new BufferedInputStream(new FileInputStream(s)));
datainputstream.readFully(buffer, 0, i);
datainputstream.close();
return buffer;
}
}
public void writeFile(String s, byte abyte0[]) throws IOException {
FileOutputStream fileoutputstream = new FileOutputStream(s);
fileoutputstream.write(abyte0, 0, abyte0.length);
fileoutputstream.close();
}
public boolean method26(byte abyte0[]) throws Exception {
if (abyte0 == null)
return false;
MessageDigest messagedigest = MessageDigest.getInstance("SHA");
messagedigest.reset();
messagedigest.update(abyte0);
byte abyte1[] = messagedigest.digest();
for (int i = 0; i < 20; i++)
if (abyte1[i] != anIntArray100[i])
return false;
return true;
}
public void resetAllImageProducers() {
if (super.fullGameScreen != null) {
return;
}
aRSImageProducer_1166 = null;
aRSImageProducer_1164 = null;
aRSImageProducer_1163 = null;
aRSImageProducer_1165 = null;
aRSImageProducer_1123 = null;
aRSImageProducer_1124 = null;
aRSImageProducer_1125 = null;
aRSImageProducer_1107 = null;
aRSImageProducer_1108 = null;
aRSImageProducer_1109 = null;
aRSImageProducer_1110 = null;
aRSImageProducer_1111 = null;
aRSImageProducer_1112 = null;
aRSImageProducer_1113 = null;
aRSImageProducer_1114 = null;
aRSImageProducer_1115 = null;
super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
welcomeScreenRaised = true;
}
public boolean worldMap = false;
public static boolean aBoolean102;
public int anInt103;
public int anInt104;
public int anInt105;
public int anInt106;
public int anInt107;
public int anInt108;
public boolean aBoolean109;
public int anInt110;
public static int anInt111;
public static int anInt112;
public static int anInt113;
public static int anInt114;
public int anIntArray115[];
public int anIntArray116[];
public int anIntArrayArray117[][];
public int anIntArrayArray118[][];
public byte aByteArrayArray119[][];
public byte aByteArrayArray120[][];
public byte aByteArrayArray121[][];
public byte aByteArrayArray122[][];
public Sprite mapFunction[];
public ScaledFont aSprite_126;
public ScaledFont aSprite_127;
public ScaledFont aSprite_128;
public ScaledFont aSprite_129;
public ScaledFont aSprite_130;
public ScaledFont aSprite_131;
public ScaledFont aSprite_132;
public ScaledFont aSprite_133;
public int mapfuntionXOffsets[];
public int mapfunctionYOffsets[];
public int mapfunctionIds[];
public int anInt137;
public int selectedIconXOffsets[];
public int selectedIconYOffsets[];
public int selectedIconIds[];
public int locationKeyPanelX;
public int locationKeyPanelY;
public int locationPanelWidth;
public int locationPanelHeight;
public int anInt145;
public int locationListPosition;
public boolean showLocationKey;
public int hoveredLocationKey;
public int anInt149;
public int selectedIcon;
public int anInt151;
public int overviewPanelHeight;
public int overviewPanelWidth;
public int overviewPanelX;
public int overViewPanelY;
public boolean overviewVisible;
public Sprite overviewSprite;
public int anInt158;
private Sprite[] newmapFunction = new Sprite[100];
private Background[] newmapScenes = new Background[100];
public int anInt159;
public int anInt160;
public int anInt161;
public static boolean aBoolean162 = true;
public int anInt163;
public int anInt164;
public String maplocationNames[];
public int anIntArray166[];
public int anIntArray167[];
public int anIntArray168[];
public double aDouble169;
public double zoomLevel;
public static int anInt171;
public static int anInt172;
public int drawCount = 0;
public RSFont myboldFont;
public String mapIdentifiers[] = { "General Store", "Sword Shop",
"Magic Shop", "Axe Shop", "Helmet Shop", "Bank", "Quest Start",
"Amulet Shop", "Mining Site", "Furnace", "Anvil",
"Combat Training", "Dungeon", "Staff Shop", "Platebody Shop",
"Platelegs Shop", "Scimitar Shop", "Archery Shop", "Shield Shop",
"Altar", "Herbalist", "Jewelery", "Gem Shop", "Crafting Shop",
"Candle Shop", "Fishing Shop", "Fishing Spot", "Clothes Shop",
"Apothecary", "Silk Trader", "Kebab Seller", "Pub/Bar",
"Mace Shop", "Tannery", "Rare Trees", "Spinning Wheel",
"Food Shop", "Cookery Shop", "Mini-Game", "Water Source",
"Cooking Range", "Skirt Shop", "Potters Wheel", "Windmill",
"Mining Shop", "Chainmail Shop", "Silver Shop", "Fur Trader",
"Spice Shop", "Agility Training", "Vegetable Store",
"Slayer Master", "Hair Dressers", "Farming patch", "Makeover Mage",
"Guide", "Transportation", "???", "Farming shop", "Loom", "Brewery" };
Step 2. Now in the very TOP of drawGameScreen add this:
if (worldMap
&& (loadingStage == 2 || super.fullGameScreen != null)) {
if (loadingStage == 2) {
resetAllImageProducers();
super.fullGameScreen.initDrawingArea();
drawWorldMap();
processLoop();
drawCount++;
return;
}
}
Now. after "drawLoadingText("starting up" or whatever. Add this:
NamedArchive archive = getMapArchive();
drawLoadingText(100, "Please wait... Rendering Map");
ByteVector byteVector = new ByteVector(archive.getFile("size.dat"));
anInt111 = byteVector.getShort();
anInt112 = byteVector.getShort();
anInt113 = byteVector.getShort();
anInt114 = byteVector.getShort();
anInt171 = 3200 - anInt111;
anInt172 = (anInt112 + anInt114) - 3200;
overviewPanelHeight = 180;
overviewPanelWidth = (anInt113 * overviewPanelHeight) / anInt114;
overviewPanelX = 765 - overviewPanelWidth - 5;
overViewPanelY = 503 - overviewPanelHeight - 20;
byteVector = new ByteVector(archive.getFile("labels.dat"));
anInt163 = byteVector.getShort();
for (int i = 0; i < anInt163; i++) {
maplocationNames[i] = byteVector.getString();
anIntArray166[i] = byteVector.getShort();
anIntArray167[i] = byteVector.getShort();
anIntArray168[i] = byteVector.getUnsignedByte();
}
myboldFont = new RSFont(archive, "b12_full", false);
byteVector = new ByteVector(archive.getFile("floorcol.dat"));
int j = byteVector.getShort();
anIntArray115 = new int[j + 1];
anIntArray116 = new int[j + 1];
for (int k = 0; k < j; k++) {
anIntArray115[k + 1] = byteVector.getInt();
anIntArray116[k + 1] = byteVector.getInt();
}
byte abyte0[] = archive.getFile("underlay.dat");
byte abyte1[][] = new byte[anInt113][anInt114];
method14(abyte0, abyte1);
byte abyte2[] = archive.getFile("overlay.dat");
anIntArrayArray118 = new int[anInt113][anInt114];
aByteArrayArray119 = new byte[anInt113][anInt114];
method15(abyte2, anIntArrayArray118, aByteArrayArray119);
byte abyte3[] = archive.getFile("loc.dat");
aByteArrayArray120 = new byte[anInt113][anInt114];
aByteArrayArray122 = new byte[anInt113][anInt114];
aByteArrayArray121 = new byte[anInt113][anInt114];
method13(abyte3, aByteArrayArray120, aByteArrayArray122,
aByteArrayArray121);
for (int l = 0; l < 70; l++)
newmapScenes[l] = new Background(archive, "mapscene", l);
for (int i1 = 0; i1 < 70; i1++)
newmapFunction[i1] = new Sprite(archive, "mapfunction", i1);
aSprite_126 = new ScaledFont(11, true, this);
aSprite_127 = new ScaledFont(12, true, this);
aSprite_128 = new ScaledFont(14, true, this);
aSprite_129 = new ScaledFont(17, true, this);
aSprite_130 = new ScaledFont(19, true, this);
aSprite_131 = new ScaledFont(22, true, this);
aSprite_132 = new ScaledFont(26, true, this);
aSprite_133 = new ScaledFont(30, true, this);
anIntArrayArray117 = new int[anInt113][anInt114];
method16(abyte1, anIntArrayArray117);
overviewSprite = new Sprite(overviewPanelWidth, overviewPanelHeight);
overviewSprite.initSpriteDrawingArea();
method19(0, 0, anInt113, anInt114, 0, 0, overviewPanelWidth,
overviewPanelHeight);
DrawingArea.drawBox(0, 0, overviewPanelWidth, overviewPanelHeight, 0);
DrawingArea.drawBox(1, 1, overviewPanelWidth - 2,
overviewPanelHeight - 2, anInt103);
Replace RSApplet with this:
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class RSApplet extends Applet
implements Runnable, MouseListener, MouseMotionListener, KeyListener, FocusListener, WindowListener {
private int yPressed;
private int xPressed;
public final void createClientFrame(int i, int j) {
myWidth = j;
myHeight = i;
gameFrame = new RSFrame(this, myWidth, myHeight);
graphics = getGameComponent().getGraphics();
fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
startRunnable(this, 1);
}
public final void initClientFrame(int i, int j) {
myWidth = j;
myHeight = i;
graphics = getGameComponent().getGraphics();
fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
startRunnable(this, 1);
}
public void run() {
getGameComponent().addMouseListener(this);
getGameComponent().addMouseMotionListener(this);
getGameComponent().addKeyListener(this);
getGameComponent().addFocusListener(this);
if (gameFrame != null) {
gameFrame.addWindowListener(this);
}
drawLoadingText(0, "Loading...");
startUp();
int i = 0;
int j = 256;
int k = 1;
int i1 = 0;
int j1 = 0;
for (int k1 = 0; k1 < 10; k1++) {
aLongArray7[k1] = System.currentTimeMillis();
}
while (anInt4 >= 0) {
if (anInt4 > 0) {
anInt4--;
if (anInt4 == 0) {
exit();
return;
}
}
int i2 = j;
int j2 = k;
j = 300;
k = 1;
long l1 = System.currentTimeMillis();
if (aLongArray7[i] == 0L) {
j = i2;
k = j2;
} else if (l1 > aLongArray7[i]) {
j = (int) ((long) (2560 * delayTime) / (l1 - aLongArray7[i]));
}
if (j < 25) {
j = 25;
}
if (j > 256) {
j = 256;
k = (int) ((long) delayTime - (l1 - aLongArray7[i]) / 10L);
}
if (k > delayTime) {
k = delayTime;
}
aLongArray7[i] = l1;
i = (i + 1) % 10;
if (k > 1) {
for (int k2 = 0; k2 < 10; k2++) {
if (aLongArray7[k2] != 0L) {
aLongArray7[k2] += k;
}
}
}
if (k < minDelay) {
k = minDelay;
}
try {
Thread.sleep(k);
} catch (InterruptedException _ex) {
j1++;
}
for (; i1 < 256; i1 += j) {
clickMode3 = clickMode1;
saveClickX = clickX;
saveClickY = clickY;
aLong29 = clickTime;
clickMode1 = 0;
processGameLoop();
readIndex = writeIndex;
}
i1 &= 0xff;
if (delayTime > 0) {
fps = (1000 * j) / (delayTime * 256);
}
processDrawing();
if (shouldDebug) {
System.out.println("ntime:" + l1);
for (int l2 = 0; l2 < 10; l2++) {
int i3 = ((i - l2 - 1) + 20) % 10;
System.out.println("otim" + i3 + ":" + aLongArray7[i3]);
}
System.out.println("fps:" + fps + " ratio:" + j + " count:" + i1);
System.out.println("del:" + k + " deltime:" + delayTime + " mindel:" + minDelay);
System.out.println("intex:" + j1 + " opos:" + i);
shouldDebug = false;
j1 = 0;
}
}
if (anInt4 == -1) {
exit();
}
}
private void exit() {
anInt4 = -2;
cleanUpForQuit();
if (gameFrame != null) {
try {
Thread.sleep(1000L);
} catch (Exception _ex) {
}
try {
System.exit(0);
} catch (Throwable _ex) {
}
}
}
public final void method4(int i) {
delayTime = 1000 / i;
}
public final void start() {
if (anInt4 >= 0) {
anInt4 = 0;
}
}
public final void stop() {
if (anInt4 >= 0) {
anInt4 = 4000 / delayTime;
}
}
public final void destroy() {
anInt4 = -1;
try {
Thread.sleep(5000L);
} catch (Exception _ex) {
}
if (anInt4 == -1) {
exit();
}
}
public final void update(Graphics g) {
if (graphics == null) {
graphics = g;
}
shouldClearScreen = true;
raiseWelcomeScreen();
}
public final void paint(Graphics g) {
if (graphics == null) {
graphics = g;
}
shouldClearScreen = true;
raiseWelcomeScreen();
}
public final void mousePressed(MouseEvent mouseevent) {
int i = mouseevent.getX();
int j = mouseevent.getY();
if (gameFrame != null) {
i -= 4;
j -= 22;
}
idleTime = 0;
clickX = i;
clickY = j;
xPressed = i;
yPressed = j;
clickTime = System.currentTimeMillis();
if (mouseevent.isMetaDown()) {
clickMode1 = 2;
clickMode2 = 2;
} else {
clickMode1 = 1;
clickMode2 = 1;
}
}
public final void mouseReleased(MouseEvent mouseevent) {
idleTime = 0;
clickMode2 = 0;
}
public final void mouseClicked(MouseEvent mouseevent) {
}
public final void mouseEntered(MouseEvent mouseevent) {
}
public final void mouseExited(MouseEvent mouseevent) {
idleTime = 0;
mouseX = -1;
mouseY = -1;
}
public final void mouseDragged(MouseEvent mouseevent) {
int i = mouseevent.getX();
int j = mouseevent.getY();
if (gameFrame != null) {
i -= 4;
j -= 22;
}
idleTime = 0;
mouseX = i;
mouseY = j;
xDragged = i;
yDragged = j;
}
public final void mouseMoved(MouseEvent mouseevent) {
int i = mouseevent.getX();
int j = mouseevent.getY();
if (gameFrame != null) {
i -= 4;
j -= 22;
}
idleTime = 0;
mouseX = i;
mouseY = j;
xDragged = i;
yDragged = j;
}
public final void keyPressed(KeyEvent keyevent) {
idleTime = 0;
int i = keyevent.getKeyCode();
int j = keyevent.getKeyChar();
if (j < 30) {
j = 0;
}
if (i == 37) {
j = 1;
}
if (i == 39) {
j = 2;
}
if (i == 38) {
j = 3;
}
if (i == 40) {
j = 4;
}
if (i == 17) {
j = 5;
}
if (i == 8) {
j = 8;
}
if (i == 127) {
j = 8;
}
if (i == 9) {
j = 9;
}
if (i == 10) {
j = 10;
}
if (i >= 112 && i <= 123) {
j = (1008 + i) - 112;
}
if (i == 36) {
j = 1000;
}
if (i == 35) {
j = 1001;
}
if (i == 33) {
j = 1002;
}
if (i == 34) {
j = 1003;
}
if (j > 0 && j < 128) {
keyArray[j] = 1;
}
if (j > 4) {
charQueue[writeIndex] = j;
writeIndex = writeIndex + 1 & 0x7f;
}
}
public final void keyReleased(KeyEvent keyevent) {
idleTime = 0;
int i = keyevent.getKeyCode();
char c = keyevent.getKeyChar();
if (c < '\036') {
c = '\0';
}
if (i == 37) {
c = '\001';
}
if (i == 39) {
c = '\002';
}
if (i == 38) {
c = '\003';
}
if (i == 40) {
c = '\004';
}
if (i == 17) {
c = '\005';
}
if (i == 8) {
c = '\b';
}
if (i == 127) {
c = '\b';
}
if (i == 9) {
c = '\t';
}
if (i == 10) {
c = '\n';
}
if (c > 0 && c < '\200') {
keyArray[c] = 0;
}
}
public final void keyTyped(KeyEvent keyevent) {
}
public final int readChar(int dummy) {
int k = -1;
if (writeIndex != readIndex) {
k = charQueue[readIndex];
readIndex = readIndex + 1 & 0x7f;
}
return k;
}
public final void focusGained(FocusEvent focusevent) {
awtFocus = true;
shouldClearScreen = true;
raiseWelcomeScreen();
}
public final void focusLost(FocusEvent focusevent) {
awtFocus = false;
for (int i = 0; i < 128; i++) {
keyArray[i] = 0;
}
}
public final void windowActivated(WindowEvent windowevent) {
}
public final void windowClosed(WindowEvent windowevent) {
}
public final void windowClosing(WindowEvent windowevent) {
destroy();
}
public final void windowDeactivated(WindowEvent windowevent) {
}
public final void windowDeiconified(WindowEvent windowevent) {
}
public final void windowIconified(WindowEvent windowevent) {
}
public final void windowOpened(WindowEvent windowevent) {
}
void startUp() {
}
void processGameLoop() {
}
void cleanUpForQuit() {
}
void processDrawing() {
}
void raiseWelcomeScreen() {
}
Component getGameComponent() {
if (gameFrame != null) {
return gameFrame;
} else {
return this;
}
}
public void startRunnable(Runnable runnable, int priority) {
Thread thread = new Thread(runnable);
thread.start();
thread.setPriority(priority);
}
void drawLoadingText(int i, String s) {
while (graphics == null) {
graphics = getGameComponent().getGraphics();
try {
getGameComponent().repaint();
} catch (Exception _ex) {
}
try {
Thread.sleep(1000L);
} catch (Exception _ex) {
}
}
Font font = new Font("Helvetica", 1, 13);
FontMetrics fontmetrics = getGameComponent().getFontMetrics(font);
Font font1 = new Font("Helvetica", 0, 13);
getGameComponent().getFontMetrics(font1);
if (shouldClearScreen) {
graphics.setColor(Color.black);
graphics.fillRect(0, 0, myWidth, myHeight);
shouldClearScreen = false;
}
Color color = new Color(140, 17, 17);
int j = myHeight / 2 - 18;
graphics.setColor(color);
graphics.drawRect(myWidth / 2 - 152, j, 304, 34);
graphics.fillRect(myWidth / 2 - 150, j + 2, i * 3, 30);
graphics.setColor(Color.black);
graphics.fillRect((myWidth / 2 - 150) + i * 3, j + 2, 300 - i * 3, 30);
graphics.setFont(font);
graphics.setColor(Color.white);
graphics.drawString(s, (myWidth - fontmetrics.stringWidth(s)) / 2, j + 22);
}
RSApplet() {
delayTime = 20;
minDelay = 1;
aLongArray7 = new long[10];
shouldDebug = false;
shouldClearScreen = true;
awtFocus = true;
keyArray = new int[128];
charQueue = new int[128];
}
private int anInt4;
private int delayTime;
int minDelay;
private final long[] aLongArray7;
int fps;
boolean shouldDebug;
int myWidth;
int myHeight;
Graphics graphics;
RSImageProducer fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
RSFrame gameFrame;
private boolean shouldClearScreen;
boolean awtFocus;
int idleTime;
int clickMode2;
public int mouseX;
public int mouseY;
private int clickMode1;
public int clickX;
public int clickY;
private long clickTime;
public int yDragged;
public int xDragged;
int clickMode3;
int saveClickX;
int saveClickY;
long aLong29;
public final int[] keyArray;
private final int[] charQueue;
private int readIndex;
private int writeIndex;
public static int anInt34;
}
Open DrawingArea and add these methods:
public static void drawDiamond(int drawX, int drawY, int squareArea, int color, int alpha)
{
int j1 = 256 - alpha;
int k1 = (color >> 16 & 0xff) * alpha;
int l1 = (color >> 8 & 0xff) * alpha;
int i2 = (color & 0xff) * alpha;
int i3 = drawY - squareArea;
if(i3 < 0)
i3 = 0;
int j3 = drawY + squareArea;
if(j3 >= height)
j3 = height - 1;
for(int k3 = i3; k3 <= j3; k3++)
{
int l3 = k3 - drawY;
int i4 = (int)Math.sqrt(squareArea * squareArea - l3 * l3);
int j4 = drawX - i4;
if(j4 < 0)
j4 = 0;
int k4 = drawX + i4;
if(k4 >= width)
k4 = width - 1;
int l4 = j4 + k3 * width;
for(int i5 = j4; i5 <= k4; i5++)
{
int j2 = (pixels[l4] >> 16 & 0xff) * j1;
int k2 = (pixels[l4] >> 8 & 0xff) * j1;
int l2 = (pixels[l4] & 0xff) * j1;
int j5 = ((k1 + j2 >> 8) << 16) + ((l1 + k2 >> 8) << 8) + (i2 + l2 >> 8);
pixels[l4++] = j5;
}
}
}
public static void drawHorizontalLine(int drawX, int drawY, int lineWidth,
int color) {
if (drawY < topY || drawY >= bottomY) {
return;
}
if (drawX < topX) {
lineWidth -= topX - drawX;
drawX = topX;
}
if (drawX + lineWidth > bottomX) {
lineWidth = bottomX - drawX;
}
int offset = drawX + drawY * width;
for (int curPixel = 0; curPixel < lineWidth; curPixel++) {
pixels[offset + curPixel] = color;
}
}
public static void drawBox(int drawX, int drawY, int boxWidth,
int boxHeight, int color) {
drawHorizontalLine(drawX, drawY, boxWidth, color);
drawHorizontalLine(drawX, drawY + boxHeight - 1, boxWidth, color);
drawVerticalLine(drawX, drawY, boxHeight, color);
drawVerticalLine(drawX + boxWidth - 1, drawY, boxHeight, color);
}
public static void fillBoxAlpha(int i, int i_146_, int i_147_, int i_148_,
int i_149_, int i_150_) {
if (i < topX) {
i_147_ -= topX - i;
i = topX;
}
if (i_146_ < topY) {
i_148_ -= topY - i_146_;
i_146_ = topY;
}
if (i + i_147_ > bottomX) {
i_147_ = bottomX - i;
}
if (i_146_ + i_148_ > bottomY) {
i_148_ = bottomY - i_146_;
}
i_149_ = (((i_149_ & 0xff00ff) * i_150_ >> 8 & 0xff00ff) + ((i_149_ & 0xff00)
* i_150_ >> 8 & 0xff00));
int i_151_ = 256 - i_150_;
int i_152_ = width - i_147_;
int i_153_ = i + i_146_ * width;
for (int i_154_ = 0; i_154_ < i_148_; i_154_++) {
for (int i_155_ = -i_147_; i_155_ < 0; i_155_++) {
int i_156_ = pixels[i_153_];
i_156_ = (((i_156_ & 0xff00ff) * i_151_ >> 8 & 0xff00ff) + ((i_156_ & 0xff00)
* i_151_ >> 8 & 0xff00));
pixels[i_153_++] = i_149_ + i_156_;
}
i_153_ += i_152_;
}
}
public static void drawVerticalLine(int i, int i_103_, int i_104_,
int i_105_) {
if (i >= topX && i < bottomX) {
if (i_103_ < topY) {
i_104_ -= topY - i_103_;
i_103_ = topY;
}
if (i_103_ + i_104_ > bottomY) {
i_104_ = bottomY - i_103_;
}
int i_106_ = i + i_103_ * width;
for (int i_107_ = 0; i_107_ < i_104_; i_107_++) {
pixels[i_106_ + i_107_ * width] = i_105_;
}
}
}
public static void fillBox(int drawX, int drawY, int boxWidth,
int boxHeight, int color) {
if (drawX < topX) {
boxWidth -= topX - drawX;
drawX = topX;
}
if (drawY < topY) {
boxHeight -= topY - drawY;
drawY = topY;
}
if (drawX + boxWidth > bottomX) {
boxWidth = bottomX - drawX;
}
if (drawY + boxHeight > bottomY) {
boxHeight = bottomY - drawY;
}
int widthOffsets = width - boxWidth;
int pixelOffset = drawX + drawY * width;
for (int widthOffset = -boxHeight; widthOffset < 0; widthOffset++) {
for (int heightOffset = -boxWidth; heightOffset < 0; heightOffset++) {
pixels[pixelOffset++] = color;
}
pixelOffset += widthOffsets;
}
}
Open up Sprite.java and add these methods:
public Sprite(NamedArchive archive, String s, int spriteIndex) {
Stream image = new Stream(archive.getFile(s + ".dat", null));
Stream index = new Stream(archive.getFile("index.dat", null));
index.currentOffset = image.getShort();
maxWidth = index.getShort();
maxHeight = index.getShort();
int size = index.getUnsignedByte();
int newPixels[] = new int[size];
for (int k = 0; k < size - 1; k++) {
newPixels[k + 1] = index.getShortInt();
if (newPixels[k + 1] == 0)
newPixels[k + 1] = 1;
}
for (int l = 0; l < spriteIndex; l++) {
index.currentOffset += 2;
image.currentOffset += index.getShort() * index.getShort();
index.currentOffset++;
}
xDrawOffset = index.getUnsignedByte();
yDrawOffset = index.getUnsignedByte();
imageWidth = index.getShort();
imageHeight = index.getShort();
int type = index.getUnsignedByte();
int area = imageWidth * imageHeight;
imagePixels = new int[area];
if (type == 0) {
for (int k1 = 0; k1 < area; k1++) {
imagePixels[k1] = newPixels[image.getUnsignedByte()];
}
} else if (type == 1) {
for (int widthIndex = 0; widthIndex < imageWidth; widthIndex++) {
for (int heightIndex = 0; heightIndex < imageHeight; heightIndex++) {
imagePixels[widthIndex + heightIndex * imageWidth] = newPixels[image
.getUnsignedByte()];
}
}
}
}
public void drawTransparentSprite1(int i, int j) {
i += xDrawOffset;
j += yDrawOffset;
int k = i + j * DrawingArea.width;
int l = 0;
int i1 = imageHeight;
int j1 = imageWidth;
int k1 = DrawingArea.width - j1;
int l1 = 0;
if (j < DrawingArea.topY) {
int i2 = DrawingArea.topY - j;
i1 -= i2;
j = DrawingArea.topY;
l += i2 * j1;
k += i2 * DrawingArea.width;
}
if (j + i1 > DrawingArea.bottomY)
i1 -= (j + i1) - DrawingArea.bottomY;
if (i < DrawingArea.topX) {
int j2 = DrawingArea.topX - i;
j1 -= j2;
i = DrawingArea.topX;
l += j2;
k += j2;
l1 += j2;
k1 += j2;
}
if (i + j1 > DrawingArea.bottomX) {
int k2 = (i + j1) - DrawingArea.bottomX;
j1 -= k2;
l1 += k2;
k1 += k2;
}
if (j1 <= 0 || i1 <= 0) {
return;
} else {
createTransparentPixels(DrawingArea.pixels, imagePixels, l, k, j1, i1, k1, l1);
return;
}
}
public void createTransparentPixels(int ai[], int ai1[], int i, int j, int k, int l,
int i1, int j1) {
int k1 = -(k >> 2);
k = -(k & 3);
for (int l1 = -l; l1 < 0; l1++) {
for (int i2 = k1; i2 < 0; i2++) {
ai[j++] = ai1[i++];
ai[j++] = ai1[i++];
ai[j++] = ai1[i++];
ai[j++] = ai1[i++];
}
for (int j2 = k; j2 < 0; j2++)
ai[j++] = ai1[i++];
j += i1;
i += j1;
}
}
Open Background and add these methods:
public Background(NamedArchive class6, String s, int i)
{
Stream byteVector = new Stream(class6.getFile(s + ".dat", null));
Stream byteVector_1 = new Stream(class6.getFile("index.dat", null));
byteVector_1.currentOffset = byteVector.getShort();
maxWidth = byteVector_1.getShort();
maxHeight = byteVector_1.getShort();
int j = byteVector_1.getUnsignedByte();
imagePixels = new int[j];
for(int k = 0; k < j - 1; k++)
imagePixels[k + 1] = byteVector_1.getShortInt();
for(int l = 0; l < i; l++)
{
byteVector_1.currentOffset += 2;
byteVector.currentOffset += byteVector_1.getShort() * byteVector_1.getShort();
byteVector_1.currentOffset++;
}
xDrawOffset = byteVector_1.getUnsignedByte();
yDrawOffset = byteVector_1.getUnsignedByte();
imageWidth = byteVector_1.getShort();
imageHeight = byteVector_1.getShort();
int i1 = byteVector_1.getUnsignedByte();
int j1 = imageWidth * imageHeight;
imageBytes = new byte[j1];
if(i1 == 0)
{
for(int k1 = 0; k1 < j1; k1++)
imageBytes[k1] = byteVector.getByte();
} else
if(i1 == 1)
{
for(int l1 = 0; l1 < imageWidth; l1++)
{
for(int i2 = 0; i2 < imageHeight; i2++)
imageBytes[l1 + i2 * imageWidth] = byteVector.getByte();
}
}
}
public void method50(int i, int j, int k, int l)
{
try
{
int i1 = imageWidth;
int j1 = imageHeight;
int k1 = 0;
int l1 = 0;
int i2 = (i1 << 16) / k;
int j2 = (j1 << 16) / l;
int k2 = maxWidth;
int l2 = maxHeight;
i2 = (k2 << 16) / k;
j2 = (l2 << 16) / l;
i += ((xOffset * k + k2) - 1) / k2;
j += ((yOffset * l + l2) - 1) / l2;
if((xOffset * k) % k2 != 0)
k1 = (k2 - (xOffset * k) % k2 << 16) / k;
if((yOffset * l) % l2 != 0)
l1 = (l2 - (yOffset * l) % l2 << 16) / l;
k = (k * (imageWidth - (k1 >> 16))) / k2;
l = (l * (imageHeight - (l1 >> 16))) / l2;
int i3 = i + j * DrawingArea.width;
int j3 = DrawingArea.width - k;
if(j < DrawingArea.topY)
{
int k3 = DrawingArea.topY - j;
l -= k3;
j = 0;
i3 += k3 * DrawingArea.width;
l1 += j2 * k3;
}
if(j + l > DrawingArea.bottomY)
l -= (j + l) - DrawingArea.bottomY;
if(i < DrawingArea.topX)
{
int l3 = DrawingArea.topX - i;
k -= l3;
i = 0;
i3 += l3;
k1 += i2 * l3;
j3 += l3;
}
if(i + k > DrawingArea.bottomX)
{
int i4 = (i + k) - DrawingArea.bottomX;
k -= i4;
j3 += i4;
}
method51(DrawingArea.pixels, imagePixels, palette, k1, l1, i3, j3, k, l, i2, j2, i1);
}
catch(Exception exception)
{
System.out.println("error in sprite clipping routine");
exception.printStackTrace();
}
}
public void method51(int ai[], byte abyte0[], int ai1[], int i, int j, int k, int l,
int i1, int j1, int k1, int l1, int i2)
{
try
{
int j2 = i;
for(int k2 = -j1; k2 < 0; k2++)
{
int l2 = (j >> 16) * i2;
for(int i3 = -i1; i3 < 0; i3++)
{
byte byte0 = abyte0[(i >> 16) + l2];
if(byte0 != 0)
ai[k++] = ai1[byte0 & 0xff];
else
k++;
i += k1;
}
j += l1;
i = j2;
k += l;
}
}
catch(Exception exception)
{
System.out.println("error in plot_scale");
exception.printStackTrace();
}
}
Download and add these classes to your client files:
UppIT - Free File hosting - New Files.rar (Only the registered members can see the link.)
The world map data: UppIT - Free File hosting - worldmap317.dat (Only the registered members can see the link.)
Source to my World Map Editor(Highly refactored):UppIT - Free File hosting - World Applety.rar (Only the registered members can see the link.)
Finished Result:
Only the registered members can see the link.
DISCLAIMER:
To load the world map, set worldMap = true;. To close it once opened, click the top right hand corner of the screen.
That is all. If you have errors. Fix them yourselves. You have been given the resources to fix anything and everything you may encounter in this tutorial. And do not ask for where to put the worldmap317.dat because you will not be answered. Read the code to find out. And no non-renamed versions shall be released. I will report anyone who does this.
Warning this will be very long...
Step 1. Add this to client.java anywhere:
public void method13(byte abyte0[], byte abyte1[][], byte abyte2[][],
byte abyte3[][]) {
for (int i = 0; i < abyte0.length;) {
int k = (abyte0[i++] & 0xff) * 64 - anInt111;
int l = (abyte0[i++] & 0xff) * 64 - anInt112;
if (k > 0 && l > 0 && k + 64 < anInt113 && l + 64 < anInt114) {
for (int i1 = 0; i1 < 64; i1++) {
byte abyte4[] = abyte1[i1 + k];
byte abyte5[] = abyte2[i1 + k];
byte abyte6[] = abyte3[i1 + k];
int l1 = anInt114 - l - 1;
for (int i2 = -64; i2 < 0; i2++) {
do {
int j = abyte0[i++] & 0xff;
if (j == 0)
break;
if (j < 29)
abyte4[l1] = (byte) j;
else if (j < 160) {
abyte5[l1] = (byte) (j - 28);
} else {
abyte6[l1] = (byte) (j - 159);
selectedIconXOffsets[anInt137] = i1 + k;
selectedIconYOffsets[anInt137] = l1;
selectedIconIds[anInt137] = j - 160;
anInt137++;
}
} while (true);
l1--;
}
}
} else {
for (int j1 = 0; j1 < 64; j1++) {
for (int k1 = -64; k1 < 0; k1++) {
byte byte0;
do
byte0 = abyte0[i++];
while (byte0 != 0);
}
}
}
}
}
public void method14(byte abyte0[], byte abyte1[][]) {
for (int i = 0; i < abyte0.length;) {
int j = (abyte0[i++] & 0xff) * 64 - anInt111;
int k = (abyte0[i++] & 0xff) * 64 - anInt112;
if (j > 0 && k > 0 && j + 64 < anInt113 && k + 64 < anInt114) {
for (int l = 0; l < 64; l++) {
byte abyte2[] = abyte1[l + j];
int i1 = anInt114 - k - 1;
for (int j1 = -64; j1 < 0; j1++)
abyte2[i1--] = abyte0[i++];
}
} else {
i += 4096;
}
}
}
public void method15(byte abyte0[], int ai[][], byte abyte1[][]) {
for (int i = 0; i < abyte0.length;) {
int j = (abyte0[i++] & 0xff) * 64 - anInt111;
int k = (abyte0[i++] & 0xff) * 64 - anInt112;
if (j > 0 && k > 0 && j + 64 < anInt113 && k + 64 < anInt114) {
for (int l = 0; l < 64; l++) {
int ai1[] = ai[l + j];
byte abyte2[] = abyte1[l + j];
int j1 = anInt114 - k - 1;
for (int k1 = -64; k1 < 0; k1++) {
byte byte0 = abyte0[i++];
if (byte0 != 0) {
abyte2[j1] = abyte0[i++];
int l1 = 0;
if (byte0 > 0)
l1 = anIntArray116[byte0];
ai1[j1--] = l1;
} else {
ai1[j1--] = 0;
}
}
}
} else {
for (int i1 = -4096; i1 < 0; i1++) {
byte byte1 = abyte0[i++];
if (byte1 != 0)
i++;
}
}
}
}
public void method16(byte abyte0[][], int ai[][]) {
int i = anInt113;
int j = anInt114;
int ai1[] = new int[j];
for (int k = 0; k < j; k++)
ai1[k] = 0;
for (int l = 5; l < i - 5; l++) {
byte abyte1[] = abyte0[l + 5];
byte abyte2[] = abyte0[l - 5];
for (int i1 = 0; i1 < j; i1++)
ai1[i1] += anIntArray115[abyte1[i1] & 0xff]
- anIntArray115[abyte2[i1] & 0xff];
if (l > 10 && l < i - 10) {
int j1 = 0;
int k1 = 0;
int l1 = 0;
int ai2[] = ai[l];
for (int i2 = 5; i2 < j - 5; i2++) {
int j2 = ai1[i2 - 5];
int k2 = ai1[i2 + 5];
j1 += (k2 >> 20) - (j2 >> 20);
k1 += (k2 >> 10 & 0x3ff) - (j2 >> 10 & 0x3ff);
l1 += (k2 & 0x3ff) - (j2 & 0x3ff);
if (l1 > 0)
ai2[i2] = method17((double) j1 / 8533D,
(double) k1 / 8533D, (double) l1 / 8533D);
}
}
}
}
public int method17(double d, double d1, double d2) {
double d3 = d2;
double d4 = d2;
double d5 = d2;
if (d1 != 0.0D) {
double d6;
if (d2 < 0.5D)
d6 = d2 * (1.0D + d1);
else
d6 = (d2 + d1) - d2 * d1;
double d7 = 2D * d2 - d6;
double d8 = d + 0.33333333333333331D;
if (d8 > 1.0D)
d8--;
double d9 = d;
double d10 = d - 0.33333333333333331D;
if (d10 < 0.0D)
d10++;
if (6D * d8 < 1.0D)
d3 = d7 + (d6 - d7) * 6D * d8;
else if (2D * d8 < 1.0D)
d3 = d6;
else if (3D * d8 < 2D)
d3 = d7 + (d6 - d7) * (0.66666666666666663D - d8) * 6D;
else
d3 = d7;
if (6D * d9 < 1.0D)
d4 = d7 + (d6 - d7) * 6D * d9;
else if (2D * d9 < 1.0D)
d4 = d6;
else if (3D * d9 < 2D)
d4 = d7 + (d6 - d7) * (0.66666666666666663D - d9) * 6D;
else
d4 = d7;
if (6D * d10 < 1.0D)
d5 = d7 + (d6 - d7) * 6D * d10;
else if (2D * d10 < 1.0D)
d5 = d6;
else if (3D * d10 < 2D)
d5 = d7 + (d6 - d7) * (0.66666666666666663D - d10) * 6D;
else
d5 = d7;
}
int i = (int) (d3 * 256D);
int j = (int) (d4 * 256D);
int k = (int) (d5 * 256D);
int l = (i << 16) + (j << 8) + k;
return l;
}
public void nullLoader1() {
try {
anIntArray115 = null;
anIntArray116 = null;
anIntArrayArray117 = null;
anIntArrayArray118 = null;
aByteArrayArray119 = null;
aByteArrayArray120 = null;
aByteArrayArray121 = null;
aByteArrayArray122 = null;
mapScenes = null;
mapFunction = null;
boldFont = null;
mapfuntionXOffsets = null;
mapfunctionYOffsets = null;
mapfunctionIds = null;
selectedIconXOffsets = null;
selectedIconYOffsets = null;
selectedIconIds = null;
overviewSprite = null;
maplocationNames = null;
anIntArray166 = null;
anIntArray167 = null;
anIntArray168 = null;
mapIdentifiers = null;
System.gc();
return;
} catch (Throwable _ex) {
return;
}
}
public void processLoop() {
if (super.keyArray[1] == 1) {
anInt171 = (int) ((double) anInt171 - 16D / aDouble169);
aBoolean109 = true;
}
if (super.keyArray[2] == 1) {
anInt171 = (int) ((double) anInt171 + 16D / aDouble169);
aBoolean109 = true;
}
if (super.keyArray[3] == 1) {
anInt172 = (int) ((double) anInt172 - 16D / aDouble169);
aBoolean109 = true;
}
if (super.keyArray[4] == 1) {
anInt172 = (int) ((double) anInt172 + 16D / aDouble169);
aBoolean109 = true;
}
for (int action = 1; action > 0;) {
action = super.readChar(0);
if (action == 49) {
zoomLevel = 3D;
aBoolean109 = true;
}
if (action == 50) {
zoomLevel = 4D;
aBoolean109 = true;
}
if (action == 51) {
zoomLevel = 6D;
aBoolean109 = true;
}
if (action == 52) {
zoomLevel = 8D;
aBoolean109 = true;
}
if (action == 107 || action == 75) {
showLocationKey = !showLocationKey;
aBoolean109 = true;
}
if (action == 111 || action == 79) {
overviewVisible = !overviewVisible;
aBoolean109 = true;
}
if (super.gameFrame != null && action == 101) {// write world map
// image
System.out.println("Starting export...");
Sprite image = new Sprite(anInt113 * 2, anInt114 * 2);
image.initSpriteDrawingArea();
method19(0, 0, anInt113, anInt114, 0, 0, anInt113 * 2,
anInt114 * 2);
super.fullGameScreen.initDrawingArea();
int area = image.imagePixels.length;
byte pixelData[] = new byte[area * 3];
int offset = 0;
for (int l2 = 0; l2 < area; l2++) {
int color = image.imagePixels[l2];
pixelData[offset++] = (byte) (color >> 16);
pixelData[offset++] = (byte) (color >> 8);
pixelData[offset++] = (byte) color;
}
System.out.println("Saving to disk");
try {
BufferedOutputStream bufferedoutputstream = new BufferedOutputStream(
new FileOutputStream("map-" + anInt113 * 2 + "-"
+ anInt114 * 2 + "-rgb.raw"));
bufferedoutputstream.write(pixelData);
bufferedoutputstream.close();
} catch (Exception exception) {
exception.printStackTrace();
}
System.out.println("Done export: " + anInt113 * 2 + ","
+ anInt114 * 2);
}
}
if (super.clickMode3 == 1) {
if (super.clickX >= 765 - 20 - 5
&& super.clickX <= 760
&& super.clickY >= 0
&& super.clickY <= 50) {
worldMap = false;
resetImageProducers2();
}
anInt158 = super.clickX;
anInt159 = super.clickY;
anInt160 = anInt171;
anInt161 = anInt172;
if (super.clickX > 170 && super.clickX < 219 && super.clickY > 481
&& super.clickY < 500) {
zoomLevel = 3D;
anInt158 = -1;
}// Zoom 37
if (super.clickX > 230 && super.clickX < 280 && super.clickY > 481
&& super.clickY < 503) {
zoomLevel = 4D;
anInt158 = -1;
}// Zoom 50
if (super.clickX > 290 && super.clickX < 340 && super.clickY > 481
&& super.clickY < 503) {
zoomLevel = 6D;
anInt158 = -1;
}// Zoom 75
if (super.clickX > 350 && super.clickX < 400 && super.clickY > 481
&& super.clickY < 503) {
zoomLevel = 8D;
anInt158 = -1;
}// Zoom 100
if (super.clickX > locationKeyPanelX
&& super.clickY > locationKeyPanelY + locationPanelHeight
&& super.clickX < locationKeyPanelX + locationPanelWidth
&& super.clickY < 503) {// Hide/Show Location
showLocationKey = !showLocationKey;
anInt158 = -1;
}
if (super.clickX > overviewPanelX
&& super.clickY > overViewPanelY + overviewPanelHeight
&& super.clickX < overviewPanelX + overviewPanelWidth
&& super.clickY < 503) {// Hide/Show Overview
overviewVisible = !overviewVisible;
anInt158 = -1;
}
if (showLocationKey) {
if (super.clickX > locationKeyPanelX
&& super.clickY > locationKeyPanelY
&& super.clickX < locationKeyPanelX
+ locationPanelWidth
&& super.clickY < locationKeyPanelY
+ locationPanelHeight) {
anInt158 = -1;
}
if (super.clickX > locationKeyPanelX
&& super.clickY > locationKeyPanelY
&& super.clickX < locationKeyPanelX
+ locationPanelWidth
&& super.clickY < locationKeyPanelY + 18
&& locationListPosition > 0) {
locationListPosition -= 25;
}// Previous Page
if (super.clickX > locationKeyPanelX
&& super.clickY > (locationKeyPanelY + locationPanelHeight) - 18
&& super.clickX < locationKeyPanelX
+ locationPanelWidth
&& super.clickY < locationKeyPanelY
+ locationPanelHeight
&& locationListPosition < 50) {
locationListPosition += 25;
}// Next Page
}
aBoolean109 = true;
}
if (showLocationKey) {
hoveredLocationKey = -1;
if (super.xDragged > locationKeyPanelX
&& super.xDragged < locationKeyPanelX + locationPanelWidth) {
int j = locationKeyPanelY + 21 + 5;
for (int j1 = 0; j1 < 25; j1++)
if (j1 + anInt145 >= mapIdentifiers.length
|| !mapIdentifiers[j1 + anInt145].equals("???")) {
if (super.yDragged >= j && super.yDragged < j + 17) {
hoveredLocationKey = j1 + anInt145;
if (super.clickMode3 == 1) {
selectedIcon = j1 + anInt145;
anInt151 = 50;
}
}
j += 17;
}
}
if (hoveredLocationKey != anInt149) {
anInt149 = hoveredLocationKey;
aBoolean109 = true;
}
}
if ((super.clickMode2 == 1 || super.clickMode3 == 1) && overviewVisible) {
int k = super.clickX;
int k1 = super.clickY;
if (super.clickMode2 == 1) {
k = super.xDragged;
k1 = super.yDragged;
}
if (k > overviewPanelX && k1 > overViewPanelY
&& k < overviewPanelX + overviewPanelWidth
&& k1 < overViewPanelY + overviewPanelHeight) {
anInt171 = ((k - overviewPanelX) * anInt113)
/ overviewPanelWidth;
anInt172 = ((k1 - overViewPanelY) * anInt114)
/ overviewPanelHeight;
anInt158 = -1;
aBoolean109 = true;
}
}
if (super.clickMode2 == 1 && anInt158 != -1) {
anInt171 = anInt160
+ (int) (((double) (anInt158 - super.xDragged) * 2D) / zoomLevel);
anInt172 = anInt161
+ (int) (((double) (anInt159 - super.yDragged) * 2D) / zoomLevel);
aBoolean109 = true;
}
if (aDouble169 < zoomLevel) {
aBoolean109 = true;
aDouble169 += aDouble169 / 30D;
if (aDouble169 > zoomLevel)
aDouble169 = zoomLevel;
}
if (aDouble169 > zoomLevel) {
aBoolean109 = true;
aDouble169 -= aDouble169 / 30D;
if (aDouble169 < zoomLevel)
aDouble169 = zoomLevel;
}
if (anInt145 < locationListPosition) {
aBoolean109 = true;
anInt145++;
}
if (anInt145 > locationListPosition) {
aBoolean109 = true;
anInt145--;
}
if (anInt151 > 0) {
aBoolean109 = true;
anInt151--;
}
int l = anInt171 - (int) (765D / aDouble169);
int l1 = anInt172 - (int) (503D / aDouble169);
int i2 = anInt171 + (int) (765D / aDouble169);
int k2 = anInt172 + (int) (503D / aDouble169);
if (l < 48)
anInt171 = 48 + (int) (765D / aDouble169);
if (l1 < 48)
anInt172 = 48 + (int) (503D / aDouble169);
if (i2 > anInt113 - 48)
anInt171 = anInt113 - 48 - (int) (765D / aDouble169);
if (k2 > anInt114 - 48)
anInt172 = anInt114 - 48 - (int) (503D / aDouble169);
}
public boolean hoveredLogout = false;
Sprite[] close = new Sprite[2];
public void drawWorldMap() {
if (aBoolean109) {
aBoolean109 = false;
anInt110 = 0;
DrawingArea.setAllPixelsToZero();
int i = anInt171 - (int) (765D / aDouble169);
int j = anInt172 - (int) (503D / aDouble169);
int k = anInt171 + (int) (765D / aDouble169);
int l = anInt172 + (int) (503D / aDouble169);
method19(i, j, k, l, 0, 0, 765, 503);
if (overviewVisible) {
overviewSprite.drawTransparentSprite1(overviewPane lX,
overViewPanelY);
DrawingArea.fillBoxAlpha(overviewPanelX
+ (overviewPanelWidth * i) / anInt113, overViewPanelY
+ (overviewPanelHeight * j) / anInt114,
((k - i) * overviewPanelWidth) / anInt113,
((l - j) * overviewPanelHeight) / anInt114, 0xff0000,
128);
DrawingArea.drawBox(overviewPanelX + (overviewPanelWidth * i)
/ anInt113, overViewPanelY + (overviewPanelHeight * j)
/ anInt114, ((k - i) * overviewPanelWidth) / anInt113,
((l - j) * overviewPanelHeight) / anInt114, 0xff0000);
if (anInt151 > 0 && anInt151 % 10 < 5) {
for (int index = 0; index < anInt137; index++)
if (selectedIconIds[index] == selectedIcon) {
int diamondX = overviewPanelX
+ (overviewPanelWidth * selectedIconXOffsets[index])
/ anInt113;
int diamondY = overViewPanelY
+ (overviewPanelHeight * selectedIconYOffsets[index])
/ anInt114;
DrawingArea.drawDiamond(diamondX, diamondY, 2,
0xffff00, 256);// This draws the little
// flashing diamonds on the
// overview
}
}
}
if (showLocationKey) {
drawPanel(locationKeyPanelX, locationKeyPanelY,
locationPanelWidth, 18, 0x999999, 0x777777, 0x555555,
"Prev page");
drawPanel(locationKeyPanelX, locationKeyPanelY + 18,
locationPanelWidth, locationPanelHeight - 36, 0x999999,
0x777777, 0x555555, "");
drawPanel(locationKeyPanelX,
(locationKeyPanelY + locationPanelHeight) - 18,
locationPanelWidth, 18, 0x999999, 0x777777, 0x555555,
"Next page");
int drawY = locationKeyPanelY + 3 + 18;
for (int index = 0; index < 25; index++) {
if (index + anInt145 < newmapFunction.length
&& index + anInt145 < mapIdentifiers.length) {
if (mapIdentifiers[index + anInt145].equals("???"))
continue;
newmapFunction[index + anInt145].drawSprite(
locationKeyPanelX + 3, drawY);
myboldFont.drawText(mapIdentifiers[index + anInt145],
locationKeyPanelX + 21, drawY + 14, 0);
int textColor = 0xffffff;
if (hoveredLocationKey == index + anInt145)
textColor = 0xbbaaaa;
if (anInt151 > 0 && anInt151 % 10 < 5
&& selectedIcon == index + anInt145)
textColor = 0xffff00;
myboldFont.drawText(mapIdentifiers[index + anInt145],
locationKeyPanelX + 20, drawY + 13, textColor);
}
drawY += 17;
}
}
drawPanel(overviewPanelX, overViewPanelY + overviewPanelHeight,
overviewPanelWidth, 18, anInt103, anInt104, anInt105,
"Overview");
drawPanel(locationKeyPanelX, locationKeyPanelY
+ locationPanelHeight, locationPanelWidth, 18, anInt103,
anInt104, anInt105, "Key");
if (zoomLevel == 3D) {
drawPanel(170, 481, 50, 20, anInt106, anInt107, anInt108, "37%");
} else {
drawPanel(170, 481, 50, 20, anInt103, anInt104, anInt105, "37%");
}
if (zoomLevel == 4D) {
drawPanel(230, 481, 50, 20, anInt106, anInt107, anInt108, "50%");
} else {
drawPanel(230, 481, 50, 20, anInt103, anInt104, anInt105, "50%");
}
if (zoomLevel == 6D) {
drawPanel(290, 481, 50, 20, anInt106, anInt107, anInt108, "75%");
} else {
drawPanel(290, 481, 50, 20, anInt103, anInt104, anInt105, "75%");
}
if (zoomLevel == 8D) {
drawPanel(350, 481, 50, 20, anInt106, anInt107, anInt108,
"100%");
} else {
drawPanel(350, 481, 50, 20, anInt103, anInt104, anInt105,
"100%");
}
}
anInt110--;
if (anInt110 <= 0) {
super.fullGameScreen.drawGraphics(0, super.graphics, 0);
anInt110 = 50;
}
}
public void stupidMethodThatDoesNothing() {
anInt110 = 0;
}
public void drawPanel(int i, int j, int k, int l, int i1, int color,
int k1, String s) {
DrawingArea.drawBox(i, j, k, l, 0);
i++;
j++;
k -= 2;
l -= 2;
DrawingArea.fillBox(i, j, k, l, color);
DrawingArea.drawHorizontalLine(i, j, k, i1);
DrawingArea.drawVerticalLine(i, j, l, i1);
DrawingArea.drawHorizontalLine(i, (j + l) - 1, k, k1);
DrawingArea.drawVerticalLine((i + k) - 1, j, l, k1);
myboldFont.method55(s, i + k / 2 + 1, j + l / 2 + 1 + 4, 0);
myboldFont.method55(s, i + k / 2, j + l / 2 + 4, 0xffffff);
}
public void method19(int i, int j, int k, int l, int i1, int j1, int k1,
int l1) {
int i2 = k - i;
int j2 = l - j;
int k2 = (k1 - i1 << 16) / i2;
int l2 = (l1 - j1 << 16) / j2;
for (int i3 = 0; i3 < i2; i3++) {
int j3 = k2 * i3 >> 16;
int l3 = k2 * (i3 + 1) >> 16;
int j4 = l3 - j3;
if (j4 > 0) {
j3 += i1;
l3 += i1;
int ai[] = anIntArrayArray117[i3 + i];
int ai1[] = anIntArrayArray118[i3 + i];
byte abyte0[] = aByteArrayArray119[i3 + i];
for (int j7 = 0; j7 < j2; j7++) {
int i8 = l2 * j7 >> 16;
int l8 = l2 * (j7 + 1) >> 16;
int l9 = l8 - i8;
if (l9 > 0) {
i8 += j1;
l8 += j1;
int l10 = ai1[j7 + j];
if (l10 == 0) {
DrawingArea.fillBox(j3, i8, l3 - j3, l8 - i8, ai[j7
+ j]);
} else {
byte byte0 = abyte0[j7 + j];
int l11 = byte0 & 0xfc;
if (l11 == 0 || j4 <= 1 || l9 <= 1)
DrawingArea.fillBox(j3, i8, j4, l9, l10);
else
method20(DrawingArea.pixels, i8
* DrawingArea.width + j3, ai[j7 + j],
l10, j4, l9, l11 >> 2, byte0 & 3);
}
}
}
}
}
if (k - i > k1 - i1)
return;
int mapfunctionCount = 0;
for (int i4 = 0; i4 < i2; i4++) {
int k4 = k2 * i4 >> 16;
int i5 = k2 * (i4 + 1) >> 16;
int i6 = i5 - k4;
if (i6 > 0) {
byte abyte1[] = aByteArrayArray120[i4 + i];
byte abyte2[] = aByteArrayArray122[i4 + i];
byte abyte3[] = aByteArrayArray121[i4 + i];
for (int i9 = 0; i9 < j2; i9++) {
int i10 = l2 * i9 >> 16;
int i11 = l2 * (i9 + 1) >> 16;
int k11 = i11 - i10;
if (k11 > 0) {
int i12 = abyte1[i9 + j] & 0xff;
if (i12 != 0) {
int k12;
if (i6 == 1)
k12 = k4;
else
k12 = i5 - 1;
int j13;
if (k11 == 1)
j13 = i10;
else
j13 = i11 - 1;
int i14 = 0xcccccc;
if (i12 >= 5 && i12 <= 8 || i12 >= 13 && i12 <= 16
|| i12 >= 21 && i12 <= 24 || i12 == 27
|| i12 == 28) {
i14 = 0xcc0000;
i12 -= 4;
}
if (i12 == 1)
DrawingArea.drawVerticalLine(k4, i10, k11, i14);
else if (i12 == 2)
DrawingArea
.drawHorizontalLine(k4, i10, i6, i14);
else if (i12 == 3)
DrawingArea
.drawVerticalLine(k12, i10, k11, i14);
else if (i12 == 4)
DrawingArea
.drawHorizontalLine(k4, j13, i6, i14);
else if (i12 == 9) {
DrawingArea.drawVerticalLine(k4, i10, k11,
0xffffff);
DrawingArea
.drawHorizontalLine(k4, i10, i6, i14);
} else if (i12 == 10) {
DrawingArea.drawVerticalLine(k12, i10, k11,
0xffffff);
DrawingArea
.drawHorizontalLine(k4, i10, i6, i14);
} else if (i12 == 11) {
DrawingArea.drawVerticalLine(k12, i10, k11,
0xffffff);
DrawingArea
.drawHorizontalLine(k4, j13, i6, i14);
} else if (i12 == 12) {
DrawingArea.drawVerticalLine(k4, i10, k11,
0xffffff);
DrawingArea
.drawHorizontalLine(k4, j13, i6, i14);
} else if (i12 == 17)
DrawingArea.drawHorizontalLine(k4, i10, 1, i14);
else if (i12 == 18)
DrawingArea
.drawHorizontalLine(k12, i10, 1, i14);
else if (i12 == 19)
DrawingArea
.drawHorizontalLine(k12, j13, 1, i14);
else if (i12 == 20)
DrawingArea.drawHorizontalLine(k4, j13, 1, i14);
else if (i12 == 25) {
for (int j14 = 0; j14 < k11; j14++)
DrawingArea.drawHorizontalLine(k4 + j14,
j13 - j14, 1, i14);
} else if (i12 == 26) {
for (int k14 = 0; k14 < k11; k14++)
DrawingArea.drawHorizontalLine(k4 + k14,
i10 + k14, 1, i14);
}
}
int l12 = abyte2[i9 + j] & 0xff;
if (l12 != 0)
newmapScenes[l12 - 1].drawSprite(k4 - i6 / 2, i10
- k11 / 2);
try {
// newmapScenes[l12 - 1].method50(k4 - i6 / 2, i10 -
// k11
// / 2, i6 * 2, k11 * 2);
} catch (Exception e) {
e.printStackTrace();
}
int k13 = abyte3[i9 + j] & 0xff;
if (k13 != 0) {
mapfunctionIds[mapfunctionCount] = k13 - 1;
mapfuntionXOffsets[mapfunctionCount] = k4 + i6 / 2;
mapfunctionYOffsets[mapfunctionCount] = i10 + k11
/ 2;
mapfunctionCount++;
}
}
}
}
}
try {
for (int index = 0; index < mapfunctionCount; index++)
if (newmapFunction[mapfunctionIds[index]] != null)
newmapFunction[mapfunctionIds[index]].drawSprite(
mapfuntionXOffsets[index] - 7,
mapfunctionYOffsets[index] - 7);
if (anInt151 > 0) {
for (int index = 0; index < mapfunctionCount; index++)
if (mapfunctionIds[index] == selectedIcon) {
newmapFunction[mapfunctionIds[index]].drawSprite(
mapfuntionXOffsets[index] - 7,
mapfunctionYOffsets[index] - 7);
if (anInt151 % 10 < 5) {
DrawingArea.drawDiamond(mapfuntionXOffsets[index],
mapfunctionYOffsets[index], 15, 0xffff00,
128);
DrawingArea.drawDiamond(mapfuntionXOffsets[index],
mapfunctionYOffsets[index], 7, 0xffffff,
256);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
if (aDouble169 == zoomLevel && aBoolean162) {
for (int index = 0; index < anInt163; index++) {
int j6 = anIntArray166[index];
int l6 = anIntArray167[index];
j6 -= anInt111;
l6 = (anInt112 + anInt114) - l6;
int k7 = i1 + ((k1 - i1) * (j6 - i)) / (k - i);
int j8 = j1 + ((l1 - j1) * (l6 - j)) / (l - j);
int j9 = anIntArray168[index];
int j10 = 0xffffff;
ScaledFont class1_sub1_sub1_sub1 = aSprite_126;
if (j9 == 0) {
if (aDouble169 == 3D)
class1_sub1_sub1_sub1 = aSprite_126;
if (aDouble169 == 4D)
class1_sub1_sub1_sub1 = aSprite_127;
if (aDouble169 == 6D)
class1_sub1_sub1_sub1 = aSprite_128;
if (aDouble169 == 8D)
class1_sub1_sub1_sub1 = aSprite_129;
}
if (j9 == 1) {
if (aDouble169 == 3D)
class1_sub1_sub1_sub1 = aSprite_128;
if (aDouble169 == 4D)
class1_sub1_sub1_sub1 = aSprite_129;
if (aDouble169 == 6D)
class1_sub1_sub1_sub1 = aSprite_130;
if (aDouble169 == 8D)
class1_sub1_sub1_sub1 = aSprite_131;
}
if (j9 == 2) {
j10 = 0xffaa00;
if (aDouble169 == 3D)
class1_sub1_sub1_sub1 = aSprite_130;
if (aDouble169 == 4D)
class1_sub1_sub1_sub1 = aSprite_131;
if (aDouble169 == 6D)
class1_sub1_sub1_sub1 = aSprite_132;
if (aDouble169 == 8D)
class1_sub1_sub1_sub1 = aSprite_133;
}
if (class1_sub1_sub1_sub1 != null) {
String s = maplocationNames[index];
int j12 = 1;
for (int i13 = 0; i13 < s.length(); i13++)
if (s.charAt(i13) == '/')
j12++;
j8 -= (class1_sub1_sub1_sub1.method40() * (j12 - 1)) / 2;
j8 += class1_sub1_sub1_sub1.method44() / 2;
do {
int l13 = s.indexOf("/");
if (l13 == -1) {
class1_sub1_sub1_sub1
.method38(s, k7, j8, j10, true);
break;
}
String s1 = s.substring(0, l13);
class1_sub1_sub1_sub1.method38(s1, k7, j8, j10, true);
j8 += class1_sub1_sub1_sub1.method40();
s = s.substring(l13 + 1);
} while (true);
}
}
}
if (aBoolean102) {
for (int l5 = anInt111 / 64; l5 < (anInt111 + anInt113) / 64; l5++) {
for (int k6 = anInt112 / 64; k6 < (anInt112 + anInt114) / 64; k6++) {
int i7 = l5 * 64;
int l7 = k6 * 64;
i7 -= anInt111;
l7 = (anInt112 + anInt114) - l7;
int k8 = i1 + ((k1 - i1) * (i7 - i)) / (k - i);
int k9 = j1 + ((l1 - j1) * (l7 - 64 - j)) / (l - j);
int k10 = i1 + ((k1 - i1) * ((i7 + 64) - i)) / (k - i);
int j11 = j1 + ((l1 - j1) * (l7 - j)) / (l - j);
DrawingArea.drawBox(k8, k9, k10 - k8, j11 - k9, 0xffffff);
myboldFont.method54(l5 + "_" + k6, k10 - 5, j11 - 5,
0xffffff);
if (l5 == 33 && k6 >= 71 && k6 <= 73)
myboldFont.method55("u_pass", (k10 + k8) / 2,
(j11 + k9) / 2, 0xff0000);
}
}
}
}
public void method20(int ai[], int i, int j, int k, int l, int i1, int j1,
int k1) {
int l1 = DrawingArea.width - l;
if (j1 == 9) {
j1 = 1;
k1 = k1 + 1 & 3;
}
if (j1 == 10) {
j1 = 1;
k1 = k1 + 3 & 3;
}
if (j1 == 11) {
j1 = 8;
k1 = k1 + 3 & 3;
}
if (j1 == 1) {
if (k1 == 0) {
for (int i2 = 0; i2 < i1; i2++) {
for (int i10 = 0; i10 < l; i10++)
if (i10 <= i2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j2 = i1 - 1; j2 >= 0; j2--) {
for (int j10 = 0; j10 < l; j10++)
if (j10 <= j2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k2 = 0; k2 < i1; k2++) {
for (int k10 = 0; k10 < l; k10++)
if (k10 >= k2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l2 = i1 - 1; l2 >= 0; l2--) {
for (int l10 = 0; l10 < l; l10++)
if (l10 >= l2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 2) {
if (k1 == 0) {
for (int i3 = i1 - 1; i3 >= 0; i3--) {
for (int i11 = 0; i11 < l; i11++)
if (i11 <= i3 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j3 = 0; j3 < i1; j3++) {
for (int j11 = 0; j11 < l; j11++)
if (j11 >= j3 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k3 = 0; k3 < i1; k3++) {
for (int k11 = l - 1; k11 >= 0; k11--)
if (k11 <= k3 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l3 = i1 - 1; l3 >= 0; l3--) {
for (int l11 = l - 1; l11 >= 0; l11--)
if (l11 >= l3 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 3) {
if (k1 == 0) {
for (int i4 = i1 - 1; i4 >= 0; i4--) {
for (int i12 = l - 1; i12 >= 0; i12--)
if (i12 <= i4 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j4 = i1 - 1; j4 >= 0; j4--) {
for (int j12 = 0; j12 < l; j12++)
if (j12 >= j4 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k4 = 0; k4 < i1; k4++) {
for (int k12 = 0; k12 < l; k12++)
if (k12 <= k4 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l4 = 0; l4 < i1; l4++) {
for (int l12 = l - 1; l12 >= 0; l12--)
if (l12 >= l4 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 4) {
if (k1 == 0) {
for (int i5 = i1 - 1; i5 >= 0; i5--) {
for (int i13 = 0; i13 < l; i13++)
if (i13 >= i5 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j5 = 0; j5 < i1; j5++) {
for (int j13 = 0; j13 < l; j13++)
if (j13 <= j5 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k5 = 0; k5 < i1; k5++) {
for (int k13 = l - 1; k13 >= 0; k13--)
if (k13 >= k5 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l5 = i1 - 1; l5 >= 0; l5--) {
for (int l13 = l - 1; l13 >= 0; l13--)
if (l13 <= l5 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 5) {
if (k1 == 0) {
for (int i6 = i1 - 1; i6 >= 0; i6--) {
for (int i14 = l - 1; i14 >= 0; i14--)
if (i14 >= i6 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j6 = i1 - 1; j6 >= 0; j6--) {
for (int j14 = 0; j14 < l; j14++)
if (j14 <= j6 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k6 = 0; k6 < i1; k6++) {
for (int k14 = 0; k14 < l; k14++)
if (k14 >= k6 >> 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l6 = 0; l6 < i1; l6++) {
for (int l14 = l - 1; l14 >= 0; l14--)
if (l14 <= l6 << 1)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
} else {
return;
}
}
if (j1 == 6) {
if (k1 == 0) {
for (int i7 = 0; i7 < i1; i7++) {
for (int i15 = 0; i15 < l; i15++)
if (i15 <= l / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j7 = 0; j7 < i1; j7++) {
for (int j15 = 0; j15 < l; j15++)
if (j7 <= i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k7 = 0; k7 < i1; k7++) {
for (int k15 = 0; k15 < l; k15++)
if (k15 >= l / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l7 = 0; l7 < i1; l7++) {
for (int l15 = 0; l15 < l; l15++)
if (l7 >= i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
}
if (j1 == 7) {
if (k1 == 0) {
for (int i8 = 0; i8 < i1; i8++) {
for (int i16 = 0; i16 < l; i16++)
if (i16 <= i8 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j8 = i1 - 1; j8 >= 0; j8--) {
for (int j16 = 0; j16 < l; j16++)
if (j16 <= j8 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k8 = i1 - 1; k8 >= 0; k8--) {
for (int k16 = l - 1; k16 >= 0; k16--)
if (k16 <= k8 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l8 = 0; l8 < i1; l8++) {
for (int l16 = l - 1; l16 >= 0; l16--)
if (l16 <= l8 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
}
if (j1 == 8) {
if (k1 == 0) {
for (int i9 = 0; i9 < i1; i9++) {
for (int i17 = 0; i17 < l; i17++)
if (i17 >= i9 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 1) {
for (int j9 = i1 - 1; j9 >= 0; j9--) {
for (int j17 = 0; j17 < l; j17++)
if (j17 >= j9 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 2) {
for (int k9 = i1 - 1; k9 >= 0; k9--) {
for (int k17 = l - 1; k17 >= 0; k17--)
if (k17 >= k9 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
return;
}
if (k1 == 3) {
for (int l9 = 0; l9 < i1; l9++) {
for (int l17 = l - 1; l17 >= 0; l17--)
if (l17 >= l9 - i1 / 2)
ai[i++] = k;
else
ai[i++] = j;
i += l1;
}
}
}
}
public NamedArchive getMapArchive() {
byte file[] = null;
String s = null;
try {
s = findCache();
file = FileOperations.ReadFile("C:/Files/worldmap317.dat");
// if(!method26(abyte0))
// abyte0 = null;
// if(abyte0 != null)
return new NamedArchive(file);
} catch (Throwable _ex) {
}
file = getFile();
if (s != null && file != null)
try {
writeFile(s + "/worldmap.dat", file);
} catch (Throwable _ex) {
}
return new NamedArchive(file);
}
public static int anIntArray100[] = { 118, -62, 7, 24, 121, -123, -10, -8,
116, 6, -106, 28, -36, 86, 109, 112, -115, -116, -37, -35 };
public static int anInt101;
public byte[] getFile() {
drawLoadingText(0, "Requesting map");
try {
String s = "";
for (int i = 0; i < 10; i++)
s = s + anIntArray100[i];
DataInputStream datainputstream;
if (super.gameFrame != null) {
datainputstream = new DataInputStream(new FileInputStream(
"C:/Files/worldmap317.dat"));
} else {
datainputstream = new DataInputStream((new URL(getCodeBase(),
"C:/Files/worldmap317.dat")).openStream());
}
int j = 0;
int k = 0;
int l = 0x53901;
byte abyte0[] = new byte[l];
while (k < l) {
int i1 = l - k;
if (i1 > 1000)
i1 = 1000;
int length = datainputstream.read(abyte0, k, i1);
if (length < 0)
throw new IOException("End of file");
k += length;
int k1 = (k * 100) / l;
if (k1 != j)
drawLoadingText(k1, "Loading map - " + k1 + "%");
j = k1;
}
datainputstream.close();
return abyte0;
} catch (IOException ioexception) {
System.out.println("Error loading");
ioexception.printStackTrace();
return null;
}
}
public String findCache() {
String as[] = { "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/",
"e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/",
"~/", "/tmp/", "" };
String s = ".file_store_32";
for (int i = 0; i < as.length; i++)
try {
String s1 = as[i];
if (s1.length() > 0) {
File file = new File(s1);
if (!file.exists())
continue;
}
File file1 = new File(s1 + s);
if (file1.exists() || file1.mkdir())
return s1 + s + "/";
} catch (Exception _ex) {
}
return null;
}
public byte[] readFile(String s)// Decompress something?
throws IOException {
File file = new File(s);
if (!file.exists()) {
return null;
} else {
int i = (int) file.length();
byte buffer[] = new byte[i];
DataInputStream datainputstream = new DataInputStream(
new BufferedInputStream(new FileInputStream(s)));
datainputstream.readFully(buffer, 0, i);
datainputstream.close();
return buffer;
}
}
public void writeFile(String s, byte abyte0[]) throws IOException {
FileOutputStream fileoutputstream = new FileOutputStream(s);
fileoutputstream.write(abyte0, 0, abyte0.length);
fileoutputstream.close();
}
public boolean method26(byte abyte0[]) throws Exception {
if (abyte0 == null)
return false;
MessageDigest messagedigest = MessageDigest.getInstance("SHA");
messagedigest.reset();
messagedigest.update(abyte0);
byte abyte1[] = messagedigest.digest();
for (int i = 0; i < 20; i++)
if (abyte1[i] != anIntArray100[i])
return false;
return true;
}
public void resetAllImageProducers() {
if (super.fullGameScreen != null) {
return;
}
aRSImageProducer_1166 = null;
aRSImageProducer_1164 = null;
aRSImageProducer_1163 = null;
aRSImageProducer_1165 = null;
aRSImageProducer_1123 = null;
aRSImageProducer_1124 = null;
aRSImageProducer_1125 = null;
aRSImageProducer_1107 = null;
aRSImageProducer_1108 = null;
aRSImageProducer_1109 = null;
aRSImageProducer_1110 = null;
aRSImageProducer_1111 = null;
aRSImageProducer_1112 = null;
aRSImageProducer_1113 = null;
aRSImageProducer_1114 = null;
aRSImageProducer_1115 = null;
super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
welcomeScreenRaised = true;
}
public boolean worldMap = false;
public static boolean aBoolean102;
public int anInt103;
public int anInt104;
public int anInt105;
public int anInt106;
public int anInt107;
public int anInt108;
public boolean aBoolean109;
public int anInt110;
public static int anInt111;
public static int anInt112;
public static int anInt113;
public static int anInt114;
public int anIntArray115[];
public int anIntArray116[];
public int anIntArrayArray117[][];
public int anIntArrayArray118[][];
public byte aByteArrayArray119[][];
public byte aByteArrayArray120[][];
public byte aByteArrayArray121[][];
public byte aByteArrayArray122[][];
public Sprite mapFunction[];
public ScaledFont aSprite_126;
public ScaledFont aSprite_127;
public ScaledFont aSprite_128;
public ScaledFont aSprite_129;
public ScaledFont aSprite_130;
public ScaledFont aSprite_131;
public ScaledFont aSprite_132;
public ScaledFont aSprite_133;
public int mapfuntionXOffsets[];
public int mapfunctionYOffsets[];
public int mapfunctionIds[];
public int anInt137;
public int selectedIconXOffsets[];
public int selectedIconYOffsets[];
public int selectedIconIds[];
public int locationKeyPanelX;
public int locationKeyPanelY;
public int locationPanelWidth;
public int locationPanelHeight;
public int anInt145;
public int locationListPosition;
public boolean showLocationKey;
public int hoveredLocationKey;
public int anInt149;
public int selectedIcon;
public int anInt151;
public int overviewPanelHeight;
public int overviewPanelWidth;
public int overviewPanelX;
public int overViewPanelY;
public boolean overviewVisible;
public Sprite overviewSprite;
public int anInt158;
private Sprite[] newmapFunction = new Sprite[100];
private Background[] newmapScenes = new Background[100];
public int anInt159;
public int anInt160;
public int anInt161;
public static boolean aBoolean162 = true;
public int anInt163;
public int anInt164;
public String maplocationNames[];
public int anIntArray166[];
public int anIntArray167[];
public int anIntArray168[];
public double aDouble169;
public double zoomLevel;
public static int anInt171;
public static int anInt172;
public int drawCount = 0;
public RSFont myboldFont;
public String mapIdentifiers[] = { "General Store", "Sword Shop",
"Magic Shop", "Axe Shop", "Helmet Shop", "Bank", "Quest Start",
"Amulet Shop", "Mining Site", "Furnace", "Anvil",
"Combat Training", "Dungeon", "Staff Shop", "Platebody Shop",
"Platelegs Shop", "Scimitar Shop", "Archery Shop", "Shield Shop",
"Altar", "Herbalist", "Jewelery", "Gem Shop", "Crafting Shop",
"Candle Shop", "Fishing Shop", "Fishing Spot", "Clothes Shop",
"Apothecary", "Silk Trader", "Kebab Seller", "Pub/Bar",
"Mace Shop", "Tannery", "Rare Trees", "Spinning Wheel",
"Food Shop", "Cookery Shop", "Mini-Game", "Water Source",
"Cooking Range", "Skirt Shop", "Potters Wheel", "Windmill",
"Mining Shop", "Chainmail Shop", "Silver Shop", "Fur Trader",
"Spice Shop", "Agility Training", "Vegetable Store",
"Slayer Master", "Hair Dressers", "Farming patch", "Makeover Mage",
"Guide", "Transportation", "???", "Farming shop", "Loom", "Brewery" };
Step 2. Now in the very TOP of drawGameScreen add this:
if (worldMap
&& (loadingStage == 2 || super.fullGameScreen != null)) {
if (loadingStage == 2) {
resetAllImageProducers();
super.fullGameScreen.initDrawingArea();
drawWorldMap();
processLoop();
drawCount++;
return;
}
}
Now. after "drawLoadingText("starting up" or whatever. Add this:
NamedArchive archive = getMapArchive();
drawLoadingText(100, "Please wait... Rendering Map");
ByteVector byteVector = new ByteVector(archive.getFile("size.dat"));
anInt111 = byteVector.getShort();
anInt112 = byteVector.getShort();
anInt113 = byteVector.getShort();
anInt114 = byteVector.getShort();
anInt171 = 3200 - anInt111;
anInt172 = (anInt112 + anInt114) - 3200;
overviewPanelHeight = 180;
overviewPanelWidth = (anInt113 * overviewPanelHeight) / anInt114;
overviewPanelX = 765 - overviewPanelWidth - 5;
overViewPanelY = 503 - overviewPanelHeight - 20;
byteVector = new ByteVector(archive.getFile("labels.dat"));
anInt163 = byteVector.getShort();
for (int i = 0; i < anInt163; i++) {
maplocationNames[i] = byteVector.getString();
anIntArray166[i] = byteVector.getShort();
anIntArray167[i] = byteVector.getShort();
anIntArray168[i] = byteVector.getUnsignedByte();
}
myboldFont = new RSFont(archive, "b12_full", false);
byteVector = new ByteVector(archive.getFile("floorcol.dat"));
int j = byteVector.getShort();
anIntArray115 = new int[j + 1];
anIntArray116 = new int[j + 1];
for (int k = 0; k < j; k++) {
anIntArray115[k + 1] = byteVector.getInt();
anIntArray116[k + 1] = byteVector.getInt();
}
byte abyte0[] = archive.getFile("underlay.dat");
byte abyte1[][] = new byte[anInt113][anInt114];
method14(abyte0, abyte1);
byte abyte2[] = archive.getFile("overlay.dat");
anIntArrayArray118 = new int[anInt113][anInt114];
aByteArrayArray119 = new byte[anInt113][anInt114];
method15(abyte2, anIntArrayArray118, aByteArrayArray119);
byte abyte3[] = archive.getFile("loc.dat");
aByteArrayArray120 = new byte[anInt113][anInt114];
aByteArrayArray122 = new byte[anInt113][anInt114];
aByteArrayArray121 = new byte[anInt113][anInt114];
method13(abyte3, aByteArrayArray120, aByteArrayArray122,
aByteArrayArray121);
for (int l = 0; l < 70; l++)
newmapScenes[l] = new Background(archive, "mapscene", l);
for (int i1 = 0; i1 < 70; i1++)
newmapFunction[i1] = new Sprite(archive, "mapfunction", i1);
aSprite_126 = new ScaledFont(11, true, this);
aSprite_127 = new ScaledFont(12, true, this);
aSprite_128 = new ScaledFont(14, true, this);
aSprite_129 = new ScaledFont(17, true, this);
aSprite_130 = new ScaledFont(19, true, this);
aSprite_131 = new ScaledFont(22, true, this);
aSprite_132 = new ScaledFont(26, true, this);
aSprite_133 = new ScaledFont(30, true, this);
anIntArrayArray117 = new int[anInt113][anInt114];
method16(abyte1, anIntArrayArray117);
overviewSprite = new Sprite(overviewPanelWidth, overviewPanelHeight);
overviewSprite.initSpriteDrawingArea();
method19(0, 0, anInt113, anInt114, 0, 0, overviewPanelWidth,
overviewPanelHeight);
DrawingArea.drawBox(0, 0, overviewPanelWidth, overviewPanelHeight, 0);
DrawingArea.drawBox(1, 1, overviewPanelWidth - 2,
overviewPanelHeight - 2, anInt103);
Replace RSApplet with this:
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class RSApplet extends Applet
implements Runnable, MouseListener, MouseMotionListener, KeyListener, FocusListener, WindowListener {
private int yPressed;
private int xPressed;
public final void createClientFrame(int i, int j) {
myWidth = j;
myHeight = i;
gameFrame = new RSFrame(this, myWidth, myHeight);
graphics = getGameComponent().getGraphics();
fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
startRunnable(this, 1);
}
public final void initClientFrame(int i, int j) {
myWidth = j;
myHeight = i;
graphics = getGameComponent().getGraphics();
fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
startRunnable(this, 1);
}
public void run() {
getGameComponent().addMouseListener(this);
getGameComponent().addMouseMotionListener(this);
getGameComponent().addKeyListener(this);
getGameComponent().addFocusListener(this);
if (gameFrame != null) {
gameFrame.addWindowListener(this);
}
drawLoadingText(0, "Loading...");
startUp();
int i = 0;
int j = 256;
int k = 1;
int i1 = 0;
int j1 = 0;
for (int k1 = 0; k1 < 10; k1++) {
aLongArray7[k1] = System.currentTimeMillis();
}
while (anInt4 >= 0) {
if (anInt4 > 0) {
anInt4--;
if (anInt4 == 0) {
exit();
return;
}
}
int i2 = j;
int j2 = k;
j = 300;
k = 1;
long l1 = System.currentTimeMillis();
if (aLongArray7[i] == 0L) {
j = i2;
k = j2;
} else if (l1 > aLongArray7[i]) {
j = (int) ((long) (2560 * delayTime) / (l1 - aLongArray7[i]));
}
if (j < 25) {
j = 25;
}
if (j > 256) {
j = 256;
k = (int) ((long) delayTime - (l1 - aLongArray7[i]) / 10L);
}
if (k > delayTime) {
k = delayTime;
}
aLongArray7[i] = l1;
i = (i + 1) % 10;
if (k > 1) {
for (int k2 = 0; k2 < 10; k2++) {
if (aLongArray7[k2] != 0L) {
aLongArray7[k2] += k;
}
}
}
if (k < minDelay) {
k = minDelay;
}
try {
Thread.sleep(k);
} catch (InterruptedException _ex) {
j1++;
}
for (; i1 < 256; i1 += j) {
clickMode3 = clickMode1;
saveClickX = clickX;
saveClickY = clickY;
aLong29 = clickTime;
clickMode1 = 0;
processGameLoop();
readIndex = writeIndex;
}
i1 &= 0xff;
if (delayTime > 0) {
fps = (1000 * j) / (delayTime * 256);
}
processDrawing();
if (shouldDebug) {
System.out.println("ntime:" + l1);
for (int l2 = 0; l2 < 10; l2++) {
int i3 = ((i - l2 - 1) + 20) % 10;
System.out.println("otim" + i3 + ":" + aLongArray7[i3]);
}
System.out.println("fps:" + fps + " ratio:" + j + " count:" + i1);
System.out.println("del:" + k + " deltime:" + delayTime + " mindel:" + minDelay);
System.out.println("intex:" + j1 + " opos:" + i);
shouldDebug = false;
j1 = 0;
}
}
if (anInt4 == -1) {
exit();
}
}
private void exit() {
anInt4 = -2;
cleanUpForQuit();
if (gameFrame != null) {
try {
Thread.sleep(1000L);
} catch (Exception _ex) {
}
try {
System.exit(0);
} catch (Throwable _ex) {
}
}
}
public final void method4(int i) {
delayTime = 1000 / i;
}
public final void start() {
if (anInt4 >= 0) {
anInt4 = 0;
}
}
public final void stop() {
if (anInt4 >= 0) {
anInt4 = 4000 / delayTime;
}
}
public final void destroy() {
anInt4 = -1;
try {
Thread.sleep(5000L);
} catch (Exception _ex) {
}
if (anInt4 == -1) {
exit();
}
}
public final void update(Graphics g) {
if (graphics == null) {
graphics = g;
}
shouldClearScreen = true;
raiseWelcomeScreen();
}
public final void paint(Graphics g) {
if (graphics == null) {
graphics = g;
}
shouldClearScreen = true;
raiseWelcomeScreen();
}
public final void mousePressed(MouseEvent mouseevent) {
int i = mouseevent.getX();
int j = mouseevent.getY();
if (gameFrame != null) {
i -= 4;
j -= 22;
}
idleTime = 0;
clickX = i;
clickY = j;
xPressed = i;
yPressed = j;
clickTime = System.currentTimeMillis();
if (mouseevent.isMetaDown()) {
clickMode1 = 2;
clickMode2 = 2;
} else {
clickMode1 = 1;
clickMode2 = 1;
}
}
public final void mouseReleased(MouseEvent mouseevent) {
idleTime = 0;
clickMode2 = 0;
}
public final void mouseClicked(MouseEvent mouseevent) {
}
public final void mouseEntered(MouseEvent mouseevent) {
}
public final void mouseExited(MouseEvent mouseevent) {
idleTime = 0;
mouseX = -1;
mouseY = -1;
}
public final void mouseDragged(MouseEvent mouseevent) {
int i = mouseevent.getX();
int j = mouseevent.getY();
if (gameFrame != null) {
i -= 4;
j -= 22;
}
idleTime = 0;
mouseX = i;
mouseY = j;
xDragged = i;
yDragged = j;
}
public final void mouseMoved(MouseEvent mouseevent) {
int i = mouseevent.getX();
int j = mouseevent.getY();
if (gameFrame != null) {
i -= 4;
j -= 22;
}
idleTime = 0;
mouseX = i;
mouseY = j;
xDragged = i;
yDragged = j;
}
public final void keyPressed(KeyEvent keyevent) {
idleTime = 0;
int i = keyevent.getKeyCode();
int j = keyevent.getKeyChar();
if (j < 30) {
j = 0;
}
if (i == 37) {
j = 1;
}
if (i == 39) {
j = 2;
}
if (i == 38) {
j = 3;
}
if (i == 40) {
j = 4;
}
if (i == 17) {
j = 5;
}
if (i == 8) {
j = 8;
}
if (i == 127) {
j = 8;
}
if (i == 9) {
j = 9;
}
if (i == 10) {
j = 10;
}
if (i >= 112 && i <= 123) {
j = (1008 + i) - 112;
}
if (i == 36) {
j = 1000;
}
if (i == 35) {
j = 1001;
}
if (i == 33) {
j = 1002;
}
if (i == 34) {
j = 1003;
}
if (j > 0 && j < 128) {
keyArray[j] = 1;
}
if (j > 4) {
charQueue[writeIndex] = j;
writeIndex = writeIndex + 1 & 0x7f;
}
}
public final void keyReleased(KeyEvent keyevent) {
idleTime = 0;
int i = keyevent.getKeyCode();
char c = keyevent.getKeyChar();
if (c < '\036') {
c = '\0';
}
if (i == 37) {
c = '\001';
}
if (i == 39) {
c = '\002';
}
if (i == 38) {
c = '\003';
}
if (i == 40) {
c = '\004';
}
if (i == 17) {
c = '\005';
}
if (i == 8) {
c = '\b';
}
if (i == 127) {
c = '\b';
}
if (i == 9) {
c = '\t';
}
if (i == 10) {
c = '\n';
}
if (c > 0 && c < '\200') {
keyArray[c] = 0;
}
}
public final void keyTyped(KeyEvent keyevent) {
}
public final int readChar(int dummy) {
int k = -1;
if (writeIndex != readIndex) {
k = charQueue[readIndex];
readIndex = readIndex + 1 & 0x7f;
}
return k;
}
public final void focusGained(FocusEvent focusevent) {
awtFocus = true;
shouldClearScreen = true;
raiseWelcomeScreen();
}
public final void focusLost(FocusEvent focusevent) {
awtFocus = false;
for (int i = 0; i < 128; i++) {
keyArray[i] = 0;
}
}
public final void windowActivated(WindowEvent windowevent) {
}
public final void windowClosed(WindowEvent windowevent) {
}
public final void windowClosing(WindowEvent windowevent) {
destroy();
}
public final void windowDeactivated(WindowEvent windowevent) {
}
public final void windowDeiconified(WindowEvent windowevent) {
}
public final void windowIconified(WindowEvent windowevent) {
}
public final void windowOpened(WindowEvent windowevent) {
}
void startUp() {
}
void processGameLoop() {
}
void cleanUpForQuit() {
}
void processDrawing() {
}
void raiseWelcomeScreen() {
}
Component getGameComponent() {
if (gameFrame != null) {
return gameFrame;
} else {
return this;
}
}
public void startRunnable(Runnable runnable, int priority) {
Thread thread = new Thread(runnable);
thread.start();
thread.setPriority(priority);
}
void drawLoadingText(int i, String s) {
while (graphics == null) {
graphics = getGameComponent().getGraphics();
try {
getGameComponent().repaint();
} catch (Exception _ex) {
}
try {
Thread.sleep(1000L);
} catch (Exception _ex) {
}
}
Font font = new Font("Helvetica", 1, 13);
FontMetrics fontmetrics = getGameComponent().getFontMetrics(font);
Font font1 = new Font("Helvetica", 0, 13);
getGameComponent().getFontMetrics(font1);
if (shouldClearScreen) {
graphics.setColor(Color.black);
graphics.fillRect(0, 0, myWidth, myHeight);
shouldClearScreen = false;
}
Color color = new Color(140, 17, 17);
int j = myHeight / 2 - 18;
graphics.setColor(color);
graphics.drawRect(myWidth / 2 - 152, j, 304, 34);
graphics.fillRect(myWidth / 2 - 150, j + 2, i * 3, 30);
graphics.setColor(Color.black);
graphics.fillRect((myWidth / 2 - 150) + i * 3, j + 2, 300 - i * 3, 30);
graphics.setFont(font);
graphics.setColor(Color.white);
graphics.drawString(s, (myWidth - fontmetrics.stringWidth(s)) / 2, j + 22);
}
RSApplet() {
delayTime = 20;
minDelay = 1;
aLongArray7 = new long[10];
shouldDebug = false;
shouldClearScreen = true;
awtFocus = true;
keyArray = new int[128];
charQueue = new int[128];
}
private int anInt4;
private int delayTime;
int minDelay;
private final long[] aLongArray7;
int fps;
boolean shouldDebug;
int myWidth;
int myHeight;
Graphics graphics;
RSImageProducer fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
RSFrame gameFrame;
private boolean shouldClearScreen;
boolean awtFocus;
int idleTime;
int clickMode2;
public int mouseX;
public int mouseY;
private int clickMode1;
public int clickX;
public int clickY;
private long clickTime;
public int yDragged;
public int xDragged;
int clickMode3;
int saveClickX;
int saveClickY;
long aLong29;
public final int[] keyArray;
private final int[] charQueue;
private int readIndex;
private int writeIndex;
public static int anInt34;
}
Open DrawingArea and add these methods:
public static void drawDiamond(int drawX, int drawY, int squareArea, int color, int alpha)
{
int j1 = 256 - alpha;
int k1 = (color >> 16 & 0xff) * alpha;
int l1 = (color >> 8 & 0xff) * alpha;
int i2 = (color & 0xff) * alpha;
int i3 = drawY - squareArea;
if(i3 < 0)
i3 = 0;
int j3 = drawY + squareArea;
if(j3 >= height)
j3 = height - 1;
for(int k3 = i3; k3 <= j3; k3++)
{
int l3 = k3 - drawY;
int i4 = (int)Math.sqrt(squareArea * squareArea - l3 * l3);
int j4 = drawX - i4;
if(j4 < 0)
j4 = 0;
int k4 = drawX + i4;
if(k4 >= width)
k4 = width - 1;
int l4 = j4 + k3 * width;
for(int i5 = j4; i5 <= k4; i5++)
{
int j2 = (pixels[l4] >> 16 & 0xff) * j1;
int k2 = (pixels[l4] >> 8 & 0xff) * j1;
int l2 = (pixels[l4] & 0xff) * j1;
int j5 = ((k1 + j2 >> 8) << 16) + ((l1 + k2 >> 8) << 8) + (i2 + l2 >> 8);
pixels[l4++] = j5;
}
}
}
public static void drawHorizontalLine(int drawX, int drawY, int lineWidth,
int color) {
if (drawY < topY || drawY >= bottomY) {
return;
}
if (drawX < topX) {
lineWidth -= topX - drawX;
drawX = topX;
}
if (drawX + lineWidth > bottomX) {
lineWidth = bottomX - drawX;
}
int offset = drawX + drawY * width;
for (int curPixel = 0; curPixel < lineWidth; curPixel++) {
pixels[offset + curPixel] = color;
}
}
public static void drawBox(int drawX, int drawY, int boxWidth,
int boxHeight, int color) {
drawHorizontalLine(drawX, drawY, boxWidth, color);
drawHorizontalLine(drawX, drawY + boxHeight - 1, boxWidth, color);
drawVerticalLine(drawX, drawY, boxHeight, color);
drawVerticalLine(drawX + boxWidth - 1, drawY, boxHeight, color);
}
public static void fillBoxAlpha(int i, int i_146_, int i_147_, int i_148_,
int i_149_, int i_150_) {
if (i < topX) {
i_147_ -= topX - i;
i = topX;
}
if (i_146_ < topY) {
i_148_ -= topY - i_146_;
i_146_ = topY;
}
if (i + i_147_ > bottomX) {
i_147_ = bottomX - i;
}
if (i_146_ + i_148_ > bottomY) {
i_148_ = bottomY - i_146_;
}
i_149_ = (((i_149_ & 0xff00ff) * i_150_ >> 8 & 0xff00ff) + ((i_149_ & 0xff00)
* i_150_ >> 8 & 0xff00));
int i_151_ = 256 - i_150_;
int i_152_ = width - i_147_;
int i_153_ = i + i_146_ * width;
for (int i_154_ = 0; i_154_ < i_148_; i_154_++) {
for (int i_155_ = -i_147_; i_155_ < 0; i_155_++) {
int i_156_ = pixels[i_153_];
i_156_ = (((i_156_ & 0xff00ff) * i_151_ >> 8 & 0xff00ff) + ((i_156_ & 0xff00)
* i_151_ >> 8 & 0xff00));
pixels[i_153_++] = i_149_ + i_156_;
}
i_153_ += i_152_;
}
}
public static void drawVerticalLine(int i, int i_103_, int i_104_,
int i_105_) {
if (i >= topX && i < bottomX) {
if (i_103_ < topY) {
i_104_ -= topY - i_103_;
i_103_ = topY;
}
if (i_103_ + i_104_ > bottomY) {
i_104_ = bottomY - i_103_;
}
int i_106_ = i + i_103_ * width;
for (int i_107_ = 0; i_107_ < i_104_; i_107_++) {
pixels[i_106_ + i_107_ * width] = i_105_;
}
}
}
public static void fillBox(int drawX, int drawY, int boxWidth,
int boxHeight, int color) {
if (drawX < topX) {
boxWidth -= topX - drawX;
drawX = topX;
}
if (drawY < topY) {
boxHeight -= topY - drawY;
drawY = topY;
}
if (drawX + boxWidth > bottomX) {
boxWidth = bottomX - drawX;
}
if (drawY + boxHeight > bottomY) {
boxHeight = bottomY - drawY;
}
int widthOffsets = width - boxWidth;
int pixelOffset = drawX + drawY * width;
for (int widthOffset = -boxHeight; widthOffset < 0; widthOffset++) {
for (int heightOffset = -boxWidth; heightOffset < 0; heightOffset++) {
pixels[pixelOffset++] = color;
}
pixelOffset += widthOffsets;
}
}
Open up Sprite.java and add these methods:
public Sprite(NamedArchive archive, String s, int spriteIndex) {
Stream image = new Stream(archive.getFile(s + ".dat", null));
Stream index = new Stream(archive.getFile("index.dat", null));
index.currentOffset = image.getShort();
maxWidth = index.getShort();
maxHeight = index.getShort();
int size = index.getUnsignedByte();
int newPixels[] = new int[size];
for (int k = 0; k < size - 1; k++) {
newPixels[k + 1] = index.getShortInt();
if (newPixels[k + 1] == 0)
newPixels[k + 1] = 1;
}
for (int l = 0; l < spriteIndex; l++) {
index.currentOffset += 2;
image.currentOffset += index.getShort() * index.getShort();
index.currentOffset++;
}
xDrawOffset = index.getUnsignedByte();
yDrawOffset = index.getUnsignedByte();
imageWidth = index.getShort();
imageHeight = index.getShort();
int type = index.getUnsignedByte();
int area = imageWidth * imageHeight;
imagePixels = new int[area];
if (type == 0) {
for (int k1 = 0; k1 < area; k1++) {
imagePixels[k1] = newPixels[image.getUnsignedByte()];
}
} else if (type == 1) {
for (int widthIndex = 0; widthIndex < imageWidth; widthIndex++) {
for (int heightIndex = 0; heightIndex < imageHeight; heightIndex++) {
imagePixels[widthIndex + heightIndex * imageWidth] = newPixels[image
.getUnsignedByte()];
}
}
}
}
public void drawTransparentSprite1(int i, int j) {
i += xDrawOffset;
j += yDrawOffset;
int k = i + j * DrawingArea.width;
int l = 0;
int i1 = imageHeight;
int j1 = imageWidth;
int k1 = DrawingArea.width - j1;
int l1 = 0;
if (j < DrawingArea.topY) {
int i2 = DrawingArea.topY - j;
i1 -= i2;
j = DrawingArea.topY;
l += i2 * j1;
k += i2 * DrawingArea.width;
}
if (j + i1 > DrawingArea.bottomY)
i1 -= (j + i1) - DrawingArea.bottomY;
if (i < DrawingArea.topX) {
int j2 = DrawingArea.topX - i;
j1 -= j2;
i = DrawingArea.topX;
l += j2;
k += j2;
l1 += j2;
k1 += j2;
}
if (i + j1 > DrawingArea.bottomX) {
int k2 = (i + j1) - DrawingArea.bottomX;
j1 -= k2;
l1 += k2;
k1 += k2;
}
if (j1 <= 0 || i1 <= 0) {
return;
} else {
createTransparentPixels(DrawingArea.pixels, imagePixels, l, k, j1, i1, k1, l1);
return;
}
}
public void createTransparentPixels(int ai[], int ai1[], int i, int j, int k, int l,
int i1, int j1) {
int k1 = -(k >> 2);
k = -(k & 3);
for (int l1 = -l; l1 < 0; l1++) {
for (int i2 = k1; i2 < 0; i2++) {
ai[j++] = ai1[i++];
ai[j++] = ai1[i++];
ai[j++] = ai1[i++];
ai[j++] = ai1[i++];
}
for (int j2 = k; j2 < 0; j2++)
ai[j++] = ai1[i++];
j += i1;
i += j1;
}
}
Open Background and add these methods:
public Background(NamedArchive class6, String s, int i)
{
Stream byteVector = new Stream(class6.getFile(s + ".dat", null));
Stream byteVector_1 = new Stream(class6.getFile("index.dat", null));
byteVector_1.currentOffset = byteVector.getShort();
maxWidth = byteVector_1.getShort();
maxHeight = byteVector_1.getShort();
int j = byteVector_1.getUnsignedByte();
imagePixels = new int[j];
for(int k = 0; k < j - 1; k++)
imagePixels[k + 1] = byteVector_1.getShortInt();
for(int l = 0; l < i; l++)
{
byteVector_1.currentOffset += 2;
byteVector.currentOffset += byteVector_1.getShort() * byteVector_1.getShort();
byteVector_1.currentOffset++;
}
xDrawOffset = byteVector_1.getUnsignedByte();
yDrawOffset = byteVector_1.getUnsignedByte();
imageWidth = byteVector_1.getShort();
imageHeight = byteVector_1.getShort();
int i1 = byteVector_1.getUnsignedByte();
int j1 = imageWidth * imageHeight;
imageBytes = new byte[j1];
if(i1 == 0)
{
for(int k1 = 0; k1 < j1; k1++)
imageBytes[k1] = byteVector.getByte();
} else
if(i1 == 1)
{
for(int l1 = 0; l1 < imageWidth; l1++)
{
for(int i2 = 0; i2 < imageHeight; i2++)
imageBytes[l1 + i2 * imageWidth] = byteVector.getByte();
}
}
}
public void method50(int i, int j, int k, int l)
{
try
{
int i1 = imageWidth;
int j1 = imageHeight;
int k1 = 0;
int l1 = 0;
int i2 = (i1 << 16) / k;
int j2 = (j1 << 16) / l;
int k2 = maxWidth;
int l2 = maxHeight;
i2 = (k2 << 16) / k;
j2 = (l2 << 16) / l;
i += ((xOffset * k + k2) - 1) / k2;
j += ((yOffset * l + l2) - 1) / l2;
if((xOffset * k) % k2 != 0)
k1 = (k2 - (xOffset * k) % k2 << 16) / k;
if((yOffset * l) % l2 != 0)
l1 = (l2 - (yOffset * l) % l2 << 16) / l;
k = (k * (imageWidth - (k1 >> 16))) / k2;
l = (l * (imageHeight - (l1 >> 16))) / l2;
int i3 = i + j * DrawingArea.width;
int j3 = DrawingArea.width - k;
if(j < DrawingArea.topY)
{
int k3 = DrawingArea.topY - j;
l -= k3;
j = 0;
i3 += k3 * DrawingArea.width;
l1 += j2 * k3;
}
if(j + l > DrawingArea.bottomY)
l -= (j + l) - DrawingArea.bottomY;
if(i < DrawingArea.topX)
{
int l3 = DrawingArea.topX - i;
k -= l3;
i = 0;
i3 += l3;
k1 += i2 * l3;
j3 += l3;
}
if(i + k > DrawingArea.bottomX)
{
int i4 = (i + k) - DrawingArea.bottomX;
k -= i4;
j3 += i4;
}
method51(DrawingArea.pixels, imagePixels, palette, k1, l1, i3, j3, k, l, i2, j2, i1);
}
catch(Exception exception)
{
System.out.println("error in sprite clipping routine");
exception.printStackTrace();
}
}
public void method51(int ai[], byte abyte0[], int ai1[], int i, int j, int k, int l,
int i1, int j1, int k1, int l1, int i2)
{
try
{
int j2 = i;
for(int k2 = -j1; k2 < 0; k2++)
{
int l2 = (j >> 16) * i2;
for(int i3 = -i1; i3 < 0; i3++)
{
byte byte0 = abyte0[(i >> 16) + l2];
if(byte0 != 0)
ai[k++] = ai1[byte0 & 0xff];
else
k++;
i += k1;
}
j += l1;
i = j2;
k += l;
}
}
catch(Exception exception)
{
System.out.println("error in plot_scale");
exception.printStackTrace();
}
}
Download and add these classes to your client files:
UppIT - Free File hosting - New Files.rar (Only the registered members can see the link.)
The world map data: UppIT - Free File hosting - worldmap317.dat (Only the registered members can see the link.)
Source to my World Map Editor(Highly refactored):UppIT - Free File hosting - World Applety.rar (Only the registered members can see the link.)
Finished Result:
Only the registered members can see the link.
DISCLAIMER:
To load the world map, set worldMap = true;. To close it once opened, click the top right hand corner of the screen.
That is all. If you have errors. Fix them yourselves. You have been given the resources to fix anything and everything you may encounter in this tutorial. And do not ask for where to put the worldmap317.dat because you will not be answered. Read the code to find out. And no non-renamed versions shall be released. I will report anyone who does this.