Exemple #1
0
  public boolean tryDamageSkill(String rem, String cut, String output) {

    if (cut.length() > 0)
      if (rem.indexOf(cut) == 0) {
        rem = rem.substring(cut.length(), rem.length());
        rem = Utility.clearWhiteSpace(rem);
      }

    target = owner.getRoom().findEntity(owner, rem);

    if ((target == null) && (owner.getPlayerState() == Utility.PSTATE_FIGHTING))
      target = owner.getTarget();

    if (target == null) {
      owner.echo(output);
      return false;
    }

    if (!Combat.canAttack(owner, target, false, true)) return false;

    tn = target.getName();
    Tn = target.getPName();
    ty = Utility.possessive(tn);
    Ty = Utility.possessive(Tn);

    return true;
  }
Exemple #2
0
  public boolean trainPeaceful() {

    if (level >= 100) return false;

    int max = learnRate * ((level / 20) + 1);

    timesUsed++;

    if ((timesUsed % max) != 0) return false;

    level++;
    owner.echo(name + " has improved!");

    return true;
  }