public static void doAnimalFollowerLevelingCheck(CharClass C, Environmental host, CMMsg msg) { if ((msg.sourceMessage() == null) && (msg.sourceMinor() == CMMsg.TYP_LEVEL) && (msg.source().isMonster())) { final MOB druidM = msg.source().amUltimatelyFollowing(); if ((druidM != null) && (!druidM.isMonster()) && (druidM.charStats().getCurrentClass().ID().equals(C.ID())) && (CMLib.flags().isAnimalIntelligence(msg.source()) || msg.source() .charStats() .getMyRace() .racialCategory() .equalsIgnoreCase("Vegetation") || msg.source() .charStats() .getMyRace() .racialCategory() .equalsIgnoreCase("Stone Golem"))) { final int xp = msg.source().phyStats().level() * 5; if (xp > 0) { druidM.tell( CMLib.lang().L("Your stewardship has benefitted @x1.", msg.source().name(druidM))); CMLib.leveler().postExperience(druidM, null, null, xp, false); } } } }
@Override public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel) { Item target = null; if ((commands.size() == 0) && (!auto) && (givenTarget == null)) target = Prayer_Sacrifice.getBody(mob.location()); if (target == null) target = getTarget(mob, mob.location(), givenTarget, commands, Wearable.FILTER_UNWORNONLY); if (target == null) return false; if ((!(target instanceof DeadBody)) || (target.rawSecretIdentity().toUpperCase().indexOf("FAKE") >= 0)) { mob.tell(L("You may only desecrate the dead.")); return false; } if ((((DeadBody) target).isPlayerCorpse()) && (!((DeadBody) target).getMobName().equals(mob.Name())) && (((DeadBody) target).hasContent())) { mob.tell(L("You are not allowed to desecrate a players corpse.")); return false; } if (!super.invoke(mob, commands, givenTarget, auto, asLevel)) return false; final boolean success = proficiencyCheck(mob, 0, auto); if (success) { final CMMsg msg = CMClass.getMsg( mob, target, this, verbalCastCode(mob, target, auto), auto ? L("<T-NAME> feel(s) desecrated!") : L("^S<S-NAME> desecrate(s) <T-NAMESELF> before @x1.^?", hisHerDiety(mob))); if (mob.location().okMessage(mob, msg)) { mob.location().send(mob, msg); if (CMLib.flags().isEvil(mob)) { double exp = 5.0; final int levelLimit = CMProps.getIntVar(CMProps.Int.EXPRATE); final int levelDiff = (mob.phyStats().level()) - target.phyStats().level(); if (levelDiff > levelLimit) exp = 0.0; if (exp > 0.0) CMLib.leveler() .postExperience( mob, null, null, (int) Math.round(exp) + super.getXPCOSTLevel(mob), false); } target.destroy(); mob.location().recoverRoomStats(); } } else beneficialWordsFizzle( mob, target, L("<S-NAME> attempt(s) to desecrate <T-NAMESELF>, but fail(s).")); // return whether it worked return success; }
public boolean invoke( MOB mob, Vector commands, Environmental givenTarget, boolean auto, int asLevel) { Item target = super.getTarget(mob, mob.location(), givenTarget, commands, Wearable.FILTER_ANY); if (target == null) return false; if ((!(target instanceof Ammunition)) || (!((Ammunition) target).ammunitionType().equalsIgnoreCase("arrows"))) { mob.tell(mob, target, null, "You can't enchant <T-NAME> ith an Enchant Arrows spell!"); return false; } if (!super.invoke(mob, commands, givenTarget, auto, asLevel)) return false; int experienceToLose = getXPCOSTAdjustment(mob, 5); CMLib.leveler().postExperience(mob, null, null, -experienceToLose, false); boolean success = proficiencyCheck(mob, 0, auto); if (success) { CMMsg msg = CMClass.getMsg( mob, target, this, verbalCastCode(mob, target, auto), auto ? "" : "^S<S-NAME> hold(s) <T-NAMESELF> and cast(s) a spell.^?"); if (mob.location().okMessage(mob, msg)) { mob.location().send(mob, msg); Ability A = target.fetchEffect(ID()); if ((A != null) && (CMath.s_int(A.text()) > 2)) mob.tell("You are not able to enchant " + target.name() + " further."); else { mob.location().show(mob, target, CMMsg.MSG_OK_VISUAL, "<T-NAME> glows!"); if (A == null) { A = (Ability) copyOf(); target.addNonUninvokableEffect(A); } A.setMiscText("" + (CMath.s_int(A.text()) + 1)); target.recoverEnvStats(); mob.recoverEnvStats(); } } } else beneficialWordsFizzle( mob, target, "<S-NAME> hold(s) <T-NAMESELF> tightly and whisper(s), but fail(s) to cast a spell."); // return whether it worked return success; }
public static void doAnimalFreeingCheck(CharClass C, Environmental host, CMMsg msg) { if ((msg.source() != host) && (msg.sourceMinor() == CMMsg.TYP_NOFOLLOW) && (msg.source().isMonster()) && (host instanceof MOB) && (!((MOB) host).isMonster()) && (msg.target() == host) && (msg.source().getStartRoom() != null) && (CMLib.law().isACity(msg.source().getStartRoom().getArea())) && (((MOB) host).charStats().getCurrentClass().ID().equals(C.ID())) && (CMLib.flags().isAnimalIntelligence(msg.source()) || msg.source().charStats().getMyRace().racialCategory().equalsIgnoreCase("Vegetation") || msg.source() .charStats() .getMyRace() .racialCategory() .equalsIgnoreCase("Stone Golem")) && (CMLib.flags().flaggedAffects(msg.source(), Ability.FLAG_SUMMONING).size() == 0) && (msg.source().location() != null) && (!msg.source().amDestroyed()) && (CMLib.flags().isInTheGame((MOB) host, true)) && (!CMLib.law().isACity(msg.source().location().getArea()))) { Object[] stuff = (Object[]) animalChecking.get(host); final Room room = msg.source().location(); if ((stuff == null) || (System.currentTimeMillis() - ((Long) stuff[0]).longValue() > (room.getArea().getTimeObj().getDaysInMonth() * room.getArea().getTimeObj().getHoursInDay() * CMProps.getMillisPerMudHour()))) { stuff = new Object[3]; stuff[0] = Long.valueOf(System.currentTimeMillis()); animalChecking.remove(host); animalChecking.put(host, stuff); stuff[1] = Integer.valueOf(0); stuff[2] = new Vector(); } if ((((Integer) stuff[1]).intValue() < 19) && (!((List) stuff[2]).contains("" + msg.source()))) { stuff[1] = Integer.valueOf(((Integer) stuff[1]).intValue() + 1); ((MOB) host) .tell( CMLib.lang() .L( "You have freed @x1 from @x2.", msg.source().name((MOB) host), (msg.source().getStartRoom().getArea().name()))); CMLib.leveler() .postExperience((MOB) host, null, null, ((Integer) stuff[1]).intValue(), false); } } }
public boolean resurrect(MOB tellMob, Room corpseRoom, DeadBody body, int XPLevel) { MOB rejuvedMOB = CMLib.players().getPlayer(((DeadBody) body).mobName()); if (rejuvedMOB != null) { rejuvedMOB.tell("You are being resurrected."); if (rejuvedMOB.location() != corpseRoom) { rejuvedMOB .location() .showOthers(rejuvedMOB, null, CMMsg.MSG_OK_VISUAL, "<S-NAME> disappears!"); corpseRoom.bringMobHere(rejuvedMOB, false); } Ability A = rejuvedMOB.fetchAbility("Prop_AstralSpirit"); if (A != null) rejuvedMOB.delAbility(A); A = rejuvedMOB.fetchEffect("Prop_AstralSpirit"); if (A != null) rejuvedMOB.delEffect(A); int it = 0; while (it < rejuvedMOB.location().numItems()) { Item item = rejuvedMOB.location().fetchItem(it); if ((item != null) && (item.container() == body)) { CMMsg msg2 = CMClass.getMsg(rejuvedMOB, body, item, CMMsg.MSG_GET, null); rejuvedMOB.location().send(rejuvedMOB, msg2); CMMsg msg3 = CMClass.getMsg(rejuvedMOB, item, null, CMMsg.MSG_GET, null); rejuvedMOB.location().send(rejuvedMOB, msg3); it = 0; } else it++; } body.delEffect(body.fetchEffect("Age")); // so misskids doesn't record it body.destroy(); rejuvedMOB .baseEnvStats() .setDisposition( CMath.unsetb(rejuvedMOB.baseEnvStats().disposition(), EnvStats.IS_SITTING)); rejuvedMOB .envStats() .setDisposition( CMath.unsetb(rejuvedMOB.baseEnvStats().disposition(), EnvStats.IS_SITTING)); rejuvedMOB.location().show(rejuvedMOB, null, CMMsg.MSG_NOISYMOVEMENT, "<S-NAME> get(s) up!"); corpseRoom.recoverRoomStats(); Vector whatsToDo = CMParms.parse(CMProps.getVar(CMProps.SYSTEM_PLAYERDEATH)); for (int w = 0; w < whatsToDo.size(); w++) { String whatToDo = (String) whatsToDo.elementAt(w); if (whatToDo.startsWith("UNL")) CMLib.leveler().level(rejuvedMOB); else if (whatToDo.startsWith("ASTR")) { } else if (whatToDo.startsWith("PUR")) { } else if ((whatToDo.trim().equals("0")) || (CMath.s_int(whatToDo) > 0)) { if (XPLevel >= 0) { int expLost = (CMath.s_int(whatToDo) + (2 * XPLevel)) / 2; rejuvedMOB.tell("^*You regain " + expLost + " experience points.^?^."); CMLib.leveler().postExperience(rejuvedMOB, null, null, expLost, false); } } else if (whatToDo.length() < 3) continue; else if (XPLevel >= 0) { double lvl = (double) body.envStats().level(); for (int l = body.envStats().level(); l < rejuvedMOB.envStats().level(); l++) lvl = lvl / 2.0; int expRestored = (int) Math.round(((100.0 + (2.0 * ((double) XPLevel))) * lvl) / 2.0); rejuvedMOB.tell("^*You regain " + expRestored + " experience points.^?^."); CMLib.leveler().postExperience(rejuvedMOB, null, null, expRestored, false); } } return true; } else corpseRoom.show( tellMob, body, CMMsg.MSG_OK_VISUAL, "<T-NAME> twitch(es) for a moment, but the spirit is too far gone."); return false; }
@Override public boolean invoke( MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final MOB target = this.getTarget(mob, commands, givenTarget); if (target == null) return false; if ((mob.getWorshipCharID().length() == 0) || (CMLib.map().getDeity(mob.getWorshipCharID()) == null)) { if (!auto) mob.tell(L("You must worship a god to use this prayer.")); return false; } final Deity D = CMLib.map().getDeity(mob.getWorshipCharID()); if ((target.getWorshipCharID().length() > 0) && (CMLib.map().getDeity(target.getWorshipCharID()) != null)) { if (!auto) mob.tell( L( "@x1 worships @x2, and may not be converted with this prayer.", target.name(mob), target.getWorshipCharID())); return false; } if ((CMLib.flags().isAnimalIntelligence(target) || CMLib.flags().isGolem(target) || (D == null))) { if (!auto) mob.tell(L("@x1 can not be converted with this prayer.", target.name(mob))); return false; } if (!auto) { if (convertStack.contains(target)) { final Long L = (Long) convertStack.elementAt(convertStack.indexOf(target), 2); if ((System.currentTimeMillis() - L.longValue()) > CMProps.getMillisPerMudHour() * 5) convertStack.removeElement(target); } if (convertStack.contains(target)) { mob.tell(L("@x1 must wait to be undeniably faithful again.", target.name(mob))); return false; } } if (!super.invoke(mob, commands, givenTarget, auto, asLevel)) return false; int levelDiff = target.phyStats().level() - (mob.phyStats().level() + (2 * getXLEVELLevel(mob))); if (levelDiff < 0) levelDiff = 0; final boolean success = proficiencyCheck(mob, -(levelDiff * 25), auto); int type = verbalCastCode(mob, target, auto); int mal = CMMsg.MASK_MALICIOUS; if (auto) { type = CMath.unsetb(type, CMMsg.MASK_MALICIOUS); mal = 0; } if (success) { final CMMsg msg = CMClass.getMsg( mob, target, this, type, auto ? "" : L("^S<S-NAME> @x1 for <T-NAMESELF> to BELIEVE!^?", prayWord(mob))); final CMMsg msg2 = CMClass.getMsg(target, D, this, CMMsg.MSG_SERVE, L("<S-NAME> BELIEVE(S) !!!")); final CMMsg msg3 = CMClass.getMsg( mob, target, this, CMMsg.MSK_CAST_VERBAL | mal | CMMsg.TYP_MIND | (auto ? CMMsg.MASK_ALWAYS : 0), null); if ((mob.location().okMessage(mob, msg)) && (mob.location().okMessage(mob, msg3)) && (mob.location().okMessage(mob, msg2))) { mob.location().send(mob, msg); mob.location().send(mob, msg3); if ((msg.value() <= 0) && (msg3.value() <= 0)) { target.location().send(target, msg2); target.setWorshipCharID(godName); if (mob != target) CMLib.leveler().postExperience(mob, target, null, 25, false); godName = mob.getWorshipCharID(); beneficialAffect(mob, target, asLevel, CMProps.getIntVar(CMProps.Int.TICKSPERMUDMONTH)); convertStack.addElement(target, Long.valueOf(System.currentTimeMillis())); } } } else beneficialWordsFizzle( mob, target, auto ? "" : L("<S-NAME> @x1 for <T-NAMESELF>, but nothing happens.", prayWord(mob))); // return whether it worked return success; }
@Override public boolean invoke( MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final Physical target = getAnyTarget(mob, commands, givenTarget, Wearable.FILTER_UNWORNONLY); if (target == null) return false; if (target == mob) { mob.tell(L("@x1 doesn't look dead yet.", target.name(mob))); return false; } if (!(target instanceof DeadBody)) { mob.tell(L("You can't animate that.")); return false; } final DeadBody body = (DeadBody) target; if (body.isPlayerCorpse() || (body.getMobName().length() == 0) || ((body.charStats() != null) && (body.charStats().getMyRace() != null) && (body.charStats().getMyRace().racialCategory().equalsIgnoreCase("Undead")))) { mob.tell(L("You can't animate that.")); return false; } String race = "a"; if ((body.charStats() != null) && (body.charStats().getMyRace() != null)) race = CMLib.english().startWithAorAn(body.charStats().getMyRace().name()).toLowerCase(); String description = body.getMobDescription(); if (description.trim().length() == 0) description = "It looks dead."; else description += "\n\rIt also looks dead."; if (body.basePhyStats().level() < 7) { mob.tell(L("This creature is too weak to create a ghast from.")); return false; } if (!super.invoke(mob, commands, givenTarget, auto, asLevel)) return false; final boolean success = proficiencyCheck(mob, 0, auto); if (success) { final CMMsg msg = CMClass.getMsg( mob, target, this, verbalCastCode(mob, target, auto), auto ? "" : L("^S<S-NAME> @x1 to animate <T-NAMESELF> as a ghast.^?", prayForWord(mob))); if (mob.location().okMessage(mob, msg)) { mob.location().send(mob, msg); int undeadLevel = this.getUndeadLevel(mob, 6, body.phyStats().level()); final MOB newMOB = CMClass.getMOB("GenUndead"); newMOB.setName(L("@x1 ghast", race)); newMOB.setDescription(description); newMOB.setDisplayText(L("@x1 ghast is here", race)); newMOB.basePhyStats().setLevel(undeadLevel); newMOB .baseCharStats() .setStat(CharStats.STAT_GENDER, body.charStats().getStat(CharStats.STAT_GENDER)); newMOB.baseCharStats().setMyRace(CMClass.getRace("Undead")); newMOB .baseCharStats() .setBodyPartsFromStringAfterRace(body.charStats().getBodyPartsAsString()); final Ability P = CMClass.getAbility("Prop_StatTrainer"); if (P != null) { P.setMiscText("NOTEACH STR=20 INT=10 WIS=10 CON=10 DEX=15 CHA=2"); newMOB.addNonUninvokableEffect(P); } newMOB.recoverCharStats(); newMOB.basePhyStats().setAttackAdjustment(CMLib.leveler().getLevelAttack(newMOB)); newMOB.basePhyStats().setDamage(CMLib.leveler().getLevelMOBDamage(newMOB)); newMOB.basePhyStats().setSensesMask(PhyStats.CAN_SEE_DARK); CMLib.factions().setAlignment(newMOB, Faction.Align.EVIL); newMOB.baseState().setHitPoints(25 * newMOB.basePhyStats().level()); newMOB.baseState().setMovement(CMLib.leveler().getLevelMove(newMOB)); newMOB.basePhyStats().setArmor(CMLib.leveler().getLevelMOBArmor(newMOB)); newMOB.baseState().setMana(100); newMOB.recoverCharStats(); newMOB.recoverPhyStats(); newMOB.recoverMaxState(); newMOB.resetToMaxState(); newMOB.addAbility(CMClass.getAbility("Paralysis")); Behavior B = CMClass.getBehavior("CombatAbilities"); if (B != null) newMOB.addBehavior(B); B = CMClass.getBehavior("Aggressive"); if (B != null) { B.setParms("+NAMES \"-" + mob.Name() + "\" -LEVEL +>" + newMOB.basePhyStats().level()); newMOB.addBehavior(B); } newMOB.addNonUninvokableEffect(CMClass.getAbility("Spell_CauseStink")); newMOB.addNonUninvokableEffect(CMClass.getAbility("Prop_ModExperience")); newMOB.text(); newMOB.bringToLife(mob.location(), true); CMLib.beanCounter().clearZeroMoney(newMOB, null); // newMOB.location().showOthers(newMOB,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> appears!")); int it = 0; while (it < newMOB.location().numItems()) { final Item item = newMOB.location().getItem(it); if ((item != null) && (item.container() == body)) { final CMMsg msg2 = CMClass.getMsg(newMOB, body, item, CMMsg.MSG_GET, null); newMOB.location().send(newMOB, msg2); final CMMsg msg4 = CMClass.getMsg(newMOB, item, null, CMMsg.MSG_GET, null); newMOB.location().send(newMOB, msg4); final CMMsg msg3 = CMClass.getMsg(newMOB, item, null, CMMsg.MSG_WEAR, null); newMOB.location().send(newMOB, msg3); if (!newMOB.isMine(item)) it++; else it = 0; } else it++; } body.destroy(); mob.location().show(newMOB, null, CMMsg.MSG_OK_ACTION, L("<S-NAME> begin(s) to rise!")); newMOB.setStartRoom(null); beneficialAffect(mob, newMOB, 0, 0); mob.location().recoverRoomStats(); } } else return beneficialWordsFizzle( mob, target, L("<S-NAME> @x1 to animate <T-NAMESELF>, but fail(s) miserably.", prayForWord(mob))); // return whether it worked return success; }
public StringBuffer deviations(MOB mob, String rest) { final Vector<String> V = CMParms.parse(rest); if ((V.size() == 0) || ((!V.get(0).equalsIgnoreCase("mobs")) && (!V.get(0).equalsIgnoreCase("items")) && (!V.get(0).equalsIgnoreCase("both")))) return new StringBuffer( "You must specify whether you want deviations on MOBS, ITEMS, or BOTH."); final String type = V.get(0).toLowerCase(); if (V.size() == 1) return new StringBuffer( "You must also specify a mob or item name, or the word room, or the word area."); final Room mobR = mob.location(); Faction useFaction = null; for (final Enumeration<Faction> e = CMLib.factions().factions(); e.hasMoreElements(); ) { final Faction F = e.nextElement(); if (F.showInSpecialReported()) useFaction = F; } final String where = V.get(1).toLowerCase(); final Environmental E = mobR.fetchFromMOBRoomFavorsItems(mob, null, where, Wearable.FILTER_ANY); final Vector<Environmental> check = new Vector<Environmental>(); if (where.equalsIgnoreCase("room")) fillCheckDeviations(mobR, type, check); else if (where.equalsIgnoreCase("area")) { for (final Enumeration<Room> r = mobR.getArea().getFilledCompleteMap(); r.hasMoreElements(); ) { final Room R = r.nextElement(); fillCheckDeviations(R, type, check); } } else if (where.equalsIgnoreCase("world")) { for (final Enumeration<Room> r = CMLib.map().roomsFilled(); r.hasMoreElements(); ) { final Room R = r.nextElement(); fillCheckDeviations(R, type, check); } } else if (E == null) return new StringBuffer("'" + where + "' is an unknown item or mob name."); else if (type.equals("items") && (!(E instanceof Weapon)) && (!(E instanceof Armor))) return new StringBuffer("'" + where + "' is not a weapon or armor item."); else if (type.equals("mobs") && (!(E instanceof MOB))) return new StringBuffer("'" + where + "' is not a MOB."); else if ((!(E instanceof Weapon)) && (!(E instanceof Armor)) && (!(E instanceof MOB))) return new StringBuffer("'" + where + "' is not a MOB, or Weapon, or Item."); else check.add(E); final StringBuffer str = new StringBuffer(""); str.append(L("Deviations Report:\n\r")); final StringBuffer itemResults = new StringBuffer(); final StringBuffer mobResults = new StringBuffer(); for (int c = 0; c < check.size(); c++) { if (check.get(c) instanceof Item) { final Item I = (Item) check.get(c); Weapon W = null; if (I instanceof Weapon) W = (Weapon) I; final Map<String, String> vals = CMLib.itemBuilder() .timsItemAdjustments( I, I.phyStats().level(), I.material(), I.rawLogicalAnd() ? 2 : 1, (W == null) ? 0 : W.weaponClassification(), I.maxRange(), I.rawProperLocationBitmap()); itemResults.append(CMStrings.padRight(I.name(), 20) + " "); itemResults.append(CMStrings.padRight(I.ID(), 10) + " "); itemResults.append(CMStrings.padRight("" + I.phyStats().level(), 4) + " "); itemResults.append( CMStrings.padRight( "" + getDeviation(I.basePhyStats().attackAdjustment(), vals, "ATTACK"), 5) + " "); itemResults.append( CMStrings.padRight("" + getDeviation(I.basePhyStats().damage(), vals, "DAMAGE"), 5) + " "); itemResults.append( CMStrings.padRight("" + getDeviation(I.basePhyStats().damage(), vals, "ARMOR"), 5) + " "); itemResults.append( CMStrings.padRight("" + getDeviation(I.baseGoldValue(), vals, "VALUE"), 5) + " "); itemResults.append( CMStrings.padRight( "" + ((I.phyStats().rejuv() == PhyStats.NO_REJUV) ? " MAX" : "" + I.phyStats().rejuv()), 5) + " "); if (I instanceof Weapon) itemResults.append(CMStrings.padRight("" + I.basePhyStats().weight(), 4)); else itemResults.append( CMStrings.padRight("" + getDeviation(I.basePhyStats().weight(), vals, "WEIGHT"), 4) + " "); if (I instanceof Armor) itemResults.append(CMStrings.padRight("" + ((Armor) I).phyStats().height(), 4)); else itemResults.append(CMStrings.padRight(" - ", 4) + " "); itemResults.append("\n\r"); } else { final MOB M = (MOB) check.get(c); mobResults.append(CMStrings.padRight(M.name(), 20) + " "); mobResults.append(CMStrings.padRight("" + M.phyStats().level(), 4) + " "); mobResults.append( CMStrings.padRight( "" + getDeviation( M.basePhyStats().attackAdjustment(), CMLib.leveler().getLevelAttack(M)), 5) + " "); mobResults.append( CMStrings.padRight( "" + getDeviation( M.basePhyStats().damage(), (int) Math.round( CMath.div( CMLib.leveler().getLevelMOBDamage(M), M.basePhyStats().speed()))), 5) + " "); mobResults.append( CMStrings.padRight( "" + getDeviation( M.basePhyStats().armor(), CMLib.leveler().getLevelMOBArmor(M)), 5) + " "); mobResults.append( CMStrings.padRight( "" + getDeviation( M.basePhyStats().speed(), CMLib.leveler().getLevelMOBSpeed(M)), 5) + " "); mobResults.append( CMStrings.padRight( "" + ((M.phyStats().rejuv() == PhyStats.NO_REJUV) ? " MAX" : "" + M.phyStats().rejuv()), 5) + " "); if (useFaction != null) mobResults.append( CMStrings.padRight( "" + (M.fetchFaction(useFaction.factionID()) == Integer.MAX_VALUE ? "N/A" : "" + M.fetchFaction(useFaction.factionID())), 7) + " "); double value = CMLib.beanCounter().getTotalAbsoluteNativeValue(M); double[] range = CMLib.leveler().getLevelMoneyRange(M); if (value < range[0]) mobResults.append(CMStrings.padRight("" + getDeviation(value, range[0]), 5) + " "); else if (value > range[1]) mobResults.append(CMStrings.padRight("" + getDeviation(value, range[1]), 5) + " "); else mobResults.append(CMStrings.padRight("0%", 5) + " "); int reallyWornCount = 0; for (int j = 0; j < M.numItems(); j++) { final Item Iw = M.getItem(j); if (!(Iw.amWearingAt(Wearable.IN_INVENTORY))) reallyWornCount++; } mobResults.append(CMStrings.padRight("" + reallyWornCount, 5) + " "); mobResults.append("\n\r"); } } if (itemResults.length() > 0) str.append(itemHeader() + itemResults.toString()); if (mobResults.length() > 0) str.append(mobHeader(useFaction) + mobResults.toString()); return str; }