···
370
370
private int npcCount;
371
371
private int[] npcIds = new int[16384];
372
372
private int renderCount;
373
373
-
private int anInt1140 = -110;
374
373
private long aLong1141;
375
374
private ImageRGB[] moderatorIcon = new ImageRGB[2];
376
375
private boolean characterEditChangeGenger = true;
···
492
491
private int[] anIntArray1290 = {17, 24, 34, 40};
493
492
private IndexedImage titleboxImage;
494
493
private IndexedImage titleboxButtonImage;
495
495
-
private int removePlayerCount;
496
496
-
private int[] removePlayers = new int[1000];
494
494
+
private int enityUpdateCount;
495
495
+
private int[] eneityUpdateIndices = new int[1000];
497
496
private int[] chatTypes = new int[100];
498
497
private String[] chatPlayerNames = new String[100];
499
498
private String[] chatMessages = new String[100];
···
879
878
playerList = null;
880
879
updatedPlayers = null;
881
880
cachedAppearances = null;
882
882
-
removePlayers = null;
881
881
+
eneityUpdateIndices = null;
883
882
aClass18_906 = null;
884
883
aClass18_907 = null;
885
884
aClass18_908 = null;
···
2978
2977
return true;
2979
2978
}
2980
2979
if (NPC_UPDATING.equals(opcode)) {
2981
2981
-
updateNpcs(buffer, aBoolean1038, packetSize);
2980
2980
+
updateNpcs(buffer, packetSize);
2982
2981
opcode = -1;
2983
2982
return true;
2984
2983
}
···
3915
3914
}
3916
3915
}
3917
3916
3918
3918
-
private void method46(Buffer buffer) {
3917
3917
+
private void updateNpcMovement(Buffer buffer) {
3919
3918
buffer.initBitAccess();
3920
3919
int j = buffer.getBits(8);
3921
3920
if (j < npcCount) {
3922
3921
for (int k = j; k < npcCount; k++)
3923
3923
-
removePlayers[removePlayerCount++] = npcIds[k];
3922
3922
+
eneityUpdateIndices[enityUpdateCount++] = npcIds[k];
3924
3923
3925
3924
}
3926
3925
if (j > npcCount) {
···
3960
3959
if (blockUpdateRequired == 1)
3961
3960
updatedPlayers[updatedPlayerCount++] = i1;
3962
3961
} else if (moveType == MovementType.TELEPORT)
3963
3963
-
removePlayers[removePlayerCount++] = i1;
3962
3962
+
eneityUpdateIndices[enityUpdateCount++] = i1;
3964
3963
}
3965
3964
}
3966
3965
3967
3966
}
3968
3967
3969
3969
-
private void updateNpcs(Buffer buffer, boolean flag, int packetSize) {
3970
3970
-
loggedIn &= flag;
3971
3971
-
removePlayerCount = 0;
3968
3968
+
private void updateNpcs(Buffer buffer, int packetSize) {
3969
3969
+
enityUpdateCount = 0;
3972
3970
updatedPlayerCount = 0;
3973
3973
-
method46(buffer);
3974
3974
-
method132(buffer, packetSize, false);
3971
3971
+
updateNpcMovement(buffer);
3972
3972
+
processNewNpcs(buffer, packetSize);
3975
3973
parseNpcUpdateMasks(buffer, packetSize, 838);
3976
3976
-
for (int j = 0; j < removePlayerCount; j++) {
3977
3977
-
int k = removePlayers[j];
3978
3978
-
if (npcs[k].pulseCycle != pulseCycle) {
3979
3979
-
npcs[k].npcDefinition = null;
3980
3980
-
npcs[k] = null;
3974
3974
+
for (int i = 0; i < enityUpdateCount; i++) {
3975
3975
+
int npcIndex = eneityUpdateIndices[i];
3976
3976
+
if (npcs[npcIndex].pulseCycle != pulseCycle) {
3977
3977
+
npcs[npcIndex].npcDefinition = null;
3978
3978
+
npcs[npcIndex] = null;
3981
3979
}
3982
3980
}
3983
3981
···
4247
4245
}
4248
4246
}
4249
4247
4250
4250
-
private void drawMinimap(ImageRGB sprite, int x, int y) {
4251
4251
-
int r = x * x + y * y;
4248
4248
+
private void drawMinimapMark(ImageRGB sprite, int mapX, int mapY) {
4249
4249
+
int len = mapX * mapX + mapY * mapY;
4252
4250
4253
4253
-
if (r > 4225 && r < 0x15f90) {
4251
4251
+
if (len > 4225 && len < 90000) {
4254
4252
int theta = cameraHorizontal + cameraYawOffset & 0x7ff;
4255
4253
int sin = Model.SINE[theta];
4256
4254
int cos = Model.COSINE[theta];
4257
4255
sin = (sin * 256) / (mapZoomOffset + 256);
4258
4256
cos = (cos * 256) / (mapZoomOffset + 256);
4259
4259
-
int l1 = y * sin + x * cos >> 16;
4260
4260
-
int i2 = y * cos - x * sin >> 16;
4261
4261
-
double d = Math.atan2(l1, i2);
4262
4262
-
int j2 = (int) (Math.sin(d) * 63D);
4263
4263
-
int k2 = (int) (Math.cos(d) * 57D);
4264
4264
-
minimapEdge.method466(256, 15, (94 + j2 + 4) - 10, 15, 20, anInt1119, 20, d, 83 - k2 - 20);
4257
4257
+
int x = mapY * sin + mapX * cos >> 16;
4258
4258
+
int y = mapY * cos - mapX * sin >> 16;
4259
4259
+
double angle = Math.atan2(x, y);
4260
4260
+
int drawX = (int) (Math.sin(angle) * 63D);
4261
4261
+
int drawY = (int) (Math.cos(angle) * 57D);
4262
4262
+
minimapEdge.drawRotated((94 + drawX + 4) - 10, 83 - drawY - 20, 15, 15, 20, 20, 256, angle);
4265
4263
} else {
4266
4266
-
drawOnMinimap(sprite, x, y);
4264
4264
+
drawOnMinimap(sprite, mapX, mapY);
4267
4265
}
4268
4266
}
4269
4267
···
7341
7339
int npcX = npc.worldX / 32 - localPlayer.worldX / 32;
7342
7340
int npcY = npc.worldY / 32 - localPlayer.worldY / 32;
7343
7341
7344
7344
-
drawMinimap(aClass50_Sub1_Sub1_Sub1_1037, npcX, npcY);
7342
7342
+
drawMinimapMark(aClass50_Sub1_Sub1_Sub1_1037, npcX, npcY);
7345
7343
}
7346
7344
}
7347
7345
···
7349
7347
int hintX = ((hintIconX - nextTopLeftTileX) * 4 + 2) - localPlayer.worldX / 32;
7350
7348
int hintY = ((hintIconY - nextTopRightTileY) * 4 + 2) - localPlayer.worldY / 32;
7351
7349
7352
7352
-
drawMinimap(aClass50_Sub1_Sub1_Sub1_1037, hintX, hintY);
7350
7350
+
drawMinimapMark(aClass50_Sub1_Sub1_Sub1_1037, hintX, hintY);
7353
7351
}
7354
7352
7355
7353
if (headIconDrawType == 10 && otherPlayerId >= 0 && otherPlayerId < players.length) {
···
7359
7357
int playerX = player.worldX / 32 - localPlayer.worldX / 32;
7360
7358
int playerY = player.worldY / 32 - localPlayer.worldY / 32;
7361
7359
7362
7362
-
drawMinimap(aClass50_Sub1_Sub1_Sub1_1037, playerX, playerY);
7360
7360
+
drawMinimapMark(aClass50_Sub1_Sub1_Sub1_1037, playerX, playerY);
7363
7361
}
7364
7362
}
7365
7363
}
···
7782
7780
}
7783
7781
7784
7782
private void updatePlayers(int size, Buffer buffer) {
7785
7785
-
removePlayerCount = 0;
7783
7783
+
enityUpdateCount = 0;
7786
7784
updatedPlayerCount = 0;
7787
7785
7788
7786
updateLocalPlayerMovement(buffer);
···
7790
7788
addNewPlayers(size, buffer);
7791
7789
parsePlayerBlocks(buffer);
7792
7790
7793
7793
-
for (int i = 0; i < removePlayerCount; i++) {
7794
7794
-
int index = removePlayers[i];
7791
7791
+
for (int i = 0; i < enityUpdateCount; i++) {
7792
7792
+
int index = eneityUpdateIndices[i];
7795
7793
7796
7794
if (players[index].pulseCycle != pulseCycle)
7797
7795
players[index] = null;
···
8656
8654
8657
8655
if (playerCount < localPlayerCount) {
8658
8656
for (int i = playerCount; i < localPlayerCount; i++)
8659
8659
-
removePlayers[removePlayerCount++] = playerList[i];
8657
8657
+
eneityUpdateIndices[enityUpdateCount++] = playerList[i];
8660
8658
}
8661
8659
8662
8660
if (playerCount > localPlayerCount) {
···
8708
8706
if (updateRequired == 1)
8709
8707
updatedPlayers[updatedPlayerCount++] = id;
8710
8708
} else if (moveType == MovementType.TELEPORT) {
8711
8711
-
removePlayers[removePlayerCount++] = id;
8709
8709
+
eneityUpdateIndices[enityUpdateCount++] = id;
8712
8710
}
8713
8711
}
8714
8712
}
···
10340
10338
int k1 = y * i1 + x * j1 >> 16;
10341
10339
int l1 = y * j1 - x * i1 >> 16;
10342
10340
if (l > 2500) {
10343
10343
-
sprite.method467(minimapBackgroundImage, 83 - l1 - sprite.maxHeight
10344
10344
-
/ 2 - 4, -49993, ((94 + k1) - sprite.maxWidth / 2) + 4);
10341
10341
+
sprite.drawTo(minimapBackgroundImage, ((94 + k1) - sprite.maxWidth / 2) + 4, 83 - l1 - sprite.maxHeight
10342
10342
+
/ 2 - 4);
10345
10343
} else {
10346
10344
sprite.drawImage(((94 + k1) - sprite.maxWidth / 2) + 4, 83 - l1 - sprite.maxHeight / 2 - 4
10347
10345
);
···
10428
10426
}
10429
10427
}
10430
10428
10431
10431
-
private void method132(Buffer buffer, int i, boolean flag) {
10432
10432
-
if (flag)
10433
10433
-
anInt1140 = 287;
10429
10429
+
private void processNewNpcs(Buffer buffer, int i) {
10434
10430
while (buffer.bitPosition + 21 < i * 8) {
10435
10431
int j = buffer.getBits(14);
10436
10432
if (j == 16383)
···
370
370
}
371
371
}
372
372
373
373
-
public void method466(int i, int j, int k, int l, int i1, int j1, int k1, double d, int l1) {
374
374
-
if (j1 != -30658)
375
375
-
return;
373
373
+
public void drawRotated(int x, int y, int pivotX, int pivotY, int width, int height, int zoom, double angle) {
376
374
try {
377
377
-
int i2 = -k1 / 2;
378
378
-
int j2 = -i1 / 2;
379
379
-
int k2 = (int) (Math.sin(d) * 65536D);
380
380
-
int l2 = (int) (Math.cos(d) * 65536D);
381
381
-
k2 = k2 * i >> 8;
382
382
-
l2 = l2 * i >> 8;
383
383
-
int i3 = (j << 16) + (j2 * k2 + i2 * l2);
384
384
-
int j3 = (l << 16) + (j2 * l2 - i2 * k2);
385
385
-
int k3 = k + l1 * Rasterizer.width;
386
386
-
for (l1 = 0; l1 < i1; l1++) {
387
387
-
int l3 = k3;
388
388
-
int i4 = i3;
389
389
-
int j4 = j3;
390
390
-
for (k = -k1; k < 0; k++) {
391
391
-
int k4 = pixels[(i4 >> 16) + (j4 >> 16) * width];
392
392
-
if (k4 != 0)
393
393
-
Rasterizer.pixels[l3++] = k4;
375
375
+
int centerX = -width / 2;
376
376
+
int centerY = -height / 2;
377
377
+
int sine = (int) (Math.sin(angle) * 65536D);
378
378
+
int cosine = (int) (Math.cos(angle) * 65536D);
379
379
+
sine = sine * zoom >> 8;
380
380
+
cosine = cosine * zoom >> 8;
381
381
+
int sourceOffsetX = (pivotX << 16) + (centerY * sine + centerX * cosine);
382
382
+
int sourceOffsetY = (pivotY << 16) + (centerY * cosine - centerX * sine);
383
383
+
int destinationOffset = x + y * Rasterizer.width;
384
384
+
for (y = 0; y < height; y++) {
385
385
+
int i = destinationOffset;
386
386
+
int offsetX = sourceOffsetX;
387
387
+
int offsetY = sourceOffsetY;
388
388
+
for (x = -width; x < 0; x++) {
389
389
+
int colour = pixels[(offsetX >> 16) + (offsetY >> 16) * this.width];
390
390
+
if (colour != 0)
391
391
+
Rasterizer.pixels[i++] = colour;
394
392
else
395
395
-
l3++;
396
396
-
i4 += l2;
397
397
-
j4 -= k2;
393
393
+
i++;
394
394
+
offsetX += cosine;
395
395
+
offsetY -= sine;
398
396
}
399
397
400
400
-
i3 += k2;
401
401
-
j3 += l2;
402
402
-
k3 += Rasterizer.width;
398
398
+
sourceOffsetX += sine;
399
399
+
sourceOffsetY += cosine;
400
400
+
destinationOffset += Rasterizer.width;
403
401
}
404
402
405
405
-
return;
406
403
} catch (Exception _ex) {
407
407
-
return;
408
404
}
409
405
}
410
406
411
411
-
public void method467(IndexedImage class50_sub1_sub1_sub3, int i, int j, int k) {
412
412
-
if (j != -49993)
413
413
-
return;
414
414
-
k += offsetX;
415
415
-
i += offsetY;
416
416
-
int l = k + i * Rasterizer.width;
407
407
+
public void drawTo(IndexedImage indexedImage, int x, int y) {
408
408
+
x += offsetX;
409
409
+
y += offsetY;
410
410
+
int l = x + y * Rasterizer.width;
417
411
int i1 = 0;
418
412
int j1 = height;
419
413
int k1 = width;
420
414
int l1 = Rasterizer.width - k1;
421
415
int i2 = 0;
422
422
-
if (i < Rasterizer.topY) {
423
423
-
int j2 = Rasterizer.topY - i;
416
416
+
if (y < Rasterizer.topY) {
417
417
+
int j2 = Rasterizer.topY - y;
424
418
j1 -= j2;
425
425
-
i = Rasterizer.topY;
419
419
+
y = Rasterizer.topY;
426
420
i1 += j2 * k1;
427
421
l += j2 * Rasterizer.width;
428
422
}
429
429
-
if (i + j1 > Rasterizer.bottomY)
430
430
-
j1 -= (i + j1) - Rasterizer.bottomY;
431
431
-
if (k < Rasterizer.topX) {
432
432
-
int k2 = Rasterizer.topX - k;
423
423
+
if (y + j1 > Rasterizer.bottomY)
424
424
+
j1 -= (y + j1) - Rasterizer.bottomY;
425
425
+
if (x < Rasterizer.topX) {
426
426
+
int k2 = Rasterizer.topX - x;
433
427
k1 -= k2;
434
434
-
k = Rasterizer.topX;
428
428
+
x = Rasterizer.topX;
435
429
i1 += k2;
436
430
l += k2;
437
431
i2 += k2;
438
432
l1 += k2;
439
433
}
440
440
-
if (k + k1 > Rasterizer.bottomX) {
441
441
-
int l2 = (k + k1) - Rasterizer.bottomX;
434
434
+
if (x + k1 > Rasterizer.bottomX) {
435
435
+
int l2 = (x + k1) - Rasterizer.bottomX;
442
436
k1 -= l2;
443
437
i2 += l2;
444
438
l1 += l2;
···
447
441
return;
448
442
} else {
449
443
method468(l, l1, pixels, k1, Rasterizer.pixels,
450
450
-
class50_sub1_sub1_sub3.pixels, 40303, j1, i1, 0, i2);
444
444
+
indexedImage.pixels, 40303, j1, i1, 0, i2);
451
445
return;
452
446
}
453
447
}
···
73
73
public static int cursorX;
74
74
public static int cursorY;
75
75
public static int resourceCount;
76
76
-
public static int[] anIntArray1709 = new int[1000];
76
76
+
public static int[] hoveredHash = new int[1000];
77
77
public static int[] SINE;
78
78
public static int[] COSINE;
79
79
private static int[] HSLtoRGB;
···
1487
1487
int k6 = cursorY - Rasterizer3D.centerY;
1488
1488
if (i6 > k3 && i6 < l3 && k6 > i5 && k6 < k4) {
1489
1489
if (singleTile) {
1490
1490
-
anIntArray1709[resourceCount++] = i2;
1490
1490
+
hoveredHash[resourceCount++] = i2;
1491
1491
} else {
1492
1492
flag1 = true;
1493
1493
}
···
1561
1561
if (flag1
1562
1562
&& method602(cursorX, cursorY, vertexScreenY[l], vertexScreenY[k1],
1563
1563
vertexScreenY[j2], i3, l3, k4)) {
1564
1564
-
anIntArray1709[resourceCount++] = i;
1564
1564
+
hoveredHash[resourceCount++] = i;
1565
1565
flag1 = false;
1566
1566
}
1567
1567
if ((i3 - l3) * (vertexScreenY[j2] - vertexScreenY[k1])
···
626
626
}
627
627
}
628
628
629
629
-
public int method271(int z, int x, int y, int l) {
629
629
+
public int getArrangement(int z, int x, int y, int l) {
630
630
SceneTile sceneTile = groundArray.getTile(z, x, y);
631
631
if (sceneTile == null) {
632
632
return -1;