Implemented lua methods eq.pause_timer("timername") and eq.resume_tim…

…er("timername"). This allows developers to pause and resume the given timer on the current NPC.

Added lua method eq.is_paused_timer("timername") to check to see if y…

…ou have a paused timer or not. Example usage:

if(eq.is_paused_timer("test"))then
     e.self:Say("You have a paused timer.");
else
     e.self:Say("You do not have a paused timer.");
end

(credit goes to Cavedude)
This commit is contained in:
regneq
2018-04-27 16:31:35 -07:00
parent 7d99becca9
commit f7fe10fc98
3 changed files with 127 additions and 0 deletions
+16
View File
@@ -341,6 +341,19 @@ void lua_stop_all_timers(Lua_Encounter enc) {
quest_manager.stopalltimers(enc);
}
void lua_pause_timer(const char *timer) {
quest_manager.pausetimer(timer);
}
void lua_resume_timer(const char *timer) {
quest_manager.resumetimer(timer);
}
bool lua_is_paused_timer(const char *timer) {
return quest_manager.ispausedtimer(timer);
}
void lua_depop() {
quest_manager.depop(0);
}
@@ -1543,6 +1556,9 @@ luabind::scope lua_register_general() {
luabind::def("stop_timer", (void(*)(const char*, Lua_ItemInst))&lua_stop_timer),
luabind::def("stop_timer", (void(*)(const char*, Lua_Mob))&lua_stop_timer),
luabind::def("stop_timer", (void(*)(const char*, Lua_Encounter))&lua_stop_timer),
luabind::def("pause_timer", (void(*)(const char*))&lua_pause_timer),
luabind::def("resume_timer", (void(*)(const char*))&lua_resume_timer),
luabind::def("is_paused_timer", (bool(*)(const char*))&lua_is_paused_timer),
luabind::def("stop_all_timers", (void(*)(void))&lua_stop_all_timers),
luabind::def("stop_all_timers", (void(*)(Lua_ItemInst))&lua_stop_all_timers),
luabind::def("stop_all_timers", (void(*)(Lua_Mob))&lua_stop_all_timers),