mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-05 19:32:25 +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:
parent
76b0183a0f
commit
6400e2f8bc
@ -764,6 +764,7 @@ RULE_CATEGORY_END()
|
|||||||
|
|
||||||
RULE_CATEGORY(Expansion)
|
RULE_CATEGORY(Expansion)
|
||||||
RULE_INT(Expansion, CurrentExpansion, -1, "The current expansion enabled for the server [-1 = ALL, 0 = Classic, 1 = Kunark etc.]")
|
RULE_INT(Expansion, CurrentExpansion, -1, "The current expansion enabled for the server [-1 = ALL, 0 = Classic, 1 = Kunark etc.]")
|
||||||
|
RULE_BOOL(Expansion, UseCurrentExpansionAAOnly, true, "When true will only load AA ranks that match CurrentExpansion rule")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Instances)
|
RULE_CATEGORY(Instances)
|
||||||
|
|||||||
23
zone/aa.cpp
23
zone/aa.cpp
@ -499,9 +499,19 @@ void Client::ResetAA() {
|
|||||||
|
|
||||||
void Client::SendClearAA()
|
void Client::SendClearAA()
|
||||||
{
|
{
|
||||||
auto outapp = new EQApplicationPacket(OP_ClearLeadershipAbilities, 0);
|
SendClearLeadershipAA();
|
||||||
|
SendClearPlayerAA();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client::SendClearPlayerAA()
|
||||||
|
{
|
||||||
|
auto outapp = new EQApplicationPacket(OP_ClearAA, 0);
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
outapp = new EQApplicationPacket(OP_ClearAA, 0);
|
}
|
||||||
|
|
||||||
|
void Client::SendClearLeadershipAA()
|
||||||
|
{
|
||||||
|
auto outapp = new EQApplicationPacket(OP_ClearLeadershipAbilities, 0);
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1700,11 +1710,18 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogInfo("Loaded [{}] Alternate Advancement Abilities", (int)abilities.size());
|
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");
|
LogInfo("Loading Alternate Advancement Ability Ranks");
|
||||||
ranks.clear();
|
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";
|
"next_id, expansion FROM aa_ranks";
|
||||||
|
}
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if(results.Success()) {
|
if(results.Success()) {
|
||||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
|||||||
@ -897,6 +897,8 @@ public:
|
|||||||
void ResetAA();
|
void ResetAA();
|
||||||
void RefundAA();
|
void RefundAA();
|
||||||
void SendClearAA();
|
void SendClearAA();
|
||||||
|
void SendClearLeadershipAA();
|
||||||
|
void SendClearPlayerAA();
|
||||||
inline uint32 GetAAXP() const { return m_pp.expAA; }
|
inline uint32 GetAAXP() const { return m_pp.expAA; }
|
||||||
inline uint32 GetAAPercent() const { return m_epp.perAA; }
|
inline uint32 GetAAPercent() const { return m_epp.perAA; }
|
||||||
int32 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id);
|
int32 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id);
|
||||||
|
|||||||
@ -5331,6 +5331,7 @@ void EntityList::StopMobAI()
|
|||||||
|
|
||||||
void EntityList::SendAlternateAdvancementStats() {
|
void EntityList::SendAlternateAdvancementStats() {
|
||||||
for(auto &c : client_list) {
|
for(auto &c : client_list) {
|
||||||
|
c.second->SendClearPlayerAA();
|
||||||
c.second->SendAlternateAdvancementTable();
|
c.second->SendAlternateAdvancementTable();
|
||||||
c.second->SendAlternateAdvancementStats();
|
c.second->SendAlternateAdvancementStats();
|
||||||
c.second->SendAlternateAdvancementPoints();
|
c.second->SendAlternateAdvancementPoints();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user