Example #1
0
  @Override
  public void grantAbilities(MOB mob, boolean isBorrowedClass) {
    super.grantAbilities(mob, isBorrowedClass);

    if (mob.playerStats() == null) {
      final List<AbilityMapper.AbilityMapping> V =
          CMLib.ableMapper()
              .getUpToLevelListings(ID(), mob.charStats().getClassLevel(ID()), false, false);
      for (final AbilityMapper.AbilityMapping able : V) {
        final Ability A = CMClass.getAbility(able.abilityID);
        if ((A != null)
            && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_CHANT)
            && (!CMLib.ableMapper().getDefaultGain(ID(), true, A.ID())))
          giveMobAbility(
              mob,
              A,
              CMLib.ableMapper().getDefaultProficiency(ID(), true, A.ID()),
              CMLib.ableMapper().getDefaultParm(ID(), true, A.ID()),
              isBorrowedClass);
      }
      return;
    }

    final Vector grantable = new Vector();

    final int level = mob.charStats().getClassLevel(this);
    int numChants = 2;
    for (final Enumeration<Ability> a = CMClass.abilities(); a.hasMoreElements(); ) {
      final Ability A = a.nextElement();
      if ((CMLib.ableMapper().getQualifyingLevel(ID(), true, A.ID()) == level)
          && ((CMLib.ableMapper().getQualifyingLevel(ID(), true, A.ID()) <= 25)
              && (!CMLib.ableMapper().getSecretSkill(ID(), true, A.ID()))
              && (!CMLib.ableMapper().getDefaultGain(ID(), true, A.ID()))
              && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_CHANT))) {
        if (!grantable.contains(A.ID())) grantable.addElement(A.ID());
      }
    }
    for (int a = 0; a < mob.numAbilities(); a++) {
      final Ability A = mob.fetchAbility(a);
      if (grantable.contains(A.ID())) {
        grantable.remove(A.ID());
        numChants--;
      }
    }
    for (int i = 0; i < numChants; i++) {
      if (grantable.size() == 0) break;
      final String AID = (String) grantable.elementAt(CMLib.dice().roll(1, grantable.size(), -1));
      if (AID != null) {
        grantable.removeElement(AID);
        giveMobAbility(
            mob,
            CMClass.getAbility(AID),
            CMLib.ableMapper().getDefaultProficiency(ID(), true, AID),
            CMLib.ableMapper().getDefaultParm(ID(), true, AID),
            isBorrowedClass);
      }
    }
  }
Example #2
0
  @Override
  public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel) {
    if (!super.invoke(mob, commands, givenTarget, auto, asLevel)) return false;

    final boolean success = proficiencyCheck(mob, 0, auto);
    final String str =
        auto
            ? L("The unholy word is spoken.")
            : L("^S<S-NAME> speak(s) the unholy word@x1 to <T-NAMESELF>.^?", ofDiety(mob));

    final Room room = mob.location();
    if (room != null)
      for (int i = 0; i < room.numInhabitants(); i++) {
        final MOB target = room.fetchInhabitant(i);
        if (target == null) break;
        int affectType = CMMsg.MSG_CAST_VERBAL_SPELL;
        if (auto) affectType = affectType | CMMsg.MASK_ALWAYS;
        if (CMLib.flags().isGood(target)) affectType = affectType | CMMsg.MASK_MALICIOUS;

        if (success) {
          final CMMsg msg = CMClass.getMsg(mob, target, this, affectType, str);
          if (room.okMessage(mob, msg)) {
            room.send(mob, msg);
            if (msg.value() <= 0) {
              if (CMLib.flags().canBeHeardSpeakingBy(mob, target)) {
                final Item I = Prayer_Curse.getSomething(mob, true);
                if (I != null) {
                  Prayer_Curse.endLowerBlessings(I, CMLib.ableMapper().lowestQualifyingLevel(ID()));
                  I.recoverPhyStats();
                }
                Prayer_Curse.endLowerBlessings(
                    target, CMLib.ableMapper().lowestQualifyingLevel(ID()));
                beneficialAffect(mob, target, asLevel, 0);
                target.recoverPhyStats();
              } else if (CMath.bset(affectType, CMMsg.MASK_MALICIOUS))
                maliciousFizzle(mob, target, L("<T-NAME> did not hear the unholy word!"));
              else beneficialWordsFizzle(mob, target, L("<T-NAME> did not hear the unholy word!"));
            }
          }
        } else {
          if (CMath.bset(affectType, CMMsg.MASK_MALICIOUS))
            maliciousFizzle(
                mob,
                target,
                L("<S-NAME> attempt(s) to speak the unholy word to <T-NAMESELF>, but flub(s) it."));
          else
            beneficialWordsFizzle(
                mob,
                target,
                L("<S-NAME> attempt(s) to speak the unholy word to <T-NAMESELF>, but flub(s) it."));
          return false;
        }
      }

    // return whether it worked
    return success;
  }
