mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Rules] Add option rule to load AA based on CurrentExpansion rule (#1758)
* Add option rule to load AA based on CurrentExpansion rule * Default UseCurrentExpansionAAOnly to true * Only clear the PlayerAA when reloadingAA
This commit is contained in:
+21
-4
@@ -499,9 +499,19 @@ void Client::ResetAA() {
|
||||
|
||||
void Client::SendClearAA()
|
||||
{
|
||||
auto outapp = new EQApplicationPacket(OP_ClearLeadershipAbilities, 0);
|
||||
SendClearLeadershipAA();
|
||||
SendClearPlayerAA();
|
||||
}
|
||||
|
||||
void Client::SendClearPlayerAA()
|
||||
{
|
||||
auto outapp = new EQApplicationPacket(OP_ClearAA, 0);
|
||||
FastQueuePacket(&outapp);
|
||||
outapp = new EQApplicationPacket(OP_ClearAA, 0);
|
||||
}
|
||||
|
||||
void Client::SendClearLeadershipAA()
|
||||
{
|
||||
auto outapp = new EQApplicationPacket(OP_ClearLeadershipAbilities, 0);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
@@ -1700,11 +1710,18 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] Alternate Advancement Abilities", (int)abilities.size());
|
||||
|
||||
int expansion = RuleI(Expansion, CurrentExpansion);
|
||||
bool use_expansion_aa = RuleB(Expansion, UseCurrentExpansionAAOnly);
|
||||
|
||||
LogInfo("Loading Alternate Advancement Ability Ranks");
|
||||
ranks.clear();
|
||||
query = "SELECT id, upper_hotkey_sid, lower_hotkey_sid, title_sid, desc_sid, cost, level_req, spell, spell_type, recast_time, "
|
||||
if (use_expansion_aa && expansion >= 0) {
|
||||
query = fmt::format("SELECT id, upper_hotkey_sid, lower_hotkey_sid, title_sid, desc_sid, cost, level_req, spell, spell_type, recast_time, "
|
||||
"next_id, expansion FROM aa_ranks WHERE expansion <= {}", expansion);
|
||||
} else {
|
||||
query = "SELECT id, upper_hotkey_sid, lower_hotkey_sid, title_sid, desc_sid, cost, level_req, spell, spell_type, recast_time, "
|
||||
"next_id, expansion FROM aa_ranks";
|
||||
}
|
||||
results = QueryDatabase(query);
|
||||
if(results.Success()) {
|
||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||
|
||||
Reference in New Issue
Block a user