mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +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:
@@ -2,19 +2,19 @@
|
||||
|
||||
void command_max_all_skills(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (c) {
|
||||
Client *client_target = (c->GetTarget() ? (c->GetTarget()->IsClient() ? c->GetTarget()->CastToClient() : c)
|
||||
: c);
|
||||
auto Skills = EQ::skills::GetSkillTypeMap();
|
||||
for (auto &skills_iter : Skills) {
|
||||
auto skill_id = skills_iter.first;
|
||||
auto current_skill_value = (
|
||||
(EQ::skills::IsSpecializedSkill(skill_id)) ?
|
||||
50 :
|
||||
content_db.GetSkillCap(client_target->GetClass(), skill_id, client_target->GetLevel())
|
||||
);
|
||||
client_target->SetSkill(skill_id, current_skill_value);
|
||||
}
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
t->MaxSkills();
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Maxed skills for {}.",
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user