mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 10:50:24 +00:00
[Quest API] Add EVENT_AA_BUY and EVENT_AA_GAIN to Perl/Lua. (#2504)
# Perl - Add EVENT_AA_BUY to Perl. - Exports `$aa_cost`, `$aa_id`, `$aa_previous_id`, and `$aa_next_id` - Add EVENT_AA_GAIN to Perl. - Exports `$aa_gained` - Add quest::getaaname(aa_id) to Perl. # Lua - Add event_aa_buy to Lua. - Exports `e.aa_cost`, `e.aa_id`, `e.aa_previous_id`, and `e.aa_next_id` - Add event_aa_gain to Lua. - Exports `e.aa_gained` - Add eq.get_aa_name(aa_id) to Lua.
This commit is contained in:
@@ -2950,3 +2950,29 @@ void Zone::LoadDynamicZoneTemplates()
|
||||
dz_template_cache[dz_template.id] = dz_template;
|
||||
}
|
||||
}
|
||||
|
||||
std::string Zone::GetAAName(int aa_id)
|
||||
{
|
||||
if (!aa_id) {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
int current_aa_id = 0;
|
||||
|
||||
const auto& r = aa_ranks.find(aa_id);
|
||||
if (
|
||||
r != aa_ranks.end() &&
|
||||
r->second.get()->base_ability
|
||||
) {
|
||||
current_aa_id = r->second.get()->base_ability->id;
|
||||
}
|
||||
|
||||
if (current_aa_id) {
|
||||
const auto& a = aa_abilities.find(current_aa_id);
|
||||
if (a != aa_abilities.end()) {
|
||||
return a->second.get()->name;
|
||||
}
|
||||
}
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user