Find highest one.
|
Hey guys, just wondering the BEST way to do defence, atm I do the way below:
Add all defence
Add all attackCode:(defenceLvl + stabDef + slashDef + crushDef) / 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?Code:(attackLvl + stabAtt + slashAtt + crushAtt) / 4 / 10)
Then 1 player always hits and the other don't
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);
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?
Thanks LYNX V, now my defence system is already a bit better. Also I've been looking ages for this.
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.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |