Sets the total Experience Points for the Player Character to the given value. Note this sets earned Experience Points as a side effect (calculated based on the level-adjusted Experience Points the Player Character may have). If the given xp value is less than the level-adjusted Experience Points
(int xp)
| 2163 | * @param xp The total Experience Points for the Player Character |
| 2164 | */ |
| 2165 | public void setXP(int xp) |
| 2166 | { |
| 2167 | // Remove the effect of LEVELADJ when storing our |
| 2168 | // internal notion of experience |
| 2169 | int realXP = xp - getLAXP(); |
| 2170 | |
| 2171 | if (realXP < 0) |
| 2172 | { |
| 2173 | Logging.errorPrint("ERROR: too little experience: " + realXP); |
| 2174 | realXP = 0; |
| 2175 | } |
| 2176 | |
| 2177 | if (xpFacet.set(id, realXP)) |
| 2178 | { |
| 2179 | setDirty(true); |
| 2180 | } |
| 2181 | } |
| 2182 | |
| 2183 | /** |
| 2184 | * Return the total Experience Points for the Player Character. |
nothing calls this directly
no test coverage detected