[Commands] Make #maxskills work on target. (#1445)

* [Commands] Make #maxskills work on target.

* Update command.cpp

* don't code when you first wake up... doesn't end well...

* another typo brought to you by lack of coffee
This commit is contained in:
Dencelle 2021-07-07 10:55:23 -05:00 committed by GitHub
parent 92914d86f1
commit f5ab135906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12852,19 +12852,17 @@ void command_cvs(Client *c, const Seperator *sep)
void command_max_all_skills(Client *c, const Seperator *sep) void command_max_all_skills(Client *c, const Seperator *sep)
{ {
if(c) if(c) {
{ Client* client_target = (c->GetTarget() ? (c->GetTarget()->IsClient() ? c->GetTarget()->CastToClient() : c) : c);
for (int i = 0; i <= EQ::skills::HIGHEST_SKILL; ++i) auto Skills = EQ::skills::GetSkillTypeMap();
{ for (auto& skills_iter : Skills) {
if (i >= EQ::skills::SkillSpecializeAbjure && i <= EQ::skills::SkillSpecializeEvocation) auto skill_id = skills_iter.first;
{ auto current_skill_value = (
c->SetSkill((EQ::skills::SkillType)i, 50); (EQ::skills::IsSpecializedSkill(skill_id)) ?
} 50 :
else content_db.GetSkillCap(client_target->GetClass(), skill_id, client_target->GetLevel())
{ );
int max_skill_level = content_db.GetSkillCap(c->GetClass(), (EQ::skills::SkillType)i, c->GetLevel()); client_target->SetSkill(skill_id, current_skill_value);
c->SetSkill((EQ::skills::SkillType)i, max_skill_level);
}
} }
} }
} }