mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user