diff --git a/common/dist/scripts/habitrpg-shared.js b/common/dist/scripts/habitrpg-shared.js index 02b879577d..e0c5bc83ce 100644 --- a/common/dist/scripts/habitrpg-shared.js +++ b/common/dist/scripts/habitrpg-shared.js @@ -2641,12 +2641,16 @@ api.spells = { target: 'task', notes: t('spellWizardFireballNotes'), cast: function(user, target) { - var bonus; + var bonus, req; bonus = user._statsComputed.int * user.fns.crit('per'); target.value += diminishingReturns(bonus * .02, 4); bonus *= Math.ceil((target.value < 0 ? 1 : target.value + 1) * .075); user.stats.exp += diminishingReturns(bonus, 75); - return user.party.quest.progress.up += diminishingReturns(bonus * .1, 50, 30); + user.party.quest.progress.up += diminishingReturns(bonus * .1, 50, 30); + req = { + language: user.preferences.language + }; + return user.fns.updateStats(user.stats, req); } }, mpheal: { @@ -2772,12 +2776,16 @@ api.spells = { target: 'task', notes: t('spellRogueBackStabNotes'), cast: function(user, target) { - var bonus, _crit; + var bonus, req, _crit; _crit = user.fns.crit('str', .3); target.value += _crit * .03; bonus = (target.value < 0 ? 1 : target.value + 1) * _crit; user.stats.exp += bonus; - return user.stats.gp += bonus; + user.stats.gp += bonus; + req = { + language: user.preferences.language + }; + return user.fns.updateStats(user.stats, req); } }, toolsOfTrade: { @@ -7036,6 +7044,9 @@ api.wrap = function(user, main) { user.fns.autoAllocate(); } else { user.stats.points = user.stats.lvl - (user.stats.con + user.stats.str + user.stats.per + user.stats.int); + if (user.stats.points < 0) { + user.stats.points = 0; + } } user.stats.hp = 50; } diff --git a/common/script/index.coffee b/common/script/index.coffee index 9f595e5ccd..b16bfe44db 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -1384,6 +1384,10 @@ api.wrap = (user, main=true) -> else # add new allocatable points. We could do user.stats.points++, but this does a fail-safe just in case user.stats.points = user.stats.lvl - (user.stats.con + user.stats.str + user.stats.per + user.stats.int); + if user.stats.points < 0 + user.stats.points = 0 + # This happens after dropping level with Fix Character Values and perhaps from other causes. + # TODO: Subtract points from attributes in the same manner as on death. user.stats.hp = 50 user.stats.exp = stats.exp