[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:
Alex King
2022-12-06 08:46:21 -05:00
committed by GitHub
parent 91ea6462f2
commit f7fb1c9fe1
7 changed files with 45 additions and 14 deletions
+15
View File
@@ -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);
}
}
}