mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 20:08:37 +00:00
[Quest API] Add Caster ID Parameter to FindBuff in Perl/Lua (#3590)
* [Quest API] Add Caster ID Parameter to FindBuff in Perl/Lua # Perl - Add `$mob->FindBuff(spell_id, caster_id)`. # Lua - Add `mob:FindBuff(spell_id, caster_id)`. # Notes - Allows operators to check if the spell ID is cast by a specific entity ID. - We don't use `Mob*` reference here since the mob may have died, left zone, etc. * Formatting.
This commit is contained in:
+8
-4
@@ -4411,14 +4411,18 @@ std::vector<uint16> Mob::GetBuffSpellIDs()
|
||||
return l;
|
||||
}
|
||||
|
||||
bool Mob::FindBuff(uint16 spell_id)
|
||||
bool Mob::FindBuff(uint16 spell_id, uint16 caster_id)
|
||||
{
|
||||
uint32 buff_count = GetMaxTotalSlots();
|
||||
const int buff_count = GetMaxTotalSlots();
|
||||
for (int buff_slot = 0; buff_slot < buff_count; buff_slot++) {
|
||||
auto current_spell_id = buffs[buff_slot].spellid;
|
||||
const uint16 current_spell_id = buffs[buff_slot].spellid;
|
||||
if (
|
||||
IsValidSpell(current_spell_id) &&
|
||||
current_spell_id == spell_id
|
||||
current_spell_id == spell_id &&
|
||||
(
|
||||
!caster_id ||
|
||||
buffs[buff_slot].casterid == caster_id
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user