Beispiel #1
0
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   affectableStats.setStat(
       CharStats.STAT_CONSTITUTION, affectableStats.getStat(CharStats.STAT_CONSTITUTION) - 1);
   if (affectableStats.getStat(CharStats.STAT_CONSTITUTION) <= 0)
     affectableStats.setStat(CharStats.STAT_CONSTITUTION, 1);
 }
Beispiel #2
0
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats affectableStats) {
   super.affectCharStats(affectedMOB, affectableStats);
   for (final int i : CharStats.CODES.SAVING_THROWS())
     affectableStats.setStat(
         i, affectableStats.getStat(i) + (affectableStats.getClassLevel(this)));
 }
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   if (affected == null) return;
   affectableStats.setStat(CharStats.STAT_STRENGTH, 3);
   affectableStats.setStat(CharStats.STAT_CONSTITUTION, 3);
 }
 @Override
 public int getRacialStat(MOB mob, int statNum) {
   final CharStats copyStats = (CharStats) copyOf();
   getMyRace().affectCharStats(mob, copyStats);
   for (int c = 0; c < numClasses(); c++) getMyClass(c).affectCharStats(mob, copyStats);
   return copyStats.getStat(statNum);
 }
Beispiel #5
0
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats affectableStats) {
   super.affectCharStats(affectedMOB, affectableStats);
   affectableStats.setRacialStat(CharStats.STAT_STRENGTH, 12);
   affectableStats.setRacialStat(CharStats.STAT_DEXTERITY, 10);
   affectableStats.setRacialStat(CharStats.STAT_INTELLIGENCE, 7);
 }
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_STRENGTH,
       (int) Math.round(CMath.div(affectableStats.getStat(CharStats.STAT_STRENGTH), 2.0)));
 }
Beispiel #7
0
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats affectableStats) {
   super.affectCharStats(affectedMOB, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_CHARISMA,
       affectableStats.getStat(CharStats.STAT_CHARISMA) + 10 + getXLEVELLevel(invoker()));
 }
Beispiel #8
0
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats affectableStats) {
   super.affectCharStats(affectedMOB, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_SAVE_MAGIC, affectableStats.getStat(CharStats.STAT_SAVE_MAGIC) + 5);
   affectableStats.setStat(
       CharStats.STAT_SAVE_JUSTICE, affectableStats.getStat(CharStats.STAT_SAVE_JUSTICE) + 5);
 }
Beispiel #9
0
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_SAVE_MIND,
       affectableStats.getStat(CharStats.STAT_SAVE_MIND)
           + (2 * affectableStats.getClassLevel(this)));
 }
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   affectableStats.setStat(
       CharStats.STAT_STRENGTH, affectableStats.getStat(CharStats.STAT_STRENGTH) / 2);
   if (affectableStats.getStat(CharStats.STAT_STRENGTH) < 1)
     affectableStats.setStat(CharStats.STAT_STRENGTH, 1);
   super.affectCharStats(affected, affectableStats);
 }
Beispiel #11
0
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats affectableStats) {
   super.affectCharStats(affectedMOB, affectableStats);
   affectableStats.setRacialStat(CharStats.STAT_STRENGTH, 5);
   affectableStats.setRacialStat(CharStats.STAT_DEXTERITY, 10);
   affectableStats.setRacialStat(CharStats.STAT_INTELLIGENCE, 1);
   affectableStats.setStat(
       CharStats.STAT_SAVE_POISON, affectableStats.getStat(CharStats.STAT_SAVE_POISON) + 100);
 }
 @Override
 public void affectCharStats(MOB E, CharStats stats) {
   super.affectCharStats(E, stats);
   if ((E != null) && (E != invoker()) && (stats.getCurrentClass().baseClass().equals("Bard"))) {
     int lvl = adjustedLevel(invoker(), 0) / 10;
     if (lvl < 1) lvl = 1;
     stats.setClassLevel(stats.getCurrentClass(), stats.getCurrentClassLevel() + lvl);
   }
 }
Beispiel #13
0
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_SAVE_MAGIC,
       affectableStats.getStat(CharStats.STAT_SAVE_MAGIC) + (affectableStats.getClassLevel(this)));
   if (CMath.bset(affected.basePhyStats().disposition(), PhyStats.IS_BONUS))
     affectableStats.setStat(
         CharStats.STAT_CHARISMA, affectableStats.getStat(CharStats.STAT_CHARISMA) + 30);
 }
