Пример #1
0
 public ArrayList<SpellEffect> getCritEffects() {
   ArrayList<SpellEffect> effets = new ArrayList<SpellEffect>();
   for (SpellEffect SE : Effects) {
     try {
       boolean boost = true;
       for (int i : Constants.NO_BOOST_CC_IDS) if (i == SE.getEffectID()) boost = false;
       String[] infos = SE.getArgs().split(";");
       if (!boost) {
         effets.add(SE);
         continue;
       }
       int min = Integer.parseInt(infos[0], 16) + (boost ? template.getBonusCC() : 0);
       int max = Integer.parseInt(infos[1], 16) + (boost ? template.getBonusCC() : 0);
       String jet = "1d" + (max - min + 1) + "+" + (min - 1);
       // exCode: String newArgs =
       // Integer.toHexString(min)+";"+Integer.toHexString(max)+";-1;-1;0;"+jet;
       // osef du minMax, vu qu'on se sert du jet pour calculer les dégats
       String newArgs = "0;0;0;-1;0;" + jet;
       effets.add(new SpellEffect(SE.getEffectID(), newArgs, 0, -1));
     } catch (Exception e) {
       continue;
     }
     ;
   }
   return effets;
 }
Пример #2
0
 public String parseItem() {
   StringBuilder str = new StringBuilder();
   String posi = position == Constants.ITEM_POS_NO_EQUIPED ? "" : Integer.toHexString(position);
   str.append(Integer.toHexString(guid))
       .append("~")
       .append(Integer.toHexString(template.getID()))
       .append("~")
       .append(Integer.toHexString(quantity))
       .append("~")
       .append(posi)
       .append("~")
       .append(parseStatsString())
       .append(";");
   return str.toString();
 }