/** * @param player * @param target */ public MyTargetSelected(L2PcInstance player, L2Character target) { _objectId = (target instanceof L2ControllableAirShipInstance) ? ((L2ControllableAirShipInstance) target).getHelmObjectId() : target.getObjectId(); _color = target.isAutoAttackable(player) ? (player.getLevel() - target.getLevel()) : 0; }
@Override public void onStart(BuffInfo info) { final L2Character target = info.getEffected(); if ((target == null) || target.isDead() || target.isDoor()) { return; } double amount = 0; final double power = _power; final boolean full = (power == 100.0); amount = full ? target.getMaxMp() : (target.getMaxMp() * power) / 100.0; // Prevents overheal and negative amount amount = Math.max(Math.min(amount, target.getMaxRecoverableMp() - target.getCurrentMp()), 0); if (amount != 0) { target.setCurrentMp(amount + target.getCurrentMp()); } SystemMessage sm; if (info.getEffector().getObjectId() != target.getObjectId()) { sm = SystemMessage.getSystemMessage(SystemMessageId.S2_MP_HAS_BEEN_RESTORED_BY_C1); sm.addCharName(info.getEffector()); } else { sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MP_HAS_BEEN_RESTORED); } sm.addInt((int) amount); target.sendPacket(sm); }
/** * Special Camera 3 packet constructor. * * @param creature the creature * @param force * @param angle1 * @param angle2 * @param time * @param range * @param duration * @param relYaw * @param relPitch * @param isWide * @param relAngle * @param unk unknown post-C4 parameter */ public SpecialCamera( L2Character creature, int force, int angle1, int angle2, int time, int range, int duration, int relYaw, int relPitch, int isWide, int relAngle, int unk) { _id = creature.getObjectId(); _force = force; _angle1 = angle1; _angle2 = angle2; _time = time; _duration = duration; _relYaw = relYaw; _relPitch = relPitch; _isWide = isWide; _relAngle = relAngle; _unk = unk; }