示例#1
0
  @Override
  public boolean onActionTime() {
    if (_skill == null) return true;

    int mpConsume = _skill.getMpConsume();
    if (mpConsume > getEffector().getCurrentMp()) {
      getEffector()
          .sendPacket(SystemMessage.getSystemMessage(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP));
      return false;
    }
    getEffector().reduceCurrentMp(mpConsume);

    List<L2Character> targets = new ArrayList<>();
    for (L2Character cha :
        _actor
            .getKnownList()
            .getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius())) {
      if (_skill.isOffensive()
          && !L2Skill.checkForAreaOffensiveSkills(getEffector(), cha, _skill, _srcInArena))
        continue;

      // there doesn't seem to be a visible effect with MagicSkillLaunched packet...
      _actor.broadcastPacket(
          new MagicSkillUse(_actor, cha, _skill.getId(), _skill.getLevel(), 0, 0));
      targets.add(cha);
    }

    if (!targets.isEmpty())
      getEffector().callSkill(_skill, targets.toArray(new L2Character[targets.size()]));

    return true;
  }
示例#2
0
 @Override
 public void onExit() {
   if (_actor != null) _actor.deleteMe();
 }