mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(Core): Another way to get talent points (#3773)
This commit is contained in:
@@ -732,6 +732,7 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
|
|||||||
|
|
||||||
m_usedTalentCount = 0;
|
m_usedTalentCount = 0;
|
||||||
m_questRewardTalentCount = 0;
|
m_questRewardTalentCount = 0;
|
||||||
|
m_extraBonusTalentCount = 0;
|
||||||
|
|
||||||
m_regenTimer = 0;
|
m_regenTimer = 0;
|
||||||
m_regenTimerCount = 0;
|
m_regenTimerCount = 0;
|
||||||
@@ -7286,6 +7287,14 @@ void Player::RewardReputation(Quest const* quest)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::RewardExtraBonusTalentPoints(uint32 bonusTalentPoints)
|
||||||
|
{
|
||||||
|
if (bonusTalentPoints)
|
||||||
|
{
|
||||||
|
m_extraBonusTalentCount += bonusTalentPoints;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Player::UpdateHonorFields()
|
void Player::UpdateHonorFields()
|
||||||
{
|
{
|
||||||
/// called when rewarding honor and at each save
|
/// called when rewarding honor and at each save
|
||||||
@@ -20046,7 +20055,7 @@ void Player::_SaveMail(SQLTransaction& trans)
|
|||||||
if (!GetMailCacheSize() || !m_mailsUpdated)
|
if (!GetMailCacheSize() || !m_mailsUpdated)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement* stmt = nullptr;
|
PreparedStatement* stmt = nullptr;
|
||||||
|
|
||||||
@@ -25426,6 +25435,7 @@ uint32 Player::CalculateTalentsPoints() const
|
|||||||
if (talentPointsForLevel > base_talent)
|
if (talentPointsForLevel > base_talent)
|
||||||
talentPointsForLevel = base_talent;
|
talentPointsForLevel = base_talent;
|
||||||
|
|
||||||
|
talentPointsForLevel += m_extraBonusTalentCount;
|
||||||
return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));
|
return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2169,6 +2169,16 @@ public:
|
|||||||
void UpdateSkillsToMaxSkillsForLevel(); // for .levelup
|
void UpdateSkillsToMaxSkillsForLevel(); // for .levelup
|
||||||
void ModifySkillBonus(uint32 skillid, int32 val, bool talent);
|
void ModifySkillBonus(uint32 skillid, int32 val, bool talent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A talent point boost.
|
||||||
|
* Usage:
|
||||||
|
* 1). Hot update situation (occurred when character is online, like PlayerScript:OnAchiComplete):
|
||||||
|
* Right after calling this function, character can reward talent points by calling function player->InitTalentForLevel().
|
||||||
|
*
|
||||||
|
* 2). Data initing situation (like PlayerScript:OnLoadFromDB)
|
||||||
|
*/
|
||||||
|
void RewardExtraBonusTalentPoints(uint32 bonusTalentPoints);
|
||||||
|
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
/*** PVP SYSTEM ***/
|
/*** PVP SYSTEM ***/
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
@@ -2918,6 +2928,7 @@ protected:
|
|||||||
time_t m_resetTalentsTime;
|
time_t m_resetTalentsTime;
|
||||||
uint32 m_usedTalentCount;
|
uint32 m_usedTalentCount;
|
||||||
uint32 m_questRewardTalentCount;
|
uint32 m_questRewardTalentCount;
|
||||||
|
uint32 m_extraBonusTalentCount;
|
||||||
|
|
||||||
// Social
|
// Social
|
||||||
PlayerSocial* m_social;
|
PlayerSocial* m_social;
|
||||||
|
|||||||
Reference in New Issue
Block a user