Exemplo n.º 1
0
 @Override
 public void executeMsg(final Environmental myHost, final CMMsg msg) {
   super.executeMsg(myHost, msg);
   if ((reRollFlag)
       && (affected instanceof MOB)
       && (msg.sourceMinor() == CMMsg.TYP_LOOK)
       && (msg.source() == affected)) {
     final MOB M = msg.source();
     if ((M.session() != null) && (M.playerStats() != null)) {
       final Ability me = this;
       CMLib.threads()
           .executeRunnable(
               new Runnable() {
                 @Override
                 public void run() {
                   try {
                     CMLib.login()
                         .promptBaseCharStats(
                             M.playerStats().getTheme(), M, 300, M.session(), bonusPointsPerStat);
                     M.recoverCharStats();
                     if (rePickClass)
                       M.baseCharStats()
                           .setCurrentClass(
                               CMLib.login()
                                   .promptCharClass(M.playerStats().getTheme(), M, M.session()));
                     M.recoverCharStats();
                     M.delEffect(me);
                     M.baseCharStats().getCurrentClass().grantAbilities(M, false);
                   } catch (final IOException e) {
                   }
                 }
               });
     }
   }
 }
Exemplo n.º 2
0
 @Override
 public void executeMsg(final Environmental myHost, final CMMsg msg) {
   super.executeMsg(myHost, msg);
   if (((msg.sourceMinor() == CMMsg.TYP_SHUTDOWN)
           || ((msg.targetMinor() == CMMsg.TYP_EXPIRE) && (msg.target() == affected))
           || (msg.sourceMinor() == CMMsg.TYP_ROOMRESET))
       && (affected instanceof Room)) {
     updateLot(null);
     final Vector mobs = new Vector();
     Room R = (Room) affected;
     if (R != null) {
       synchronized (("SYNC" + R.roomID()).intern()) {
         R = CMLib.map().getRoom(R);
         for (int m = 0; m < R.numInhabitants(); m++) {
           final MOB M = R.fetchInhabitant(m);
           if ((M != null)
               && (M.isSavable())
               && (M.getStartRoom() == R)
               && ((M.basePhyStats().rejuv() == 0)
                   || (M.basePhyStats().rejuv() == PhyStats.NO_REJUV))) {
             CMLib.catalog().updateCatalogIntegrity(M);
             mobs.addElement(M);
           }
         }
         if (!CMSecurity.isSaveFlag(CMSecurity.SaveFlag.NOPROPERTYMOBS))
           CMLib.database().DBUpdateTheseMOBs(R, mobs);
       }
     }
   }
 }
Exemplo n.º 3
0
 @Override
 public void executeMsg(Environmental affecting, CMMsg msg) {
   super.executeMsg(affecting, msg);
   if (msg.amITarget(affecting)) {
     boolean activated = false;
     if (affecting instanceof MOB) {
       if ((msg.targetMajor(CMMsg.MASK_MALICIOUS)) && (!msg.source().isMonster()))
         activated = true;
     } else if ((affecting instanceof Food) || (affecting instanceof Drink)) {
       if ((msg.targetMinor() == CMMsg.TYP_EAT) || (msg.targetMinor() == CMMsg.TYP_DRINK))
         activated = true;
     } else if ((affecting instanceof Armor) || (affecting instanceof Weapon)) {
       if ((msg.targetMinor() == CMMsg.TYP_WEAR)
           || (msg.targetMinor() == CMMsg.TYP_HOLD)
           || (msg.targetMinor() == CMMsg.TYP_WIELD)) activated = true;
     } else if (affecting instanceof Item) {
       if ((msg.targetMinor() == CMMsg.TYP_GET)
           || (msg.targetMinor() == CMMsg.TYP_PUSH)
           || (msg.targetMinor() == CMMsg.TYP_PULL)) activated = true;
     } else activated = true;
     if (activated) {
       synchronized (killTrigger) {
         killTrigger[0] = true;
         if (!CMLib.threads().isTicking(this, Tickable.TICKID_MISCELLANEOUS))
           CMLib.threads().startTickDown(this, Tickable.TICKID_MISCELLANEOUS, 500, 1);
       }
     }
   }
 }
Exemplo n.º 4
0
 @Override
 public void executeMsg(Environmental host, CMMsg msg) {
   if ((affected instanceof Room) || (affected instanceof Area)) {
     if ((msg.targetMinor() == CMMsg.TYP_LEAVE) || (msg.sourceMinor() == CMMsg.TYP_RECALL))
       removeMyAffectsFrom(msg.source());
     if (msg.targetMinor() == CMMsg.TYP_ENTER)
       addMeIfNeccessary(msg.source(), msg.source(), true, 0, maxTicks);
   }
   super.executeMsg(host, msg);
 }