[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:
Alex King
2023-09-29 19:38:36 -04:00
committed by GitHub
parent 79918ebaba
commit cf27f2bc88
5 changed files with 26 additions and 9 deletions
+8 -2
View File
@@ -315,11 +315,16 @@ void Lua_Mob::SetInvisible(int state) {
self->SetInvisible(state);
}
bool Lua_Mob::FindBuff(int spell_id) {
bool Lua_Mob::FindBuff(uint16 spell_id) {
Lua_Safe_Call_Bool();
return self->FindBuff(spell_id);
}
bool Lua_Mob::FindBuff(uint16 spell_id, uint16 caster_id) {
Lua_Safe_Call_Bool();
return self->FindBuff(spell_id, caster_id);
}
uint16 Lua_Mob::FindBuffBySlot(int slot) {
Lua_Safe_Call_Int();
return self->FindBuffBySlot(slot);
@@ -3324,7 +3329,8 @@ luabind::scope lua_register_mob() {
.def("Emote", &Lua_Mob::Emote)
.def("EntityVariableExists", &Lua_Mob::EntityVariableExists)
.def("FaceTarget", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::FaceTarget)
.def("FindBuff", &Lua_Mob::FindBuff)
.def("FindBuff", (bool(Lua_Mob::*)(uint16))&Lua_Mob::FindBuff)
.def("FindBuff", (bool(Lua_Mob::*)(uint16,uint16))&Lua_Mob::FindBuff)
.def("FindBuffBySlot", (uint16(Lua_Mob::*)(int))&Lua_Mob::FindBuffBySlot)
.def("FindGroundZ", (double(Lua_Mob::*)(double,double))&Lua_Mob::FindGroundZ)
.def("FindGroundZ", (double(Lua_Mob::*)(double,double,double))&Lua_Mob::FindGroundZ)