Example #3
0
 public static boolean useTheWand(Ability A, MOB mob, int level) {
   int manaRequired = 5;
   final int q = CMLib.ableMapper().qualifyingLevel(mob, A);
   if (q > 0) {
     if (q < CMLib.ableMapper().qualifyingClassLevel(mob, A)) manaRequired = 0;
     else manaRequired = 5;
   } else manaRequired = 25;
   manaRequired -= (2 * level);
   if (manaRequired < 5) manaRequired = 5;
   if (manaRequired > mob.curState().getMana()) {
     mob.tell(CMLib.lang().L("You don't have enough mana."));
     return false;
   }
   mob.curState().adjMana(-manaRequired, mob.maxState());
   return true;
 }
Example #4
0
 @Override
 public void grantAbilities(MOB mob, boolean isBorrowedClass) {
   super.grantAbilities(mob, isBorrowedClass);
   if (mob.playerStats() == null) {
     final List<AbilityMapper.AbilityMapping> V =
         CMLib.ableMapper()
             .getUpToLevelListings(ID(), mob.charStats().getClassLevel(ID()), false, false);
     for (final AbilityMapper.AbilityMapping able : V) {
       final Ability A = CMClass.getAbility(able.abilityID);
       if ((A != null)
           && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_SONG)
           && (!CMLib.ableMapper().getDefaultGain(ID(), true, A.ID())))
         giveMobAbility(
             mob,
             A,
             CMLib.ableMapper().getDefaultProficiency(ID(), true, A.ID()),
             CMLib.ableMapper().getDefaultParm(ID(), true, A.ID()),
             isBorrowedClass);
     }
   }
 }
Example #5
0
  @Override
  public boolean tick(Tickable ticking, int tickID) {
    if ((affected == null) || (!(affected instanceof Room))) return super.tick(ticking, tickID);

    if ((--damageTickDown) >= 0) return super.tick(ticking, tickID);
    damageTickDown = 4;

    HashSet H = null;
    if ((invoker() != null) && (invoker().location() == affected)) {
      H = new HashSet();
      invoker().getGroupMembers(H);
    }
    final Room R = (Room) affected;
    for (int i = 0; i < R.numInhabitants(); i++) {
      final MOB M = R.fetchInhabitant(i);
      if ((M != null) && ((H == null) || (!H.contains(M)))) {
        if (invoker() != null) {
          final int harming = CMLib.dice().roll(1, adjustedLevel(invoker(), 0) / 3, 1);
          CMLib.combat()
              .postDamage(
                  invoker(),
                  M,
                  this,
                  harming,
                  CMMsg.MASK_MALICIOUS | CMMsg.TYP_UNDEAD,
                  Weapon.TYPE_BURSTING,
                  L("The unholy aura <DAMAGE> <T-NAME>!"));
        } else {
          final int harming =
              CMLib.dice().roll(1, CMLib.ableMapper().lowestQualifyingLevel(ID()) / 3, 1);
          CMLib.combat()
              .postDamage(
                  M,
                  M,
                  this,
                  harming,
                  CMMsg.MASK_MALICIOUS | CMMsg.TYP_UNDEAD,
                  Weapon.TYPE_BURSTING,
                  L("The unholy aura <DAMAGE> <T-NAME>!"));
        }
        if ((!M.isInCombat())
            && (M.isMonster())
            && (M != invoker)
            && (invoker != null)
            && (M.location() == invoker.location())
            && (M.location().isInhabitant(invoker))
            && (CMLib.flags().canBeSeenBy(invoker, M)))
          CMLib.combat().postAttack(M, invoker, M.fetchWieldedItem());
      }
    }
    return super.tick(ticking, tickID);
  }
