[Quest API] Add GetBuffSpellIDs() to Perl/Lua (#3273)

# Perl
- Add `$mob->GetBuffSpellIDs()`.

# Lua
- Add `$mob->GetBuffSpellIDs()`.

# Notes
- These methods allow operators to get a list of a mob's buff IDs without having to loop through their buffs themselves.
This commit is contained in:
Alex King
2023-04-09 10:58:35 -04:00
committed by GitHub
parent df92c578d2
commit 57a15d473f
5 changed files with 46 additions and 0 deletions
+14
View File
@@ -4375,6 +4375,20 @@ void Corpse::CastRezz(uint16 spellid, Mob* Caster)
safe_delete(outapp);
}
std::vector<uint16> Mob::GetBuffSpellIDs()
{
std::vector<uint16> l;
for (int i = 0; i < GetMaxTotalSlots(); i++) {
const auto& e = buffs[i].spellid;
if (IsValidSpell(e)) {
l.emplace_back(e);
}
}
return l;
}
bool Mob::FindBuff(uint16 spell_id)
{
uint32 buff_count = GetMaxTotalSlots();