Esempio n. 1
0
 public MobGroup(int Aid, int cID, String groupData) {
   int maxLevel = 0;
   id = Aid;
   align = Constants.ALIGNEMENT_NEUTRE;
   cellID = cID;
   aggroDistance = Constants.getAggroByLevel(maxLevel);
   isFix = true;
   _creationDate = System.currentTimeMillis();
   int guid = -1;
   for (String data : groupData.split(";")) {
     String[] infos = data.split(",");
     try {
       int id = Integer.parseInt(infos[0]);
       int min = Integer.parseInt(infos[1]);
       int max = Integer.parseInt(infos[2]);
       Monstre m = World.getMonstre(id);
       List<MobGrade> mgs = new ArrayList<MobGrade>();
       // on ajoute a la liste les grades possibles
       for (MobGrade MG : m.getGrades().values())
         if (MG.level >= min && MG.level <= max) mgs.add(MG);
       if (mgs.isEmpty()) continue;
       // On prend un grade au hasard entre 0 et size -1 parmis les mobs possibles
       _Mobs.put(guid, mgs.get(Formulas.getRandomValue(0, mgs.size() - 1)));
       guid--;
     } catch (Exception e) {
       continue;
     }
     ;
   }
   orientation = (Formulas.getRandomValue(0, 3) * 2) + 1;
 }
Esempio n. 2
0
 public ArrayList<Drop> getDrops() {
   return template.getDrops();
 }