Example #6
0
 @Override
 public void executeMsg(Environmental host, CMMsg msg) {
   if (host instanceof MOB) {
     final MOB myChar = (MOB) host;
     if (msg.amISource(myChar)
         && (msg.tool() instanceof Ability)
         && (!myChar.isMonster())
         && (msg.sourceMinor() == CMMsg.TYP_PREINVOKE)
         && (myChar.isMine(msg.tool()))
         && (myChar.charStats().getClassLevel(this) >= 30)
         && (CMLib.ableMapper().getQualifyingLevel(ID(), true, msg.tool().ID()) < 1))
       invokable = new WeakReference(msg.tool());
   }
   super.executeMsg(host, msg);
   Bard.visitationBonusMessage(host, msg);
 }
Example #7
0
  public void executeMsg(Environmental myHost, CMMsg msg) {
    super.executeMsg(myHost, msg);
    if ((myHost == null) || (!(myHost instanceof MOB))) return;
    MOB mob = (MOB) myHost;
    if (msg.amISource(mob) && (msg.tool() != null)) {
      if (msg.tool() instanceof Ability) {
        Ability A = mob.fetchAbility(msg.tool().ID());
        if ((A != null)
            && (!CMLib.ableMapper().getDefaultGain(ID(), false, A.ID()))
            && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_SPELL)) {
          mob.delAbility(A);
          mob.recoverMaxState();
        }
      } else if (msg.tool().ID().equalsIgnoreCase("Skill_ScrollCopy")) {

      }
    }
  }
Example #8
0
 public boolean okMessage(Environmental myHost, CMMsg msg) {
   if (!(myHost instanceof MOB)) return super.okMessage(myHost, msg);
   MOB myChar = (MOB) myHost;
   if ((msg.tool() == null) || (!(msg.tool() instanceof Ability)))
     return super.okMessage(myChar, msg);
   if (msg.amISource(myChar) && (myChar.isMine(msg.tool()))) {
     if ((msg.sourceMinor() == CMMsg.TYP_CAST_SPELL)
         && (!CMLib.ableMapper().getDefaultGain(ID(), true, msg.tool().ID()))) {
       if (CMLib.dice().rollPercentage()
           > (myChar.charStats().getStat(CharStats.STAT_INTELLIGENCE)
               * ((myChar.charStats().getCurrentClass().ID().equals(ID())) ? 1 : 2))) {
         myChar.location().show(myChar, null, CMMsg.MSG_OK_VISUAL, "<S-NAME> fizzle(s) a spell.");
         return false;
       }
     }
   }
   return super.okMessage(myChar, msg);
 }
Example #9
0
 public static void waveIfAble(MOB mob, Physical afftarget, String message, Wand me) {
   if ((mob.isMine(me)) && (message != null) && (!me.amWearingAt(Wearable.IN_INVENTORY))) {
     Physical target = null;
     if (mob.location() != null) target = afftarget;
     final int x = message.toUpperCase().indexOf(me.magicWord().toUpperCase());
     if (x >= 0) {
       message = message.substring(x + me.magicWord().length());
       final int y = message.indexOf('\'');
       if (y >= 0) message = message.substring(0, y);
       message = message.trim();
       final Ability wandUse = mob.fetchAbility("Skill_WandUse");
       if ((wandUse == null) || (!wandUse.proficiencyCheck(null, 0, false)))
         mob.tell(CMLib.lang().L("@x1 glows faintly for a moment, then fades.", me.name()));
       else {
         Ability A = me.getSpell();
         if (A == null) mob.tell(CMLib.lang().L("Something seems wrong with @x1.", me.name()));
         else if (me.usesRemaining() <= 0) mob.tell(CMLib.lang().L("@x1 seems spent.", me.name()));
         else {
           wandUse.setInvoker(mob);
           A = (Ability) A.newInstance();
           if (useTheWand(A, mob, wandUse.abilityCode())) {
             final Vector V = new Vector();
             if (target != null) V.addElement(target.name());
             V.addAll(CMParms.parse(message));
             mob.location()
                 .show(
                     mob,
                     null,
                     CMMsg.MSG_OK_VISUAL,
                     CMLib.lang().L("@x1 glows brightly.", me.name()));
             me.setUsesRemaining(me.usesRemaining() - 1);
             int level = me.phyStats().level();
             final int lowest = CMLib.ableMapper().lowestQualifyingLevel(A.ID());
             if (level < lowest) level = lowest;
             A.invoke(mob, V, target, true, level);
             wandUse.helpProficiency(mob, 0);
             return;
           }
         }
       }
     }
   }
 }
