Пример #1
0
 public PhysicalAgent getTarget(String parameters) {
   if (parameters.equalsIgnoreCase("USER")) return req.getUser();
   int x = parameters.indexOf('@');
   String who = parameters;
   String where = "";
   PhysicalAgent P = req.getTarget();
   if (x > 0) {
     who = parameters.substring(0, x);
     where = parameters.substring(x + 1);
     Room R = CMLib.map().getRoom(where);
     if (R == null) {
       Area A = CMLib.map().getArea(where);
       if (A != null) R = A.getRandomMetroRoom();
     }
     if (who.length() == 0) P = R;
   } else {
     MOB M = CMLib.players().getLoadPlayer(who);
     if (M != null) return M;
   }
   Room R = CMLib.map().roomLocation(P);
   if (R == null) CMLib.map().roomLocation(req.getTarget());
   if (R == null) return null;
   P = R.fetchFromRoomFavorMOBs(null, who);
   if ((P == null) && (req.getTarget() instanceof MOB)) P = R.fetchFromRoomFavorMOBs(null, who);
   return P;
 }