513 lines
12 KiB
Java
513 lines
12 KiB
Java
import java.util.Iterator;
|
|
import java.util.LinkedList;
|
|
import net.runelite.mapping.Export;
|
|
import net.runelite.mapping.Implements;
|
|
import net.runelite.mapping.ObfuscatedGetter;
|
|
import net.runelite.mapping.ObfuscatedName;
|
|
import net.runelite.mapping.ObfuscatedSignature;
|
|
|
|
@ObfuscatedName("aa")
|
|
@Implements("WorldMapArea")
|
|
public class WorldMapArea {
|
|
@ObfuscatedName("f")
|
|
@ObfuscatedGetter(
|
|
intValue = -403509389
|
|
)
|
|
@Export("id")
|
|
int id;
|
|
@ObfuscatedName("i")
|
|
@Export("internalName")
|
|
String internalName;
|
|
@ObfuscatedName("y")
|
|
@Export("externalName")
|
|
String externalName;
|
|
@ObfuscatedName("w")
|
|
@ObfuscatedGetter(
|
|
intValue = 857333611
|
|
)
|
|
@Export("backGroundColor")
|
|
int backGroundColor;
|
|
@ObfuscatedName("p")
|
|
@ObfuscatedGetter(
|
|
intValue = -345776741
|
|
)
|
|
@Export("zoom")
|
|
int zoom;
|
|
@ObfuscatedName("b")
|
|
@ObfuscatedSignature(
|
|
signature = "Lht;"
|
|
)
|
|
@Export("origin")
|
|
Coord origin;
|
|
@ObfuscatedName("e")
|
|
@ObfuscatedGetter(
|
|
intValue = 1441436013
|
|
)
|
|
@Export("regionLowX")
|
|
int regionLowX;
|
|
@ObfuscatedName("x")
|
|
@ObfuscatedGetter(
|
|
intValue = -685952677
|
|
)
|
|
@Export("regionHighX")
|
|
int regionHighX;
|
|
@ObfuscatedName("a")
|
|
@ObfuscatedGetter(
|
|
intValue = 143703109
|
|
)
|
|
@Export("regionLowY")
|
|
int regionLowY;
|
|
@ObfuscatedName("d")
|
|
@ObfuscatedGetter(
|
|
intValue = 1106684175
|
|
)
|
|
@Export("regionHighY")
|
|
int regionHighY;
|
|
@ObfuscatedName("c")
|
|
@Export("isMain")
|
|
boolean isMain;
|
|
@ObfuscatedName("o")
|
|
@Export("sections")
|
|
LinkedList sections;
|
|
|
|
public WorldMapArea() {
|
|
this.id = -1;
|
|
this.backGroundColor = -1;
|
|
this.zoom = -1;
|
|
this.origin = null;
|
|
this.regionLowX = Integer.MAX_VALUE;
|
|
this.regionHighX = 0;
|
|
this.regionLowY = Integer.MAX_VALUE;
|
|
this.regionHighY = 0;
|
|
this.isMain = false;
|
|
}
|
|
|
|
@ObfuscatedName("f")
|
|
@ObfuscatedSignature(
|
|
signature = "(Lkq;II)V",
|
|
garbageValue = "-1882227443"
|
|
)
|
|
@Export("read")
|
|
public void read(Buffer var1, int var2) {
|
|
this.id = var2;
|
|
this.internalName = var1.readStringCp1252NullTerminated();
|
|
this.externalName = var1.readStringCp1252NullTerminated();
|
|
this.origin = new Coord(var1.readInt());
|
|
this.backGroundColor = var1.readInt();
|
|
var1.readUnsignedByte();
|
|
this.isMain = var1.readUnsignedByte() == 1;
|
|
this.zoom = var1.readUnsignedByte();
|
|
int var3 = var1.readUnsignedByte();
|
|
this.sections = new LinkedList();
|
|
|
|
for (int var4 = 0; var4 < var3; ++var4) {
|
|
this.sections.add(this.readWorldMapSection(var1));
|
|
}
|
|
|
|
this.setBounds();
|
|
}
|
|
|
|
@ObfuscatedName("i")
|
|
@ObfuscatedSignature(
|
|
signature = "(Lkq;I)Laz;",
|
|
garbageValue = "383916658"
|
|
)
|
|
@Export("readWorldMapSection")
|
|
WorldMapSection readWorldMapSection(Buffer var1) {
|
|
int var2 = var1.readUnsignedByte();
|
|
WorldMapSectionType var3 = (WorldMapSectionType)DynamicObject.findEnumerated(WorldMapSectionType.method235(), var2);
|
|
Object var4 = null;
|
|
switch(var3.type) {
|
|
case 0:
|
|
var4 = new WorldMapSection1();
|
|
break;
|
|
case 1:
|
|
var4 = new WorldMapSection0();
|
|
break;
|
|
case 2:
|
|
var4 = new class42();
|
|
break;
|
|
case 3:
|
|
var4 = new WorldMapSection2();
|
|
break;
|
|
default:
|
|
throw new IllegalStateException("");
|
|
}
|
|
|
|
((WorldMapSection)var4).read(var1);
|
|
return (WorldMapSection)var4;
|
|
}
|
|
|
|
@ObfuscatedName("y")
|
|
@ObfuscatedSignature(
|
|
signature = "(IIII)Z",
|
|
garbageValue = "-1895835322"
|
|
)
|
|
@Export("containsCoord")
|
|
public boolean containsCoord(int var1, int var2, int var3) {
|
|
Iterator var4 = this.sections.iterator();
|
|
|
|
WorldMapSection var5;
|
|
do {
|
|
if (!var4.hasNext()) {
|
|
return false;
|
|
}
|
|
|
|
var5 = (WorldMapSection)var4.next();
|
|
} while(!var5.containsCoord(var1, var2, var3));
|
|
|
|
return true;
|
|
}
|
|
|
|
@ObfuscatedName("w")
|
|
@ObfuscatedSignature(
|
|
signature = "(III)Z",
|
|
garbageValue = "1579456955"
|
|
)
|
|
@Export("containsPosition")
|
|
public boolean containsPosition(int var1, int var2) {
|
|
int var3 = var1 / 64;
|
|
int var4 = var2 / 64;
|
|
if (var3 >= this.regionLowX && var3 <= this.regionHighX) {
|
|
if (var4 >= this.regionLowY && var4 <= this.regionHighY) {
|
|
Iterator var5 = this.sections.iterator();
|
|
|
|
WorldMapSection var6;
|
|
do {
|
|
if (!var5.hasNext()) {
|
|
return false;
|
|
}
|
|
|
|
var6 = (WorldMapSection)var5.next();
|
|
} while(!var6.containsPosition(var1, var2));
|
|
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("p")
|
|
@ObfuscatedSignature(
|
|
signature = "(IIII)[I",
|
|
garbageValue = "-722762456"
|
|
)
|
|
@Export("position")
|
|
public int[] position(int var1, int var2, int var3) {
|
|
Iterator var4 = this.sections.iterator();
|
|
|
|
WorldMapSection var5;
|
|
do {
|
|
if (!var4.hasNext()) {
|
|
return null;
|
|
}
|
|
|
|
var5 = (WorldMapSection)var4.next();
|
|
} while(!var5.containsCoord(var1, var2, var3));
|
|
|
|
return var5.getBorderTileLengths(var1, var2, var3);
|
|
}
|
|
|
|
@ObfuscatedName("b")
|
|
@ObfuscatedSignature(
|
|
signature = "(IIB)Lht;",
|
|
garbageValue = "78"
|
|
)
|
|
@Export("coord")
|
|
public Coord coord(int var1, int var2) {
|
|
Iterator var3 = this.sections.iterator();
|
|
|
|
WorldMapSection var4;
|
|
do {
|
|
if (!var3.hasNext()) {
|
|
return null;
|
|
}
|
|
|
|
var4 = (WorldMapSection)var3.next();
|
|
} while(!var4.containsPosition(var1, var2));
|
|
|
|
return var4.coord(var1, var2);
|
|
}
|
|
|
|
@ObfuscatedName("e")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)V",
|
|
garbageValue = "-6387744"
|
|
)
|
|
@Export("setBounds")
|
|
void setBounds() {
|
|
Iterator var1 = this.sections.iterator();
|
|
|
|
while (var1.hasNext()) {
|
|
WorldMapSection var2 = (WorldMapSection)var1.next();
|
|
var2.expandBounds(this);
|
|
}
|
|
|
|
}
|
|
|
|
@ObfuscatedName("x")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)I",
|
|
garbageValue = "-1737975976"
|
|
)
|
|
@Export("getId")
|
|
public int getId() {
|
|
return this.id;
|
|
}
|
|
|
|
@ObfuscatedName("a")
|
|
@ObfuscatedSignature(
|
|
signature = "(S)Z",
|
|
garbageValue = "128"
|
|
)
|
|
@Export("getIsMain")
|
|
public boolean getIsMain() {
|
|
return this.isMain;
|
|
}
|
|
|
|
@ObfuscatedName("d")
|
|
@ObfuscatedSignature(
|
|
signature = "(B)Ljava/lang/String;",
|
|
garbageValue = "1"
|
|
)
|
|
@Export("getInternalName")
|
|
public String getInternalName() {
|
|
return this.internalName;
|
|
}
|
|
|
|
@ObfuscatedName("c")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)Ljava/lang/String;",
|
|
garbageValue = "1973605030"
|
|
)
|
|
@Export("getExternalName")
|
|
public String getExternalName() {
|
|
return this.externalName;
|
|
}
|
|
|
|
@ObfuscatedName("o")
|
|
@ObfuscatedSignature(
|
|
signature = "(B)I",
|
|
garbageValue = "14"
|
|
)
|
|
@Export("getBackGroundColor")
|
|
int getBackGroundColor() {
|
|
return this.backGroundColor;
|
|
}
|
|
|
|
@ObfuscatedName("l")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)I",
|
|
garbageValue = "597434028"
|
|
)
|
|
@Export("getZoom")
|
|
public int getZoom() {
|
|
return this.zoom;
|
|
}
|
|
|
|
@ObfuscatedName("t")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)I",
|
|
garbageValue = "-1252580439"
|
|
)
|
|
@Export("getRegionLowX")
|
|
public int getRegionLowX() {
|
|
return this.regionLowX;
|
|
}
|
|
|
|
@ObfuscatedName("j")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)I",
|
|
garbageValue = "-1887142799"
|
|
)
|
|
@Export("getRegionHighX")
|
|
public int getRegionHighX() {
|
|
return this.regionHighX;
|
|
}
|
|
|
|
@ObfuscatedName("n")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)I",
|
|
garbageValue = "-56288601"
|
|
)
|
|
@Export("getRegionLowY")
|
|
public int getRegionLowY() {
|
|
return this.regionLowY;
|
|
}
|
|
|
|
@ObfuscatedName("u")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)I",
|
|
garbageValue = "1216154135"
|
|
)
|
|
@Export("getRegionHighY")
|
|
public int getRegionHighY() {
|
|
return this.regionHighY;
|
|
}
|
|
|
|
@ObfuscatedName("z")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)I",
|
|
garbageValue = "-1826469414"
|
|
)
|
|
@Export("getOriginX")
|
|
public int getOriginX() {
|
|
return this.origin.x;
|
|
}
|
|
|
|
@ObfuscatedName("h")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)I",
|
|
garbageValue = "-1153099258"
|
|
)
|
|
@Export("getOriginPlane")
|
|
public int getOriginPlane() {
|
|
return this.origin.plane;
|
|
}
|
|
|
|
@ObfuscatedName("m")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)I",
|
|
garbageValue = "907548196"
|
|
)
|
|
@Export("getOriginY")
|
|
public int getOriginY() {
|
|
return this.origin.y;
|
|
}
|
|
|
|
@ObfuscatedName("aa")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)Lht;",
|
|
garbageValue = "1045101809"
|
|
)
|
|
@Export("getOrigin")
|
|
public Coord getOrigin() {
|
|
return new Coord(this.origin);
|
|
}
|
|
|
|
@ObfuscatedName("f")
|
|
@ObfuscatedSignature(
|
|
signature = "(IIII)Lls;",
|
|
garbageValue = "905152692"
|
|
)
|
|
static Sprite method381(int var0, int var1, int var2) {
|
|
DemotingHashTable var3 = WorldMapRegion.WorldMapRegion_cachedSprites;
|
|
long var4 = (long)(var2 << 16 | var0 << 8 | var1);
|
|
return (Sprite)var3.get(var4);
|
|
}
|
|
|
|
@ObfuscatedName("i")
|
|
@ObfuscatedSignature(
|
|
signature = "(IB)Liy;",
|
|
garbageValue = "80"
|
|
)
|
|
public static FloorUnderlayDefinition method405(int var0) {
|
|
FloorUnderlayDefinition var1 = (FloorUnderlayDefinition)FloorUnderlayDefinition.FloorUnderlayDefinition_cached.get((long)var0);
|
|
if (var1 != null) {
|
|
return var1;
|
|
} else {
|
|
byte[] var2 = FloorUnderlayDefinition.FloorUnderlayDefinition_archive.takeFile(1, var0);
|
|
var1 = new FloorUnderlayDefinition();
|
|
if (var2 != null) {
|
|
var1.decode(new Buffer(var2), var0);
|
|
}
|
|
|
|
var1.postDecode();
|
|
FloorUnderlayDefinition.FloorUnderlayDefinition_cached.put(var1, (long)var0);
|
|
return var1;
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("il")
|
|
@ObfuscatedSignature(
|
|
signature = "(ILjava/lang/String;I)V",
|
|
garbageValue = "-2069103908"
|
|
)
|
|
static void method364(int var0, String var1) {
|
|
int var2 = Players.Players_count;
|
|
int[] var3 = Players.Players_indices;
|
|
boolean var4 = false;
|
|
Username var5 = new Username(var1, class188.loginType);
|
|
|
|
for (int var6 = 0; var6 < var2; ++var6) {
|
|
Player var7 = Client.players[var3[var6]];
|
|
if (var7 != null && var7 != Message.localPlayer && var7.username != null && var7.username.equals(var5)) {
|
|
PacketBufferNode var8;
|
|
if (var0 == 1) {
|
|
var8 = class2.getPacketBufferNode(ClientPacket.field2222, Client.packetWriter.isaacCipher);
|
|
var8.packetBuffer.method5746(var3[var6]);
|
|
var8.packetBuffer.method5569(0);
|
|
Client.packetWriter.addNode(var8);
|
|
} else if (var0 == 4) {
|
|
var8 = class2.getPacketBufferNode(ClientPacket.field2273, Client.packetWriter.isaacCipher);
|
|
var8.packetBuffer.method5696(0);
|
|
var8.packetBuffer.writeIntME(var3[var6]);
|
|
Client.packetWriter.addNode(var8);
|
|
} else if (var0 == 6) {
|
|
var8 = class2.getPacketBufferNode(ClientPacket.field2214, Client.packetWriter.isaacCipher);
|
|
var8.packetBuffer.method5720(0);
|
|
var8.packetBuffer.method5579(var3[var6]);
|
|
Client.packetWriter.addNode(var8);
|
|
} else if (var0 == 7) {
|
|
var8 = class2.getPacketBufferNode(ClientPacket.field2235, Client.packetWriter.isaacCipher);
|
|
var8.packetBuffer.method5720(0);
|
|
var8.packetBuffer.method5746(var3[var6]);
|
|
Client.packetWriter.addNode(var8);
|
|
}
|
|
|
|
var4 = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (!var4) {
|
|
class83.addGameMessage(4, "", "Unable to find " + var1);
|
|
}
|
|
|
|
}
|
|
|
|
@ObfuscatedName("iq")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)V",
|
|
garbageValue = "1140940631"
|
|
)
|
|
static final void method404() {
|
|
boolean var0 = false;
|
|
|
|
while (!var0) {
|
|
var0 = true;
|
|
|
|
for (int var1 = 0; var1 < Client.menuOptionsCount - 1; ++var1) {
|
|
if (Client.menuOpcodes[var1] < 1000 && Client.menuOpcodes[var1 + 1] > 1000) {
|
|
String var2 = Client.menuTargets[var1];
|
|
Client.menuTargets[var1] = Client.menuTargets[var1 + 1];
|
|
Client.menuTargets[var1 + 1] = var2;
|
|
String var3 = Client.menuActions[var1];
|
|
Client.menuActions[var1] = Client.menuActions[var1 + 1];
|
|
Client.menuActions[var1 + 1] = var3;
|
|
int var4 = Client.menuOpcodes[var1];
|
|
Client.menuOpcodes[var1] = Client.menuOpcodes[var1 + 1];
|
|
Client.menuOpcodes[var1 + 1] = var4;
|
|
var4 = Client.menuArguments1[var1];
|
|
Client.menuArguments1[var1] = Client.menuArguments1[var1 + 1];
|
|
Client.menuArguments1[var1 + 1] = var4;
|
|
var4 = Client.menuArguments2[var1];
|
|
Client.menuArguments2[var1] = Client.menuArguments2[var1 + 1];
|
|
Client.menuArguments2[var1 + 1] = var4;
|
|
var4 = Client.menuIdentifiers[var1];
|
|
Client.menuIdentifiers[var1] = Client.menuIdentifiers[var1 + 1];
|
|
Client.menuIdentifiers[var1 + 1] = var4;
|
|
boolean var5 = Client.menuShiftClick[var1];
|
|
Client.menuShiftClick[var1] = Client.menuShiftClick[var1 + 1];
|
|
Client.menuShiftClick[var1 + 1] = var5;
|
|
var0 = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|