Skip to content

Commit

Permalink
fix: apply animus mastery exp multiplier only when bestiary unlocked
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipePaluco committed Jan 17, 2025
1 parent 38a74d5 commit 674aac0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3120,8 +3120,13 @@ void Player::addExperience(const std::shared_ptr<Creature> &target, uint64_t exp
float animusMasteryMultiplier = 0;

if (handleAnimusMastery) {
animusMasteryMultiplier = animusMastery().getExperienceMultiplier();
exp *= animusMasteryMultiplier;
auto mType = g_monsters().getMonsterType(monster->getName());
uint32_t killCounter = this->getBestiaryKillCount(mType->info.raceid);
uint8_t currentLevel = g_iobestiary().getKillStatus(mType, killCounter);
if (currentLevel > 3) {
animusMasteryMultiplier = animusMastery().getExperienceMultiplier();
exp *= animusMasteryMultiplier;
}
}

experience += exp;
Expand All @@ -3135,7 +3140,7 @@ void Player::addExperience(const std::shared_ptr<Creature> &target, uint64_t exp
}
}

if (handleAnimusMastery) {
if (handleAnimusMastery && animusMasteryMultiplier > 0) {
expString = fmt::format("{} (animus mastery bonus {:.1f}%)", expString, (animusMasteryMultiplier - 1) * 100);
}

Expand Down

0 comments on commit 674aac0

Please sign in to comment.