Example #10
0
 public void affectCharState(MOB mob, CharState state) {
   super.affectCharState(mob, state);
   if (mob.baseCharStats().getCurrentClass().ID().equals(ID())) {
     Ability A = null;
     for (int a = 0; a < mob.numLearnedAbilities(); a++) {
       A = mob.fetchAbility(a);
       if ((A != null)
           && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_SPELL)
           && (!CMLib.ableMapper().getDefaultGain(ID(), false, A.ID()))) {
         int[] cost = A.usageCost(mob, true);
         int manaCost = cost[Ability.USAGEINDEX_MANA];
         if (manaCost > 0) {
           if (state.getMana() < manaCost) {
             mob.delAbility(A);
             a--;
           } else state.setMana(state.getMana() - manaCost);
         }
       }
     }
     if (mob.curState().getMana() > state.getMana()) mob.curState().setMana(state.getMana());
   }
 }
Example #11
0
  @Override
  public void initializeClass() {
    super.initializeClass();
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_Natural", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_Ranged", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_Sword", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Recall", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Write", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Swim", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Befriend", 50, true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Dance_Stop", 100, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Dance_CanCan", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Thief_Lore", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Dance_Foxtrot", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Fighter_Kick", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Skill_Climb", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Dance_Tarantella", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Thief_Appraise", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Dance_Waltz", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Skill_Dodge", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Dance_Salsa", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Dance_Grass", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Dance_Clog", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Thief_Distract", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Dance_Capoeira", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Dance_Tap", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Dance_Swing", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Skill_Disarm", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Dance_Basse", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Fighter_BodyFlip", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Dance_Tango", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Fighter_Spring", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Dance_Polka", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Dance_RagsSharqi", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Dance_Manipuri", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Skill_Trip", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Dance_Cotillon", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Skill_TwoWeaponFighting", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Dance_Ballet", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Fighter_Tumble", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Dance_Jitterbug", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 16, "Dance_Butoh", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Skill_Attack2", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Dance_Courante", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Dance_Musette", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Fighter_Endurance", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Fighter_Cartwheel", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Dance_Swords", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Dance_Flamenco", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Fighter_Roll", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Dance_Jingledress", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Dance_Morris", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Fighter_BlindFighting", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Dance_Butterfly", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Dance_Macabre", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Fighter_CircleTrip", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Dance_War", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 30, "Dance_Square", true);
  }
Example #12
0
  public void initializeClass() {
    super.initializeClass();
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Spellcraft", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_ScrollCopy", 100, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_Scribe", 75, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Papermaking", 75, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_ReadMagic", 100, true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_MagicMissile", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_ResistMagicMissiles", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_Shield", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_IronGrip", false);

    for (Enumeration a = CMClass.abilities(); a.hasMoreElements(); ) {
      Ability A = (Ability) a.nextElement();
      if ((A != null) && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_SPELL)) {
        int level = CMLib.ableMapper().getQualifyingLevel(ID(), true, A.ID());
        if (level > 0) {
          AbilityMapper.AbilityMapping able = CMLib.ableMapper().getAbleMap(ID(), A.ID());
          if ((able != null) && (!CMLib.ableMapper().getDefaultGain(ID(), true, A.ID()))) {
            able.costOverrides =
                new Integer[] {
                  Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0)
                };
            able.defaultProficiency = 100;
          }
        }
      }
    }
  }
Example #13
0
  @Override
  public void initializeClass() {
    super.initializeClass();
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Recall", 100, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Swim", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Prayer_Marry", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Prayer_Annul", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Write", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Revoke", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_WandUse", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Convert", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_Ranged", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Prayer_RestoreSmell", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Prayer_DivineLuck", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Prayer_SenseEvil", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Prayer_SenseGood", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Prayer_SenseLife", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Prayer_Bury", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Prayer_InfuseBalance", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Prayer_ProtUndead", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Prayer_Position", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Prayer_CreateFood", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Prayer_BirdsEye", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Prayer_CreateWater", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Prayer_SenseTraps", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Prayer_ElectricStrike", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Prayer_ProtParalyzation", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Prayer_Revival", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Prayer_AiryForm", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Prayer_MinorInfusion", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Prayer_SenseMagic", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Prayer_SenseInvisible", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Prayer_SenseHidden", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Prayer_ProtPoison", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Prayer_ProtDisease", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Prayer_Sanctuary", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Prayer_BloodMoon", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Prayer_HolyWind", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Prayer_Wings", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Prayer_RemoveCurse", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 16, "Prayer_Etherealness", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Skill_AttackHalf", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Prayer_Blindsight", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Prayer_Retribution", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Prayer_ProtectElements", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Prayer_ChainStrike", false);

    CMLib.ableMapper()
        .addCharAbilityMapping(
            ID(),
            20,
            "Prayer_MassMobility",
            true,
            CMParms.parseSemicolons("Prayer_ProtParalyzation", true));
    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Prayer_Monolith", 0, "AIR", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Prayer_Gateway", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Prayer_MoralBalance", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Prayer_Disenchant", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Prayer_ModerateInfusion", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Prayer_LinkedHealth", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Prayer_Weather", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Prayer_Nullification", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Prayer_UndeniableFaith", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Prayer_SummonElemental", 0, "AIR", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Prayer_ElectricHealing", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 30, "Prayer_Sermon", true);
  }
