Exemplo n.º 1
0
  /**
   * Method onEvtClanAttacked.
   *
   * @param attacked_member Creature
   * @param attacker Creature
   * @param damage int
   */
  @Override
  protected void onEvtClanAttacked(Creature attacked_member, Creature attacker, int damage) {
    super.onEvtClanAttacked(attacked_member, attacker, damage);
    final NpcInstance actor = getActor();

    if (_healSkills.length == 0) {
      return;
    }

    if (attacked_member.isDead()
        || actor.isDead()
        || (attacked_member.getCurrentHpPercents() > 50)) {
      return;
    }

    int heal_chance = 0;

    if (attacked_member.getId() == actor.getId()) {
      heal_chance = (attacked_member.getObjectId() == actor.getObjectId()) ? 100 : 0;
    } else {
      heal_chance = (attacked_member.getId() == Orfen_id) ? 90 : 10;
    }

    if (Rnd.chance(heal_chance) && canUseSkill(_healSkills[0], attacked_member, -1)) {
      addTaskAttack(attacked_member, _healSkills[0], 1000000);
    }
  }
Exemplo n.º 2
0
 public SpawnEmitter(NpcInstance monster, Player player) {
   _playerObjId = player.getObjectId();
   _monsterObjId = monster.getObjectId();
 }