PHP Code:
public function applyStatChange(stat, amt) {
temp.limited = {"hp", "mp"};
temp.max = 0;
temp.min = 0;
if (amt.type() != 0) return; // not a number
with (findPlayer(this.account)) {
clientr.mud.(@ stat) += amt;
if (stat in limited) {
max = clientr.mud.(@ "max" @ stat);
min = clientr.mud.(@ "min" @ stat);
if (clientr.mud.(@ stat) > max)
amt = max;
if (clientr.mud.(@ stat) < min)
amt = min;
}
}
}