Example #14
0
  @Override
  public void initializeClass() {
    super.initializeClass();
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Write", 0, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Recall", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Revoke", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_WandUse", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Swim", 100, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Climb", 100, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_Natural", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_Staff", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Herbology", 0, false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Druidic", 75, true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Druid_DruidicPass", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Druid_ShapeShift", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Druid_MyPlants", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Chant_PredictWeather", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Chant_BestowName", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Chant_SummonPlants", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Chant_HardenSkin", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_WildernessLore", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Chant_SummonWater", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Chant_LocatePlants", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Chant_SensePoison", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Chant_SummonFood", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Chant_Moonbeam", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Chant_RestoreMana", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Chant_SenseLife", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Chant_Tangle", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Chant_SummonFire", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Chant_LocateAnimals", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Chant_FortifyFood", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Chant_Farsight", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Chant_FeelElectricity", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Chant_CalmAnimal", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Chant_Sunray", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Chant_Treeform", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Chant_Goodberry", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Chant_Hunger", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Chant_FeelCold", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Chant_NaturalBalance", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Chant_WarpWood", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Chant_ControlFire", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Chant_VenomWard", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Chant_CalmWind", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Chant_Barkskin", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Chant_WaterWalking", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Chant_AnimalFriendship", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Chant_FeelHeat", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Chant_GrowClub", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Chant_Brittle", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Chant_PlantPass", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Chant_WindGust", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Chant_Poison", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Chant_Treemind", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Chant_WhisperWard", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Chant_BreatheWater", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Chant_HoldAnimal", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Chant_PlantBed", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Chant_LightningWard", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Chant_ColdWard", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Chant_Bury", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Chant_IllusionaryForest", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Chant_Hippieness", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Herbalism", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Chant_Fertilization", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Chant_CharmAnimal", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Chant_CalmWeather", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "PlantLore", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 16, "Chant_FireWard", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 16, "Chant_Shillelagh", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 16, "Chant_SummonPeace", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Chant_Plague", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Chant_DistantGrowth", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Chant_Earthquake", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Chant_PlantMaze", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Chant_GasWard", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Chant_Hibernation", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Chant_Reabsorb", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Chant_SummonAnimal", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Chant_Nectar", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Chant_SummonHeat", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Chant_SenseSentience", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Scrapping", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Chant_Grapevine", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Chant_SummonCold", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Chant_SummonInsects", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Chant_AnimalSpy", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Chant_SummonRain", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Chant_PlantSnare", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Chant_SensePregnancy", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Chant_SenseFluids", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Chant_Treemorph", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Chant_SummonWind", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Chant_NeutralizePoison", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Chant_FindPlant", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Chant_SensePlants", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Chant_GrowItem", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Chant_SummonLightning", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Chant_SummonMount", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Chant_FindOre", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Chant_SenseOres", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Chant_CharmArea", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Chant_SummonElemental", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Chant_SummonFear", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Chant_SenseAge", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Chant_FindGem", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Chant_SenseGems", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Chant_SpeedTime", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Chant_SummonSapling", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Chant_Feralness", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 30, "Chant_Reincarnation", true);
  }
