public void appendGraphic(int spellbook, int spell) { try { Player opp = Server.engine.players[p.magicOppIndex]; updateAttributes(spellbook, spell); if ((!opp.wildernessZone(opp.absX, opp.absY)) || (!p.wildernessZone(p.absX, p.absY))) { p.getActionSender().sendMessage(p, "You cannot attack players outside of the wilderness."); return; } if (p.InBounty == 0) { if (!p.properWildernessLevel(p.combatLevel, opp.combatLevel) || !opp.properWildernessLevel(opp.combatLevel, p.combatLevel)) { p.getActionSender().sendMessage(p, "Your combat difference is too great!"); return; } } if (p.InBounty == 1) { if (opp.playerId != p.bhTarget && (p.playerId != opp.bhTarget && (p.username != opp.OriginalAttacker))) { if (!opp.multiwayCombatZone(opp.absX, opp.absY)) { if (opp.attackedBy != null && (opp.attacking != null || opp.attackedByCount >= 1) && opp.attackedBy != p.username) { p.getActionSender().sendMessage(p, "This player is already in combat."); Engine.playerMovement.resetWalkingQueue(p); p.resetAttack(); return; } if (opp.username != p.attackedBy && p.attackedBy != null) { p.getActionSender().sendMessage(p, "You are already in combat."); Engine.playerMovement.resetWalkingQueue(p); p.resetAttack(); return; } } } } if (p.InBounty == 0) { if (!opp.multiwayCombatZone(opp.absX, opp.absY)) { if (opp.attackedBy != null && (opp.attacking != null || opp.attackedByCount >= 1) && opp.attackedBy != p.username) { p.getActionSender().sendMessage(p, "This player is already in combat."); Engine.playerMovement.resetWalkingQueue(p); p.resetAttack(); return; } if (opp.username != p.attackedBy && p.attackedBy != null) { p.getActionSender().sendMessage(p, "You are already in combat."); Engine.playerMovement.resetWalkingQueue(p); p.resetAttack(); return; } } } if (!p.successfulCast) { graphic = 85; p.graphicMSDelay = 100; } else if (opp.orb && spell == 3) { graphic = 1677; p.graphicMSDelay = 100; } if (!multipleDamage || !opp.multiwayCombatZone(opp.absX, opp.absY)) { opp.requestGFX(graphic, p.graphicMSDelay); opp.orb = false; } else { for (Player player : Server.engine.players) { if (player == null || player == p) { continue; } if (Misc.getDistance(opp.absX, opp.absY, player.absX, player.absY) <= 1) { if (player.wildernessZone(player.absX, player.absY) && p.properWildernessLevel(p.combatLevel, player.combatLevel) && player.properWildernessLevel(player.combatLevel, p.combatLevel)) { player.requestGFX(graphic, p.graphicMSDelay); player.orb = false; } } } } p.graphicMSDelay = 0; } catch (Exception e) { return; } }
public void ancientMagicksAffect(Player opp, String affect) { if (!p.successfulCast) { return; } if (affect.equals("Smoke")) {} if (affect.equals("Shadow")) {} if (affect.equals("Blood")) {} if (affect.equals("Miasmic")) { switch (p.spell) { case 19: if (opp.miasmicSpell == 0) { opp.miasmicSpell = 48; opp.message("You feel very tired."); } case 18: if (opp.miasmicSpell == 0) { opp.miasmicSpell = 36; opp.message("You feel tired."); } case 17: if (opp.miasmicSpell == 0) { opp.miasmicSpell = 24; opp.message("You feel tired."); } case 16: if (opp.miasmicSpell == 0) { opp.miasmicSpell = 12; opp.message("You feel slightly tired."); } } } if (affect.equals("Ice")) { switch (p.spell) { case 0: if (!(opp.freezeDelay > 0)) { opp.freezeDelay = 5; Engine.playerMovement.resetWalkingQueue(opp); } case 1: if (!(opp.freezeDelay > 0)) { opp.freezeDelay = 15; Engine.playerMovement.resetWalkingQueue(opp); } break; case 2: if (!(opp.freezeDelay > 0)) { opp.freezeDelay = 10; Engine.playerMovement.resetWalkingQueue(opp); } break; case 3: if (!(opp.freezeDelay > 0)) { opp.orb = false; opp.freezeDelay = 20; Engine.playerMovement.resetWalkingQueue(opp); } else { opp.orb = true; } break; } } }