Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void registerMeleeHit(final Client o, final Client c, final int hitDelay) {
- //CycleEventHandler.getSingleton().addEvent(o, new CycleEvent() {
- final int stat = c.fightXp;
- final boolean veracsEffect = c.getCombat().fullVeracs() && Misc.random(4) == 1;
- final boolean guthansEffect = c.getCombat().fullGuthans() && Misc.random(4) == 1;
- final boolean ahrimsEffect = c.getCombat().fullAhrim() && Misc.random(4) == 1;
- int damage = !CombatAssistant.hitSuccessful(c.getCombat().getAttack(), o.getCombat().getMeleeDefence(c)) && !veracsEffect ? 0 : Misc.random(MeleeMaxHit.meleeMaxHit(c));
- //@Override
- //public void execute(CycleEventContainer container) {
- if (o == null || c == null || o.isDead || c.isDead) {
- return;
- }
- if (o.prayerActive[18] && System.currentTimeMillis() - o.protMeleeDelay > 1500 && !veracsEffect) {
- damage *= .60;
- }
- if (c.ssSpec) {
- damage = 5 + Misc.random(11);
- c.ssSpec = false;
- }
- if (o.playerLevel[Config.HITPOINTS] - damage < 0) {
- damage = o.playerLevel[Config.HITPOINTS];
- }
- c.getCombat().specEffect(o, c.specEffect, damage);
- c.specEffect = 0;
- if (c.killedBy != o.playerId) {
- c.totalPlayerDamageDealt = 0;
- }
- if (damage > 0) {
- if (Misc.random(3) == 1) {
- if (o.poisonDamage < 1) {
- if (c.poisonweapon("(p)")) {
- o.getPA().appendPoison(4);
- }
- if (c.poisonweapon("(p+)")) {
- o.getPA().appendPoison(5);
- }
- if (c.poisonweapon("(p++)")) {
- o.getPA().appendPoison(6);
- }
- }
- }
- if (o.vengOn) {
- c.getCombat().hitPlayer(o.getCombat().applyVengeance(damage));
- }
- if (o.playerEquipment[Config.RING] == 2550) {
- c.getCombat().hitPlayer(o.getCombat().applyRecoil(damage));
- }
- if (guthansEffect) {
- c.playerLevel[Config.HITPOINTS] += damage;
- if (c.playerLevel[Config.HITPOINTS] > c.getPlayerLevel(Config.HITPOINTS)) {
- c.playerLevel[Config.HITPOINTS] = c.getPlayerLevel(Config.HITPOINTS);
- }
- c.getPA().refreshSkill(Config.HITPOINTS);
- o.gfx0(398);
- }
- if (ahrimsEffect) {
- if (o.playerLevel[Config.STRENGTH] > 5) {
- o.playerLevel[Config.STRENGTH] -= 5;
- o.sendMessage("Your strength seems to weaken.");
- }
- }
- c.getCombat().applySmite(o, damage);
- }
- AttackPlayer.addCombatExp(c, damage, stat);
- o.getCombat().hitPlayer(damage);
- o.damageTaken[c.playerId] += damage;
- afterAttack(o, c);
- c.getCombat().getHitDelay();
- //container.stop();
- //}
- //@Override
- //public void stop() {
- // TODO Auto-generated method stub
- //}
- //}, c.getCombat().getHitDelay());
- }
Add Comment
Please, Sign In to add comment