mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[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:
@@ -2985,6 +2985,21 @@ void Lua_Mob::StopTimer(const char* timer_name) {
|
||||
quest_manager.stoptimer(timer_name, self);
|
||||
}
|
||||
|
||||
luabind::object Lua_Mob::GetBuffSpellIDs(lua_State* L) {
|
||||
auto t = luabind::newtable(L);
|
||||
if (d_) {
|
||||
auto self = reinterpret_cast<NativeType*>(d_);
|
||||
auto l = self->GetBuffSpellIDs();
|
||||
auto i = 1;
|
||||
for (const auto& v : l) {
|
||||
t[i] = v;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_mob() {
|
||||
return luabind::class_<Lua_Mob, Lua_Entity>("Mob")
|
||||
.def(luabind::constructor<>())
|
||||
@@ -3184,6 +3199,7 @@ luabind::scope lua_register_mob() {
|
||||
.def("GetBucketKey", (std::string(Lua_Mob::*)(void))&Lua_Mob::GetBucketKey)
|
||||
.def("GetBucketRemaining", (std::string(Lua_Mob::*)(std::string))&Lua_Mob::GetBucketRemaining)
|
||||
.def("GetBuffSlotFromType", &Lua_Mob::GetBuffSlotFromType)
|
||||
.def("GetBuffSpellIDs", &Lua_Mob::GetBuffSpellIDs)
|
||||
.def("GetBuffStatValueBySlot", (void(Lua_Mob::*)(uint8, const char*))& Lua_Mob::GetBuffStatValueBySlot)
|
||||
.def("GetBuffStatValueBySpell", (void(Lua_Mob::*)(int, const char*))&Lua_Mob::GetBuffStatValueBySpell)
|
||||
.def("GetCHA", &Lua_Mob::GetCHA)
|
||||
|
||||
Reference in New Issue
Block a user