diff --git a/zone/lua_zone.cpp b/zone/lua_zone.cpp index 3907a3ed9..037571620 100644 --- a/zone/lua_zone.cpp +++ b/zone/lua_zone.cpp @@ -838,6 +838,36 @@ void Lua_Zone::Signal(int signal_id) self->Signal(signal_id); } +luabind::object Lua_Zone::GetPausedTimers(lua_State* L) { + auto t = luabind::newtable(L); + if (d_) { + auto self = reinterpret_cast(d_); + auto l = self->GetPausedTimers(); + int i = 1; + for (const auto& v : l) { + t[i] = v; + i++; + } + } + + return t; +} + +luabind::object Lua_Zone::GetTimers(lua_State* L) { + auto t = luabind::newtable(L); + if (d_) { + auto self = reinterpret_cast(d_); + auto l = self->GetTimers(); + int i = 1; + for (const auto& v : l) { + t[i] = v; + i++; + } + } + + return t; +} + luabind::scope lua_register_zone() { return luabind::class_("Zones") .def(luabind::constructor<>()) @@ -906,6 +936,7 @@ luabind::scope lua_register_zone() { .def("GetMinimumStatus", &Lua_Zone::GetMinimumStatus) .def("GetNote", &Lua_Zone::GetNote) .def("GetNPCMaximumAggroDistance", &Lua_Zone::GetNPCMaximumAggroDistance) + .def("GetPausedTimers", &Lua_Zone::GetPausedTimers) .def("GetPEQZone", &Lua_Zone::GetPEQZone) .def("GetRainChance", (int(Lua_Zone::*)(void))&Lua_Zone::GetRainChance) .def("GetRainChance", (int(Lua_Zone::*)(uint8))&Lua_Zone::GetRainChance) @@ -929,6 +960,7 @@ luabind::scope lua_register_zone() { .def("GetTimeZone", &Lua_Zone::GetTimeZone) .def("GetTimerDuration", &Lua_Zone::GetTimerDuration) .def("GetTimerRemainingTime", &Lua_Zone::GetTimerRemainingTime) + .def("GetTimers", &Lua_Zone::GetTimers) .def("GetZoneDescription", &Lua_Zone::GetZoneDescription) .def("GetZoneID", &Lua_Zone::GetZoneID) .def("GetZoneType", &Lua_Zone::GetZoneType) diff --git a/zone/lua_zone.h b/zone/lua_zone.h index b1a5390c2..42a1d8841 100644 --- a/zone/lua_zone.h +++ b/zone/lua_zone.h @@ -158,6 +158,8 @@ public: void StopAllTimers(); void Signal(int signal_id); void SendPayload(int payload_id, std::string payload_value); + luabind::object GetPausedTimers(lua_State* L); + luabind::object GetTimers(lua_State* L); // data buckets void SetBucket(const std::string& bucket_name, const std::string& bucket_value); diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index bd51e0b0c..342955fff 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -4673,10 +4673,8 @@ std::vector QuestManager::GetPausedTimers(Mob* m) std::vector v; if (m && !PTimerList.empty()) { - LogError("m valid | !PTimerList.empty()"); for (auto e = PTimerList.begin(); e != PTimerList.end(); e++) { if (e->owner == m) { - LogError("e->owner == m | e->name [{}]", e->name); v.emplace_back(e->name); } } @@ -4690,10 +4688,8 @@ std::vector QuestManager::GetTimers(Mob* m) std::vector v; if (m && !QTimerList.empty()) { - LogError("m valid | !QTimerList.empty()"); for (auto e = QTimerList.begin(); e != QTimerList.end(); e++) { if (e->mob == m) { - LogError("e->mob == m | e->name [{}]", e->name); v.emplace_back(e->name); } }