Beispiel #14
0
 @Override
 public void affectCharStats(MOB mob, CharStats stats) {
   super.affectCharStats(mob, stats);
   if (invoker() != null)
     stats.setStat(
         CharStats.STAT_SAVE_MIND,
         stats.getStat(CharStats.STAT_SAVE_MIND)
             + (adjustedLevel(invoker(), 0) * 2)
             + invoker().charStats().getStat(CharStats.STAT_CHARISMA));
 }
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   if (affected == null) return;
   int newLevel =
       affected.basePhyStats().level()
           - (direction * (levelsDown - affectableStats.combinedSubLevels()));
   if (newLevel < 0) newLevel = 0;
   affectableStats.setClassLevel(affectableStats.getCurrentClass(), newLevel);
 }
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   if ((invoker() != null) && (affected != invoker()) && (CMLib.flags().isEvil(invoker()))) {
     affectableStats.setStat(
         CharStats.STAT_CHARISMA,
         affectableStats.getStat(CharStats.STAT_CHARISMA) - (adjustedLevel(invoker(), 0) / 5));
     if (affectableStats.getStat(CharStats.STAT_CHARISMA) <= 0)
       affectableStats.setStat(CharStats.STAT_CHARISMA, 1);
   }
 }
Beispiel #17
0
  @Override
  public void affectCharStats(MOB affectedMOB, CharStats affectableStats) {
    super.affectCharStats(affectedMOB, affectableStats);
    affectableStats.setStat(
        CharStats.STAT_SAVE_BLUNT, affectableStats.getStat(CharStats.STAT_SAVE_BLUNT) + 50);
    affectableStats.setStat(
        CharStats.STAT_SAVE_PIERCE, affectableStats.getStat(CharStats.STAT_SAVE_PIERCE) + 50);
    affectableStats.setStat(
        CharStats.STAT_SAVE_ACID, affectableStats.getStat(CharStats.STAT_SAVE_ACID) + 100);

    affectableStats.setStat(
        CharStats.STAT_SAVE_FIRE, affectableStats.getStat(CharStats.STAT_SAVE_FIRE) - 50);
    affectableStats.setStat(
        CharStats.STAT_SAVE_ELECTRIC, affectableStats.getStat(CharStats.STAT_SAVE_ELECTRIC) - 50);
  }
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   final int[] breatheables = affectableStats.getBreathables();
   if (breatheables.length == 0) return;
   if ((lastSet != breatheables) || (newSet == null)) {
     newSet =
         Arrays.copyOf(
             affectableStats.getBreathables(), affectableStats.getBreathables().length + 2);
     newSet[newSet.length - 1] = RawMaterial.RESOURCE_SALTWATER;
     newSet[newSet.length - 2] = RawMaterial.RESOURCE_FRESHWATER;
     Arrays.sort(newSet);
     lastSet = breatheables;
   }
   affectableStats.setBreathables(newSet);
 }
Beispiel #19
0
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   if ((whom != null) && (song != null)) {
     final Hashtable<Integer, Integer> H = getSongBenefits(song);
     for (final Enumeration<Integer> e = H.keys(); e.hasMoreElements(); ) {
       final Integer I = e.nextElement();
       final String[] chk = stuff[I.intValue()];
       if ((chk != null) && (chk[1].startsWith("c"))) {
         int ticks = H.get(I).intValue();
         if (ticks > 50) ticks = 50;
         if (ticks <= 0) ticks = 1;
         final int stat = CMath.s_int(chk[2]);
         if (CharStats.CODES.isBASE(stat)) if (ticks > 5) ticks = 5;
         affectableStats.setStat(
             stat, affectableStats.getStat(stat) + ticks + getXLEVELLevel(invoker()));
       }
     }
   }
 }
Beispiel #20
0
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats affectableStats) {
   super.affectCharStats(affectedMOB, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_DEXTERITY, affectableStats.getStat(CharStats.STAT_DEXTERITY) + 4);
   affectableStats.setStat(
       CharStats.STAT_STRENGTH, affectableStats.getStat(CharStats.STAT_INTELLIGENCE) - 2);
   affectableStats.setStat(
       CharStats.STAT_DEXTERITY, affectableStats.getStat(CharStats.STAT_CONSTITUTION) - 2);
 }
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   int increase = 1;
   if (affectableStats.getCurrentClass().baseClass().equals("Fighter")) increase = 1;
   else if (affectableStats.getCurrentClass().baseClass().equals("Mage")) increase = 2;
   else if (affectableStats.getCurrentClass().baseClass().equals("Thief")) increase = 1;
   else if (affectableStats.getCurrentClass().baseClass().equals("Bard")) increase = 1;
   else if (affectableStats.getCurrentClass().baseClass().equals("Cleric")) increase = 3;
   else if (affectableStats.getCurrentClass().baseClass().equals("Druid")) increase = 3;
   increase += (super.getXLEVELLevel(invoker()) + 2) / 3;
   affectableStats.setStat(
       CharStats.STAT_WISDOM, affectableStats.getStat(CharStats.STAT_WISDOM) + increase);
 }
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats affectedStats) {
   super.affectCharStats(affectedMOB, affectedStats);
   affectedStats.setStat(
       CharStats.STAT_SAVE_UNDEAD, affectedStats.getStat(CharStats.STAT_SAVE_UNDEAD) + 10);
 }
Beispiel #23
0
  public String runMacro(ExternalHTTPRequests httpReq, String parm) {
    if (!CMProps.getBoolVar(CMProps.SYSTEMB_MUDSTARTED))
      return CMProps.getVar(CMProps.SYSTEM_MUDSTATUS);

    Hashtable parms = parseParms(parm);
    String last = httpReq.getRequestParameter("PLAYER");
    if (last == null) return " @break@";
    if (last.length() > 0) {
      MOB M = CMLib.players().getLoadPlayer(last);
      if (M == null) {
        MOB authM = Authenticate.getAuthenticatedMob(httpReq);
        if ((authM != null) && (authM.Name().equalsIgnoreCase(last))) M = authM;
        else return " @break@";
      }

      boolean firstTime =
          (!httpReq.isRequestParameter("ACTION"))
              || (httpReq.getRequestParameter("ACTION")).equals("FIRSTTIME");
      StringBuffer str = new StringBuffer("");
      for (int i = 0; i < MOB.AUTODESC.length; i++) {
        if (parms.containsKey(MOB.AUTODESC[i])) {
          boolean set = CMath.isSet(M.getBitmap(), i);
          if (MOB.AUTOREV[i]) set = !set;
          str.append((set ? "ON" : "OFF") + ",");
        }
      }
      for (int i : CharStats.CODES.ALL()) {
        String stat = CharStats.CODES.NAME(i);
        if (!stat.equalsIgnoreCase("GENDER")) {
          CharStats C = M.charStats();
          if (parms.containsKey(stat)) {
            String old = httpReq.getRequestParameter(stat);
            if ((firstTime) || (old.length() == 0)) {
              if ((!CharStats.CODES.isBASE(i)) && (i != CharStats.STAT_GENDER))
                old = "" + C.getSave(i);
              else old = "" + C.getStat(i);
            }
            str.append(old + ", ");
          }
        }
      }
      for (int i : CharStats.CODES.ALL()) {
        String stat = CharStats.CODES.NAME(i);
        if (!stat.equalsIgnoreCase("GENDER")) {
          CharStats C = M.baseCharStats();
          if (parms.containsKey("BASE" + stat)) {
            String old = httpReq.getRequestParameter("BASE" + stat);
            if ((firstTime) || (old.length() == 0)) old = "" + C.getStat(i);
            str.append(old + ", ");
          }
        }
      }
      for (int i = 0; i < BASICS.length; i++) {
        if (parms.containsKey(BASICS[i])) {
          if (httpReq.isRequestParameter(BASICS[i]))
            str.append(httpReq.getRequestParameter(BASICS[i]) + ", ");
          else str.append(getBasic(M, i));
        }
      }
      if (parms.containsKey("RACE")) {
        String old = httpReq.getRequestParameter("RACE");
        if ((firstTime) || (old.length() == 0)) old = "" + M.baseCharStats().getMyRace().ID();
        for (Enumeration r = CMClass.races(); r.hasMoreElements(); ) {
          Race R2 = (Race) r.nextElement();
          str.append("<OPTION VALUE=\"" + R2.ID() + "\"");
          if (R2.ID().equals(old)) str.append(" SELECTED");
          str.append(">" + R2.name());
        }
      }
      if (parms.containsKey("DEITY")) {
        String old = httpReq.getRequestParameter("DEITY");
        if (firstTime) old = M.getWorshipCharID();
        str.append("<OPTION " + ((old.length() == 0) ? "SELECTED" : "") + " VALUE=\"\">Godless");
        for (Enumeration e = CMLib.map().deities(); e.hasMoreElements(); ) {
          Deity E = (Deity) e.nextElement();
          str.append("<OPTION VALUE=\"" + E.Name() + "\"");
          if (E.Name().equalsIgnoreCase(old)) str.append(" SELECTED");
          str.append(">" + E.Name());
        }
      }
      if (parms.containsKey("TITLELIST")) {
        if (M.playerStats() != null) {
          int b = 0;
          Vector titles = new Vector();
          if (firstTime) CMParms.addToVector(M.playerStats().getTitles(), titles);
          else
            while (httpReq.isRequestParameter("TITLE" + b)) {
              String B = httpReq.getRequestParameter("TITLE" + b);
              if ((B != null) && (B.trim().length() > 0)) titles.addElement(B);
              b++;
            }
          for (b = 0; b < titles.size(); b++) {
            String B = (String) titles.elementAt(b);
            if (B != null)
              str.append(
                  "<INPUT TYPE=TEXT NAME=TITLE"
                      + b
                      + " SIZE="
                      + B.length()
                      + " VALUE=\""
                      + CMStrings.replaceAll(B, "\"", "&quot;")
                      + "\"><BR>");
          }
          str.append("<INPUT TYPE=TEXT NAME=TITLE" + titles.size() + " SIZE=60 VALUE=\"\">");
        }
      }
      if (parms.containsKey("CLAN")) {
        String old = httpReq.getRequestParameter("CLAN");
        if (firstTime) old = M.getClanID();
        str.append("<OPTION " + ((old.length() == 0) ? "SELECTED" : "") + " VALUE=\"\">Clanless");
        for (Enumeration e = CMLib.clans().allClans(); e.hasMoreElements(); ) {
          Clan C = (Clan) e.nextElement();
          str.append("<OPTION VALUE=\"" + C.clanID() + "\"");
          if (C.clanID().equalsIgnoreCase(old)) str.append(" SELECTED");
          str.append(">" + C.getName());
        }
      }
      if (parms.containsKey("ALIGNMENT")) {
        String old = httpReq.getRequestParameter("ALIGNMENT");
        if ((firstTime) || (old.length() == 0))
          old = "" + M.fetchFaction(CMLib.factions().AlignID());
        if (CMLib.factions().getFaction(CMLib.factions().AlignID()) != null) {
          for (int v = 1; v < Faction.ALIGN_NAMES.length; v++) {
            str.append("<OPTION VALUE=" + Faction.ALIGN_NAMES[v]);
            if (old.equalsIgnoreCase(Faction.ALIGN_NAMES[v])) str.append(" SELECTED");
            str.append(">" + CMStrings.capitalizeAndLower(Faction.ALIGN_NAMES[v].toLowerCase()));
          }
        }
      }
      if (parms.containsKey("BASEGENDER")) {
        String old = httpReq.getRequestParameter("BASEGENDER");
        if (firstTime) old = "" + M.baseCharStats().getStat(CharStats.STAT_GENDER);
        str.append("<OPTION VALUE=M " + ((old.equalsIgnoreCase("M")) ? "SELECTED" : "") + ">M");
        str.append("<OPTION VALUE=F " + ((old.equalsIgnoreCase("F")) ? "SELECTED" : "") + ">F");
        str.append("<OPTION VALUE=N " + ((old.equalsIgnoreCase("N")) ? "SELECTED" : "") + ">N");
      }
      str.append(MobData.expertiseList(M, httpReq, parms));
      str.append(MobData.classList(M, httpReq, parms));
      str.append(MobData.itemList(M, M, httpReq, parms, 0));
      str.append(MobData.abilities(M, httpReq, parms, 0));
      str.append(MobData.factions(M, httpReq, parms, 0));
      str.append(AreaData.affectsNBehaves(M, httpReq, parms, 0));
      str.append(ExitData.dispositions(M, firstTime, httpReq, parms));
      str.append(MobData.senses(M, firstTime, httpReq, parms));
      String strstr = str.toString();
      if (strstr.endsWith(", ")) strstr = strstr.substring(0, strstr.length() - 2);
      return clearWebMacros(strstr);
    }
    return "";
  }
 @Override
 public void copyInto(CharStats intoStats) {
   if (intoStats instanceof DefaultCharStats) {
     ((DefaultCharStats) intoStats).arriveStr = arriveStr;
     ((DefaultCharStats) intoStats).leaveStr = leaveStr;
     ((DefaultCharStats) intoStats).breathables = breathables;
     ((DefaultCharStats) intoStats).proficiencies = proficiencies;
     if (myClasses == null) ((DefaultCharStats) intoStats).myClasses = null;
     else if ((((DefaultCharStats) intoStats).myClasses != null)
         && (((DefaultCharStats) intoStats).myClasses.length == myClasses.length)) {
       for (int i = 0; i < myClasses.length; i++)
         ((DefaultCharStats) intoStats).myClasses[i] = myClasses[i];
     } else ((DefaultCharStats) intoStats).myClasses = myClasses.clone();
     if (myLevels == null) ((DefaultCharStats) intoStats).myLevels = null;
     else if ((((DefaultCharStats) intoStats).myLevels != null)
         && (((DefaultCharStats) intoStats).myLevels.length == myLevels.length)) {
       for (int i = 0; i < myLevels.length; i++)
         ((DefaultCharStats) intoStats).myLevels[i] = myLevels[i];
     } else ((DefaultCharStats) intoStats).myLevels = myLevels.clone();
     if (myRace != null) ((DefaultCharStats) intoStats).myRace = myRace;
     ((DefaultCharStats) intoStats).raceName = raceName;
     ((DefaultCharStats) intoStats).genderName = genderName;
     ((DefaultCharStats) intoStats).displayClassName = displayClassName;
     ((DefaultCharStats) intoStats).displayClassLevel = displayClassLevel;
     if (profAdj == null) ((DefaultCharStats) intoStats).profAdj = null;
     else ((DefaultCharStats) intoStats).profAdj = new TreeMap<String, Integer>(profAdj);
     if (bodyAlterations == null) ((DefaultCharStats) intoStats).bodyAlterations = null;
     else if ((((DefaultCharStats) intoStats).bodyAlterations != null)
         && (((DefaultCharStats) intoStats).bodyAlterations.length == bodyAlterations.length)) {
       for (int i = 0; i < bodyAlterations.length; i++)
         ((DefaultCharStats) intoStats).bodyAlterations[i] = bodyAlterations[i];
     } else ((DefaultCharStats) intoStats).bodyAlterations = bodyAlterations.clone();
     for (int i = 0; i < stats.length; i++) ((DefaultCharStats) intoStats).stats[i] = stats[i];
     ((DefaultCharStats) intoStats).unwearableBitmap = unwearableBitmap;
   } else {
     intoStats.setMyClasses(getMyClassesStr());
     intoStats.setMyLevels(getMyLevelsStr());
     intoStats.setMyRace(getMyRace());
     intoStats.setRaceName(raceName);
     intoStats.setRaceName(raceName);
     intoStats.setGenderName(genderName);
     intoStats.setArriveLeaveStr(arriveStr, leaveStr);
     intoStats.setDisplayClassName(displayClassName);
     intoStats.setDisplayClassLevel(displayClassLevel);
     intoStats.setBodyPartsFromStringAfterRace(getBodyPartsAsString());
     intoStats.setWearableRestrictionsBitmap(unwearableBitmap);
     intoStats.setBreathables(breathables);
     intoStats.setItemProficiencies(proficiencies);
   }
 }
