Thread: Need some help.

Results 1 to 6 of 6
  1. #1 Need some help. 
    Extreme Donator


    Join Date
    Oct 2006
    Posts
    1,370
    Thanks given
    64
    Thanks received
    197
    Rep Power
    426
    Hi,

    I've come across an annoying error in my server.


    I know exactly what this means, but I don't know how to fix it.

    I checked my imports, they were wrong, so I corrected them. Then I went back to where the error was, and I now have a bunch more errors.

    This is my followPlayer method:
    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.

    I'm honestly stuck at this point and I hope you can help me.

    VirtualWorld.java:
    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,
    ~phl0e
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Nov 2011
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Bumping this. Thanks for posting phl0w.

    Would really appreciate the help guys.

    -Sov
    Reply With Quote  
     

  3. #3  
    Extreme Donator


    Join Date
    Oct 2006
    Posts
    1,370
    Thanks given
    64
    Thanks received
    197
    Rep Power
    426
    Anyone, please?
    Reply With Quote  
     

  4. #4  
    Dr. Jaegon


    Join Date
    Sep 2011
    Posts
    2,132
    Thanks given
    407
    Thanks received
    441
    Rep Power
    2559
    Did you compile?
    Reply With Quote  
     

  5. #5  
    Extreme Donator


    Join Date
    Oct 2006
    Posts
    1,370
    Thanks given
    64
    Thanks received
    197
    Rep Power
    426
    gtfo you don't even know what you are talking about.
    Reply With Quote  
     

  6. #6  
    Donator


    Join Date
    Mar 2011
    Posts
    2,350
    Thanks given
    1,193
    Thanks received
    824
    Rep Power
    856
    Look on the previous thread you opened.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •