Thread: Defence

Results 1 to 8 of 8
  1. #1 Defence 
    Expert Programmer


    Join Date
    Dec 2007
    Posts
    2,018
    Thanks given
    52
    Thanks received
    84
    Rep Power
    986
    Hey guys, just wondering the BEST way to do defence, atm I do the way below:

    Add all defence

    Code:
    (defenceLvl + stabDef + slashDef + crushDef) / 4 / 10)
    Add all attack

    Code:
    (attackLvl + stabAtt + slashAtt + crushAtt) / 4 / 10)
    Finally, I get the random of the 2 and if the other plays attack is higher than the target's defence, then the hit is sucessful. Tbh this way sucks! Has anybody got any better ways?
    Reply With Quote  
     

  2. #2  
    Defence



    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    30
    Posts
    16,307
    Thanks given
    7,215
    Thanks received
    12,308
    Rep Power
    5000
    Find highest one.

    Attached image
    Reply With Quote  
     

  3. #3  
    Expert Programmer


    Join Date
    Dec 2007
    Posts
    2,018
    Thanks given
    52
    Thanks received
    84
    Rep Power
    986
    Then 1 player always hits and the other don't
    Reply With Quote  
     

  4. #4  
    Registered Member
    Shamon King's Avatar
    Join Date
    Aug 2007
    Posts
    3,335
    Thanks given
    90
    Thanks received
    228
    Rep Power
    1363
    Heres the max hit formula. Isn't defence something like it?
    http://runescape.wikia.com/wiki/Maximum_melee_hit

    Code:
    int baseStr = strength * (1+poitionBonus+prayerBonus+otherBonus);
    int combatStr = baseStr+CombatStyleBonus;
    int strMultiplier = (EquipmentBonus * 0.00175) + 0.1;
    int maxHit = Math.floor(combatStr * strMultiplier + 1.05);
    Reply With Quote  
     

  5. #5  
     

    Vastiko's Avatar
    Join Date
    Dec 2006
    Posts
    5,700
    Thanks given
    300
    Thanks received
    663
    Rep Power
    5000
    Defence is calculated by the attackers style of attack.

    Say you had a idk slash defence of + 10 and the attacker slash attack was + 50 yet he was using stab which was + 5, the slash defence would count for nothing but it would use your stab defence which was + 1.

    And the message about the visitor message thing, I will ask him yes, he said that for now, you get it?
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Oct 2007
    Posts
    1,017
    Thanks given
    1
    Thanks received
    3
    Rep Power
    562
    Thanks LYNX V, now my defence system is already a bit better. Also I've been looking ages for this.
    <William.D | Perfectworld> before
    Reply With Quote  
     

  7. #7  
    Expert Programmer


    Join Date
    Dec 2007
    Posts
    2,018
    Thanks given
    52
    Thanks received
    84
    Rep Power
    986
    Quote Originally Posted by LYNX V View Post
    Defence is calculated by the attackers style of attack.

    Say you had a idk slash defence of + 10 and the attacker slash attack was + 50 yet he was using stab which was + 5, the slash defence would count for nothing but it would use your stab defence which was + 1.

    And the message about the visitor message thing, I will ask him yes, he said that for now, you get it?
    Tell Vastico thanks alot I get it, but how should I go about random 0s?
    Reply With Quote  
     

  8. #8  
     

    Vastiko's Avatar
    Join Date
    Dec 2006
    Posts
    5,700
    Thanks given
    300
    Thanks received
    663
    Rep Power
    5000
    Quote Originally Posted by Ultimate View Post
    Tell Vastico thanks alot I get it, but how should I go about random 0s?
    use a formula, JaGeX wont ever release there formula so you won't ever get it exact but I would go along the lines of:

    long defRan = opp.getDefence(att.getStyle);
    defRan = defRan+opp.getLevel(DEFENCE);
    defRan = java.lang.math.Random(defRan/3)+1;
    if (defRan <= (att.getLevel(STRENGTH) + att.getLevel(ATTACK) /2)) {
    hit = 0;
    }

    Something like that IDK lol.
    Reply With Quote  
     


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
  •