From dff5e62f6ebb1b06c234b9144458788893b6ca86 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Fri, 30 May 2025 10:32:29 -0300 Subject: initial work on `crcombat.cc` --- src/player.cc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/player.cc') diff --git a/src/player.cc b/src/player.cc index 0ee78f3..04298c6 100644 --- a/src/player.cc +++ b/src/player.cc @@ -3,6 +3,33 @@ #include "stubs.hh" +uint8 TPlayer::GetRealProfession(void){ + return this->Profession; +} + +uint8 TPlayer::GetEffectiveProfession(void){ + uint8 Profession = this->Profession; + if(Profession >= 10){ + Profession -= 10; + } + return Profession; +} + +uint8 TPlayer::GetActiveProfession(void){ + uint8 Profession; + if(CheckRight(this->ID, PREMIUM_ACCOUNT)){ + Profession = this->Profession; + }else{ + Profession = this->GetEffectiveProfession(); + } + return Profession; +} + +bool TPlayer::GetActivePromotion(void){ + return CheckRight(this->ID, PREMIUM_ACCOUNT) + && this->Profession >= 10; +} + void TPlayer::CheckState(void){ if(this->Connection != NULL){ uint8 State = 0; -- cgit v1.2.3