Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-10-07 09:14:47 -06:00
committed by GitHub
34 changed files with 3357 additions and 300 deletions

View File

@@ -106,6 +106,11 @@ void EventMap::Repeat(Milliseconds time)
RepeatEvent(time.count());
}
void EventMap::Repeat(Milliseconds minTime, Milliseconds maxTime)
{
RepeatEvent(randtime(minTime, maxTime).count());
}
uint32 EventMap::ExecuteEvent()
{
while (!Empty())

View File

@@ -182,12 +182,9 @@ public:
void RescheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group = 0, uint32 phase = 0);
/**
* @name RescheduleEvent
* @brief Cancels the given event and reschedules it.
* @param eventId The id of the event.
* @param time The time in milliseconds until the event occurs.
* @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group.
* @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases.
* @name RepeatEvent
* @brief Repeats the most recently executed event.
* @param time Time until the event occurs as std::chrono type.
*/
void RepeatEvent(uint32 time);
@@ -198,6 +195,15 @@ public:
*/
void Repeat(Milliseconds time);
/**
* @name RepeatEvent
* @brief Repeats the most recently executed event.
* @param minTime The minimum time until the event occurs as std::chrono type.
* @param maxTime The maximum time until the event occurs as std::chrono type.
*/
void Repeat(Milliseconds minTime, Milliseconds maxTime);
/**
* @name ExecuteEvent
* @brief Returns the next event to execute and removes it from map.