mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 15:00:25 +00:00
[Quest API] Add MaxSkills() to Perl/Lua. (#2621)
* [Quest API] Add MaxSkills() to Perl/Lua. # Perl - Add `$client->MaxSkills()`. # Lua - Add `client:MaxSkills()`. # Notes - Allows operators an easy short hand for maxing a player's skills for their level without needing to do all the looping and stuff on their own. * Cleanup. * Only set if it's higher than skill level player has. * Add constant.
This commit is contained in:
@@ -12013,3 +12013,18 @@ std::string Client::GetGuildPublicNote()
|
||||
|
||||
return gci.public_note;
|
||||
}
|
||||
|
||||
void Client::MaxSkills()
|
||||
{
|
||||
for (const auto &s : EQ::skills::GetSkillTypeMap()) {
|
||||
auto current_skill_value = (
|
||||
EQ::skills::IsSpecializedSkill(s.first) ?
|
||||
MAX_SPECIALIZED_SKILL :
|
||||
content_db.GetSkillCap(GetClass(), s.first, GetLevel())
|
||||
);
|
||||
|
||||
if (GetSkill(s.first) < current_skill_value) {
|
||||
SetSkill(s.first, current_skill_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user