Thread: Diagonal Combat Fix

Results 1 to 6 of 6
  1. #1 Diagonal Combat Fix 
    HYBRID JEFE
    Brett the Don's Avatar
    Join Date
    Dec 2009
    Posts
    1,806
    Thanks given
    255
    Thanks received
    298
    Rep Power
    796
    Not sure if this has been released, was cleaning up my PC and remember I had it on my 718 when not many did....

    IF this has been released before feel free to take this down I haven't touched this for 4 years but for those who might need it here ya go, quit 718 and won't be returning back to that revision maybe 667. Good day.

    If you're in hybrid fight and got your opponent frozen and side step him he cannot attack you with melee, only mage (Like rs). As well if you're both frozen diagonally you cannot melee only mage or range.


    Place this in your CheckAll method in PlayerCombat class

    Code:
    if (player.getFreezeDelay() >= Utils.currentTimeMillis()) {
       if (isRanging(player) == 0 && player.getCombatDefinitions().getSpellId() <= 0 && size == 1)
                    if (target.getX() == player.getX()+1 && target.getY() == player.getY()+1
                        || target.getX() == player.getX()-1 && target.getY() == player.getY()-1
                        || target.getX() == player.getX()-1 && target.getY() == player.getY()+1
                        || target.getX() == player.getX()+1 && target.getY() == player.getY()-1)
                        return false;
      }
    Last edited by Brett the Don; 01-31-2019 at 03:30 AM.

    All of humanity's problems stem from man's
    inability to sit quietly in a room by himself

    Reply With Quote  
     

  2. #2  
    Junior Programmer

    Stoked's Avatar
    Join Date
    Apr 2012
    Age
    20
    Posts
    3,638
    Thanks given
    427
    Thanks received
    430
    Rep Power
    165
    [Only registered and activated users can see links. ]

    I'm pretty sure this works too,

    Code:
    		if (player.getFreezeDelay() >= Utils.currentTimeMillis()) {
    			if (player.withinDistance(target, 0))
    				return false;
    			return true;
    		}
    But i guess thanks for the share?
    Spoiler for sig too large:


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    21
    Posts
    3,371
    Thanks given
    530
    Thanks received
    1,916
    Rep Power
    2419
    Quote Originally Posted by Stoked View Post
    [Only registered and activated users can see links. ]

    I'm pretty sure this works too,

    Code:
    		if (player.getFreezeDelay() >= Utils.currentTimeMillis()) {
    			if (player.withinDistance(target, 0))
    				return false;
    			return true;
    		}
    But i guess thanks for the share?
    Yours won't work. It'll block combat entirely, not just diagonally.

    As for OP - the way yours is, is actually a little incorrect. Diagonal combat blocking does not only apply to size-1 monsters. It applies to everything.
    As for the code, local variables would not only clean the code up a lot, but also apply a micro-optimization.

    [Only registered and activated users can see links. ]
    Discord: Kris#1337
    Reply With Quote  
     

  4. Thankful users:


  5. #4  
    Registered Member
    Join Date
    May 2016
    Posts
    379
    Thanks given
    52
    Thanks received
    29
    Rep Power
    29
    That exact code has been released here years ago by _Dennis
    donald trump approves this message
    Reply With Quote  
     

  6. #5  
    Registered Member
    Teemuzz's Avatar
    Join Date
    Oct 2009
    Posts
    2,700
    Thanks given
    1,122
    Thanks received
    395
    Rep Power
    701
    Blah blah take x delta and y delta or difference in other words
    If yDelta==0 & xDelta ==1||xDelta ==-1
    And the other way around then you don't need a million comparisons

    Not trying to turn you down just to say that there is an easier way for the future
    I'm back.
    ScapeEmulator #592 Convert [Only registered and activated users can see links. ]/[Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. Thankful user:


  8. #6  
    HYBRID JEFE
    Brett the Don's Avatar
    Join Date
    Dec 2009
    Posts
    1,806
    Thanks given
    255
    Thanks received
    298
    Rep Power
    796
    Quote Originally Posted by Java100 View Post
    That exact code has been released here years ago by _Dennis
    He got it from my source so it was mine to begin with.

    All of humanity's problems stem from man's
    inability to sit quietly in a room by himself

    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. Diagonal combat fix - Project Insanity
    By Rhubarb in forum Snippets
    Replies: 22
    Last Post: 05-25-2014, 04:53 PM
  2. Dementhium 637 diagonal combat fix
    By Simmo in forum Snippets
    Replies: 0
    Last Post: 11-10-2013, 10:52 PM
  3. Diagonal Combat fix ?
    By -Andreas in forum Help
    Replies: 2
    Last Post: 02-26-2013, 06:51 PM
  4. Sell 614 Diagonal Combat Fix
    By bracket in forum Selling
    Replies: 1
    Last Post: 05-22-2012, 03:44 PM
  5. [Dementhium] Diagonal Combat Fix (Working)
    By EvanFaise in forum Help
    Replies: 10
    Last Post: 01-25-2012, 06:29 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •