Skip to content

Commit

Permalink
Update player.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Luan Luciano committed Mar 10, 2024
1 parent d784829 commit 150dd96
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,11 @@ void Player::addSkillAdvance(skills_t skill, uint64_t count) {
std::ostringstream ss;
ss << "You advanced to " << getSkillName(skill) << " level " << skills[skill].level << '.';
sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str());
if (skill == SKILL_LEVEL) {
sendTakeScreenshot(SCREENSHOT_TYPE_LEVELUP);
} else {
sendTakeScreenshot(SCREENSHOT_TYPE_SKILLUP);
}

g_creatureEvents().playerAdvance(static_self_cast<Player>(), skill, (skills[skill].level - 1), skills[skill].level);

Expand Down Expand Up @@ -2295,8 +2300,10 @@ void Player::addManaSpent(uint64_t amount) {
std::ostringstream ss;
ss << "You advanced to magic level " << magLevel << '.';
sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str());
sendTakeScreenshot(SCREENSHOT_TYPE_SKILLUP);

g_creatureEvents().playerAdvance(static_self_cast<Player>(), SKILL_MAGLEVEL, magLevel - 1, magLevel);
sendTakeScreenshot(SCREENSHOT_TYPE_SKILLUP);

sendUpdateStats = true;
currReqMana = nextReqMana;
Expand Down Expand Up @@ -2434,6 +2441,7 @@ void Player::addExperience(std::shared_ptr<Creature> target, uint64_t exp, bool
std::ostringstream ss;
ss << "You advanced from Level " << prevLevel << " to Level " << level << '.';
sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str());
sendTakeScreenshot(SCREENSHOT_TYPE_LEVELUP);
}

if (nextLevelExp > currLevelExp) {
Expand Down Expand Up @@ -5973,6 +5981,7 @@ bool Player::addOfflineTrainingTries(skills_t skill, uint64_t tries) {
std::ostringstream ss;
ss << "You advanced to magic level " << magLevel << '.';
sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str());
sendTakeScreenshot(SCREENSHOT_TYPE_SKILLUP);
}

uint8_t newPercent;
Expand Down Expand Up @@ -6029,6 +6038,11 @@ bool Player::addOfflineTrainingTries(skills_t skill, uint64_t tries) {
std::ostringstream ss;
ss << "You advanced to " << getSkillName(skill) << " level " << skills[skill].level << '.';
sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str());
if (skill == SKILL_LEVEL) {
sendTakeScreenshot(SCREENSHOT_TYPE_LEVELUP);
} else {
sendTakeScreenshot(SCREENSHOT_TYPE_SKILLUP);
}
}

uint8_t newPercent;
Expand Down

0 comments on commit 150dd96

Please sign in to comment.