Skip to content

Commit

Permalink
fix: experience formula
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed May 14, 2024
1 parent e0e7ab0 commit 481e9f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions data/scripts/talkactions/god/add_skill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ local function getSkillId(skillName)
end

local function getExpForLevel(level)
level = level - 1
return ((50 * level * level * level) - (150 * level * level) + (400 * level)) / 3
return math.floor((((level - 6) * level + 17) * level - 12) / 6) * 100
end

local addSkill = TalkAction("/addskill")
Expand Down
5 changes: 2 additions & 3 deletions src/creatures/players/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ class Player final : public Creature, public Cylinder, public Bankable {
void addList() override;
void removePlayer(bool displayEffect, bool forced = true);

static uint64_t getExpForLevel(int32_t lv) {
lv--;
return ((50ULL * lv * lv * lv) - (150ULL * lv * lv) + (400ULL * lv)) / 3ULL;
static uint64_t getExpForLevel(uint64_t lv) {
return (((lv - 6ULL) * lv + 17ULL) * lv - 12ULL) / 6ULL * 100ULL;
}

uint16_t getStaminaMinutes() const {
Expand Down

0 comments on commit 481e9f9

Please sign in to comment.