Esempio n. 1
0
    public MobGrade(
        Monstre aTemp,
        int Agrade,
        int Alevel,
        int aPA,
        int aPM,
        String Aresist,
        String Astats,
        String Aspells,
        int pdvMax,
        int aInit,
        int xp) {
      template = aTemp;
      grade = Agrade;
      level = Alevel;
      PDVMAX = pdvMax;
      PDV = PDVMAX;
      PA = aPA;
      PM = aPM;
      baseXp = xp;
      init = aInit;
      String[] resists = Aresist.split(";");
      String[] statsArray = Astats.split(",");
      int RN = 0,
          RF = 0,
          RE = 0,
          RA = 0,
          RT = 0,
          AF = 0,
          MF = 0,
          force = 0,
          intell = 0,
          sagesse = 0,
          chance = 0,
          agilite = 0;
      try {
        RN = Integer.parseInt(resists[0]);
        RT = Integer.parseInt(resists[1]);
        RF = Integer.parseInt(resists[2]);
        RE = Integer.parseInt(resists[3]);
        RA = Integer.parseInt(resists[4]);
        AF = Integer.parseInt(resists[5]);
        MF = Integer.parseInt(resists[6]);
        force = Integer.parseInt(statsArray[0]);
        sagesse = Integer.parseInt(statsArray[1]);
        intell = Integer.parseInt(statsArray[2]);
        chance = Integer.parseInt(statsArray[3]);
        agilite = Integer.parseInt(statsArray[4]);
      } catch (Exception e) {
        e.printStackTrace();
      }
      ;

      stats.clear();
      stats.put(Constants.STATS_ADD_FORC, force);
      stats.put(Constants.STATS_ADD_SAGE, sagesse);
      stats.put(Constants.STATS_ADD_INTE, intell);
      stats.put(Constants.STATS_ADD_CHAN, chance);
      stats.put(Constants.STATS_ADD_AGIL, agilite);
      stats.put(Constants.STATS_ADD_RP_NEU, RN);
      stats.put(Constants.STATS_ADD_RP_FEU, RF);
      stats.put(Constants.STATS_ADD_RP_EAU, RE);
      stats.put(Constants.STATS_ADD_RP_AIR, RA);
      stats.put(Constants.STATS_ADD_RP_TER, RT);
      stats.put(Constants.STATS_ADD_AFLEE, AF);
      stats.put(Constants.STATS_ADD_MFLEE, MF);

      spells.clear();
      String[] spellsArray = Aspells.split(";");
      for (String str : spellsArray) {
        if (str.equals("")) continue;
        String[] spellInfo = str.split("@");
        int spellID = 0;
        int spellLvl = 0;
        try {
          spellID = Integer.parseInt(spellInfo[0]);
          spellLvl = Integer.parseInt(spellInfo[1]);
        } catch (Exception e) {
          continue;
        }
        ;
        if (spellID == 0 || spellLvl == 0) continue;

        Sort sort = World.getSort(spellID);
        if (sort == null) continue;
        SortStats SpellStats = sort.getStatsByLevel(spellLvl);
        if (SpellStats == null) continue;

        spells.put(spellID, SpellStats);
      }
    }
Esempio n. 2
0
 public static void addSort(Sort sort) {
   Sorts.put(sort.getSpellID(), sort);
 }