Thread: 1 Combat problem

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 1 Combat problem 
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    So i ripped Xyle combat to winterLove because my combat was realy bad, so i got almost everything to work fine but only 1 bugs that i cant seem to fix.

    Attached image

    So for some reason my mage/range follow is fucked it walks towards the player no matter what

    Some help would be nice

    Code:
    	public void followPlayer() {
    		facePlayer(c.followID);
    		if (PlayerHandler.players[c.followID] == null || PlayerHandler.players[c.followID].deathStage > 0) {
    			resetFollow();
    			return;
    		}
    		if (freezeTimer > 0) {
    			return;
    		}
    		if (c.deathStage > 0 || c.currentHealth <= 0)
    			return;
    	
    		int otherX = PlayerHandler.players[c.followID].getX();
    		int otherY = PlayerHandler.players[c.followID].getY();
    
    		boolean sameSpot = (c.absX == otherX && c.absY == otherY);
    
    		boolean rangeWeaponDistance = c.GoodDistance(otherX, otherY, c.getX(),
    				c.getY(), 4);
    		boolean bowDistance = c.GoodDistance(otherX, otherY, c.getX(),
    				c.getY(), 6);
    		boolean mageDistance = c.GoodDistance(otherX, otherY, c.getX(),
    				c.getY(), 7);
    
    		boolean castingMagic = (c.cast || mageFollow || c.autocasting || MagicHandler.spellID > 0)
    				&& mageDistance;
    		boolean playerRanging = (usingRangeWeapon)
    				&& rangeWeaponDistance;
    		boolean playerBowOrCross = (c.usingBow) && bowDistance;
    
    		if (!c.GoodDistance(otherX, otherY, c.getX(), c.getY(), 25)) {
    			c.followID = 0;
    			resetFollow();
    			return;
    		}
    		faceUpdate(c.followID + 32768);
    		facePlayer(c.followID);
    		if (!sameSpot) {
    			if (c.playerIndex > 0 && c.isInWilderness(c.absX, c.absY, 1)) {
    				if (c.usingSpecial && (playerRanging || playerBowOrCross)) {
    					return;
    				}
    				if (c.autocasting || playerRanging || playerBowOrCross) {
    					return;
    				}
    			}
    		}
    		if (otherX == c.absX && otherY == c.absY) {
    			int r = Misc.random(3);
    			switch (r) {
    			case 0:
    				walkTo(0, -1);
    				break;
    			case 1:
    				walkTo(0, 1);
    				break;
    			case 2:
    				walkTo(1, 0);
    				break;
    			case 3:
    				walkTo(-1, 0);
    				break;
    			}
    		} else if (c.isRunning2) {
    			if (otherY > c.getY() && otherX == c.getX()) {
    				playerWalk(otherX, otherY - 1);
    			} else if (otherY < c.getY() && otherX == c.getX()) {
    				playerWalk(otherX, otherY + 1);
    			} else if (otherX > c.getX() && otherY == c.getY()) {
    				playerWalk(otherX - 1, otherY);
    			} else if (otherX < c.getX() && otherY == c.getY()) {
    				playerWalk(otherX + 1, otherY);
    			} else if (otherX < c.getX() && otherY < c.getY()) {
    				playerWalk(otherX + 1, otherY + 1);
    			} else if (otherX > c.getX() && otherY > c.getY()) {
    				playerWalk(otherX - 1, otherY - 1);
    			} else if (otherX < c.getX() && otherY > c.getY()) {
    				playerWalk(otherX + 1, otherY - 1);
    			} else if (otherX > c.getX() && otherY < c.getY()) {
    				playerWalk(otherX + 1, otherY - 1);
    			}
    		} else {
    			if (otherY > c.getY() && otherX == c.getX()) {
    				playerWalk(otherX, otherY - 1);
    			} else if (otherY < c.getY() && otherX == c.getX()) {
    				playerWalk(otherX, otherY + 1);
    			} else if (otherX > c.getX() && otherY == c.getY()) {
    				playerWalk(otherX - 1, otherY);
    			} else if (otherX < c.getX() && otherY == c.getY()) {
    				playerWalk(otherX + 1, otherY);
    			} else if (otherX < c.getX() && otherY < c.getY()) {
    				playerWalk(otherX + 1, otherY + 1);
    			} else if (otherX > c.getX() && otherY > c.getY()) {
    				playerWalk(otherX - 1, otherY - 1);
    			} else if (otherX < c.getX() && otherY > c.getY()) {
    				playerWalk(otherX + 1, otherY - 1);
    			} else if (otherX > c.getX() && otherY < c.getY()) {
    				playerWalk(otherX - 1, otherY + 1);
    			}
    		}
    		faceUpdate(c.followID+32768);
    	}
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Aug 2012
    Posts
    76
    Thanks given
    1
    Thanks received
    0
    Rep Power
    10
    Make a boolgen to handle the combat hits, and slashs, it should fix it
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    bump ^ didnt help me in any way
    Reply With Quote  
     

  4. #4  
    Donator


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

  5. #5  
    Donator


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

  6. #6  
    Super Donator


    Join Date
    Jun 2007
    Age
    31
    Posts
    2,157
    Thanks given
    316
    Thanks received
    282
    Rep Power
    779
    Code:
    if (!c.mageAllowed) {
    				c.mageAllowed = true;
    				return;
    			}
    theres ur problem
    Reply With Quote  
     

  7. Thankful user:


  8. #7  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Quote Originally Posted by HloJustin View Post
    Code:
    if (!c.mageAllowed) {
    				c.mageAllowed = true;
    				return;
    			}
    theres ur problem
    So if i delete that it would work?
    Reply With Quote  
     

  9. #8  
    Super Donator

    Batukka's Avatar
    Join Date
    Oct 2011
    Posts
    2,433
    Thanks given
    86
    Thanks received
    342
    Rep Power
    496
    i dont see differents pi's combat than xyle they uses same misc.random sht.
    Reply With Quote  
     

  10. #9  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Quote Originally Posted by Biggie Smalls View Post
    i dont see differents pi's combat than xyle they uses same misc.random sht.
    Im not using PI so there is a diffrent between winterLove combat and Xyle
    Reply With Quote  
     

  11. #10  
    Super Donator

    Batukka's Avatar
    Join Date
    Oct 2011
    Posts
    2,433
    Thanks given
    86
    Thanks received
    342
    Rep Power
    496
    Quote Originally Posted by Dwyane Wade View Post
    Im not using PI so there is a diffrent between winterLove combat and Xyle
    yes.. but pi's combat is based off wl base. if i remember right lol
    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. Combat Problem
    By Your tits trololololol in forum Help
    Replies: 2
    Last Post: 02-17-2012, 03:38 PM
  2. [Pi] my combat problem
    By turmoil-pk in forum Help
    Replies: 2
    Last Post: 06-01-2011, 01:34 AM
  3. My combat problem
    By Polaroid in forum Help
    Replies: 11
    Last Post: 08-26-2010, 06:04 PM
  4. [pi] combat problem please help
    By rexz0rd in forum Help
    Replies: 2
    Last Post: 08-01-2010, 10:37 PM
  5. Combat problem
    By johny cash in forum Help
    Replies: 0
    Last Post: 01-24-2010, 02:35 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
  •