@Override
    public void onDeath(final Creature self, final Creature killer) {
      if (self.isNpc() && (self.getId() == NOKTUM)) {
        self.broadcastPacketToOthers(
            new ExShowScreenMessage(
                NpcString.GHOST_OF_HARNAK_CAN_ONLY_BE_HIT_NEAR_SOUL_CIRCLE,
                5000,
                ExShowScreenMessage.ScreenMessageAlign.BOTTOM_CENTER,
                true,
                ExShowScreenMessage.STRING_TYPE,
                0,
                false,
                0));
        self.removeListener(_deathListener);
      }

      if (self.isNpc() && (self.getId() == DEMONIC_NOKTUM)) {
        self.broadcastPacketToOthers(
            new ExShowScreenMessage(
                NpcString.GHOST_OF_HARNAK_CAN_ONLY_BE_HIT_NEAR_SOUL_CIRCLE,
                5000,
                ExShowScreenMessage.ScreenMessageAlign.BOTTOM_CENTER,
                true,
                ExShowScreenMessage.STRING_TYPE,
                0,
                false,
                0));
        self.removeListener(_deathListener);
      }
    }
示例#2
0
 /**
  * Method clearArena.
  *
  * @param zoneName String
  */
 public void clearArena(String zoneName) {
   Zone zone = ReflectionUtils.getZone(zoneName);
   if (zone != null) {
     for (Creature cha : zone.getObjects()) {
       if (cha.isPlayer() && (cha.getPlayer().getBlockCheckerArena() < 0)) {
         cha.getPlayer().teleToClosestTown();
       } else if (cha.isNpc()) {
         cha.deleteMe();
       }
     }
   }
 }
示例#3
0
  /**
   * Method useSkill.
   *
   * @param activeChar Creature
   * @param targets List<Creature>
   */
  @Override
  public void useSkill(Creature activeChar, List<Creature> targets) {
    int effect = _effectPoint;

    if (isSSPossible()
        && (activeChar.getChargedSoulShot() || (activeChar.getChargedSpiritShot() > 0))) {
      effect *= 2;
    }

    for (Creature target : targets) {
      if (target != null) {
        if (!target.isAutoAttackable(activeChar)) {
          continue;
        }

        if (target.isNpc()) {
          if (_unaggring) {
            if (target.isNpc() && activeChar.isPlayable()) {
              ((NpcInstance) target).getAggroList().addDamageHate(activeChar, 0, -effect);
            }
          } else {
            target.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, activeChar, effect);

            if (!_silent) {
              target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, activeChar, 0);
            }
          }
        } else if (target.isPlayable() && !target.isDebuffImmune()) {
          target.setTarget(activeChar);
        }

        getEffects(activeChar, target, getActivateRate() > 0, false);
      }
    }

    if (isSSPossible()) {
      activeChar.unChargeShots(isMagic());
    }
  }
示例#4
0
  /**
   * Method checkAggression.
   *
   * @param target Creature
   * @return boolean
   */
  @Override
  public boolean checkAggression(Creature target) {
    if ((getIntention() != CtrlIntention.AI_INTENTION_ACTIVE) || !isGlobalAggro()) {
      return false;
    }

    if (target.isNpc() && !Util.contains(ATTACK_IDS, target.getId())) {
      return false;
    }

    if (!startBattle) {
      return false;
    }

    return super.checkAggression(target);
  }
示例#5
0
  private boolean checkTarget(Creature target) {
    if (target == null) return false;
    if (target.isPlayer()) return true;

    if (target.isNpc()) {
      NpcInstance npc = (NpcInstance) target;
      int _id = npc.getNpcId();
      if (_id == 27430
          || _id == 27431
          || _id == 27432
          || _id == 27433
          || _id == 27434
          || _id == 27425
          || _id == 33416) return false;
    }
    return true;
  }