(EquipmentModifier eqMod, final String listEntry)
| 127 | } |
| 128 | |
| 129 | public static String getCost(EquipmentModifier eqMod, final String listEntry) |
| 130 | { |
| 131 | String costFormula = eqMod.getSafe(FormulaKey.COST).toString(); |
| 132 | String modChoice = ""; |
| 133 | |
| 134 | while (costFormula.contains("%SPELLLEVEL")) |
| 135 | { |
| 136 | final int idx = costFormula.indexOf("%SPELLLEVEL"); |
| 137 | |
| 138 | if (modChoice.isEmpty()) |
| 139 | { |
| 140 | final int iLevel = EqModSpellInfo.getSpellInfo(listEntry, "SPELLLEVEL"); |
| 141 | |
| 142 | if (iLevel == 0) |
| 143 | { |
| 144 | modChoice = "0.5"; |
| 145 | } |
| 146 | else |
| 147 | { |
| 148 | modChoice = Integer.toString(iLevel); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | costFormula = costFormula.substring(0, idx) + modChoice + costFormula.substring(idx + 11); |
| 153 | } |
| 154 | |
| 155 | costFormula = replaceCostSpellCost(costFormula, listEntry); |
| 156 | costFormula = replaceCostSpellXPCost(costFormula, listEntry); |
| 157 | costFormula = replaceCostCasterLevel(costFormula, listEntry); |
| 158 | costFormula = replaceCostCharges(costFormula, listEntry); |
| 159 | costFormula = replaceCostChoice(costFormula, listEntry); |
| 160 | |
| 161 | return costFormula; |
| 162 | } |
| 163 | |
| 164 | private static String replaceCostCasterLevel(String costFormula, final String listEntry) |
| 165 | { |
no test coverage detected