Thread: [TUT] Make Def Matter

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 [TUT] Make Def Matter 
    LolzLand
    Guest
    By Lolzland ~ Mage K0

    Difficulty: 2/10

    Assumed Knowledge: Knowing where the attack void is

    Server Base: My own should work on all (promise)

    Classes Modified: Client.java

    Procedure
    Step 1: Alright Open client.java and search for

    Code:
    public boolean Attack()
    Step 2: Now in the boolean look for

    Code:
    calculatemaxhit();
    Step 3: Space and add this

    Code:
    if (Hit(AttackingOn)) {
                            hitDiff = misc.random(playerMaxHit);
                        } else {
                            hitDiff = 0;
    Step 4: Now Search For

    Code:
    public class client extends Player implements Runnable {
    Step 5: space and add this if you got it already dont add it

    Code:
    public boolean Hit(int index) {
    
            if (server.playerHandler.players[index] == null) {
                return false;
            }
            int BonusUsed = CheckBestBonus();
            int enemyDef = server.playerHandler.players[index].playerBonus[BonusUsed + 5]
                    + (server.playerHandler.players[index].playerLevel[1] / 4);
            int myBonus = playerBonus[BonusUsed] + (playerLevel[0] / 4); 
    
            if (misc.random(myBonus) > misc.random(enemyDef)) {
                return true;
            }
            return false;
    If you dont have Checkbestbonus();
    Add this somewhere its not a void

    Code:
        public int CheckBestBonus() {
    
            if (playerBonus[1] > playerBonus[2] && playerBonus[1] > playerBonus[3]) {
                return 1;
            }
            if (playerBonus[2] > playerBonus[1] && playerBonus[2] > playerBonus[3]) {
                return 2;
            }
            if (playerBonus[3] > playerBonus[2] && playerBonus[3] > playerBonus[1]) {
                return 3;
            }
    
            return 1;
        }
    Save and Compile


    Enjoy
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Jan 2008
    Posts
    1,338
    Thanks given
    243
    Thanks received
    85
    Rep Power
    250
    Where you took this, delta? or dont you just know about brackets? or are you goin' to say "anti l33ch pl0x", you're missick more brackets than methods what is needed
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member
    Deadly Uzi's Avatar
    Join Date
    Jul 2008
    Posts
    994
    Thanks given
    177
    Thanks received
    87
    Rep Power
    362
    If only one lined is involved in an if statement you don't need brackets

    Code:
    if(true) {
    System.out.println("Bad!");
    }
    Where as:

    Code:
    if(true)
    System.out.println("Good!");
    Attempting to develop a multi-revision library. [Only registered and activated users can see links. ] on GitHub.
    Reply With Quote  
     

  4. #4  
    gold cobra
    Guest
    Quote Originally Posted by PasiipaZ View Post
    Where you took this, delta? or dont you just know about brackets? or are you goin' to say "anti l33ch pl0x", you're missick more brackets than methods what is needed
    He took it from ZDR.
    Reply With Quote  
     

  5. #5  
    LolzLand
    Guest
    Sure i did
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Jan 2008
    Posts
    1,338
    Thanks given
    243
    Thanks received
    85
    Rep Power
    250
    Quote Originally Posted by gold cobra View Post
    He took it from ZDR.
    so its worse as delta? because delta is EPIC fail
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #7  
    .supersyn

    myK-'s Avatar
    Join Date
    Aug 2008
    Posts
    1,778
    Thanks given
    18
    Thanks received
    39
    Rep Power
    399
    I though in delta def mattered... like if u had 1 def u would always loose to someone with 99def
    Reply With Quote  
     

  8. #8  
    Member

    Join Date
    Sep 2007
    Posts
    614
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Deadly Uzi View Post
    If only one lined is involved in an if statement you don't need brackets

    Code:
    if(true) {
    System.out.println("Bad!");
    }
    Where as:

    Code:
    if(true)
    System.out.println("Good!");
    [Only registered and activated users can see links. ]

    Code:
     7.4 if, if-else, if else-if else Statements
    
    The if-else class of statements should have the following form:
    
        if (condition) {
            statements;
        }
    
        if (condition) {
            statements;
        } else {
            statements;
        }
    
        if (condition) {
            statements;
        } else if (condition) {
            statements;
        } else {
            statements;
        }
         
    
    Note: if statements always use braces {}. Avoid the following error-prone form:
    
        if (condition) //AVOID! THIS OMITS THE BRACES {}!
            statement;
    According to Java docs (which you cannot prove wrong), you FAIL SIR.
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Jun 2008
    Posts
    225
    Thanks given
    0
    Thanks received
    0
    Rep Power
    137
    actually just look in the client lots of if than statements don't have brackets for one line
    Reply With Quote  
     

  10. #10  
    LolzLand
    Guest
    You cant please anyone these days
    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

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