Refactored Player and NPC packets
This commit is contained in:
1 parent
22587cdb5a
commit
65b84fdeaa
11 files changed
+2196
-2044
No files matched your search
+148
-150
@@ -4,164 +4,162 @@
|
||||
|
||||
public class PathingEntity extends Entity {
|
||||
|
||||
public final int[] pathTileX = new int[10];
|
||||
public final int[] pathTileZ = new int[10];
|
||||
public final int[] damage = new int[4];
|
||||
public final int[] damageType = new int[4];
|
||||
public final int[] damageCycle = new int[4];
|
||||
public final boolean[] pathRunning = new boolean[10];
|
||||
public int index = -1;
|
||||
public int seqTrigger;
|
||||
public int turnSpeed = 32;
|
||||
public int seqRunID = -1;
|
||||
public String chat;
|
||||
public int height = 200;
|
||||
public int dstYaw;
|
||||
public int seqStandID = -1;
|
||||
public int seqTurnID = -1;
|
||||
public int chatColor;
|
||||
public int secondarySeqID = -1;
|
||||
public int secondarySeqFrame;
|
||||
public int secondarySeqCycle;
|
||||
public int spotanim = -1;
|
||||
public int spotanimFrame;
|
||||
public int spotanimCycle;
|
||||
public int anInt1523;
|
||||
public int spotanimY;
|
||||
public int pathLength;
|
||||
public int primarySeqID = -1;
|
||||
public int primarySeqFrame;
|
||||
public int primarySeqCycle;
|
||||
public int primarySeqDelay;
|
||||
public int primarySeqLoop;
|
||||
public int chatStyle;
|
||||
public int combatCycle = -1000;
|
||||
public int health;
|
||||
public int totalHealth;
|
||||
public int chatTimer = 100;
|
||||
public int anInt1537;
|
||||
public int faceTileX;
|
||||
public int faceTileZ;
|
||||
public int size = 1;
|
||||
public boolean aBoolean1541 = false;
|
||||
public int seqPathLength;
|
||||
public int forceMoveStartSceneTileX;
|
||||
public int forceMoveEndSceneTileX;
|
||||
public int forceMoveStartSceneTileZ;
|
||||
public int forceMoveEndSceneTileZ;
|
||||
public int forceMoveEndCycle;
|
||||
public int forceMoveStartCycle;
|
||||
public int forceMoveFaceDirection;
|
||||
public int x;
|
||||
public int z;
|
||||
public int yaw;
|
||||
public int seqWalkID = -1;
|
||||
public int seqTurnAroundID = -1;
|
||||
public int seqTurnLeftID = -1;
|
||||
public int seqTurnRightID = -1;
|
||||
public final int[] pathTileX = new int[10];
|
||||
public final int[] pathTileZ = new int[10];
|
||||
public final int[] damage = new int[4];
|
||||
public final int[] damageType = new int[4];
|
||||
public final int[] damageCycle = new int[4];
|
||||
public final boolean[] pathRunning = new boolean[10];
|
||||
public int targetID = -1;
|
||||
public int seqTrigger;
|
||||
public int turnSpeed = 32;
|
||||
public int seqRunID = -1;
|
||||
public String chat;
|
||||
public int height = 200;
|
||||
public int dstYaw;
|
||||
public int seqStandID = -1;
|
||||
public int seqTurnID = -1;
|
||||
public int chatColor;
|
||||
public int secondarySeqID = -1;
|
||||
public int secondarySeqFrame;
|
||||
public int secondarySeqCycle;
|
||||
public int spotanimID = -1;
|
||||
public int spotanimFrame;
|
||||
public int spotanimCycle;
|
||||
public int spotanimLastCycle;
|
||||
public int spotanimOffset;
|
||||
public int pathLength;
|
||||
public int primarySeqID = -1;
|
||||
public int primarySeqFrame;
|
||||
public int primarySeqCycle;
|
||||
public int primarySeqDelay;
|
||||
public int primarySeqLoop;
|
||||
public int chatStyle;
|
||||
public int combatCycle = -1000;
|
||||
public int health;
|
||||
public int totalHealth;
|
||||
public int chatTimer = 100;
|
||||
public int cycle;
|
||||
public int targetTileX;
|
||||
public int targetTileZ;
|
||||
public int size = 1;
|
||||
public boolean aBoolean1541 = false;
|
||||
public int seqPathLength;
|
||||
public int forceMoveStartSceneTileX;
|
||||
public int forceMoveEndSceneTileX;
|
||||
public int forceMoveStartSceneTileZ;
|
||||
public int forceMoveEndSceneTileZ;
|
||||
public int forceMoveEndCycle;
|
||||
public int forceMoveStartCycle;
|
||||
public int forceMoveFaceDirection;
|
||||
public int x;
|
||||
public int z;
|
||||
public int yaw;
|
||||
public int seqWalkID = -1;
|
||||
public int seqTurnAroundID = -1;
|
||||
public int seqTurnLeftID = -1;
|
||||
public int seqTurnRightID = -1;
|
||||
|
||||
public PathingEntity() {
|
||||
}
|
||||
public PathingEntity() {
|
||||
}
|
||||
|
||||
public void move(int x, int z, boolean teleport) {
|
||||
if ((primarySeqID != -1) && (SeqType.instances[primarySeqID].idleStyle == 1)) {
|
||||
primarySeqID = -1;
|
||||
}
|
||||
if (!teleport) {
|
||||
int dx = x - pathTileX[0];
|
||||
int dz = z - pathTileZ[0];
|
||||
public void move(int x, int z, boolean teleport) {
|
||||
if ((primarySeqID != -1) && (SeqType.instances[primarySeqID].idleStyle == 1)) {
|
||||
primarySeqID = -1;
|
||||
}
|
||||
if (!teleport) {
|
||||
int dx = x - pathTileX[0];
|
||||
int dz = z - pathTileZ[0];
|
||||
|
||||
if ((dx >= -8) && (dx <= 8) && (dz >= -8) && (dz <= 8)) {
|
||||
if (pathLength < 9) {
|
||||
pathLength++;
|
||||
}
|
||||
if ((dx >= -8) && (dx <= 8) && (dz >= -8) && (dz <= 8)) {
|
||||
if (pathLength < 9) {
|
||||
pathLength++;
|
||||
}
|
||||
|
||||
for (int i = pathLength; i > 0; i--) {
|
||||
pathTileX[i] = pathTileX[i - 1];
|
||||
pathTileZ[i] = pathTileZ[i - 1];
|
||||
pathRunning[i] = pathRunning[i - 1];
|
||||
}
|
||||
for (int i = pathLength; i > 0; i--) {
|
||||
pathTileX[i] = pathTileX[i - 1];
|
||||
pathTileZ[i] = pathTileZ[i - 1];
|
||||
pathRunning[i] = pathRunning[i - 1];
|
||||
}
|
||||
|
||||
pathTileX[0] = x;
|
||||
pathTileZ[0] = z;
|
||||
pathRunning[0] = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
pathLength = 0;
|
||||
seqPathLength = 0;
|
||||
seqTrigger = 0;
|
||||
pathTileX[0] = x;
|
||||
pathTileZ[0] = z;
|
||||
this.x = (pathTileX[0] * 128) + (size * 64);
|
||||
this.z = (pathTileZ[0] * 128) + (size * 64);
|
||||
}
|
||||
pathTileX[0] = x;
|
||||
pathTileZ[0] = z;
|
||||
pathRunning[0] = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
pathLength = 0;
|
||||
seqPathLength = 0;
|
||||
seqTrigger = 0;
|
||||
pathTileX[0] = x;
|
||||
pathTileZ[0] = z;
|
||||
this.x = (pathTileX[0] * 128) + (size * 64);
|
||||
this.z = (pathTileZ[0] * 128) + (size * 64);
|
||||
}
|
||||
|
||||
public void resetPath() {
|
||||
pathLength = 0;
|
||||
seqPathLength = 0;
|
||||
}
|
||||
public void resetPath() {
|
||||
pathLength = 0;
|
||||
seqPathLength = 0;
|
||||
}
|
||||
|
||||
public void method447(int j, int k, int l) {
|
||||
for (int i1 = 0; i1 < 4; i1++) {
|
||||
if (damageCycle[i1] <= l) {
|
||||
damage[i1] = k;
|
||||
damageType[i1] = j;
|
||||
damageCycle[i1] = l + 70;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void hit(int type, int damage) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (damageCycle[i] <= Game.loopCycle) {
|
||||
this.damage[i] = damage;
|
||||
damageType[i] = type;
|
||||
damageCycle[i] = Game.loopCycle + 70;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void method448(boolean flag, int i) {
|
||||
int j = pathTileX[0];
|
||||
int k = pathTileZ[0];
|
||||
if (i == 0) {
|
||||
j--;
|
||||
k++;
|
||||
}
|
||||
if (i == 1) {
|
||||
k++;
|
||||
}
|
||||
if (i == 2) {
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
if (i == 3) {
|
||||
j--;
|
||||
}
|
||||
if (i == 4) {
|
||||
j++;
|
||||
}
|
||||
if (i == 5) {
|
||||
j--;
|
||||
k--;
|
||||
}
|
||||
if (i == 6) {
|
||||
k--;
|
||||
}
|
||||
if (i == 7) {
|
||||
j++;
|
||||
k--;
|
||||
}
|
||||
if ((primarySeqID != -1) && (SeqType.instances[primarySeqID].idleStyle == 1)) {
|
||||
primarySeqID = -1;
|
||||
}
|
||||
if (pathLength < 9) {
|
||||
pathLength++;
|
||||
}
|
||||
for (int l = pathLength; l > 0; l--) {
|
||||
pathTileX[l] = pathTileX[l - 1];
|
||||
pathTileZ[l] = pathTileZ[l - 1];
|
||||
pathRunning[l] = pathRunning[l - 1];
|
||||
}
|
||||
pathTileX[0] = j;
|
||||
pathTileZ[0] = k;
|
||||
pathRunning[0] = flag;
|
||||
}
|
||||
public void step(boolean running, int direction) {
|
||||
int nextX = pathTileX[0];
|
||||
int nextZ = pathTileZ[0];
|
||||
|
||||
public boolean isVisible() {
|
||||
return false;
|
||||
}
|
||||
if (direction == 0) {
|
||||
nextX--;
|
||||
nextZ++;
|
||||
} else if (direction == 1) {
|
||||
nextZ++;
|
||||
} else if (direction == 2) {
|
||||
nextX++;
|
||||
nextZ++;
|
||||
} else if (direction == 3) {
|
||||
nextX--;
|
||||
} else if (direction == 4) {
|
||||
nextX++;
|
||||
} else if (direction == 5) {
|
||||
nextX--;
|
||||
nextZ--;
|
||||
} else if (direction == 6) {
|
||||
nextZ--;
|
||||
} else if (direction == 7) {
|
||||
nextX++;
|
||||
nextZ--;
|
||||
}
|
||||
|
||||
if ((primarySeqID != -1) && (SeqType.instances[primarySeqID].idleStyle == 1)) {
|
||||
primarySeqID = -1;
|
||||
}
|
||||
|
||||
if (pathLength < 9) {
|
||||
pathLength++;
|
||||
}
|
||||
|
||||
for (int i = pathLength; i > 0; i--) {
|
||||
pathTileX[i] = pathTileX[i - 1];
|
||||
pathTileZ[i] = pathTileZ[i - 1];
|
||||
pathRunning[i] = pathRunning[i - 1];
|
||||
}
|
||||
|
||||
pathTileX[0] = nextX;
|
||||
pathTileZ[0] = nextZ;
|
||||
pathRunning[0] = running;
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user