Thread: Level is too great! Fixed it.

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1 Level is too great! Fixed it. 
    gold cobra
    Guest
    Purpose: Wilderness levels that work.

    Difficulty: Eh, depends on the person.

    Assumed Knowledge: Basic fundamentals, and have a motivation to learn.

    Server Base: Any server.

    Classes Modified: Client class

    Procedure
    Step 1: Declare these methods.

    Code:
        public boolean CheckWildRange(int pcombat) {
            client player = (client) server.playerHandler.players[playerId];
            if (((player.combat + WildyLevel() >= pcombat) && (pcombat >= player.combat))
                    || ((player.combat - WildyLevel() <= pcombat) && (pcombat <= player.combat))) {
                return true;
            } else {
                return false;
            }
        }
    
        public int WildyLevel() {
            client player = (client) server.playerHandler.players[playerId];
            return (((player.absX - 3330) / 8) + 1);
        }
    I returned the value of the wildylevel, so the server checks for it. Call it in process also.

    Step 2: Put this statement into your attack packet.
    Code:
                            if (!CheckWildRange(AttackingOn2.combat)) {
                                sendMessage("Level difference is too great, move to further wilderness.");
                                ResetAttack();
                                IsAttacking = false;
                            } else  if (CheckWildRange(AttackingOn2.combat)) {
                            // your attacking code here
                            }
    The above statements checks everytime you click the attack.

    You can also put that into your attack method, but make sure the ResetAttack method isn't called inside of the statement. This is how.

    Go to your attack method, and add this right below the GoodDistance statement.

    Code:
                            if (!CheckWildRange(AttackingOn2.combat)) {
                                sendMessage("Level difference is too great, move to further wilderness.");
                                IsAttacking = false;
                            } else  if (CheckWildRange(AttackingOn2.combat)) {
                            // your attacking code
                            }
    Step 3: idkmybffjill

    Credits: idkmybffjill
     

  2. #2  
    Registered Member Rabid Butterfly's Avatar
    Join Date
    Aug 2007
    Posts
    467
    Thanks given
    0
    Thanks received
    0
    Rep Power
    70
    Thanks, I was trying to fix it myself, but you got it down.

    EDIT: it still says, your level is too great , maybe I put it in the wrong place.
    cs508 - Coming soon.
     

  3. #3  
    gold cobra
    Guest
    Quote Originally Posted by Rabid Butterfly View Post
    Thanks, I was trying to fix it myself, but you got it down.

    EDIT: it still says, your level is too great , maybe I put it in the wrong place.
    Call the WildyLevel method in process.
     

  4. #4  
    Terror
    Guest
    Wud Dis Stuf Mek Moar Lag? Plz Halp.
     

  5. #5  
    Jord0n
    Guest
    Quote Originally Posted by Terror View Post
    Wud Dis Stuf Mek Moar Lag? Plz Halp.
    pepe .
     

  6. #6  
    gold cobra
    Guest
    Quote Originally Posted by Jord0n View Post
    pepe .
    Pepe on my wewe.
     

  7. #7  
    Luke
    Guest
    Moar cake pls.

    Ben, gonna have to explain it more for these neebs
     

  8. #8  
    Registered Member

    Join Date
    Aug 2007
    Posts
    2,395
    Thanks given
    2
    Thanks received
    63
    Rep Power
    558
    misreaded again .. this is still not fixed..
    [Only registered and activated users can see links. ]
     

  9. #9  
    gold cobra
    Guest
    Quote Originally Posted by i jonas i View Post
    misreaded again .. this is still not fixed..
    Looks like somebody did it wrong.
     

  10. #10  
    Registered Member paniy's Avatar
    Join Date
    Feb 2007
    Posts
    484
    Thanks given
    6
    Thanks received
    4
    Rep Power
    52
    nice i guess.
     

Page 1 of 4 123 ... LastLast

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
  •