[Quest API] Add BuffCount() Overloads to Perl/Lua. (#2679)

# Perl
- Add `$mob->BuffCount(is_beneficial)`.
- Add `$mob->BuffCount(is_beneficial, is_detrimental)`.

# Lua
- Add `mob:BuffCount(is_beneficial)`.
- Add `mob:BuffCount(is_beneficial, is_detrimental)`.

 # Notes
- Allows operators to count only beneficial or detrimental buffs a mob has instead of always counting all buffs.
This commit is contained in:
Alex King
2022-12-29 11:58:38 -05:00
committed by GitHub
parent a590ea1d52
commit 7e7485be77
5 changed files with 48 additions and 15 deletions
+18 -6
View File
@@ -338,11 +338,6 @@ int Perl_Mob_FindBuffBySlot(Mob* self, int slot) // @categories Spells and Disci
return self->FindBuffBySlot(slot);
}
int Perl_Mob_BuffCount(Mob* self) // @categories Script Utility, Spells and Disciplines
{
return self->BuffCount();
}
bool Perl_Mob_FindType(Mob* self, uint16_t type) // @categories Script Utility
{
return self->FindType(type);
@@ -2703,6 +2698,21 @@ bool Perl_Mob_IsAttackAllowed(Mob* self, Mob* target, bool is_spell_attack)
return self->IsAttackAllowed(target, is_spell_attack);
}
uint32 Perl_Mob_BuffCount(Mob* self) // @categories Script Utility, Spells and Disciplines
{
return self->BuffCount();
}
uint32 Perl_Mob_BuffCount(Mob* self, bool is_beneficial) // @categories Script Utility, Spells and Disciplines
{
return self->BuffCount(is_beneficial);
}
uint32 Perl_Mob_BuffCount(Mob* self, bool is_beneficial, bool is_detrimental) // @categories Script Utility, Spells and Disciplines
{
return self->BuffCount(is_beneficial, is_detrimental);
}
#ifdef BOTS
void Perl_Mob_DamageAreaBots(Mob* self, int64 damage) // @categories Hate and Aggro
{
@@ -2801,7 +2811,9 @@ void perl_register_mob()
package.add("BehindMob", (bool(*)(Mob*, Mob*))&Perl_Mob_BehindMob);
package.add("BehindMob", (bool(*)(Mob*, Mob*, float))&Perl_Mob_BehindMob);
package.add("BehindMob", (bool(*)(Mob*, Mob*, float, float))&Perl_Mob_BehindMob);
package.add("BuffCount", &Perl_Mob_BuffCount);
package.add("BuffCount", (uint32(*)(Mob*))&Perl_Mob_BuffCount);
package.add("BuffCount", (uint32(*)(Mob*, bool))&Perl_Mob_BuffCount);
package.add("BuffCount", (uint32(*)(Mob*, bool, bool))&Perl_Mob_BuffCount);
package.add("BuffFadeAll", &Perl_Mob_BuffFadeAll);
package.add("BuffFadeByEffect", (void(*)(Mob*, int))&Perl_Mob_BuffFadeByEffect);
package.add("BuffFadeByEffect", (void(*)(Mob*, int, int))&Perl_Mob_BuffFadeByEffect);