Example #15
0
  @Override
  public void initializeClass() {
    super.initializeClass();
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Recall", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Write", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_EdgedWeapon", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Apothecary", false, "+WIS 12");
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "ThievesCant", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Swim", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "ScrollScribing", 10, true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Climb", 50, true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Alchemy", false, "+INT 12 +WIS 12");
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_ReadMagic", true);

    // clan magic
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqAcid", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqCold", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqElectric", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqFire", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqGas", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqMind", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqParalysis", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqPoison", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqWater", 0, "", false, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_CEqDisease", 0, "", false, true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Thief_Hide", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Spell_Erase", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Skill_WandUse", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Spell_EnchantArrows", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Spell_ClarifyScroll", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Thief_Sneak", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "PaperMaking", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Skill_Revoke", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Thief_DetectTraps", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Skill_Dodge", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Thief_Pick", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Skill_Spellcraft", true);
    CMLib.ableMapper()
        .addCharAbilityMapping(
            ID(), 7, "Skill_IdentifyPoison", false, CMParms.parseSemicolons("Apothecary", true));

    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Skill_Disarm", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Thief_UsePoison", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Skill_Parry", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Thief_RemoveTraps", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Spell_RechargeWand", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Spell_RepairingAura", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Thief_Lore", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Skill_Trip", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Spell_Scribe", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Spell_DisenchantWand", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Skill_Map", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Fighter_RapidShot", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Spell_EnchantWand", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Thief_PowerGrab", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 16, "Spell_WardArea", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 16, "Spell_DetectInvisible", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Skill_Attack2", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Thief_Shadow", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Spell_Knock", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Spell_Refit", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Thief_Detection", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Spell_EnchantArmor", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Thief_Observation", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Spell_EnchantWeapon", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Thief_DampenAuras", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Spell_Mend", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Spell_Disenchant", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Spell_ComprehendLangs", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Spell_StoreSpell", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Thief_SlipperyMind", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 30, "Spell_MagicItem", true);
  }
Example #16
0
 @Override
 public void executeMsg(final Environmental myHost, final CMMsg msg) {
   super.executeMsg(myHost, msg);
   if ((myHost == null) || (!(myHost instanceof MOB))) return;
   final MOB mob = (MOB) myHost;
   if (msg.amISource(mob)) {
     if (((msg.sourceMinor() == CMMsg.TYP_LOOK) || (msg.sourceMinor() == CMMsg.TYP_EXAMINE))
         && (msg.target() instanceof Wand)
         && (mob.charStats().getClassLevel(this) >= 30)) {
       final String message =
           "<O-NAME> has " + ((Wand) msg.target()).usesRemaining() + " charges remaining.";
       msg.addTrailerMsg(
           CMClass.getMsg(
               mob,
               null,
               msg.target(),
               CMMsg.MSG_OK_VISUAL,
               CMMsg.NO_EFFECT,
               CMMsg.NO_EFFECT,
               message));
     } else if (msg.tool() != null) {
       if (msg.tool().ID().equals("Skill_Spellcraft")) {
         if ((msg.tool().text().length() > 0) && (msg.target() instanceof MOB)) {
           Ability A = ((MOB) msg.target()).fetchAbility(msg.tool().text());
           if (A == null) return;
           final Ability myA = mob.fetchAbility(A.ID());
           if (myA != null) {
             if ((!A.isSavable())
                 && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_SPELL)
                 && (CMLib.ableMapper().lowestQualifyingLevel(A.ID()) < 30))
               addAbilityToSpellcraftList(mob, A);
           } else if (CMLib.ableMapper().lowestQualifyingLevel(A.ID()) < 30) {
             final Vector<Ability> otherChoices = new Vector<Ability>();
             for (int a = 0; a < mob.numAbilities(); a++) {
               final Ability A2 = mob.fetchAbility(a);
               if ((A2 != null)
                   && (!A2.isSavable())
                   && ((A2.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_SPELL))
                 otherChoices.addElement(A2);
             }
             A = (Ability) A.copyOf();
             A.setProficiency(0);
             A.setSavable(false);
             if (otherChoices.size() > (mob.charStats().getClassLevel(this) / 3)) {
               final Ability A2 =
                   otherChoices.elementAt(CMLib.dice().roll(1, otherChoices.size(), -1));
               clearAbilityFromSpellcraftList(mob, A2);
             }
             addAbilityToSpellcraftList(mob, A);
           }
         }
       } else if (msg.tool().ID().equals("Spell_Scribe")
           || msg.tool().ID().equals("Spell_EnchantWand")
           || msg.tool().ID().equals("Spell_MagicItem")
           || msg.tool().ID().equals("Spell_StoreSpell")
           || msg.tool().ID().equals("Spell_WardArea")) {
         final Ability A = mob.fetchAbility(msg.tool().text());
         if ((A != null) && (!A.isSavable())) clearAbilityFromSpellcraftList(mob, A);
       } else if (msg.tool() instanceof Ability) {
         final Ability A = mob.fetchAbility(msg.tool().ID());
         if ((A != null)
             && (!A.isSavable())
             && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_SPELL))
           clearAbilityFromSpellcraftList(mob, A);
       }
     }
   }
 }
