Thread: Need help with barricades

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Need help with barricades 
    H_E_N_T_A_I_H_E_A_V_E_N_
    Tatsumi's Avatar
    Join Date
    May 2013
    Posts
    1,779
    Thanks given
    537
    Thanks received
    269
    Rep Power
    337
    K so, i added barricades to my zombie server, but theres a problem with them
    1) you can walk through them
    2) When you attattack them, they attack you back
    3) They follow you around if you attacked them
    4) after you kill one, it respawns at the place i put them down

    How would i be able to fix this?

    ---
    Well i have a new player.java
    could somebody put the correct code in and explain? I dont have some of those cw methods.

    http://pastebin.com/9r4H7z1S - player.java

    Castle wars - http://pastebin.com/iEGcb4Zm
    castle war objects - http://pastebin.com/Az26mHyR
    Attached image
    Reply With Quote  
     

  2. #2  
    H_E_N_T_A_I_H_E_A_V_E_N_
    Tatsumi's Avatar
    Join Date
    May 2013
    Posts
    1,779
    Thanks given
    537
    Thanks received
    269
    Rep Power
    337
    Bump
    Attached image
    Reply With Quote  
     

  3. #3  
    H_E_N_T_A_I_H_E_A_V_E_N_
    Tatsumi's Avatar
    Join Date
    May 2013
    Posts
    1,779
    Thanks given
    537
    Thanks received
    269
    Rep Power
    337
    Help please!
    Attached image
    Reply With Quote  
     

  4. #4  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Code:
    		if (inCwSafe() || inCwGame() || inCwUnderground() || inZammyBase() || inSaraBase()) {
    			int tempabsX = absX+Misc.directionDeltaX[dir];
    			int tempabsY = absY+Misc.directionDeltaY[dir];
    			if(checkBarricade(tempabsX,tempabsY,heightLevel)){
    				resetWalkingQueue();
    				return -1;
    			}
    		}
    
    	public boolean checkBarricade(int X, int Y, int Z){
    		for (int i = 0; i < CastleWars.BARRICADE_INDEX.length; i++){
    			if (CastleWars.BARRICADE_INDEX[i] != 0){
    				if (NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].npcType == 1532 || NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].npcType == 1534){
    					if (NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].absX == X && NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].absY == Y && NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].heightLevel == Z){
    						return true;
    					}
    				}
    			}
    		}
    		return false;
    	}
    Also might need to change some of the codes

    Attacking/following back is in NPCHandler
    Reply With Quote  
     

  5. #5  
    H_E_N_T_A_I_H_E_A_V_E_N_
    Tatsumi's Avatar
    Join Date
    May 2013
    Posts
    1,779
    Thanks given
    537
    Thanks received
    269
    Rep Power
    337
    Quote Originally Posted by Nighel View Post
    Code:
    		if (inCwSafe() || inCwGame() || inCwUnderground() || inZammyBase() || inSaraBase()) {
    			int tempabsX = absX+Misc.directionDeltaX[dir];
    			int tempabsY = absY+Misc.directionDeltaY[dir];
    			if(checkBarricade(tempabsX,tempabsY,heightLevel)){
    				resetWalkingQueue();
    				return -1;
    			}
    		}
    
    	public boolean checkBarricade(int X, int Y, int Z){
    		for (int i = 0; i < CastleWars.BARRICADE_INDEX.length; i++){
    			if (CastleWars.BARRICADE_INDEX[i] != 0){
    				if (NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].npcType == 1532 || NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].npcType == 1534){
    					if (NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].absX == X && NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].absY == Y && NPCHandler.getInstance().npcs[CastleWars.BARRICADE_INDEX[i]].heightLevel == Z){
    						return true;
    					}
    				}
    			}
    		}
    		return false;
    	}
    Also might need to change some of the codes

    Attacking/following back is in NPCHandler
    Sorry for being a noob, but where do i put this exactly?
    Attached image
    Reply With Quote  
     

  6. #6  
    H_E_N_T_A_I_H_E_A_V_E_N_
    Tatsumi's Avatar
    Join Date
    May 2013
    Posts
    1,779
    Thanks given
    537
    Thanks received
    269
    Rep Power
    337
    Still need help
    Attached image
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Code:
    getNextWalkingDirection()
    Player.java
    Reply With Quote  
     

  8. #8  
    H_E_N_T_A_I_H_E_A_V_E_N_
    Tatsumi's Avatar
    Join Date
    May 2013
    Posts
    1,779
    Thanks given
    537
    Thanks received
    269
    Rep Power
    337
    Quote Originally Posted by Nighel View Post
    Code:
    getNextWalkingDirection()
    Player.java
    Errors : Screenshot by Lightshot


    Heres the player.java (without the code) player.java - Pastebin.com
    Attached image
    Reply With Quote  
     

  9. #9  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Reply With Quote  
     

  10. #10  
    H_E_N_T_A_I_H_E_A_V_E_N_
    Tatsumi's Avatar
    Join Date
    May 2013
    Posts
    1,779
    Thanks given
    537
    Thanks received
    269
    Rep Power
    337
    Quote Originally Posted by Nighel View Post
    Screenshot by Lightshot
    Attached image
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. I need help with pen tool
    By Joe in forum General
    Replies: 6
    Last Post: 01-19-2008, 07:05 PM
  2. Need help with turning something back
    By ftmaster in forum RS2 Server
    Replies: 0
    Last Post: 12-20-2007, 03:11 PM
  3. Need help with DomScape
    By thegreatblob in forum Requests
    Replies: 4
    Last Post: 11-30-2007, 04:25 AM
  4. need help with making a client with new stuff
    By yahoo112 in forum RS2 Client
    Replies: 1
    Last Post: 09-19-2007, 08:06 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •