Ejemplo n.º 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);
 }
Ejemplo n.º 2
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);
 }
Ejemplo n.º 3
0
 @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);
 }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
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);
 }
Ejemplo n.º 6
0
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   if (affected == null) return;
   affectableStats.setStat(
       CharStats.STAT_CONSTITUTION, affectableStats.getStat(CharStats.STAT_CONSTITUTION) - 4);
   affectableStats.setStat(
       CharStats.STAT_STRENGTH, affectableStats.getStat(CharStats.STAT_STRENGTH) - 5);
   if (affectableStats.getStat(CharStats.STAT_CONSTITUTION) <= 0)
     affectableStats.setStat(CharStats.STAT_CONSTITUTION, 1);
   if (affectableStats.getStat(CharStats.STAT_STRENGTH) <= 0)
     affectableStats.setStat(CharStats.STAT_STRENGTH, 1);
 }
Ejemplo n.º 7
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);
  }
Ejemplo n.º 8
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)));
 }
Ejemplo n.º 9
0
 @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);
 }
Ejemplo n.º 10
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()));
 }
Ejemplo n.º 11
0
 @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)));
 }
Ejemplo n.º 12
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)));
 }
Ejemplo n.º 13
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);
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 15
0
 @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);
   }
 }
Ejemplo n.º 16
0
 @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);
 }
Ejemplo n.º 17
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()));
       }
     }
   }
 }
Ejemplo n.º 18
0
 @Override
 public void affectCharStats(MOB affectedMOB, CharStats 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);
 }
Ejemplo n.º 19
0
 @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);
 }
Ejemplo n.º 20
0
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   affectableStats.setStat(
       CharStats.STAT_DEXTERITY, affectableStats.getStat(CharStats.STAT_DEXTERITY) + 1);
 }
Ejemplo n.º 21
0
 @Override
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_CHARISMA, affectableStats.getStat(CharStats.STAT_CHARISMA) + 6);
 }
Ejemplo n.º 22
0
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_SAVE_DETECTION,
       100 + affectableStats.getStat(CharStats.STAT_SAVE_DETECTION));
 }
Ejemplo n.º 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 "";
  }
Ejemplo n.º 24
0
 @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);
 }
Ejemplo n.º 25
0
 public void affectCharStats(MOB affectedMOB, CharStats affectedStats) {
   super.affectCharStats(affectedMOB, affectedStats);
   affectedStats.setStat(
       CharStats.STAT_SAVE_FIRE, affectedStats.getStat(CharStats.STAT_SAVE_FIRE) + 100);
 }