Example #17
0
  @Override
  public void initializeClass() {
    super.initializeClass();
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_Natural", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_Ranged", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_EdgedWeapon", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Specialization_Sword", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Recall", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Write", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Swim", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Befriend", 50, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Song_Nothing", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Skill_Haggle", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Thief_Swipe", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 2, "Skill_Revoke", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Skill_Disguise", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Skill_Climb", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Thief_Hide", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Thief_Mark", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 4, "Song_Charm", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Fighter_Rescue", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Skill_StrikeTheSet", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Skill_Songcraft", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 6, "Spell_ReadMagic", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Skill_Imitation", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Skill_CastBlocking", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Thief_Distract", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Skill_WandUse", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Skill_Warrants", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Skill_BreakALeg", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Skill_Dodge", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 10, "Song_Detection", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Skill_FalseArrest", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Song_Comprehension", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Skill_Spellcraft", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Ranger_Track", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Spell_MagicMissile", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 12, "Song_Rage", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Skill_Map", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Skill_Trip", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Thief_AnalyzeMark", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 14, "Skill_Upstage", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Skill_Chantcraft", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Song_Protection", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 16, "Skill_Shuffle", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 16, "Skill_ExitStageLeft", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Skill_Attack2", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Chant_SummonPlants", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Skill_Prayercraft", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Prayer_CureLight", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 18, "Song_Mana", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Song_Knowledge", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Skill_CurtainCall", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Thief_Detection", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Skill_Monologue", true);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Song_Thanks", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Spell_LocateObject", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Skill_Parry", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 22, "Skill_AdLib", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Thief_Con", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Song_Strength", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Song_Disgust", true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 24, "Thief_FrameMark", false);

    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Skill_MarkDisguise", true);

    // 30 -- cheaper skills
  }
  @Override
  public boolean invoke(
      MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) {
    final Room trapThis = mob.location();

    Item resource =
        CMLib.materials().findMostOfMaterial(mob.location(), RawMaterial.MATERIAL_METAL);
    if (resource == null)
      resource = CMLib.materials().findMostOfMaterial(mob.location(), RawMaterial.MATERIAL_MITHRIL);
    int amount = 0;
    if (resource != null)
      amount = CMLib.materials().findNumberOfResource(mob.location(), resource.material());
    if (amount < 100) {
      mob.tell(L("You need 100 pounds of raw metal to build this trap."));
      return false;
    }
    if (mob.isInCombat()) {
      mob.tell(L("You are too busy to get that done right now."));
      return false;
    }

    if (!super.invoke(mob, commands, givenTarget, auto, asLevel)) return false;

    final boolean success = proficiencyCheck(mob, 0, auto);

    if (resource != null)
      CMLib.materials().destroyResourcesValue(mob.location(), 100, resource.material(), -1, null);

    final CMMsg msg =
        CMClass.getMsg(
            mob,
            trapThis,
            this,
            auto ? CMMsg.MSG_OK_ACTION : CMMsg.MSG_THIEF_ACT,
            CMMsg.MASK_ALWAYS | CMMsg.MSG_DELICATE_HANDS_ACT,
            CMMsg.MSG_OK_ACTION,
            (auto
                ? L("@x1 begins to glow!", trapThis.name())
                : L("<S-NAME> attempt(s) to lay a trap here.")));
    if (mob.location().okMessage(mob, msg)) {
      mob.location().send(mob, msg);
      if (success) {
        mob.tell(L("You have set the trap."));
        setTrap(
            mob,
            trapThis,
            mob.charStats().getClassLevel(mob.charStats().getCurrentClass()),
            (CMLib.ableMapper().qualifyingClassLevel(mob, this)
                    - CMLib.ableMapper().lowestQualifyingLevel(ID()))
                + 1,
            false);
        final Thief_DeathTrap T = (Thief_DeathTrap) trapThis.fetchEffect(ID());
        if (T != null) T.setMiscText(mob.Name());
      } else {
        if (CMLib.dice().rollPercentage() > 50) {
          final Trap T =
              setTrap(
                  mob,
                  trapThis,
                  mob.charStats().getClassLevel(mob.charStats().getCurrentClass()),
                  (CMLib.ableMapper().qualifyingClassLevel(mob, this)
                          - CMLib.ableMapper().lowestQualifyingLevel(ID()))
                      + 1,
                  false);
          mob.location()
              .show(mob, null, CMMsg.MSG_OK_ACTION, L("<S-NAME> trigger(s) the trap on accident!"));
          T.spring(mob);
        } else {
          mob.tell(L("You fail in your attempt to set the death trap."));
        }
      }
    }
    return success;
  }
