[Quest API] Add GrantAllAAPoints() to Perl/Lua and Modify #grantaa (#3616)

# Command
- Add optional `level` argument to `#grantaa` so you can grant AAs up the specified level.

# Perl
- Add `$client->GrantAllAAPoints()`.
- Add `$client->GrantAllAAPoints(level)`.

# Lua
- Add `client:GrantAllAAPoints()`.
- Add `client:GrantAllAAPoints(level)`.

# Notes
- Grants all AA abilities up to client's current level or a specified level.
This commit is contained in:
Alex King
2023-10-13 21:13:55 -04:00
committed by GitHub
parent 565baec675
commit 345dd442dd
7 changed files with 63 additions and 27 deletions
+13 -3
View File
@@ -7,14 +7,24 @@ void command_grantaa(Client *c, const Seperator *sep)
return;
}
const uint8 unlock_level = sep->IsNumber(1) ? static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[1])) : 0;
auto t = c->GetTarget()->CastToClient();
t->GrantAllAAPoints();
t->GrantAllAAPoints(unlock_level);
c->Message(
Chat::White,
fmt::format(
"Successfully granted all Alternate Advancements for {}.",
c->GetTargetDescription(t)
"Successfully granted all Alternate Advancements for {}{}.",
c->GetTargetDescription(t),
(
unlock_level ?
fmt::format(
" up to level {}",
unlock_level
) :
""
)
).c_str()
);
}