mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Quest API] Add GrantAllAAPoints() Overload To Perl/Lua (#4474)
This commit is contained in:
parent
1af252466f
commit
b52719a535
@ -2185,7 +2185,7 @@ void Client::AutoGrantAAPoints() {
|
||||
SendAlternateAdvancementStats();
|
||||
}
|
||||
|
||||
void Client::GrantAllAAPoints(uint8 unlock_level)
|
||||
void Client::GrantAllAAPoints(uint8 unlock_level, bool skip_grant_only)
|
||||
{
|
||||
//iterate through every AA
|
||||
for (auto& aa : zone->aa_abilities) {
|
||||
@ -2195,6 +2195,10 @@ void Client::GrantAllAAPoints(uint8 unlock_level)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability->grant_only && skip_grant_only) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const uint8 level = unlock_level ? unlock_level : GetLevel();
|
||||
|
||||
AA::Rank* rank = ability->first;
|
||||
|
||||
@ -1025,7 +1025,7 @@ public:
|
||||
int GetSpentAA() { return m_pp.aapoints_spent; }
|
||||
uint32 GetRequiredAAExperience();
|
||||
void AutoGrantAAPoints();
|
||||
void GrantAllAAPoints(uint8 unlock_level = 0);
|
||||
void GrantAllAAPoints(uint8 unlock_level = 0, bool skip_grant_only = false);
|
||||
bool HasAlreadyPurchasedRank(AA::Rank* rank);
|
||||
void ListPurchasedAAs(Client *to, std::string search_criteria = std::string());
|
||||
|
||||
|
||||
@ -7,15 +7,16 @@ 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;
|
||||
const uint8 unlock_level = sep->IsNumber(1) ? static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[1])) : 0;
|
||||
const bool skip_grant_only = sep->IsNumber(2) ? Strings::ToBool(sep->arg[2]) : false;
|
||||
|
||||
auto t = c->GetTarget()->CastToClient();
|
||||
t->GrantAllAAPoints(unlock_level);
|
||||
t->GrantAllAAPoints(unlock_level, skip_grant_only);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Successfully granted all Alternate Advancements for {}{}.",
|
||||
"Successfully granted all Alternate Advancements for {}{}{}.",
|
||||
c->GetTargetDescription(t),
|
||||
(
|
||||
unlock_level ?
|
||||
@ -24,7 +25,8 @@ void command_grantaa(Client *c, const Seperator *sep)
|
||||
unlock_level
|
||||
) :
|
||||
""
|
||||
)
|
||||
),
|
||||
skip_grant_only ? "except for grant only AAs" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@ -3216,6 +3216,12 @@ void Lua_Client::GrantAllAAPoints(uint8 unlock_level)
|
||||
self->GrantAllAAPoints(unlock_level);
|
||||
}
|
||||
|
||||
void Lua_Client::GrantAllAAPoints(uint8 unlock_level, bool skip_grant_only)
|
||||
{
|
||||
Lua_Safe_Call_Void();
|
||||
self->GrantAllAAPoints(unlock_level, skip_grant_only);
|
||||
}
|
||||
|
||||
void Lua_Client::AddEbonCrystals(uint32 amount)
|
||||
{
|
||||
Lua_Safe_Call_Void();
|
||||
@ -3699,6 +3705,7 @@ luabind::scope lua_register_client() {
|
||||
.def("GoFish", (void(Lua_Client::*)(void))&Lua_Client::GoFish)
|
||||
.def("GrantAllAAPoints", (void(Lua_Client::*)(void))&Lua_Client::GrantAllAAPoints)
|
||||
.def("GrantAllAAPoints", (void(Lua_Client::*)(uint8))&Lua_Client::GrantAllAAPoints)
|
||||
.def("GrantAllAAPoints", (void(Lua_Client::*)(uint8,bool))&Lua_Client::GrantAllAAPoints)
|
||||
.def("GrantAlternateAdvancementAbility", (bool(Lua_Client::*)(int, int))&Lua_Client::GrantAlternateAdvancementAbility)
|
||||
.def("GrantAlternateAdvancementAbility", (bool(Lua_Client::*)(int, int, bool))&Lua_Client::GrantAlternateAdvancementAbility)
|
||||
.def("GuildID", (uint32(Lua_Client::*)(void))&Lua_Client::GuildID)
|
||||
|
||||
@ -487,6 +487,7 @@ public:
|
||||
void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration);
|
||||
void GrantAllAAPoints();
|
||||
void GrantAllAAPoints(uint8 unlock_level);
|
||||
void GrantAllAAPoints(uint8 unlock_level, bool skip_grant_only);
|
||||
void AddEbonCrystals(uint32 amount);
|
||||
void AddRadiantCrystals(uint32 amount);
|
||||
void RemoveEbonCrystals(uint32 amount);
|
||||
|
||||
@ -3031,6 +3031,11 @@ void Perl_Client_GrantAllAAPoints(Client* self, uint8 unlock_level)
|
||||
self->GrantAllAAPoints(unlock_level);
|
||||
}
|
||||
|
||||
void Perl_Client_GrantAllAAPoints(Client* self, uint8 unlock_level, bool skip_grant_only)
|
||||
{
|
||||
self->GrantAllAAPoints(unlock_level, skip_grant_only);
|
||||
}
|
||||
|
||||
void Perl_Client_AddEbonCrystals(Client* self, uint32 amount)
|
||||
{
|
||||
self->AddEbonCrystals(amount);
|
||||
@ -3471,6 +3476,7 @@ void perl_register_client()
|
||||
package.add("GoFish", &Perl_Client_GoFish);
|
||||
package.add("GrantAllAAPoints", (void(*)(Client*))&Perl_Client_GrantAllAAPoints);
|
||||
package.add("GrantAllAAPoints", (void(*)(Client*, uint8))&Perl_Client_GrantAllAAPoints);
|
||||
package.add("GrantAllAAPoints", (void(*)(Client*, uint8, bool))&Perl_Client_GrantAllAAPoints);
|
||||
package.add("GrantAlternateAdvancementAbility", (bool(*)(Client*, int, int))&Perl_Client_GrantAlternateAdvancementAbility);
|
||||
package.add("GrantAlternateAdvancementAbility", (bool(*)(Client*, int, int, bool))&Perl_Client_GrantAlternateAdvancementAbility);
|
||||
package.add("GuildID", &Perl_Client_GuildID);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user