[Quest API] Add Timer related methods to Mobs in Perl/Lua (#3133)

* [Quest API] Add Timer related methods to Mobs in Perl/Lua

# Perl
- Add `quest::ispausedtimer(timer_name)`.
- Add `quest::pausetimer(timer_name)`.
- Add `quest::resumetimer(timer_name)`.
- Add `$mob->GetRemainingTimeMS(timer_name)`.
- Add `$mob->GetTimerDurationMS(timer_name)`.
- Add `$mob->HasTimer(timer_name)`.
- Add `$mob->IsPausedTimer(timer_name)`.
- Add `$mob->PauseTimer(timer_name)`.
- Add `$mob->ResumeTimer(timer_name)`.
- Add `$mob->SetTimer(timer_name)`.
- Add `$mob->SetTimerMS(timer_name)`.
- Add `$mob->StopTimer(timer_name)`.

# Lua
- Add `mob:GetRemainingTimeMS(timer_name)`.
- Add `mob:GetTimerDurationMS(timer_name)`.
- Add `mob:HasTimer(timer_name)`.
- Add `mob:IsPausedTimer(timer_name)`.
- Add `mob:PauseTimer(timer_name)`.
- Add `mob:ResumeTimer(timer_name)`.
- Add `mob:SetTimer(timer_name)`.
- Add `mob:SetTimerMS(timer_name)`.
- Add `mob:StopTimer(timer_name)`.

# Notes
- The mob-based methods allow operators to loop entity list or whatever to set, stop, resume, pause, etc for timers.

* StopAllTimers()

* Update questmgr.cpp
This commit is contained in:
Alex King
2023-03-20 16:18:51 -04:00
committed by GitHub
parent 63a8d2d641
commit 4fe44f4cb6
6 changed files with 216 additions and 70 deletions
+10
View File
@@ -528,6 +528,16 @@ public:
int64 GetActSpellHealing(uint16 spell_id, int64 value, Lua_Mob target);
int64 GetActSpellHealing(uint16 spell_id, int64 value, Lua_Mob target, bool from_buff_tic);
float GetActSpellRange(uint16 spell_id, float range);
uint32 GetRemainingTimeMS(const char* timer_name);
uint32 GetTimerDurationMS(const char* timer_name);
bool HasTimer(const char* timer_name);
bool IsPausedTimer(const char* timer_name);
void PauseTimer(const char* timer_name);
void ResumeTimer(const char* timer_name);
void SetTimer(const char* timer_name, int seconds);
void SetTimerMS(const char* timer_name, int milliseconds);
void StopAllTimers();
void StopTimer(const char* timer_name);
};
#endif