Example #19
0
  @Override
  public void grantAbilities(MOB mob, boolean isBorrowedClass) {
    super.grantAbilities(mob, isBorrowedClass);

    // if he already has one, don't give another!
    if (mob.playerStats() != null) {
      final int classLevel = mob.baseCharStats().getClassLevel(this);
      if (classLevel < 2) return;
      if ((classLevel % 2) != 0) return;

      int maxSkills = classLevel / 2;

      // now only give one, for current level, respecting alignment!
      // first, get a list of all skills you don't qualify for that you MIGHT have gained or will
      // gain
      final List<Ability> choices = new Vector<Ability>();
      for (final Enumeration<Ability> a = CMClass.abilities(); a.hasMoreElements(); ) {
        final Ability A = a.nextElement();
        final int lql = CMLib.ableMapper().lowestQualifyingLevel(A.ID());
        if ((CMLib.ableMapper().qualifyingLevel(mob, A) <= 0)
            && (lql < 25)
            && (lql > 0)
            && (!CMLib.ableMapper().getSecretSkill(A.ID()))
            && (CMLib.ableMapper().qualifiesByAnyCharClass(A.ID()))
            && (CMLib.ableMapper().availableToTheme(A.ID(), Area.THEME_FANTASY, true))
            && (!CMLib.ableMapper().qualifiesOnlyByClan(mob, A))
            && (!CMLib.ableMapper().qualifiesOnlyByRace(mob, A))
            && (A.isAutoInvoked()
                || ((A.triggerStrings() != null) && (A.triggerStrings().length > 0))))
          choices.add(A);
      }

      // now count those you already have
      for (int a = choices.size() - 1; a >= 0; a--) {
        final Ability A = choices.get(a);
        if (mob.fetchAbility(A.ID()) != null) maxSkills--;
      }
      if (maxSkills < 1) // if that reduced you to 0, you are done.
      return;
      // now eliminate those you already have, and those that are
      // above your level, if you are <25
      for (int a = choices.size() - 1; a >= 0; a--) {
        final Ability A = choices.get(a);
        final int lql = CMLib.ableMapper().lowestQualifyingLevel(A.ID());
        if ((mob.fetchAbility(ID()) != null)
            || ((lql != classLevel) && (lql != classLevel - 1) && (classLevel < 25)))
          choices.remove(a);
      }
      if (choices.size() == 0) return;
      final Ability A = choices.get(CMLib.dice().roll(1, choices.size(), -1));
      if (A != null) giveMobAbility(mob, A, 0, "", isBorrowedClass);
    } else {
      final List<AbilityMapper.AbilityMapping> V =
          CMLib.ableMapper()
              .getUpToLevelListings(ID(), mob.charStats().getClassLevel(ID()), false, false);
      for (final AbilityMapper.AbilityMapping able : V) {
        final Ability A = CMClass.getAbility(able.abilityID);
        if ((A != null)
            && (!CMLib.ableMapper().getAllQualified(ID(), true, A.ID()))
            && (!CMLib.ableMapper().getDefaultGain(ID(), true, A.ID())))
          giveMobAbility(
              mob,
              A,
              CMLib.ableMapper().getDefaultProficiency(ID(), true, A.ID()),
              CMLib.ableMapper().getDefaultParm(ID(), true, A.ID()),
              isBorrowedClass);
      }
    }
  }
Example #20
0
  @Override
  public void initializeClass() {
    super.initializeClass();
    CMLib.ableMapper().delCharAbilityMapping(ID(), "Spell_MagicMissile");

    CMLib.ableMapper().addCharAbilityMapping(ID(), 1, "Spell_DeadenSmell", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 3, "Spell_CauseStink", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 5, "Spell_ShrinkMouth", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 7, "Spell_LightSensitivity", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 8, "Skill_Spellcraft", false);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 9, "Spell_MassWaterbreath", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 11, "Spell_Misstep", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 13, "Spell_Sonar", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 15, "Spell_Grow", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 17, "Spell_LedFoot", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 19, "Spell_Toadstool", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 20, "Spell_AddLimb", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 21, "Spell_PolymorphSelf", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 23, "Spell_BigMouth", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 25, "Spell_Transformation", 25, true);
    CMLib.ableMapper().addCharAbilityMapping(ID(), 30, "Spell_Clone", 25, true);
  }