Code:
public void followPlayer() {
if(PlayerHandler.players[c.followId] == null || PlayerHandler.players[c.followId].isDead) {
c.followId = 0;
return;
}
if(c.freezeTimer > 0) {
return;
}
if(c.jailTimer > 1) {
return;
}
if(c.cageOne()) {
return;
}
if(c.cageTwo()) {
return;
}
if(c.cageThree()) {
return;
}
if(c.inLobby()) {
return;
}
if (c.isDead || c.playerLevel[3] <= 0)
return;
int otherX = PlayerHandler.players[c.followId].getX();
int otherY = PlayerHandler.players[c.followId].getY();
c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2);
c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1);
boolean hallyDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 2);
boolean bowDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 8);
boolean rangeWeaponDistance = c.goodDistance(otherX, otherY, c.getX(), c.getY(), 4);
boolean sameSpot = c.absX == otherX && c.absY == otherY;
if(!c.goodDistance(otherX, otherY, c.getX(), c.getY(), 25)) {
c.followId = 0;
return;
}
if(c.goodDistance(otherX, otherY, c.getX(), c.getY(), 1)) {
if (otherX != c.getX() && otherY != c.getY()) {
stopDiagonal(otherX, otherY);
return;
}
}
if((c.usingBow || c.mageFollow || (c.playerIndex > 0 && c.autocastId > 0)) && bowDistance && !sameSpot) {
return;
}
if(c.getCombat().usingHally() && hallyDistance && !sameSpot) {
return;
}
if(c.usingRangeWeapon && rangeWeaponDistance && !sameSpot) {
return;
}
c.faceUpdate(c.followId+32768);
if (otherX == c.absX && otherY == c.absY) {
int r = Misc.random(3);
switch (r) {
case 0:
if(VirtualWorld.checkPos(c.heightLevel,c.getX(),c.getY(),c.getX(),c.getY()-1,0))
walkTo(0,-1);
break;
case 1:
if(VirtualWorld.checkPos(c.heightLevel,c.getX(),c.getY(),c.getX(),c.getY()+1,0))
walkTo(0,1);
break;
case 2:
if(VirtualWorld.checkPos(c.heightLevel,c.getX(),c.getY(),c.getX()+1,c.getY(),0))
walkTo(1,0);
break;
case 3:
if(VirtualWorld.checkPos(c.heightLevel,c.getX(),c.getY(),c.getX()-1,c.getY(),0))
walkTo(-1,0);
break;
}
/*} else if(c.isRunning2 && !withinDistance) {
if(otherY > c.getY() && otherX == c.getX()) {
walkTo(0, getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1));
} else if(otherY < c.getY() && otherX == c.getX()) {
walkTo(0, getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1));
} else if(otherX > c.getX() && otherY == c.getY()) {
walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), 0);
} else if(otherX < c.getX() && otherY == c.getY()) {
walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), 0);
} else if(otherX < c.getX() && otherY < c.getY()) {
walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1) + getMove(c.getY(), otherY + 1));
} else if(otherX > c.getX() && otherY > c.getY()) {
walkTo(getMove(c.getX(), otherX - 1) + getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1));
} else if(otherX < c.getX() && otherY > c.getY()) {
walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1));
} else if(otherX > c.getX() && otherY < c.getY()) {
walkTo(getMove(c.getX(), otherX + 1) + getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1) + getMove(c.getY(), otherY - 1));
} */
} else {
/*if(otherY > c.getY() && otherX == c.getX()) {
walkTo(0, getMove(c.getY(), otherY - 1));
} else if(otherY < c.getY() && otherX == c.getX()) {
walkTo(0, getMove(c.getY(), otherY + 1));
} else if(otherX > c.getX() && otherY == c.getY()) {
walkTo(getMove(c.getX(), otherX - 1), 0);
} else if(otherX < c.getX() && otherY == c.getY()) {
walkTo(getMove(c.getX(), otherX + 1), 0);
} else if(otherX < c.getX() && otherY < c.getY()) {
walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY + 1));
} else if(otherX > c.getX() && otherY > c.getY()) {
walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY - 1));
} else if(otherX < c.getX() && otherY > c.getY()) {
walkTo(getMove(c.getX(), otherX + 1), getMove(c.getY(), otherY - 1));
} else if(otherX > c.getX() && otherY < c.getY()) {
walkTo(getMove(c.getX(), otherX - 1), getMove(c.getY(), otherY + 1));
} */
int baseX = c.getX()-25;
int baseY = c.getY()-25;
int[][] path = VirtualWorld.getPath(c.getX(),c.getY(),otherX,otherY,c.heightLevel);
/*if(path != null && path.length == 2)
walkTo(getMove(c.getX(), baseX+path[1][0]), getMove(c.getY(), baseY+path[1][1]));
else */if(path != null && path.length >= 2)
walkTo3(path,baseX,baseY,otherX,otherY);
//walkTo3(getMove(c.getX(), baseX+path[2][0]), getMove(c.getY(), baseY+path[2][1]));
//walkTo3(getMove(c.getX(), baseX+path[1][0]), getMove(c.getY(), baseY+path[1][1]),getMove(baseX+path[1][0], baseX+path[2][0]), getMove(baseY/*OMFG IT WAS CAUSE THIS WAS A x*/+path[1][1], baseY+path[2][1]));
}
c.faceUpdate(c.followId+32768);
}
I know that it's trying to use methods that don't exist: getPath and checkPos.
Code:
package server.world.map;
import java.util.Hashtable;
import java.util.Map;
public class VirtualWorld
{
public VirtualWorld()
{
}
public static final void main(String args[])
{
init();
}
public static final void init()
{
for(int i = 0; i < 10331; i++)
{
I[i] = null;
I[i] = new Hashtable();
}
server.world.map.I.I(true);
for(int j = 0; j < 0x989680; j++)
I(0, 3222, 3242, 3223, 3243, 0);
}
public static final boolean I(int height, int currentX, int currentY, int futureX, int futureY, int a)
{
if (height % 4 == 0)
height = 0;
if (currentX != futureX && futureY != currentY) {
return server.world.map.I.I(height, currentX, currentY, currentX, futureY, a) && server.world.map.I.I(height, currentX, currentY, futureX, currentY, a)
&& server.world.map.I.I(height, currentX, currentY, futureX, futureY, a);
}
return server.world.map.I.I(height, currentX, currentY, futureX, futureY, a);
}
public static Map I[] = new Hashtable[10331];
}
Thanks in advance,