public void actualiserStats() { int feu = 1000 + (500 * _level); int intel = 1000 + (500 * _level); int agi = 1000 + (500 * _level); int sagesse = 1000 + (500 * _level); int chance = 1000 + (500 * _level); int resistance = 9 * _level; _stats.clear(); _stats.put(Constants.STATS_ADD_FORC, feu); _stats.put(Constants.STATS_ADD_INTE, intel); _stats.put(Constants.STATS_ADD_AGIL, agi); _stats.put(Constants.STATS_ADD_SAGE, sagesse); _stats.put(Constants.STATS_ADD_CHAN, chance); _stats.put(Constants.STATS_ADD_RP_NEU, resistance); _stats.put(Constants.STATS_ADD_RP_FEU, resistance); _stats.put(Constants.STATS_ADD_RP_EAU, resistance); _stats.put(Constants.STATS_ADD_RP_AIR, resistance); _stats.put(Constants.STATS_ADD_RP_TER, resistance); _stats.put(Constants.STATS_ADD_AFLEE, resistance); _stats.put(Constants.STATS_ADD_MFLEE, resistance); _stats.put(Constants.STATS_ADD_PA, 6); _stats.put(Constants.STATS_ADD_PM, 0); _Sorts.clear(); String Sorts = "56@6;24@6;157@6;63@6;8@6;81@6"; String[] spellsArray = Sorts.split(";"); for (String str : spellsArray) { if (str.equals("")) continue; String[] spellInfo = str.split("@"); int SortID = 0; int Sortlevel = 0; try { SortID = Integer.parseInt(spellInfo[0]); Sortlevel = Integer.parseInt(spellInfo[1]); } catch (Exception e) { continue; } if (SortID == 0 || Sortlevel == 0) continue; Sort Sort = World.getSort(SortID); if (Sort == null) continue; SortStats SortStats = Sort.getStatsByLevel(Sortlevel); if (SortStats == null) continue; _Sorts.put(SortID, SortStats); } }
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); } }