Beispiel #25
0
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats affectableStats) {
   super.affectCharStats(affectedMOB, affectableStats);
   affectableStats.setStat(CharStats.STAT_GENDER, 'N');
   affectableStats.setStat(
       CharStats.STAT_SAVE_POISON, affectableStats.getStat(CharStats.STAT_SAVE_POISON) + 100);
   affectableStats.setStat(
       CharStats.STAT_SAVE_MIND, affectableStats.getStat(CharStats.STAT_SAVE_MIND) + 100);
   affectableStats.setStat(
       CharStats.STAT_SAVE_GAS, affectableStats.getStat(CharStats.STAT_SAVE_GAS) + 100);
   affectableStats.setStat(
       CharStats.STAT_SAVE_PARALYSIS,
       affectableStats.getStat(CharStats.STAT_SAVE_PARALYSIS) + 100);
   affectableStats.setStat(
       CharStats.STAT_SAVE_UNDEAD, affectableStats.getStat(CharStats.STAT_SAVE_UNDEAD) + 100);
   affectableStats.setStat(
       CharStats.STAT_SAVE_DISEASE, affectableStats.getStat(CharStats.STAT_SAVE_DISEASE) + 100);
 }
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   affectableStats.setStat(
       CharStats.STAT_DEXTERITY, affectableStats.getStat(CharStats.STAT_DEXTERITY) + 1);
 }
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats affectableStats) {
   super.affectCharStats(affectedMOB, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_SAVE_POISON, affectableStats.getStat(CharStats.STAT_SAVE_POISON) + 100);
 }
Beispiel #28
0
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_CHARISMA, affectableStats.getStat(CharStats.STAT_CHARISMA) + 6);
 }