armark1ng

Untitled

Aug 12th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. int weaponId = player.getEquipment().getWeaponId();
  2. int attackStyle = player.getCombatDefinitions().getAttackStyle();
  3. int maxhit;
  4. if (PlayerCombat.isRanging(player) == 0) {
  5. double strengthLvl = player.getSkills().getLevel(Skills.STRENGTH);
  6.  
  7. int xpStyle = CombatDefinitions.getXpStyle(weaponId, attackStyle);
  8. double styleBonus = xpStyle == Skills.STRENGTH ? 3 : xpStyle == CombatDefinitions.SHARED ? 1 : 0;
  9. double otherBonus = 1;
  10. if (PlayerCombat.fullDharokEquipped(player)) {
  11. double hp = player.getHitpoints();
  12. double maxhp = player.getMaxHitpoints();
  13. double d = hp / maxhp;
  14. otherBonus = 2 - d;
  15. }
  16. double effectiveStrength = 8
  17. + Math.floor((strengthLvl * player.getPrayer().getStrengthMultiplier()) + styleBonus);
  18. if (PlayerCombat.fullVoidEquipped(player, 11665, 11676))
  19. effectiveStrength = Math.floor(effectiveStrength * 1.1);
  20. double strengthBonus = player.getCombatDefinitions().getBonuses()[CombatDefinitions.STRENGTH_BONUS];
  21. if (weaponId == -2) {
  22. strengthBonus += 82;
  23. }
  24. double baseDamage = 5 + effectiveStrength * (1 + (strengthBonus / 64));
  25. maxhit = (int) Math.floor(baseDamage * 1 * otherBonus);
  26. } else {
  27. double rangedLvl = player.getSkills().getLevel(Skills.RANGE);
  28. double styleBonus = attackStyle == 0 ? 3 : attackStyle == 1 ? 0 : 1;
  29. double otherBonus = 1;
  30. double effectiveStrenght = Math.floor(rangedLvl * player.getPrayer().getRangeMultiplier())
  31. + styleBonus;
  32. if (PlayerCombat.fullVoidEquipped(player, 11664, 11675))
  33. effectiveStrenght += Math.floor((player.getSkills().getLevelForXp(Skills.RANGE) / 5) + 1.6);
  34. double strengthBonus = player.getCombatDefinitions()
  35. .getBonuses()[CombatDefinitions.RANGED_STR_BONUS];
  36. double baseDamage = 5 + (((effectiveStrenght + 8) * (strengthBonus + 64)) / 64);
  37. maxhit = (int) Math.floor(baseDamage * 1 * otherBonus);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment