Guest User

Untitled

a guest
Jan 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. public static void registerMeleeHit(final Client o, final Client c, final int hitDelay) {
  2. //CycleEventHandler.getSingleton().addEvent(o, new CycleEvent() {
  3. final int stat = c.fightXp;
  4. final boolean veracsEffect = c.getCombat().fullVeracs() && Misc.random(4) == 1;
  5. final boolean guthansEffect = c.getCombat().fullGuthans() && Misc.random(4) == 1;
  6. final boolean ahrimsEffect = c.getCombat().fullAhrim() && Misc.random(4) == 1;
  7. int damage = !CombatAssistant.hitSuccessful(c.getCombat().getAttack(), o.getCombat().getMeleeDefence(c)) && !veracsEffect ? 0 : Misc.random(MeleeMaxHit.meleeMaxHit(c));
  8. //@Override
  9. //public void execute(CycleEventContainer container) {
  10. if (o == null || c == null || o.isDead || c.isDead) {
  11. return;
  12. }
  13. if (o.prayerActive[18] && System.currentTimeMillis() - o.protMeleeDelay > 1500 && !veracsEffect) {
  14. damage *= .60;
  15. }
  16. if (c.ssSpec) {
  17. damage = 5 + Misc.random(11);
  18. c.ssSpec = false;
  19. }
  20. if (o.playerLevel[Config.HITPOINTS] - damage < 0) {
  21. damage = o.playerLevel[Config.HITPOINTS];
  22. }
  23. c.getCombat().specEffect(o, c.specEffect, damage);
  24. c.specEffect = 0;
  25. if (c.killedBy != o.playerId) {
  26. c.totalPlayerDamageDealt = 0;
  27. }
  28. if (damage > 0) {
  29. if (Misc.random(3) == 1) {
  30. if (o.poisonDamage < 1) {
  31. if (c.poisonweapon("(p)")) {
  32. o.getPA().appendPoison(4);
  33. }
  34. if (c.poisonweapon("(p+)")) {
  35. o.getPA().appendPoison(5);
  36. }
  37. if (c.poisonweapon("(p++)")) {
  38. o.getPA().appendPoison(6);
  39. }
  40. }
  41. }
  42. if (o.vengOn) {
  43. c.getCombat().hitPlayer(o.getCombat().applyVengeance(damage));
  44. }
  45. if (o.playerEquipment[Config.RING] == 2550) {
  46. c.getCombat().hitPlayer(o.getCombat().applyRecoil(damage));
  47. }
  48. if (guthansEffect) {
  49. c.playerLevel[Config.HITPOINTS] += damage;
  50. if (c.playerLevel[Config.HITPOINTS] > c.getPlayerLevel(Config.HITPOINTS)) {
  51. c.playerLevel[Config.HITPOINTS] = c.getPlayerLevel(Config.HITPOINTS);
  52. }
  53. c.getPA().refreshSkill(Config.HITPOINTS);
  54. o.gfx0(398);
  55. }
  56. if (ahrimsEffect) {
  57. if (o.playerLevel[Config.STRENGTH] > 5) {
  58. o.playerLevel[Config.STRENGTH] -= 5;
  59. o.sendMessage("Your strength seems to weaken.");
  60. }
  61. }
  62. c.getCombat().applySmite(o, damage);
  63. }
  64. AttackPlayer.addCombatExp(c, damage, stat);
  65. o.getCombat().hitPlayer(damage);
  66. o.damageTaken[c.playerId] += damage;
  67. afterAttack(o, c);
  68. c.getCombat().getHitDelay();
  69. //container.stop();
  70. //}
  71. //@Override
  72. //public void stop() {
  73. // TODO Auto-generated method stub
  74.  
  75. //}
  76. //}, c.getCombat().getHitDelay());
  77. }
Add Comment
Please, Sign In to add comment