コード例 #1
0
 private void spawnRareDeposit(
     final List<AbstractDepositEffectArea> depositAreas, final short casterLevel) {
   AbstractDepositEffectArea rareDeposit = null;
   for (int i = 0, n = depositAreas.size(); i < n; ++i) {
     final AbstractDepositEffectArea area = depositAreas.get(i);
     if (rareDeposit == null) {
       rareDeposit = area;
     } else if (area.getDepositLevel() > rareDeposit.getDepositLevel()) {
       rareDeposit = area;
     }
   }
   this.spawnDeposit((int) rareDeposit.getBaseId());
 }
コード例 #2
0
 private void spawnDeposit(
     final List<AbstractDepositEffectArea> depositAreas, final short casterLevel) {
   final int roll = MathHelper.random(100);
   AbstractDepositEffectArea deposit = null;
   for (int i = 0, n = depositAreas.size(); i < n; ++i) {
     final AbstractDepositEffectArea area = depositAreas.get(i);
     if (deposit == null) {
       deposit = area;
     } else if ((roll < deposit.getDepositLevel() && roll > area.getDepositLevel())
         || (roll > area.getDepositLevel()
             && area.getDepositLevel() > deposit.getDepositLevel())) {
       deposit = area;
     }
   }
   this.spawnDeposit((int) deposit.getBaseId());
 }