[API] Methods for getting more information on quest timers. (#2060)

* hastimer

* [API] Check quest timer duration, timer remaining and if timer exists.

* [API] Methods for getting more information on quest timers.

* [API] Methods for getting more information on quest timers.

* [API] Methods for getting more information on quest timers.
This commit is contained in:
KayenEQ
2022-04-13 11:20:03 -04:00
committed by GitHub
parent bb897b755f
commit bc875ae554
4 changed files with 131 additions and 0 deletions
+60
View File
@@ -683,6 +683,66 @@ bool QuestManager::ispausedtimer(const char *timer_name) {
return false;
}
bool QuestManager::hastimer(const char *timer_name) {
QuestManagerCurrentQuestVars();
std::list<QuestTimer>::iterator cur = QTimerList.begin(), end;
end = QTimerList.end();
while (cur != end)
{
if (cur->mob && cur->mob == owner && cur->name == timer_name)
{
if (cur->Timer_.Enabled())
{
return true;
}
}
++cur;
}
return false;
}
uint32 QuestManager::getremainingtimeMS(const char *timer_name) {
QuestManagerCurrentQuestVars();
std::list<QuestTimer>::iterator cur = QTimerList.begin(), end;
end = QTimerList.end();
while (cur != end)
{
if (cur->mob && cur->mob == owner && cur->name == timer_name)
{
if (cur->Timer_.Enabled())
{
return cur->Timer_.GetRemainingTime();
}
}
++cur;
}
return 0;
}
uint32 QuestManager::gettimerdurationMS(const char *timer_name) {
QuestManagerCurrentQuestVars();
std::list<QuestTimer>::iterator cur = QTimerList.begin(), end;
end = QTimerList.end();
while (cur != end)
{
if (cur->mob && cur->mob == owner && cur->name == timer_name)
{
if (cur->Timer_.Enabled())
{
return cur->Timer_.GetDuration();
}
}
++cur;
}
return 0;
}
void QuestManager::emote(const char *str) {
QuestManagerCurrentQuestVars();
if (!owner) {