mirror of
https://github.com/azerothcore/azerothcore-wotlk.git
synced 2025-11-10 12:24:22 +08:00
Merge branch 'master' into ScheduleCreatureRespawn
This commit is contained in:
commit
e3d8396182
@ -21,113 +21,81 @@
|
||||
void EventMap::Reset()
|
||||
{
|
||||
_eventMap.clear();
|
||||
_time = 0;
|
||||
_phase = 0;
|
||||
_time = TimePoint::min();
|
||||
_phaseMask = 0;
|
||||
}
|
||||
|
||||
void EventMap::SetPhase(uint8 phase)
|
||||
void EventMap::SetPhase(PhaseIndex phase)
|
||||
{
|
||||
if (!phase)
|
||||
{
|
||||
_phase = 0;
|
||||
}
|
||||
else if (phase <= 8)
|
||||
{
|
||||
_phase = (1 << (phase - 1));
|
||||
}
|
||||
_phaseMask = 0;
|
||||
else if (phase <= sizeof(PhaseMask) * 8)
|
||||
_phaseMask = PhaseMask(1u << (phase - 1u));
|
||||
}
|
||||
|
||||
void EventMap::AddPhase(uint8 phase)
|
||||
void EventMap::AddPhase(PhaseIndex phase)
|
||||
{
|
||||
if (phase && phase <= 8)
|
||||
{
|
||||
_phase |= (1 << (phase - 1));
|
||||
}
|
||||
if (phase && phase <= sizeof(PhaseMask) * 8)
|
||||
_phaseMask |= PhaseMask(1u << (phase - 1u));
|
||||
}
|
||||
|
||||
void EventMap::RemovePhase(uint8 phase)
|
||||
void EventMap::RemovePhase(PhaseIndex phase)
|
||||
{
|
||||
if (phase && phase <= 8)
|
||||
{
|
||||
_phase &= ~(1 << (phase - 1));
|
||||
}
|
||||
if (phase && phase <= sizeof(PhaseMask) * 8)
|
||||
_phaseMask &= PhaseMask(~(1u << (phase - 1u)));
|
||||
}
|
||||
|
||||
void EventMap::ScheduleEvent(uint32 eventId, uint32 time, uint32 group /*= 0*/, uint32 phase /*= 0*/)
|
||||
void EventMap::ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group /*= 0u*/, PhaseIndex phase /*= 0u*/)
|
||||
{
|
||||
if (group && group <= 8)
|
||||
{
|
||||
eventId |= (1 << (group + 15));
|
||||
}
|
||||
if (group > sizeof(GroupMask) * 8)
|
||||
return;
|
||||
|
||||
if (phase && phase <= 8)
|
||||
{
|
||||
eventId |= (1 << (phase + 23));
|
||||
}
|
||||
if (phase > sizeof(PhaseMask) * 8)
|
||||
return;
|
||||
|
||||
_eventMap.emplace(_time + time, eventId);
|
||||
_eventMap.emplace(_time + time, Event(eventId, group, phase));
|
||||
}
|
||||
|
||||
void EventMap::ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group /*= 0*/, uint8 phase /* = 0*/)
|
||||
void EventMap::ScheduleEvent(EventId eventId, Milliseconds minTime, Milliseconds maxTime, GroupIndex group /*= 0u*/, PhaseIndex phase /*= 0u*/)
|
||||
{
|
||||
ScheduleEvent(eventId, time.count(), group, phase);
|
||||
ScheduleEvent(eventId, randtime(minTime, maxTime), group, phase);
|
||||
}
|
||||
|
||||
void EventMap::ScheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group /*= 0*/, uint32 phase /*= 0*/)
|
||||
{
|
||||
ScheduleEvent(eventId, randtime(minTime, maxTime).count(), group, phase);
|
||||
}
|
||||
|
||||
void EventMap::RescheduleEvent(uint32 eventId, uint32 time, uint32 groupId /*= 0*/, uint32 phase/* = 0*/)
|
||||
void EventMap::RescheduleEvent(EventId eventId, Milliseconds minTime, Milliseconds maxTime, GroupIndex group /*= 0u*/, PhaseIndex phase /*= 0u*/)
|
||||
{
|
||||
CancelEvent(eventId);
|
||||
ScheduleEvent(eventId, time, groupId, phase);
|
||||
ScheduleEvent(eventId, randtime(minTime, maxTime), group, phase);
|
||||
}
|
||||
|
||||
void EventMap::RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group /*= 0*/, uint8 phase /* = 0*/)
|
||||
void EventMap::RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group /*= 0u*/, PhaseIndex phase /*= 0u*/)
|
||||
{
|
||||
CancelEvent(eventId);
|
||||
ScheduleEvent(eventId, time.count(), group, phase);
|
||||
}
|
||||
|
||||
void EventMap::RescheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group /*= 0*/, uint32 phase /*= 0*/)
|
||||
{
|
||||
CancelEvent(eventId);
|
||||
ScheduleEvent(eventId, randtime(minTime, maxTime).count(), group, phase);
|
||||
}
|
||||
|
||||
void EventMap::RepeatEvent(uint32 time)
|
||||
{
|
||||
_eventMap.emplace(_time + time, _lastEvent);
|
||||
ScheduleEvent(eventId, time, group, phase);
|
||||
}
|
||||
|
||||
void EventMap::Repeat(Milliseconds time)
|
||||
{
|
||||
RepeatEvent(time.count());
|
||||
_eventMap.emplace(_time + time, _lastEvent);
|
||||
}
|
||||
|
||||
void EventMap::Repeat(Milliseconds minTime, Milliseconds maxTime)
|
||||
{
|
||||
RepeatEvent(randtime(minTime, maxTime).count());
|
||||
Repeat(randtime(minTime, maxTime));
|
||||
}
|
||||
|
||||
uint32 EventMap::ExecuteEvent()
|
||||
EventMap::EventId EventMap::ExecuteEvent()
|
||||
{
|
||||
while (!Empty())
|
||||
{
|
||||
auto const& itr = _eventMap.begin();
|
||||
|
||||
if (itr->first > _time)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (_phase && (itr->second & 0xFF000000) && !((itr->second >> 24) & _phase))
|
||||
{
|
||||
else if (_phaseMask && itr->second._phaseMask && !(itr->second._phaseMask & _phaseMask))
|
||||
_eventMap.erase(itr);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 eventId = (itr->second & 0x0000FFFF);
|
||||
auto eventId = itr->second._id;
|
||||
_lastEvent = itr->second;
|
||||
_eventMap.erase(itr);
|
||||
return eventId;
|
||||
@ -137,30 +105,32 @@ uint32 EventMap::ExecuteEvent()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EventMap::DelayEvents(uint32 delay)
|
||||
{
|
||||
_time = delay < _time ? _time - delay : 0;
|
||||
}
|
||||
|
||||
void EventMap::DelayEvents(Milliseconds delay)
|
||||
{
|
||||
DelayEvents(delay.count());
|
||||
if (Empty())
|
||||
return;
|
||||
|
||||
EventStore delayed = std::move(_eventMap);
|
||||
for (auto itr = delayed.begin(); itr != delayed.end();)
|
||||
{
|
||||
auto node = delayed.extract(itr++);
|
||||
node.key() = node.key() + delay;
|
||||
_eventMap.insert(_eventMap.end(), std::move(node));
|
||||
}
|
||||
}
|
||||
|
||||
void EventMap::DelayEvents(uint32 delay, uint32 group)
|
||||
void EventMap::DelayEvents(Milliseconds delay, GroupIndex group)
|
||||
{
|
||||
if (group > 8 || Empty())
|
||||
{
|
||||
if (group > sizeof(GroupMask) * 8 || Empty())
|
||||
return;
|
||||
}
|
||||
|
||||
EventStore delayed;
|
||||
|
||||
for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
for (auto itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
{
|
||||
if (!group || (itr->second & (1 << (group + 15))))
|
||||
if (!group || (itr->second._groupMask & GroupMask(1u << (group - 1u))))
|
||||
{
|
||||
delayed.insert(EventStore::value_type(itr->first + delay, itr->second));
|
||||
delayed.emplace(itr->first + delay, itr->second);
|
||||
itr = _eventMap.erase(itr);
|
||||
continue;
|
||||
}
|
||||
@ -171,13 +141,13 @@ void EventMap::DelayEvents(uint32 delay, uint32 group)
|
||||
_eventMap.insert(delayed.begin(), delayed.end());
|
||||
}
|
||||
|
||||
void EventMap::DelayEventsToMax(uint32 delay, uint32 group)
|
||||
void EventMap::DelayEventsToMax(Milliseconds delay, GroupIndex group)
|
||||
{
|
||||
for (auto itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
{
|
||||
if (itr->first < _time + delay && (group == 0 || ((1 << (group + 15)) & itr->second)))
|
||||
if (itr->first < _time + delay && (!group || (itr->second._groupMask & GroupMask(1u << (group - 1u)))))
|
||||
{
|
||||
ScheduleEvent(itr->second, delay);
|
||||
ScheduleEvent(itr->second._id, delay, group);
|
||||
_eventMap.erase(itr);
|
||||
itr = _eventMap.begin();
|
||||
continue;
|
||||
@ -187,16 +157,14 @@ void EventMap::DelayEventsToMax(uint32 delay, uint32 group)
|
||||
}
|
||||
}
|
||||
|
||||
void EventMap::CancelEvent(uint32 eventId)
|
||||
void EventMap::CancelEvent(EventId eventId)
|
||||
{
|
||||
if (Empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
{
|
||||
if (eventId == (itr->second & 0x0000FFFF))
|
||||
if (eventId == itr->second._id)
|
||||
{
|
||||
itr = _eventMap.erase(itr);
|
||||
continue;
|
||||
@ -206,17 +174,14 @@ void EventMap::CancelEvent(uint32 eventId)
|
||||
}
|
||||
}
|
||||
|
||||
void EventMap::CancelEventGroup(uint32 group)
|
||||
void EventMap::CancelEventGroup(GroupIndex group)
|
||||
{
|
||||
if (!group || group > 8 || Empty())
|
||||
{
|
||||
if (!group || group > sizeof(GroupMask) * 8 || Empty())
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 groupMask = (1 << (group + 15));
|
||||
for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
for (auto itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
{
|
||||
if (itr->second & groupMask)
|
||||
if (itr->second._groupMask & GroupMask(1u << (group - 1u)))
|
||||
{
|
||||
_eventMap.erase(itr);
|
||||
itr = _eventMap.begin();
|
||||
@ -227,39 +192,21 @@ void EventMap::CancelEventGroup(uint32 group)
|
||||
}
|
||||
}
|
||||
|
||||
uint32 EventMap::GetNextEventTime(uint32 eventId) const
|
||||
bool EventMap::IsInPhase(PhaseIndex phase) const
|
||||
{
|
||||
if (Empty())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (auto const& itr : _eventMap)
|
||||
{
|
||||
if (eventId == (itr.second & 0x0000FFFF))
|
||||
{
|
||||
return itr.first;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return phase <= sizeof(PhaseIndex) * 8 && (!phase || _phaseMask & PhaseMask(1u << (phase - 1u)));
|
||||
}
|
||||
|
||||
uint32 EventMap::GetNextEventTime() const
|
||||
Milliseconds EventMap::GetTimeUntilEvent(EventId eventId) const
|
||||
{
|
||||
return Empty() ? 0 : _eventMap.begin()->first;
|
||||
}
|
||||
|
||||
bool EventMap::IsInPhase(uint8 phase)
|
||||
{
|
||||
return phase <= 8 && (!phase || _phase & (1 << (phase - 1)));
|
||||
}
|
||||
|
||||
Milliseconds EventMap::GetTimeUntilEvent(uint32 eventId) const
|
||||
{
|
||||
for (std::pair<uint32 const, uint32> const& itr : _eventMap)
|
||||
if (eventId == (itr.second & 0x0000FFFF))
|
||||
return std::chrono::duration_cast<Milliseconds>(Milliseconds(itr.first) - Milliseconds(_time));
|
||||
for (auto const& [time, event] : _eventMap)
|
||||
if (eventId == event._id)
|
||||
return std::chrono::duration_cast<Milliseconds>(time - _time);
|
||||
|
||||
return Milliseconds::max();
|
||||
}
|
||||
|
||||
bool EventMap::HasTimeUntilEvent(EventId eventId) const
|
||||
{
|
||||
return GetTimeUntilEvent(eventId) != Milliseconds::max();
|
||||
}
|
||||
|
||||
@ -24,18 +24,31 @@
|
||||
|
||||
class EventMap
|
||||
{
|
||||
using EventId = uint16;
|
||||
using GroupIndex = uint8;
|
||||
using GroupMask = uint8;
|
||||
using PhaseIndex = uint8;
|
||||
using PhaseMask = uint8;
|
||||
struct Event
|
||||
{
|
||||
Event() = default;
|
||||
Event(EventId id, GroupIndex groupIndex, PhaseIndex phaseIndex) :
|
||||
_id(id),
|
||||
_groupMask(groupIndex ? GroupMask(1u << (groupIndex - 1u)) : 0u),
|
||||
_phaseMask(phaseIndex ? PhaseMask(1u << (phaseIndex - 1u)) : 0u)
|
||||
{
|
||||
}
|
||||
|
||||
EventId _id = 0u;
|
||||
GroupMask _groupMask = 0u;
|
||||
PhaseMask _phaseMask = 0u;
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal storage type.
|
||||
* Key: Time as TimePoint when the event should occur.
|
||||
* Value: The event data as uint32.
|
||||
*
|
||||
* Structure of event data:
|
||||
* - Bit 0 - 15: Event Id.
|
||||
* - Bit 16 - 23: Group
|
||||
* - Bit 24 - 31: Phase
|
||||
* - Pattern: 0xPPGGEEEE
|
||||
*/
|
||||
typedef std::multimap<uint32, uint32> EventStore;
|
||||
* Internal storage type.
|
||||
* Key: Time as TimePoint when the event should occur.
|
||||
*/
|
||||
using EventStore = std::multimap<TimePoint, Event>;
|
||||
|
||||
public:
|
||||
EventMap() { }
|
||||
@ -47,13 +60,13 @@ public:
|
||||
void Reset();
|
||||
|
||||
/**
|
||||
* @name Update
|
||||
* @brief Updates the timer of the event map.
|
||||
* @param time Value to be added to time.
|
||||
*/
|
||||
* @name Update
|
||||
* @brief Updates the timer of the event map.
|
||||
* @param time Value to be added to time.
|
||||
*/
|
||||
void Update(uint32 time)
|
||||
{
|
||||
_time += time;
|
||||
Update(Milliseconds(time));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -63,37 +76,23 @@ public:
|
||||
*/
|
||||
void Update(Milliseconds time)
|
||||
{
|
||||
_time += static_cast<uint32>(time.count());
|
||||
}
|
||||
|
||||
/**
|
||||
* @name GetTimer
|
||||
* @return Current timer value.
|
||||
*/
|
||||
[[nodiscard]] uint32 GetTimer() const
|
||||
{
|
||||
return _time;
|
||||
}
|
||||
|
||||
void SetTimer(uint32 time)
|
||||
{
|
||||
_time = time;
|
||||
_time += time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name GetPhaseMask
|
||||
* @return Active phases as mask.
|
||||
*/
|
||||
[[nodiscard]] uint8 GetPhaseMask() const
|
||||
PhaseMask GetPhaseMask() const
|
||||
{
|
||||
return _phase;
|
||||
return _phaseMask;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Empty
|
||||
* @return True, if there are no events scheduled.
|
||||
*/
|
||||
[[nodiscard]] bool Empty() const
|
||||
bool Empty() const
|
||||
{
|
||||
return _eventMap.empty();
|
||||
}
|
||||
@ -103,31 +102,21 @@ public:
|
||||
* @brief Sets the phase of the map (absolute).
|
||||
* @param phase Phase which should be set. Values: 1 - 8. 0 resets phase.
|
||||
*/
|
||||
void SetPhase(uint8 phase);
|
||||
void SetPhase(PhaseIndex phase);
|
||||
|
||||
/**
|
||||
* @name AddPhase
|
||||
* @brief Activates the given phase (bitwise).
|
||||
* @brief Activates the given phase (absolute).
|
||||
* @param phase Phase which should be activated. Values: 1 - 8
|
||||
*/
|
||||
void AddPhase(uint8 phase);
|
||||
void AddPhase(PhaseIndex phase);
|
||||
|
||||
/**
|
||||
* @name RemovePhase
|
||||
* @brief Deactivates the given phase (bitwise).
|
||||
* @brief Deactivates the given phase (absolute).
|
||||
* @param phase Phase which should be deactivated. Values: 1 - 8.
|
||||
*/
|
||||
void RemovePhase(uint8 phase);
|
||||
|
||||
/**
|
||||
* @name ScheduleEvent
|
||||
* @brief Creates new event entry in map.
|
||||
* @param eventId The id of the new 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.
|
||||
*/
|
||||
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group = 0, uint32 phase = 0);
|
||||
void RemovePhase(PhaseIndex phase);
|
||||
|
||||
/**
|
||||
* @name ScheduleEvent
|
||||
@ -137,7 +126,7 @@ public:
|
||||
* @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.
|
||||
*/
|
||||
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group = 0, uint8 phase = 0);
|
||||
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group = 0u, PhaseIndex phase = 0u);
|
||||
|
||||
/**
|
||||
* @name ScheduleEvent
|
||||
@ -148,17 +137,7 @@ public:
|
||||
* @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.
|
||||
*/
|
||||
void ScheduleEvent(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.
|
||||
*/
|
||||
void RescheduleEvent(uint32 eventId, uint32 time, uint32 groupId = 0, uint32 phase = 0);
|
||||
void ScheduleEvent(EventId eventId, Milliseconds minTime, Milliseconds maxTime, GroupIndex group = 0u, PhaseIndex phase = 0u);
|
||||
|
||||
/**
|
||||
* @name RescheduleEvent
|
||||
@ -168,7 +147,7 @@ public:
|
||||
* @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.
|
||||
*/
|
||||
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group = 0, uint8 phase = 0);
|
||||
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group = 0u, PhaseIndex phase = 0u);
|
||||
|
||||
/**
|
||||
* @name RescheduleEvent
|
||||
@ -179,25 +158,17 @@ public:
|
||||
* @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.
|
||||
*/
|
||||
void RescheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group = 0, uint32 phase = 0);
|
||||
void RescheduleEvent(EventId eventId, Milliseconds minTime, Milliseconds maxTime, GroupIndex group = 0u, PhaseIndex phase = 0u);
|
||||
|
||||
/**
|
||||
* @name RepeatEvent
|
||||
* @brief Repeats the most recently executed event.
|
||||
* @param time Time until the event occurs as std::chrono type.
|
||||
*/
|
||||
void RepeatEvent(uint32 time);
|
||||
|
||||
/**
|
||||
* @name RepeatEvent
|
||||
* @name Repeat
|
||||
* @brief Repeats the most recently executed event.
|
||||
* @param time Time until the event occurs as std::chrono type.
|
||||
*/
|
||||
void Repeat(Milliseconds time);
|
||||
|
||||
/**
|
||||
|
||||
* @name RepeatEvent
|
||||
* @name Repeat
|
||||
* @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.
|
||||
@ -209,14 +180,7 @@ public:
|
||||
* @brief Returns the next event to execute and removes it from map.
|
||||
* @return Id of the event to execute.
|
||||
*/
|
||||
uint32 ExecuteEvent();
|
||||
|
||||
/**
|
||||
* @name DelayEvents
|
||||
* @brief Delays all events in the map. If delay is greater than or equal internal timer, delay will be 0.
|
||||
* @param delay Amount of delay.
|
||||
*/
|
||||
void DelayEvents(uint32 delay);
|
||||
EventId ExecuteEvent();
|
||||
|
||||
/**
|
||||
* @name DelayEvents
|
||||
@ -228,62 +192,57 @@ public:
|
||||
/**
|
||||
* @name DelayEvents
|
||||
* @brief Delay all events of the same group.
|
||||
* @param delay Amount of delay.
|
||||
* @param delay Amount of delay as std::chrono type.
|
||||
* @param group Group of the events.
|
||||
*/
|
||||
void DelayEvents(uint32 delay, uint32 group);
|
||||
void DelayEvents(Milliseconds delay, GroupIndex group);
|
||||
|
||||
/**
|
||||
* @name EventsEvents
|
||||
* @brief Delay all events of the same group.
|
||||
* @param delay Amount of delay.
|
||||
* @param delay Amount of delay as std::chrono type.
|
||||
* @param group Group of the events.
|
||||
*/
|
||||
void DelayEventsToMax(uint32 delay, uint32 group);
|
||||
void DelayEventsToMax(Milliseconds delay, GroupIndex group);
|
||||
|
||||
/**
|
||||
* @name CancelEvent
|
||||
* @brief Cancels all events of the specified id.
|
||||
* @param eventId Event id to cancel.
|
||||
*/
|
||||
void CancelEvent(uint32 eventId);
|
||||
void CancelEvent(EventId eventId);
|
||||
|
||||
/**
|
||||
* @name CancelEventGroup
|
||||
* @brief Cancel events belonging to specified group.
|
||||
* @param group Group to cancel.
|
||||
*/
|
||||
void CancelEventGroup(uint32 group);
|
||||
|
||||
/**
|
||||
* @name GetNextEventTime
|
||||
* @brief Returns closest occurence of specified event.
|
||||
* @param eventId Wanted event id.
|
||||
* @return Time of found event.
|
||||
*/
|
||||
[[nodiscard]] uint32 GetNextEventTime(uint32 eventId) const;
|
||||
|
||||
/**
|
||||
* @name GetNextEventTime
|
||||
* @return Time of next event.
|
||||
*/
|
||||
[[nodiscard]] uint32 GetNextEventTime() const;
|
||||
void CancelEventGroup(GroupIndex group);
|
||||
|
||||
/**
|
||||
* @name IsInPhase
|
||||
* @brief Returns wether event map is in specified phase or not.
|
||||
* @brief Returns whether event map is in specified phase or not.
|
||||
* @param phase Wanted phase.
|
||||
* @return True, if phase of event map contains specified phase.
|
||||
*/
|
||||
bool IsInPhase(uint8 phase);
|
||||
bool IsInPhase(PhaseIndex phase) const;
|
||||
|
||||
/**
|
||||
* @name GetTimeUntilEvent
|
||||
* @brief Returns time as std::chrono type until next event.
|
||||
* @param eventId of the event.
|
||||
* @param eventId The id of the event.
|
||||
* @return Time of next event. If event is not scheduled returns Milliseconds::max()
|
||||
* @return Time of next event.
|
||||
*/
|
||||
Milliseconds GetTimeUntilEvent(uint32 eventId) const;
|
||||
Milliseconds GetTimeUntilEvent(EventId eventId) const;
|
||||
|
||||
/**
|
||||
* @name HasTimeUntilEvent
|
||||
* @brief Returns whether an event is scheduled
|
||||
* @param eventId The id of the event.
|
||||
* @return True if event is scheduled
|
||||
*/
|
||||
bool HasTimeUntilEvent(EventId eventId) const;
|
||||
|
||||
private:
|
||||
/**
|
||||
@ -296,23 +255,23 @@ private:
|
||||
* has reached their time value. Its value is changed in the
|
||||
* Update method.
|
||||
*/
|
||||
uint32 _time{ 0 };
|
||||
TimePoint _time{ TimePoint::min() };
|
||||
|
||||
/**
|
||||
* @name _phase
|
||||
* @name _phaseMask
|
||||
* @brief Phase mask of the event map.
|
||||
*
|
||||
* Contains the phases the event map is in. Multiple
|
||||
* phases from 1 to 8 can be set with SetPhase or
|
||||
* AddPhase. RemovePhase deactives a phase.
|
||||
*/
|
||||
uint32 _phase{0};
|
||||
PhaseMask _phaseMask{ 0 };
|
||||
|
||||
/**
|
||||
* @name _lastEvent
|
||||
* @brief Stores information on the most recently executed event
|
||||
*/
|
||||
uint32 _lastEvent{0};
|
||||
Event _lastEvent;
|
||||
|
||||
/**
|
||||
* @name _eventMap
|
||||
|
||||
@ -80,7 +80,7 @@ void CombatAI::JustEngagedWith(Unit* who)
|
||||
if (AISpellInfo[*i].condition == AICOND_AGGRO)
|
||||
me->CastSpell(who, *i, false);
|
||||
else if (AISpellInfo[*i].condition == AICOND_COMBAT)
|
||||
events.ScheduleEvent(*i, AISpellInfo[*i].cooldown + rand() % AISpellInfo[*i].cooldown);
|
||||
events.ScheduleEvent(*i, Milliseconds(AISpellInfo[*i].cooldown + rand() % AISpellInfo[*i].cooldown));
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ void CombatAI::UpdateAI(uint32 diff)
|
||||
if (uint32 spellId = events.ExecuteEvent())
|
||||
{
|
||||
DoCast(spellId);
|
||||
events.ScheduleEvent(spellId, AISpellInfo[spellId].cooldown + rand() % AISpellInfo[spellId].cooldown);
|
||||
events.ScheduleEvent(spellId, Milliseconds(AISpellInfo[spellId].cooldown + rand() % AISpellInfo[spellId].cooldown));
|
||||
}
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
@ -143,7 +143,7 @@ void CasterAI::JustEngagedWith(Unit* who)
|
||||
DoCast(spells[spell]);
|
||||
cooldown += me->GetCurrentSpellCastTime(*itr);
|
||||
}
|
||||
events.ScheduleEvent(*itr, cooldown);
|
||||
events.ScheduleEvent(*itr, Milliseconds(cooldown));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -168,7 +168,7 @@ void CasterAI::UpdateAI(uint32 diff)
|
||||
{
|
||||
DoCast(spellId);
|
||||
uint32 casttime = me->GetCurrentSpellCastTime(spellId);
|
||||
events.ScheduleEvent(spellId, (casttime ? casttime : 500) + GetAISpellInfo(spellId)->realCooldown);
|
||||
events.ScheduleEvent(spellId, Milliseconds((casttime ? casttime : 500) + GetAISpellInfo(spellId)->realCooldown));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ public:
|
||||
|
||||
// Pass parameters between AI
|
||||
virtual void DoAction(int32 /*param = 0 */) {}
|
||||
virtual void SetGUID(ObjectGuid /*guid*/, int32 /*id = 0 */) {}
|
||||
virtual void SetGUID(ObjectGuid const& /*guid*/, int32 /*id = 0 */) {}
|
||||
virtual ObjectGuid GetGUID(int32 /*id = 0 */) const { return ObjectGuid::Empty; }
|
||||
|
||||
static int32 Permissible(GameObject const* go);
|
||||
|
||||
@ -217,7 +217,7 @@ public:
|
||||
virtual void DoAction(int32 /*param*/) {}
|
||||
virtual uint32 GetData(uint32 /*id = 0*/) const { return 0; }
|
||||
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
|
||||
virtual void SetGUID(ObjectGuid /*guid*/, int32 /*id*/ = 0) {}
|
||||
virtual void SetGUID(ObjectGuid const& /*guid*/, int32 /*id*/ = 0) {}
|
||||
virtual ObjectGuid GetGUID(int32 /*id*/ = 0) const { return ObjectGuid::Empty; }
|
||||
|
||||
// Select the best target (in <targetType> order) from the threat list that fulfill the following:
|
||||
|
||||
@ -50,9 +50,9 @@ AISpellInfoType* GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i];
|
||||
* @param WorldObject target The target of the speech, in case it has elements such as $n, where the target's name will be referrenced.
|
||||
* @param Milliseconds delay Delay until the creature says the text line. Creatures will talk immediately by default.
|
||||
*/
|
||||
void CreatureAI::Talk(uint8 id, WorldObject const* target /*= nullptr*/, Milliseconds delay /*= 0s*/)
|
||||
void CreatureAI::Talk(uint8 id, WorldObject const* target /*= nullptr*/, Milliseconds delay /*= 0ms*/)
|
||||
{
|
||||
if (delay > Seconds::zero())
|
||||
if (delay > 0ms)
|
||||
{
|
||||
ObjectGuid targetGuid;
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ public:
|
||||
EVADE_REASON_OTHER
|
||||
};
|
||||
|
||||
void Talk(uint8 id, WorldObject const* whisperTarget = nullptr, Milliseconds delay = 0s);
|
||||
void Talk(uint8 id, WorldObject const* whisperTarget = nullptr, Milliseconds delay = 0ms);
|
||||
void Talk(uint8 id, Milliseconds delay) { Talk(id, nullptr, delay); }
|
||||
|
||||
WorldObject* GetSummoner() const;
|
||||
|
||||
@ -68,7 +68,7 @@ void SummonList::DespawnEntry(uint32 entry)
|
||||
}
|
||||
}
|
||||
|
||||
void SummonList::DespawnAll(uint32 delay /*= 0*/)
|
||||
void SummonList::DespawnAll(Milliseconds delay /*= 0ms*/)
|
||||
{
|
||||
while (!storage_.empty())
|
||||
{
|
||||
@ -325,13 +325,13 @@ void ScriptedAI::ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax
|
||||
return;
|
||||
}
|
||||
|
||||
scheduler.Schedule(timerMin == 0s ? timerMax : timerMin, timerMax, [exec, repeatMin, repeatMax, uniqueId](TaskContext context)
|
||||
scheduler.Schedule(timerMin == 0ms ? timerMax : timerMin, timerMax, [exec, repeatMin, repeatMax, uniqueId](TaskContext context)
|
||||
{
|
||||
exec();
|
||||
|
||||
if (!uniqueId)
|
||||
{
|
||||
repeatMax > 0s ? context.Repeat(repeatMin, repeatMax) : context.Repeat(repeatMin);
|
||||
repeatMax > 0ms ? context.Repeat(repeatMin, repeatMax) : context.Repeat(repeatMin);
|
||||
}
|
||||
});
|
||||
|
||||
@ -654,7 +654,7 @@ void BossAI::_JustEngagedWith()
|
||||
ScheduleTasks();
|
||||
if (callForHelpRange)
|
||||
{
|
||||
ScheduleTimedEvent(0s, [&]
|
||||
ScheduleTimedEvent(0ms, [&]
|
||||
{
|
||||
me->CallForHelp(callForHelpRange);
|
||||
}, 2s);
|
||||
|
||||
@ -88,7 +88,7 @@ public:
|
||||
void Summon(Creature const* summon) { storage_.push_back(summon->GetGUID()); }
|
||||
void Despawn(Creature const* summon) { storage_.remove(summon->GetGUID()); }
|
||||
void DespawnEntry(uint32 entry);
|
||||
void DespawnAll(uint32 delay = 0);
|
||||
void DespawnAll(Milliseconds delay = 0ms);
|
||||
bool IsAnyCreatureAlive() const;
|
||||
bool IsAnyCreatureWithEntryAlive(uint32 entry) const;
|
||||
bool IsAnyCreatureInCombat() const;
|
||||
@ -355,11 +355,11 @@ struct ScriptedAI : public CreatureAI
|
||||
void ClearUniqueTimedEventsDone() { _uniqueTimedEvents.clear(); }
|
||||
|
||||
// Schedules a timed event using task scheduler.
|
||||
void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function<void()> exec, Milliseconds repeatMin, Milliseconds repeatMax = 0s, uint32 uniqueId = 0);
|
||||
void ScheduleTimedEvent(Milliseconds timerMax, std::function<void()> exec, Milliseconds repeatMin, Milliseconds repeatMax = 0s, uint32 uniqueId = 0) { ScheduleTimedEvent(0s, timerMax, exec, repeatMin, repeatMax, uniqueId); };
|
||||
void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function<void()> exec, Milliseconds repeatMin, Milliseconds repeatMax = 0ms, uint32 uniqueId = 0);
|
||||
void ScheduleTimedEvent(Milliseconds timerMax, std::function<void()> exec, Milliseconds repeatMin, Milliseconds repeatMax = 0ms, uint32 uniqueId = 0) { ScheduleTimedEvent(0ms, timerMax, exec, repeatMin, repeatMax, uniqueId); };
|
||||
|
||||
// Schedules a timed event using task scheduler that never repeats. Requires an unique non-zero ID.
|
||||
void ScheduleUniqueTimedEvent(Milliseconds timer, std::function<void()> exec, uint32 uniqueId) { ScheduleTimedEvent(0s, timer, exec, 0s, 0s, uniqueId); };
|
||||
void ScheduleUniqueTimedEvent(Milliseconds timer, std::function<void()> exec, uint32 uniqueId) { ScheduleTimedEvent(0ms, timer, exec, 0ms, 0ms, uniqueId); };
|
||||
|
||||
bool HealthBelowPct(uint32 pct) const { return me->HealthBelowPct(pct); }
|
||||
bool HealthAbovePct(uint32 pct) const { return me->HealthAbovePct(pct); }
|
||||
@ -463,7 +463,7 @@ enum HealthCheckStatus
|
||||
|
||||
struct HealthCheckEventData
|
||||
{
|
||||
HealthCheckEventData(uint8 healthPct, std::function<void()> exec, uint8 status = HEALTH_CHECK_SCHEDULED, bool allowedWhileCasting = true, Milliseconds Delay = 0s) : _healthPct(healthPct), _exec(exec), _status(status), _allowedWhileCasting(allowedWhileCasting), _delay(Delay) { };
|
||||
HealthCheckEventData(uint8 healthPct, std::function<void()> exec, uint8 status = HEALTH_CHECK_SCHEDULED, bool allowedWhileCasting = true, Milliseconds Delay = 0ms) : _healthPct(healthPct), _exec(exec), _status(status), _allowedWhileCasting(allowedWhileCasting), _delay(Delay) { };
|
||||
|
||||
uint8 _healthPct;
|
||||
std::function<void()> _exec;
|
||||
|
||||
@ -42,7 +42,7 @@ void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItem
|
||||
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(gossipMenuID, gossipMenuItemID, sender, action, boxMoney);
|
||||
}
|
||||
|
||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const guid)
|
||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const& guid)
|
||||
{
|
||||
player->PlayerTalkClass->SendGossipMenu(npcTextID, guid);
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ void AddGossipItemFor(Player* player, uint32 icon, std::string const& text, uint
|
||||
void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action, uint32 boxMoney = 0);
|
||||
|
||||
// Send menu text
|
||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const guid);
|
||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const& guid);
|
||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, Creature const* creature);
|
||||
|
||||
// Close menu
|
||||
|
||||
@ -410,7 +410,7 @@ void SmartAI::UpdatePath(const uint32 diff)
|
||||
|
||||
// Xinef: allow to properly hook out of range despawn action, which in most cases should perform the same operation as dying
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, me);
|
||||
me->DespawnOrUnsummon(1);
|
||||
me->DespawnOrUnsummon(1ms);
|
||||
return;
|
||||
}
|
||||
mEscortInvokerCheckTimer = 1000;
|
||||
@ -993,7 +993,7 @@ void SmartAI::SetData(uint32 id, uint32 value, WorldObject* invoker)
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, unit, id, value, false, nullptr, gob);
|
||||
}
|
||||
|
||||
void SmartAI::SetGUID(ObjectGuid /*guid*/, int32 /*id*/)
|
||||
void SmartAI::SetGUID(ObjectGuid const& /*guid*/, int32 /*id*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -164,7 +164,7 @@ public:
|
||||
void SetData(uint32 id, uint32 value, WorldObject* invoker);
|
||||
|
||||
// Used in scripts to share variables
|
||||
void SetGUID(ObjectGuid guid, int32 id = 0) override;
|
||||
void SetGUID(ObjectGuid const& guid, int32 id = 0) override;
|
||||
|
||||
// Used in scripts to share variables
|
||||
ObjectGuid GetGUID(int32 id = 0) const override;
|
||||
|
||||
@ -855,7 +855,7 @@ GameObject* Battlefield::SpawnGameObject(uint32 entry, float x, float y, float z
|
||||
return go;
|
||||
}
|
||||
|
||||
Creature* Battlefield::GetCreature(ObjectGuid const guid)
|
||||
Creature* Battlefield::GetCreature(ObjectGuid const& guid)
|
||||
{
|
||||
if (!m_Map)
|
||||
return nullptr;
|
||||
@ -863,7 +863,7 @@ Creature* Battlefield::GetCreature(ObjectGuid const guid)
|
||||
return m_Map->GetCreature(guid);
|
||||
}
|
||||
|
||||
GameObject* Battlefield::GetGameObject(ObjectGuid const guid)
|
||||
GameObject* Battlefield::GetGameObject(ObjectGuid const& guid)
|
||||
{
|
||||
if (!m_Map)
|
||||
return nullptr;
|
||||
|
||||
@ -303,8 +303,8 @@ public:
|
||||
Creature* SpawnCreature(uint32 entry, Position pos, TeamId teamId);
|
||||
GameObject* SpawnGameObject(uint32 entry, float x, float y, float z, float o);
|
||||
|
||||
Creature* GetCreature(ObjectGuid const guid);
|
||||
GameObject* GetGameObject(ObjectGuid const guid);
|
||||
Creature* GetCreature(ObjectGuid const& guid);
|
||||
GameObject* GetGameObject(ObjectGuid const& guid);
|
||||
|
||||
// Script-methods
|
||||
|
||||
|
||||
@ -415,7 +415,7 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
|
||||
{
|
||||
for (GuidUnorderedSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
|
||||
if (Creature* creature = GetCreature(*itr))
|
||||
creature->DespawnOrUnsummon(1);
|
||||
creature->DespawnOrUnsummon(1ms);
|
||||
|
||||
m_vehicles[team].clear();
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ void BattlegroundAB::PostUpdateImpl(uint32 diff)
|
||||
uint8 controlledPoints = _controlledPoints[teamId];
|
||||
if (controlledPoints == 0)
|
||||
{
|
||||
_bgEvents.ScheduleEvent(eventId, 3000);
|
||||
_bgEvents.ScheduleEvent(eventId, 3s);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -170,8 +170,8 @@ void BattlegroundAB::StartingEventOpenDoors()
|
||||
DoorOpen(BG_AB_OBJECT_GATE_A);
|
||||
DoorOpen(BG_AB_OBJECT_GATE_H);
|
||||
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, BG_AB_EVENT_START_BATTLE);
|
||||
_bgEvents.ScheduleEvent(BG_AB_EVENT_ALLIANCE_TICK, 3000);
|
||||
_bgEvents.ScheduleEvent(BG_AB_EVENT_HORDE_TICK, 3000);
|
||||
_bgEvents.ScheduleEvent(BG_AB_EVENT_ALLIANCE_TICK, 3s);
|
||||
_bgEvents.ScheduleEvent(BG_AB_EVENT_HORDE_TICK, 3s);
|
||||
}
|
||||
|
||||
void BattlegroundAB::AddPlayer(Player* player)
|
||||
|
||||
@ -170,12 +170,11 @@ enum BG_AB_Misc
|
||||
|
||||
BG_AB_WARNING_NEAR_VICTORY_SCORE = 1400,
|
||||
BG_AB_MAX_TEAM_SCORE = 1600,
|
||||
|
||||
BG_AB_FLAG_CAPTURING_TIME = 60000,
|
||||
BG_AB_BANNER_UPDATE_TIME = 2000
|
||||
};
|
||||
constexpr Milliseconds BG_AB_FLAG_CAPTURING_TIME = 60s;
|
||||
constexpr Milliseconds BG_AB_BANNER_UPDATE_TIME = 2s;
|
||||
|
||||
const uint32 BG_AB_TickIntervals[BG_AB_DYNAMIC_NODES_COUNT + 1] = {0, 12000, 9000, 6000, 3000, 1000};
|
||||
const Milliseconds BG_AB_TickIntervals[BG_AB_DYNAMIC_NODES_COUNT + 1] = {0ms, 12s, 9s, 6s, 3s, 1s};
|
||||
const uint32 BG_AB_TickPoints[BG_AB_DYNAMIC_NODES_COUNT + 1] = {0, 10, 10, 10, 10, 30};
|
||||
const uint32 BG_AB_GraveyardIds[BG_AB_ALL_NODES_COUNT] = {895, 894, 893, 897, 896, 898, 899};
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ void BattlegroundEY::PostUpdateImpl(uint32 diff)
|
||||
AddPoints(TEAM_ALLIANCE, BG_EY_TickPoints[_ownedPointsCount[TEAM_ALLIANCE] - 1]);
|
||||
if (_ownedPointsCount[TEAM_HORDE] > 0)
|
||||
AddPoints(TEAM_HORDE, BG_EY_TickPoints[_ownedPointsCount[TEAM_HORDE] - 1]);
|
||||
_bgEvents.ScheduleEvent(BG_EY_EVENT_ADD_POINTS, BG_EY_FPOINTS_TICK_TIME - (GameTime::GetGameTimeMS().count() % BG_EY_FPOINTS_TICK_TIME));
|
||||
_bgEvents.ScheduleEvent(BG_EY_EVENT_ADD_POINTS, BG_EY_FPOINTS_TICK_TIME - (GameTime::GetGameTimeMS() % BG_EY_FPOINTS_TICK_TIME));
|
||||
break;
|
||||
case BG_EY_EVENT_FLAG_ON_GROUND:
|
||||
RespawnFlagAfterDrop();
|
||||
@ -78,7 +78,7 @@ void BattlegroundEY::PostUpdateImpl(uint32 diff)
|
||||
break;
|
||||
case BG_EY_EVENT_CHECK_CPOINTS:
|
||||
UpdatePointsState();
|
||||
_bgEvents.ScheduleEvent(BG_EY_EVENT_CHECK_CPOINTS, BG_EY_FPOINTS_CHECK_TIME - (GameTime::GetGameTimeMS().count() % BG_EY_FPOINTS_CHECK_TIME));
|
||||
_bgEvents.ScheduleEvent(BG_EY_EVENT_CHECK_CPOINTS, BG_EY_FPOINTS_CHECK_TIME - (GameTime::GetGameTimeMS() % BG_EY_FPOINTS_CHECK_TIME));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -106,8 +106,8 @@ void BattlegroundEY::StartingEventOpenDoors()
|
||||
|
||||
// Achievement: Flurry
|
||||
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, BG_EY_EVENT_START_BATTLE);
|
||||
_bgEvents.ScheduleEvent(BG_EY_EVENT_ADD_POINTS, 0);
|
||||
_bgEvents.ScheduleEvent(BG_EY_EVENT_CHECK_CPOINTS, 0);
|
||||
_bgEvents.ScheduleEvent(BG_EY_EVENT_ADD_POINTS, 0ms);
|
||||
_bgEvents.ScheduleEvent(BG_EY_EVENT_CHECK_CPOINTS, 0ms);
|
||||
}
|
||||
|
||||
void BattlegroundEY::AddPoints(TeamId teamId, uint32 points)
|
||||
|
||||
@ -31,13 +31,10 @@ enum BG_EY_Events
|
||||
BG_EY_EVENT_CHECK_CPOINTS = 4
|
||||
};
|
||||
|
||||
enum BG_EY_Timers
|
||||
{
|
||||
BG_EY_FLAG_RESPAWN_TIME = 10 * IN_MILLISECONDS,
|
||||
BG_EY_FLAG_ON_GROUND_TIME = 10 * IN_MILLISECONDS,
|
||||
BG_EY_FPOINTS_CHECK_TIME = 2 * IN_MILLISECONDS,
|
||||
BG_EY_FPOINTS_TICK_TIME = 2 * IN_MILLISECONDS
|
||||
};
|
||||
constexpr Milliseconds BG_EY_FLAG_RESPAWN_TIME = 10s;
|
||||
constexpr Milliseconds BG_EY_FLAG_ON_GROUND_TIME = 10s;
|
||||
constexpr Milliseconds BG_EY_FPOINTS_CHECK_TIME = 2s;
|
||||
constexpr Milliseconds BG_EY_FPOINTS_TICK_TIME = 2s;
|
||||
|
||||
enum BG_EY_ProgressBarConsts
|
||||
{
|
||||
|
||||
@ -63,7 +63,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff)
|
||||
{
|
||||
case BG_WS_EVENT_UPDATE_GAME_TIME:
|
||||
UpdateWorldState(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER, GetMatchTime());
|
||||
_bgEvents.ScheduleEvent(BG_WS_EVENT_UPDATE_GAME_TIME, ((BG_WS_TOTAL_GAME_TIME - GetStartTime()) % (MINUTE * IN_MILLISECONDS)) + 1);
|
||||
_bgEvents.ScheduleEvent(BG_WS_EVENT_UPDATE_GAME_TIME, Milliseconds(((BG_WS_TOTAL_GAME_TIME - GetStartTime()) % (MINUTE * IN_MILLISECONDS)) + 1));
|
||||
break;
|
||||
case BG_WS_EVENT_NO_TIME_LEFT:
|
||||
if (GetTeamScore(TEAM_ALLIANCE) == GetTeamScore(TEAM_HORDE))
|
||||
@ -137,8 +137,8 @@ void BattlegroundWS::StartingEventOpenDoors()
|
||||
|
||||
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, WS_EVENT_START_BATTLE);
|
||||
UpdateWorldState(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER_ACTIVE, 1);
|
||||
_bgEvents.ScheduleEvent(BG_WS_EVENT_UPDATE_GAME_TIME, 0);
|
||||
_bgEvents.ScheduleEvent(BG_WS_EVENT_NO_TIME_LEFT, BG_WS_TOTAL_GAME_TIME - 2 * MINUTE * IN_MILLISECONDS); // 27 - 2 = 25 minutes
|
||||
_bgEvents.ScheduleEvent(BG_WS_EVENT_UPDATE_GAME_TIME, 0ms);
|
||||
_bgEvents.ScheduleEvent(BG_WS_EVENT_NO_TIME_LEFT, Milliseconds(BG_WS_TOTAL_GAME_TIME - 2 * MINUTE * IN_MILLISECONDS)); // 27 - 2 = 25 minutes
|
||||
_bgEvents.ScheduleEvent(BG_WS_EVENT_DESPAWN_DOORS, BG_WS_DOOR_DESPAWN_TIME);
|
||||
}
|
||||
|
||||
@ -229,7 +229,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* player)
|
||||
EndBattleground(GetTeamScore(TEAM_HORDE) == _configurableMaxTeamScore ? TEAM_HORDE : TEAM_ALLIANCE);
|
||||
}
|
||||
else
|
||||
_bgEvents.ScheduleEvent(BG_WS_EVENT_RESPAWN_BOTH_FLAGS, BG_WS_FLAG_RESPAWN_TIME);
|
||||
_bgEvents.ScheduleEvent(BG_WS_EVENT_RESPAWN_BOTH_FLAGS, Milliseconds(BG_WS_FLAG_RESPAWN_TIME));
|
||||
|
||||
_bgEvents.CancelEvent(BG_WS_EVENT_BOTH_FLAGS_KEPT10);
|
||||
_bgEvents.CancelEvent(BG_WS_EVENT_BOTH_FLAGS_KEPT15);
|
||||
@ -580,10 +580,10 @@ uint32 BattlegroundWS::GetAssaultSpellId() const
|
||||
{
|
||||
if ((!GetFlagPickerGUID(TEAM_ALLIANCE) && GetFlagState(TEAM_ALLIANCE) != BG_WS_FLAG_STATE_ON_GROUND) ||
|
||||
(!GetFlagPickerGUID(TEAM_HORDE) && GetFlagState(TEAM_HORDE) != BG_WS_FLAG_STATE_ON_GROUND) ||
|
||||
_bgEvents.GetNextEventTime(BG_WS_EVENT_BOTH_FLAGS_KEPT10) > 0)
|
||||
_bgEvents.HasTimeUntilEvent(BG_WS_EVENT_BOTH_FLAGS_KEPT10))
|
||||
return 0;
|
||||
|
||||
return _bgEvents.GetNextEventTime(BG_WS_EVENT_BOTH_FLAGS_KEPT15) > 0 ? BG_WS_SPELL_FOCUSED_ASSAULT : BG_WS_SPELL_BRUTAL_ASSAULT;
|
||||
return _bgEvents.HasTimeUntilEvent(BG_WS_EVENT_BOTH_FLAGS_KEPT15) ? BG_WS_SPELL_FOCUSED_ASSAULT : BG_WS_SPELL_BRUTAL_ASSAULT;
|
||||
}
|
||||
|
||||
void BattlegroundWS::RemoveAssaultAuras()
|
||||
|
||||
@ -39,12 +39,12 @@ enum BG_WS_TimerOrScore
|
||||
BG_WS_MAX_TEAM_SCORE = 3,
|
||||
|
||||
BG_WS_TOTAL_GAME_TIME = 27 * MINUTE * IN_MILLISECONDS,
|
||||
BG_WS_FLAG_RESPAWN_TIME = 23 * IN_MILLISECONDS,
|
||||
BG_WS_FLAG_DROP_TIME = 10 * IN_MILLISECONDS,
|
||||
BG_WS_SPELL_FORCE_TIME = 10 * MINUTE * IN_MILLISECONDS,
|
||||
BG_WS_SPELL_BRUTAL_TIME = 15 * MINUTE * IN_MILLISECONDS,
|
||||
BG_WS_DOOR_DESPAWN_TIME = 5 * IN_MILLISECONDS
|
||||
BG_WS_FLAG_RESPAWN_TIME = 23 * IN_MILLISECONDS
|
||||
};
|
||||
constexpr Milliseconds BG_WS_FLAG_DROP_TIME = 10s;
|
||||
constexpr Milliseconds BG_WS_SPELL_FORCE_TIME = 600s;
|
||||
constexpr Milliseconds BG_WS_SPELL_BRUTAL_TIME = 900s;
|
||||
constexpr Milliseconds BG_WS_DOOR_DESPAWN_TIME = 5s;
|
||||
|
||||
enum BG_WS_BroadcastTexts
|
||||
{
|
||||
|
||||
@ -121,7 +121,7 @@ void Corpse::DeleteFromDB(CharacterDatabaseTransaction trans)
|
||||
DeleteFromDB(GetOwnerGUID(), trans);
|
||||
}
|
||||
|
||||
void Corpse::DeleteFromDB(ObjectGuid const ownerGuid, CharacterDatabaseTransaction trans)
|
||||
void Corpse::DeleteFromDB(ObjectGuid const& ownerGuid, CharacterDatabaseTransaction trans)
|
||||
{
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE);
|
||||
stmt->SetData(0, ownerGuid.GetCounter());
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
bool LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields);
|
||||
|
||||
void DeleteFromDB(CharacterDatabaseTransaction trans);
|
||||
static void DeleteFromDB(ObjectGuid const ownerGuid, CharacterDatabaseTransaction trans);
|
||||
static void DeleteFromDB(ObjectGuid const& ownerGuid, CharacterDatabaseTransaction trans);
|
||||
|
||||
[[nodiscard]] ObjectGuid GetOwnerGUID() const { return GetGuidValue(CORPSE_FIELD_OWNER); }
|
||||
|
||||
|
||||
@ -251,7 +251,7 @@ CreatureBaseStats const* CreatureBaseStats::GetBaseStats(uint8 level, uint8 unit
|
||||
|
||||
bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
{
|
||||
m_owner.DespawnOrUnsummon(0s, m_respawnTimer); // since we are here, we are not TempSummon as object type cannot change during runtime
|
||||
m_owner.DespawnOrUnsummon(0ms, m_respawnTimer); // since we are here, we are not TempSummon as object type cannot change during runtime
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2174,12 +2174,12 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds forceRespawnTimer)
|
||||
// Xinef: Set new respawn time, ignore corpse decay time...
|
||||
RemoveCorpse(true);
|
||||
|
||||
if (forceRespawnTimer > Seconds::zero())
|
||||
if (forceRespawnTimer > 0s)
|
||||
if (GetMap())
|
||||
GetMap()->ScheduleCreatureRespawn(GetGUID(), forceRespawnTimer);
|
||||
}
|
||||
|
||||
void Creature::DespawnOrUnsummon(Milliseconds msTimeToDespawn /*= 0*/, Seconds forcedRespawnTimer)
|
||||
void Creature::DespawnOrUnsummon(Milliseconds msTimeToDespawn /*= 0ms*/, Seconds forcedRespawnTimer /*= 0s*/)
|
||||
{
|
||||
if (TempSummon* summon = this->ToTempSummon())
|
||||
summon->UnSummon(msTimeToDespawn.count());
|
||||
@ -2204,7 +2204,7 @@ void Creature::DespawnOnEvade(Seconds respawnDelay)
|
||||
return;
|
||||
}
|
||||
|
||||
DespawnOrUnsummon(Milliseconds(0), respawnDelay);
|
||||
DespawnOrUnsummon(0ms, respawnDelay);
|
||||
}
|
||||
|
||||
void Creature::InitializeReactState()
|
||||
@ -3713,6 +3713,33 @@ bool Creature::CanGeneratePickPocketLoot() const
|
||||
return (lootPickPocketRestoreTime == 0 || lootPickPocketRestoreTime < GameTime::GetGameTime().count());
|
||||
}
|
||||
|
||||
void Creature::SetTextRepeatId(uint8 textGroup, uint8 id)
|
||||
{
|
||||
CreatureTextRepeatIds& repeats = m_textRepeat[textGroup];
|
||||
if (std::find(repeats.begin(), repeats.end(), id) == repeats.end())
|
||||
repeats.push_back(id);
|
||||
else
|
||||
LOG_ERROR("sql.sql", "CreatureTextMgr: TextGroup {} for Creature({}) {}, id {} already added", uint32(textGroup), GetName(), GetGUID().ToString(), uint32(id));
|
||||
}
|
||||
|
||||
CreatureTextRepeatIds const& Creature::GetTextRepeatGroup(uint8 textGroup)
|
||||
{
|
||||
static CreatureTextRepeatIds const emptyIds;
|
||||
|
||||
CreatureTextRepeatGroup::const_iterator groupItr = m_textRepeat.find(textGroup);
|
||||
if (groupItr != m_textRepeat.end())
|
||||
return groupItr->second;
|
||||
|
||||
return emptyIds;
|
||||
}
|
||||
|
||||
void Creature::ClearTextRepeatGroup(uint8 textGroup)
|
||||
{
|
||||
CreatureTextRepeatGroup::iterator groupItr = m_textRepeat.find(textGroup);
|
||||
if (groupItr != m_textRepeat.end())
|
||||
groupItr->second.clear();
|
||||
}
|
||||
|
||||
void Creature::SetRespawnTime(uint32 respawn)
|
||||
{
|
||||
m_respawnTime = respawn ? GameTime::GetGameTime().count() + respawn : 0;
|
||||
|
||||
@ -39,6 +39,10 @@ class CreatureGroup;
|
||||
|
||||
#define MAX_VENDOR_ITEMS 150 // Limitation in 3.x.x item count in SMSG_LIST_INVENTORY
|
||||
|
||||
//used for handling non-repeatable random texts
|
||||
typedef std::vector<uint8> CreatureTextRepeatIds;
|
||||
typedef std::unordered_map<uint8, CreatureTextRepeatIds> CreatureTextRepeatGroup;
|
||||
|
||||
class Creature : public Unit, public GridObject<Creature>, public MovableMapObject, public UpdatableMapObject
|
||||
{
|
||||
public:
|
||||
@ -279,8 +283,7 @@ public:
|
||||
|
||||
void RemoveCorpse(bool setSpawnTime = true, bool skipVisibility = false);
|
||||
|
||||
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer);
|
||||
void DespawnOrUnsummon(uint32 msTimeToDespawn = 0) { DespawnOrUnsummon(Milliseconds(msTimeToDespawn), 0s); };
|
||||
void DespawnOrUnsummon(Milliseconds msTimeToDespawn = 0ms, Seconds forcedRespawnTimer = 0s);
|
||||
void DespawnOnEvade(Seconds respawnDelay = 20s);
|
||||
|
||||
[[nodiscard]] time_t const& GetRespawnTime() const { return m_respawnTime; }
|
||||
@ -388,6 +391,10 @@ public:
|
||||
void UpdateLeashExtensionTime();
|
||||
uint8 GetLeashTimer() const;
|
||||
|
||||
CreatureTextRepeatIds const& GetTextRepeatGroup(uint8 textGroup);
|
||||
void SetTextRepeatId(uint8 textGroup, uint8 id);
|
||||
void ClearTextRepeatGroup(uint8 textGroup);
|
||||
|
||||
bool IsFreeToMove();
|
||||
static constexpr uint32 MOVE_CIRCLE_CHECK_INTERVAL = 3000;
|
||||
static constexpr uint32 MOVE_BACKWARDS_CHECK_INTERVAL = 2000;
|
||||
@ -519,6 +526,8 @@ private:
|
||||
|
||||
Spell const* _focusSpell; ///> Locks the target during spell cast for proper facing
|
||||
|
||||
CreatureTextRepeatGroup m_textRepeat;
|
||||
|
||||
bool _isMissingSwimmingFlagOutOfCombat;
|
||||
|
||||
uint32 m_assistanceTimer;
|
||||
|
||||
@ -929,7 +929,7 @@ void GameObject::AddUniqueUse(Player* player)
|
||||
m_unique_users.insert(player->GetGUID());
|
||||
}
|
||||
|
||||
void GameObject::DespawnOrUnsummon(Milliseconds delay, Seconds forceRespawnTime)
|
||||
void GameObject::DespawnOrUnsummon(Milliseconds delay /*= 0ms*/, Seconds forceRespawnTime /*= 0s*/)
|
||||
{
|
||||
if (delay > 0ms)
|
||||
{
|
||||
@ -3051,13 +3051,13 @@ SpellInfo const* GameObject::GetSpellForLock(Player const* player) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void GameObject::AddToSkillupList(ObjectGuid playerGuid)
|
||||
void GameObject::AddToSkillupList(ObjectGuid const& playerGuid)
|
||||
{
|
||||
int32 timer = GetMap()->IsDungeon() ? -1 : 10 * MINUTE * IN_MILLISECONDS;
|
||||
m_SkillupList[playerGuid] = timer;
|
||||
}
|
||||
|
||||
bool GameObject::IsInSkillupList(ObjectGuid playerGuid) const
|
||||
bool GameObject::IsInSkillupList(ObjectGuid const& playerGuid) const
|
||||
{
|
||||
for (auto const& itr : m_SkillupList)
|
||||
{
|
||||
|
||||
@ -231,8 +231,8 @@ public:
|
||||
void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }
|
||||
void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; }
|
||||
|
||||
void AddToSkillupList(ObjectGuid playerGuid);
|
||||
[[nodiscard]] bool IsInSkillupList(ObjectGuid playerGuid) const;
|
||||
void AddToSkillupList(ObjectGuid const& playerGuid);
|
||||
[[nodiscard]] bool IsInSkillupList(ObjectGuid const& playerGuid) const;
|
||||
|
||||
void AddUniqueUse(Player* player);
|
||||
void AddUse() { ++m_usetimes; }
|
||||
|
||||
@ -269,7 +269,7 @@ class PackedGuid
|
||||
explicit PackedGuid(ObjectGuid guid) : _packedGuid(PACKED_GUID_MIN_BUFFER_SIZE) { _packedGuid.appendPackGUID(guid.GetRawValue()); }
|
||||
|
||||
void Set(uint64 guid) { _packedGuid.wpos(0); _packedGuid.appendPackGUID(guid); }
|
||||
void Set(ObjectGuid guid) { _packedGuid.wpos(0); _packedGuid.appendPackGUID(guid.GetRawValue()); }
|
||||
void Set(ObjectGuid const& guid) { _packedGuid.wpos(0); _packedGuid.appendPackGUID(guid.GetRawValue()); }
|
||||
|
||||
[[nodiscard]] std::size_t size() const { return _packedGuid.size(); }
|
||||
|
||||
|
||||
@ -692,7 +692,7 @@ void Pet::Update(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_duration > 0s)
|
||||
if (m_duration > 0ms)
|
||||
{
|
||||
if (m_duration > _diff)
|
||||
m_duration -= _diff;
|
||||
@ -708,7 +708,7 @@ void Pet::Update(uint32 diff)
|
||||
if (getPowerType() == POWER_FOCUS)
|
||||
{
|
||||
m_petRegenTimer -= _diff;
|
||||
if (m_petRegenTimer <= 0s)
|
||||
if (m_petRegenTimer <= 0ms)
|
||||
{
|
||||
m_petRegenTimer += PET_FOCUS_REGEN_INTERVAL;
|
||||
Regenerate(POWER_FOCUS);
|
||||
@ -1026,7 +1026,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
Unit* owner = GetOwner();
|
||||
if (!owner) // just to be sure, asynchronous now
|
||||
{
|
||||
DespawnOrUnsummon(1000);
|
||||
DespawnOrUnsummon(1s);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ public:
|
||||
PetType getPetType() const { return m_petType; }
|
||||
void setPetType(PetType type) { m_petType = type; }
|
||||
bool isControlled() const { return getPetType() == SUMMON_PET || getPetType() == HUNTER_PET; }
|
||||
bool isTemporarySummoned() const { return m_duration > 0s; }
|
||||
bool isTemporarySummoned() const { return m_duration > 0ms; }
|
||||
|
||||
bool IsPermanentPetFor(Player* owner) const; // pet have tab in character windows and set UNIT_FIELD_PETNUMBER
|
||||
|
||||
|
||||
@ -2088,7 +2088,7 @@ bool Player::CanInteractWithQuestGiver(Object* questGiver)
|
||||
return false;
|
||||
}
|
||||
|
||||
Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
|
||||
Creature* Player::GetNPCIfCanInteractWith(ObjectGuid const& guid, uint32 npcflagmask)
|
||||
{
|
||||
// unit checks
|
||||
if (!guid)
|
||||
@ -2145,7 +2145,7 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
|
||||
return creature;
|
||||
}
|
||||
|
||||
GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, GameobjectTypes type) const
|
||||
GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid const& guid, GameobjectTypes type) const
|
||||
{
|
||||
if (GameObject* go = GetMap()->GetGameObject(guid))
|
||||
{
|
||||
@ -4616,7 +4616,7 @@ void Player::KillPlayer()
|
||||
//UpdateObjectVisibility(); // pussywizard: not needed
|
||||
}
|
||||
|
||||
void Player::OfflineResurrect(ObjectGuid const guid, CharacterDatabaseTransaction trans)
|
||||
void Player::OfflineResurrect(ObjectGuid const& guid, CharacterDatabaseTransaction trans)
|
||||
{
|
||||
Corpse::DeleteFromDB(guid, trans);
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||
@ -9014,7 +9014,7 @@ Pet* Player::GetPet() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration /*= 0s*/, uint32 healthPct /*= 0*/)
|
||||
Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration /*= 0ms*/, uint32 healthPct /*= 0*/)
|
||||
{
|
||||
PetStable& petStable = GetOrInitPetStable();
|
||||
|
||||
@ -9035,7 +9035,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
++itr;
|
||||
}
|
||||
|
||||
if (duration > 0s)
|
||||
if (duration > 0ms)
|
||||
pet->SetDuration(duration);
|
||||
|
||||
// Generate a new name for the newly summoned ghoul
|
||||
@ -9129,7 +9129,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
}
|
||||
}
|
||||
|
||||
if (duration > 0s)
|
||||
if (duration > 0ms)
|
||||
pet->SetDuration(duration);
|
||||
|
||||
if (NeedSendSpectatorData() && pet->GetCreatureTemplate()->family)
|
||||
|
||||
@ -1128,8 +1128,8 @@ public:
|
||||
void SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint32 time, bool onEnterMap);
|
||||
|
||||
bool CanInteractWithQuestGiver(Object* questGiver);
|
||||
Creature* GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask);
|
||||
[[nodiscard]] GameObject* GetGameObjectIfCanInteractWith(ObjectGuid guid, GameobjectTypes type) const;
|
||||
Creature* GetNPCIfCanInteractWith(ObjectGuid const& guid, uint32 npcflagmask);
|
||||
[[nodiscard]] GameObject* GetGameObjectIfCanInteractWith(ObjectGuid const& guid, GameobjectTypes type) const;
|
||||
|
||||
void ToggleAFK();
|
||||
void ToggleDND();
|
||||
@ -1210,7 +1210,7 @@ public:
|
||||
[[nodiscard]] PetStable const* GetPetStable() const { return m_petStable.get(); }
|
||||
|
||||
[[nodiscard]] Pet* GetPet() const;
|
||||
Pet* SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration = 0s, uint32 healthPct = 0);
|
||||
Pet* SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration = 0ms, uint32 healthPct = 0);
|
||||
void RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent = false);
|
||||
bool CanPetResurrect();
|
||||
bool IsExistPet();
|
||||
@ -2033,7 +2033,7 @@ public:
|
||||
Corpse* CreateCorpse();
|
||||
void RemoveCorpse();
|
||||
void KillPlayer();
|
||||
static void OfflineResurrect(ObjectGuid const guid, CharacterDatabaseTransaction trans);
|
||||
static void OfflineResurrect(ObjectGuid const& guid, CharacterDatabaseTransaction trans);
|
||||
[[nodiscard]] bool HasCorpse() const { return _corpseLocation.GetMapId() != MAPID_INVALID; }
|
||||
[[nodiscard]] WorldLocation GetCorpseLocation() const { return _corpseLocation; }
|
||||
uint32 GetResurrectionSpellId();
|
||||
|
||||
@ -37,7 +37,7 @@ uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag) const
|
||||
return counter;
|
||||
}
|
||||
|
||||
bool PlayerSocial::AddToSocialList(ObjectGuid friendGuid, SocialFlag flag)
|
||||
bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, SocialFlag flag)
|
||||
{
|
||||
// check client limits
|
||||
if (GetNumberOfSocialsWithFlag(flag) >= (((flag & SOCIAL_FLAG_FRIEND) != 0) ? SOCIALMGR_FRIEND_LIMIT : SOCIALMGR_IGNORE_LIMIT))
|
||||
@ -71,7 +71,7 @@ bool PlayerSocial::AddToSocialList(ObjectGuid friendGuid, SocialFlag flag)
|
||||
return true;
|
||||
}
|
||||
|
||||
void PlayerSocial::RemoveFromSocialList(ObjectGuid friendGuid, SocialFlag flag)
|
||||
void PlayerSocial::RemoveFromSocialList(ObjectGuid const& friendGuid, SocialFlag flag)
|
||||
{
|
||||
auto itr = m_playerSocialMap.find(friendGuid);
|
||||
if (itr == m_playerSocialMap.end()) // not exist
|
||||
@ -102,7 +102,7 @@ void PlayerSocial::RemoveFromSocialList(ObjectGuid friendGuid, SocialFlag flag)
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerSocial::SetFriendNote(ObjectGuid friendGuid, std::string note)
|
||||
void PlayerSocial::SetFriendNote(ObjectGuid const& friendGuid, std::string note)
|
||||
{
|
||||
auto itr = m_playerSocialMap.find(friendGuid);
|
||||
if (itr == m_playerSocialMap.end()) // not exist
|
||||
@ -176,7 +176,7 @@ void PlayerSocial::SendSocialList(Player* player, uint32 flags)
|
||||
LOG_DEBUG("network", "WORLD: Sent SMSG_CONTACT_LIST");
|
||||
}
|
||||
|
||||
bool PlayerSocial::_checkContact(ObjectGuid guid, SocialFlag flags) const
|
||||
bool PlayerSocial::_checkContact(ObjectGuid const& guid, SocialFlag flags) const
|
||||
{
|
||||
auto const& itr = m_playerSocialMap.find(guid);
|
||||
if (itr != m_playerSocialMap.end())
|
||||
@ -185,12 +185,12 @@ bool PlayerSocial::_checkContact(ObjectGuid guid, SocialFlag flags) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PlayerSocial::HasFriend(ObjectGuid friend_guid) const
|
||||
bool PlayerSocial::HasFriend(ObjectGuid const& friend_guid) const
|
||||
{
|
||||
return _checkContact(friend_guid, SOCIAL_FLAG_FRIEND);
|
||||
}
|
||||
|
||||
bool PlayerSocial::HasIgnore(ObjectGuid ignore_guid) const
|
||||
bool PlayerSocial::HasIgnore(ObjectGuid const& ignore_guid) const
|
||||
{
|
||||
return _checkContact(ignore_guid, SOCIAL_FLAG_IGNORED);
|
||||
}
|
||||
@ -209,7 +209,7 @@ SocialMgr* SocialMgr::instance()
|
||||
return &instance;
|
||||
}
|
||||
|
||||
void SocialMgr::GetFriendInfo(Player* player, ObjectGuid friendGUID, FriendInfo& friendInfo)
|
||||
void SocialMgr::GetFriendInfo(Player* player, ObjectGuid const& friendGUID, FriendInfo& friendInfo)
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
@ -247,14 +247,14 @@ void SocialMgr::GetFriendInfo(Player* player, ObjectGuid friendGUID, FriendInfo&
|
||||
}
|
||||
}
|
||||
|
||||
void SocialMgr::MakeFriendStatusPacket(FriendsResult result, ObjectGuid guid, WorldPacket* data)
|
||||
void SocialMgr::MakeFriendStatusPacket(FriendsResult result, ObjectGuid const& guid, WorldPacket* data)
|
||||
{
|
||||
data->Initialize(SMSG_FRIEND_STATUS, 9);
|
||||
*data << uint8(result);
|
||||
*data << guid;
|
||||
}
|
||||
|
||||
void SocialMgr::SendFriendStatus(Player* player, FriendsResult result, ObjectGuid friendGuid, bool broadcast)
|
||||
void SocialMgr::SendFriendStatus(Player* player, FriendsResult result, ObjectGuid const& friendGuid, bool broadcast)
|
||||
{
|
||||
FriendInfo fi;
|
||||
GetFriendInfo(player, friendGuid, fi);
|
||||
@ -316,7 +316,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
|
||||
}
|
||||
}
|
||||
|
||||
PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, ObjectGuid guid)
|
||||
PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, ObjectGuid const& guid)
|
||||
{
|
||||
PlayerSocial* social = &m_socialMap[guid];
|
||||
social->SetPlayerGUID(guid);
|
||||
|
||||
@ -104,19 +104,19 @@ class PlayerSocial
|
||||
public:
|
||||
PlayerSocial();
|
||||
// adding/removing
|
||||
bool AddToSocialList(ObjectGuid friend_guid, SocialFlag flag);
|
||||
void RemoveFromSocialList(ObjectGuid friend_guid, SocialFlag flag);
|
||||
void SetFriendNote(ObjectGuid friendGuid, std::string note);
|
||||
bool AddToSocialList(ObjectGuid const& friend_guid, SocialFlag flag);
|
||||
void RemoveFromSocialList(ObjectGuid const& friend_guid, SocialFlag flag);
|
||||
void SetFriendNote(ObjectGuid const& friendGuid, std::string note);
|
||||
// Packet send's
|
||||
void SendSocialList(Player* player, uint32 flags);
|
||||
// Misc
|
||||
bool HasFriend(ObjectGuid friend_guid) const;
|
||||
bool HasIgnore(ObjectGuid ignore_guid) const;
|
||||
ObjectGuid GetPlayerGUID() const { return m_playerGUID; }
|
||||
void SetPlayerGUID(ObjectGuid guid) { m_playerGUID = guid; }
|
||||
bool HasFriend(ObjectGuid const& friend_guid) const;
|
||||
bool HasIgnore(ObjectGuid const& ignore_guid) const;
|
||||
ObjectGuid const& GetPlayerGUID() const { return m_playerGUID; }
|
||||
void SetPlayerGUID(ObjectGuid const& guid) { m_playerGUID = guid; }
|
||||
uint32 GetNumberOfSocialsWithFlag(SocialFlag flag) const;
|
||||
private:
|
||||
bool _checkContact(ObjectGuid guid, SocialFlag flags) const;
|
||||
bool _checkContact(ObjectGuid const& guid, SocialFlag flags) const;
|
||||
typedef std::map<ObjectGuid, FriendInfo> PlayerSocialMap;
|
||||
PlayerSocialMap m_playerSocialMap;
|
||||
ObjectGuid m_playerGUID;
|
||||
@ -131,14 +131,14 @@ class SocialMgr
|
||||
public:
|
||||
static SocialMgr* instance();
|
||||
// Misc
|
||||
void RemovePlayerSocial(ObjectGuid guid) { m_socialMap.erase(guid); }
|
||||
static void GetFriendInfo(Player* player, ObjectGuid friendGUID, FriendInfo& friendInfo);
|
||||
void RemovePlayerSocial(ObjectGuid const& guid) { m_socialMap.erase(guid); }
|
||||
static void GetFriendInfo(Player* player, ObjectGuid const& friendGUID, FriendInfo& friendInfo);
|
||||
// Packet management
|
||||
void MakeFriendStatusPacket(FriendsResult result, ObjectGuid friend_guid, WorldPacket* data);
|
||||
void SendFriendStatus(Player* player, FriendsResult result, ObjectGuid friend_guid, bool broadcast);
|
||||
void MakeFriendStatusPacket(FriendsResult result, ObjectGuid const& friend_guid, WorldPacket* data);
|
||||
void SendFriendStatus(Player* player, FriendsResult result, ObjectGuid const& friend_guid, bool broadcast);
|
||||
void BroadcastToFriendListers(Player* player, WorldPacket* packet);
|
||||
// Loading
|
||||
PlayerSocial* LoadFromDB(PreparedQueryResult result, ObjectGuid guid);
|
||||
PlayerSocial* LoadFromDB(PreparedQueryResult result, ObjectGuid const& guid);
|
||||
private:
|
||||
typedef std::map<ObjectGuid, PlayerSocial> SocialMap;
|
||||
SocialMap m_socialMap;
|
||||
|
||||
@ -19681,7 +19681,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
|
||||
else if (vehicleBase->IsCreature())
|
||||
{
|
||||
vehicle->Uninstall();
|
||||
vehicleBase->m_Events.AddEvent(new VehicleDespawnEvent(*vehicleBase, 2000), vehicleBase->m_Events.CalculateTime(2000));
|
||||
vehicleBase->m_Events.AddEventAtOffset(new VehicleDespawnEvent(*vehicleBase, 2s), 2s);
|
||||
}
|
||||
|
||||
// xinef: ugly hack, no appripriate hook later to cast spell
|
||||
|
||||
@ -100,12 +100,12 @@ private:
|
||||
class VehicleDespawnEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
VehicleDespawnEvent(Unit& self, uint32 duration) : _self(self), _duration(duration) { }
|
||||
VehicleDespawnEvent(Unit& self, Milliseconds duration) : _self(self), _duration(duration) { }
|
||||
bool Execute(uint64 e_time, uint32 p_time) override;
|
||||
|
||||
protected:
|
||||
Unit& _self;
|
||||
uint32 _duration;
|
||||
Milliseconds _duration;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -112,7 +112,7 @@ namespace PlayerNameMapHolder
|
||||
|
||||
} // namespace PlayerNameMapHolder
|
||||
|
||||
WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, ObjectGuid const guid)
|
||||
WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, ObjectGuid const& guid)
|
||||
{
|
||||
switch (guid.GetHigh())
|
||||
{
|
||||
@ -138,7 +138,7 @@ WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, ObjectGuid con
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, ObjectGuid const guid, uint32 typemask)
|
||||
Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, ObjectGuid const& guid, uint32 typemask)
|
||||
{
|
||||
switch (guid.GetHigh())
|
||||
{
|
||||
@ -176,27 +176,27 @@ Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, ObjectGuid con
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Corpse* ObjectAccessor::GetCorpse(WorldObject const& u, ObjectGuid const guid)
|
||||
Corpse* ObjectAccessor::GetCorpse(WorldObject const& u, ObjectGuid const& guid)
|
||||
{
|
||||
return u.GetMap()->GetCorpse(guid);
|
||||
}
|
||||
|
||||
GameObject* ObjectAccessor::GetGameObject(WorldObject const& u, ObjectGuid const guid)
|
||||
GameObject* ObjectAccessor::GetGameObject(WorldObject const& u, ObjectGuid const& guid)
|
||||
{
|
||||
return u.GetMap()->GetGameObject(guid);
|
||||
}
|
||||
|
||||
Transport* ObjectAccessor::GetTransport(WorldObject const& u, ObjectGuid const guid)
|
||||
Transport* ObjectAccessor::GetTransport(WorldObject const& u, ObjectGuid const& guid)
|
||||
{
|
||||
return u.GetMap()->GetTransport(guid);
|
||||
}
|
||||
|
||||
DynamicObject* ObjectAccessor::GetDynamicObject(WorldObject const& u, ObjectGuid const guid)
|
||||
DynamicObject* ObjectAccessor::GetDynamicObject(WorldObject const& u, ObjectGuid const& guid)
|
||||
{
|
||||
return u.GetMap()->GetDynamicObject(guid);
|
||||
}
|
||||
|
||||
Unit* ObjectAccessor::GetUnit(WorldObject const& u, ObjectGuid const guid)
|
||||
Unit* ObjectAccessor::GetUnit(WorldObject const& u, ObjectGuid const& guid)
|
||||
{
|
||||
if (guid.IsPlayer())
|
||||
return GetPlayer(u, guid);
|
||||
@ -207,17 +207,17 @@ Unit* ObjectAccessor::GetUnit(WorldObject const& u, ObjectGuid const guid)
|
||||
return GetCreature(u, guid);
|
||||
}
|
||||
|
||||
Creature* ObjectAccessor::GetCreature(WorldObject const& u, ObjectGuid const guid)
|
||||
Creature* ObjectAccessor::GetCreature(WorldObject const& u, ObjectGuid const& guid)
|
||||
{
|
||||
return u.GetMap()->GetCreature(guid);
|
||||
}
|
||||
|
||||
Pet* ObjectAccessor::GetPet(WorldObject const& u, ObjectGuid const guid)
|
||||
Pet* ObjectAccessor::GetPet(WorldObject const& u, ObjectGuid const& guid)
|
||||
{
|
||||
return u.GetMap()->GetPet(guid);
|
||||
}
|
||||
|
||||
Player* ObjectAccessor::GetPlayer(Map const* m, ObjectGuid const guid)
|
||||
Player* ObjectAccessor::GetPlayer(Map const* m, ObjectGuid const& guid)
|
||||
{
|
||||
if (Player * player = HashMapHolder<Player>::Find(guid))
|
||||
if (player->IsInWorld() && player->GetMap() == m)
|
||||
@ -226,12 +226,12 @@ Player* ObjectAccessor::GetPlayer(Map const* m, ObjectGuid const guid)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Player* ObjectAccessor::GetPlayer(WorldObject const& u, ObjectGuid const guid)
|
||||
Player* ObjectAccessor::GetPlayer(WorldObject const& u, ObjectGuid const& guid)
|
||||
{
|
||||
return GetPlayer(u.GetMap(), guid);
|
||||
}
|
||||
|
||||
Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const& u, ObjectGuid const guid)
|
||||
Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const& u, ObjectGuid const& guid)
|
||||
{
|
||||
if (guid.IsPet())
|
||||
return GetPet(u, guid);
|
||||
|
||||
@ -60,18 +60,18 @@ public:
|
||||
namespace ObjectAccessor
|
||||
{
|
||||
// these functions return objects only if in map of specified object
|
||||
WorldObject* GetWorldObject(WorldObject const&, ObjectGuid const guid);
|
||||
Object* GetObjectByTypeMask(WorldObject const&, ObjectGuid const guid, uint32 typemask);
|
||||
Corpse* GetCorpse(WorldObject const& u, ObjectGuid const guid);
|
||||
GameObject* GetGameObject(WorldObject const& u, ObjectGuid const guid);
|
||||
Transport* GetTransport(WorldObject const& u, ObjectGuid const guid);
|
||||
DynamicObject* GetDynamicObject(WorldObject const& u, ObjectGuid const guid);
|
||||
Unit* GetUnit(WorldObject const&, ObjectGuid const guid);
|
||||
Creature* GetCreature(WorldObject const& u, ObjectGuid const guid);
|
||||
Pet* GetPet(WorldObject const&, ObjectGuid const guid);
|
||||
Player* GetPlayer(Map const*, ObjectGuid const guid);
|
||||
Player* GetPlayer(WorldObject const&, ObjectGuid const guid);
|
||||
Creature* GetCreatureOrPetOrVehicle(WorldObject const&, ObjectGuid const);
|
||||
WorldObject* GetWorldObject(WorldObject const&, ObjectGuid const& guid);
|
||||
Object* GetObjectByTypeMask(WorldObject const&, ObjectGuid const& guid, uint32 typemask);
|
||||
Corpse* GetCorpse(WorldObject const& u, ObjectGuid const& guid);
|
||||
GameObject* GetGameObject(WorldObject const& u, ObjectGuid const& guid);
|
||||
Transport* GetTransport(WorldObject const& u, ObjectGuid const& guid);
|
||||
DynamicObject* GetDynamicObject(WorldObject const& u, ObjectGuid const& guid);
|
||||
Unit* GetUnit(WorldObject const&, ObjectGuid const& guid);
|
||||
Creature* GetCreature(WorldObject const& u, ObjectGuid const& guid);
|
||||
Pet* GetPet(WorldObject const&, ObjectGuid const& guid);
|
||||
Player* GetPlayer(Map const*, ObjectGuid const& guid);
|
||||
Player* GetPlayer(WorldObject const&, ObjectGuid const& guid);
|
||||
Creature* GetCreatureOrPetOrVehicle(WorldObject const&, ObjectGuid const&);
|
||||
|
||||
// these functions return objects if found in whole world
|
||||
// ACCESS LIKE THAT IS NOT THREAD SAFE
|
||||
|
||||
@ -2362,27 +2362,27 @@ void BattlegroundMap::RemoveAllPlayers()
|
||||
player->TeleportTo(player->GetEntryPoint());
|
||||
}
|
||||
|
||||
Corpse* Map::GetCorpse(ObjectGuid const guid)
|
||||
Corpse* Map::GetCorpse(ObjectGuid const& guid)
|
||||
{
|
||||
return _objectsStore.Find<Corpse>(guid);
|
||||
}
|
||||
|
||||
Creature* Map::GetCreature(ObjectGuid const guid)
|
||||
Creature* Map::GetCreature(ObjectGuid const& guid)
|
||||
{
|
||||
return _objectsStore.Find<Creature>(guid);
|
||||
}
|
||||
|
||||
GameObject* Map::GetGameObject(ObjectGuid const guid)
|
||||
GameObject* Map::GetGameObject(ObjectGuid const& guid)
|
||||
{
|
||||
return _objectsStore.Find<GameObject>(guid);
|
||||
}
|
||||
|
||||
Pet* Map::GetPet(ObjectGuid const guid)
|
||||
Pet* Map::GetPet(ObjectGuid const& guid)
|
||||
{
|
||||
return dynamic_cast<Pet*>(_objectsStore.Find<Creature>(guid));
|
||||
}
|
||||
|
||||
Transport* Map::GetTransport(ObjectGuid guid)
|
||||
Transport* Map::GetTransport(ObjectGuid const& guid)
|
||||
{
|
||||
if (guid.GetHigh() != HighGuid::Mo_Transport && guid.GetHigh() != HighGuid::Transport)
|
||||
return nullptr;
|
||||
@ -2391,7 +2391,7 @@ Transport* Map::GetTransport(ObjectGuid guid)
|
||||
return go ? go->ToTransport() : nullptr;
|
||||
}
|
||||
|
||||
DynamicObject* Map::GetDynamicObject(ObjectGuid guid)
|
||||
DynamicObject* Map::GetDynamicObject(ObjectGuid const& guid)
|
||||
{
|
||||
return _objectsStore.Find<DynamicObject>(guid);
|
||||
}
|
||||
@ -2683,7 +2683,7 @@ void Map::RemoveCorpse(Corpse* corpse)
|
||||
_corpseBones.erase(corpse);
|
||||
}
|
||||
|
||||
Corpse* Map::ConvertCorpseToBones(ObjectGuid const ownerGuid, bool insignia /*= false*/)
|
||||
Corpse* Map::ConvertCorpseToBones(ObjectGuid const& ownerGuid, bool insignia /*= false*/)
|
||||
{
|
||||
Corpse* corpse = GetCorpseByPlayer(ownerGuid);
|
||||
if (!corpse)
|
||||
|
||||
@ -338,12 +338,12 @@ public:
|
||||
GameObject* SummonGameObject(uint32 entry, Position const& pos, float rotation0 = 0.0f, float rotation1 = 0.0f, float rotation2 = 0.0f, float rotation3 = 0.0f, uint32 respawnTime = 100, bool checkTransport = true);
|
||||
void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = nullptr);
|
||||
|
||||
Corpse* GetCorpse(ObjectGuid const guid);
|
||||
Creature* GetCreature(ObjectGuid const guid);
|
||||
GameObject* GetGameObject(ObjectGuid const guid);
|
||||
Transport* GetTransport(ObjectGuid const guid);
|
||||
DynamicObject* GetDynamicObject(ObjectGuid const guid);
|
||||
Pet* GetPet(ObjectGuid const guid);
|
||||
Corpse* GetCorpse(ObjectGuid const& guid);
|
||||
Creature* GetCreature(ObjectGuid const& guid);
|
||||
GameObject* GetGameObject(ObjectGuid const& guid);
|
||||
Transport* GetTransport(ObjectGuid const& guid);
|
||||
DynamicObject* GetDynamicObject(ObjectGuid const& guid);
|
||||
Pet* GetPet(ObjectGuid const& guid);
|
||||
|
||||
MapStoredObjectTypesContainer& GetObjectsStore() { return _objectsStore; }
|
||||
|
||||
@ -438,7 +438,7 @@ public:
|
||||
void DeleteCorpseData();
|
||||
void AddCorpse(Corpse* corpse);
|
||||
void RemoveCorpse(Corpse* corpse);
|
||||
Corpse* ConvertCorpseToBones(ObjectGuid const ownerGuid, bool insignia = false);
|
||||
Corpse* ConvertCorpseToBones(ObjectGuid const& ownerGuid, bool insignia = false);
|
||||
void RemoveOldCorpses();
|
||||
|
||||
static void DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId);
|
||||
|
||||
@ -757,7 +757,7 @@ void Map::ScriptsProcess()
|
||||
case SCRIPT_COMMAND_DESPAWN_SELF:
|
||||
// Target or source must be Creature.
|
||||
if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script, true))
|
||||
cSource->DespawnOrUnsummon(step.script->DespawnSelf.DespawnDelay);
|
||||
cSource->DespawnOrUnsummon(Milliseconds(step.script->DespawnSelf.DespawnDelay));
|
||||
break;
|
||||
|
||||
case SCRIPT_COMMAND_LOAD_PATH:
|
||||
|
||||
@ -5213,7 +5213,7 @@ void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
// Position passed to SummonPet is irrelevant with current implementation,
|
||||
// pet will be relocated without using these coords in Pet::LoadPetFromDB
|
||||
player->SummonPet(0, 0.0f, 0.0f, 0.0f, 0.0f, SUMMON_PET, 0s, damage);
|
||||
player->SummonPet(0, 0.0f, 0.0f, 0.0f, 0.0f, SUMMON_PET, 0ms, damage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ void CreatureTextMgr::LoadCreatureTexts()
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
mTextMap.clear(); // for reload case
|
||||
mTextRepeatMap.clear(); //reset all currently used temp texts
|
||||
//all currently used temp texts are NOT reset
|
||||
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEXT);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
@ -218,7 +218,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject
|
||||
}
|
||||
|
||||
CreatureTextGroup const& textGroupContainer = itr->second; //has all texts in the group
|
||||
CreatureTextRepeatIds repeatGroup = GetRepeatGroup(source, textGroup);//has all textIDs from the group that were already said
|
||||
CreatureTextRepeatIds repeatGroup = source->GetTextRepeatGroup(textGroup);//has all textIDs from the group that were already said
|
||||
CreatureTextGroup tempGroup;//will use this to talk after sorting repeatGroup
|
||||
|
||||
for (CreatureTextGroup::const_iterator giter = textGroupContainer.begin(); giter != textGroupContainer.end(); ++giter)
|
||||
@ -227,52 +227,14 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject
|
||||
|
||||
if (tempGroup.empty())
|
||||
{
|
||||
CreatureTextRepeatMap::iterator mapItr = mTextRepeatMap.find(source->GetGUID());
|
||||
if (mapItr != mTextRepeatMap.end())
|
||||
{
|
||||
CreatureTextRepeatGroup::iterator groupItr = mapItr->second.find(textGroup);
|
||||
groupItr->second.clear();
|
||||
}
|
||||
|
||||
source->ClearTextRepeatGroup(textGroup);
|
||||
tempGroup = textGroupContainer;
|
||||
}
|
||||
|
||||
uint8 count = 0;
|
||||
float lastChance = -1;
|
||||
bool isEqualChanced = true;
|
||||
|
||||
float totalChance = 0;
|
||||
|
||||
for (CreatureTextGroup::const_iterator iter = tempGroup.begin(); iter != tempGroup.end(); ++iter)
|
||||
auto iter = Acore::Containers::SelectRandomWeightedContainerElement(tempGroup, [](CreatureTextEntry const& t) -> double
|
||||
{
|
||||
if (lastChance >= 0 && lastChance != iter->probability)
|
||||
isEqualChanced = false;
|
||||
|
||||
lastChance = iter->probability;
|
||||
totalChance += iter->probability;
|
||||
++count;
|
||||
}
|
||||
|
||||
int32 offset = -1;
|
||||
if (!isEqualChanced)
|
||||
{
|
||||
for (CreatureTextGroup::const_iterator iter = tempGroup.begin(); iter != tempGroup.end(); ++iter)
|
||||
{
|
||||
uint32 chance = uint32(iter->probability);
|
||||
uint32 r = urand(0, 100);
|
||||
++offset;
|
||||
if (r <= chance)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 pos = 0;
|
||||
if (isEqualChanced || offset < 0)
|
||||
pos = urand(0, count - 1);
|
||||
else if (offset >= 0)
|
||||
pos = offset;
|
||||
|
||||
CreatureTextGroup::const_iterator iter = tempGroup.begin() + pos;
|
||||
return t.probability;
|
||||
});
|
||||
|
||||
ChatMsg finalType = (msgType == CHAT_MSG_ADDON) ? iter->type : msgType;
|
||||
Language finalLang = (language == LANG_ADDON) ? iter->lang : language;
|
||||
@ -301,9 +263,8 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject
|
||||
CreatureTextBuilder builder(finalSource, finalSource->getGender(), finalType, iter->group, iter->id, finalLang, target);
|
||||
SendChatPacket(finalSource, builder, finalType, target, range, teamId, gmOnly);
|
||||
}
|
||||
if (isEqualChanced || (!isEqualChanced && totalChance == 100.0f))
|
||||
SetRepeatId(source, textGroup, iter->id);
|
||||
|
||||
source->SetTextRepeatId(textGroup, iter->id);
|
||||
return iter->duration;
|
||||
}
|
||||
|
||||
@ -410,34 +371,6 @@ void CreatureTextMgr::SendEmote(Unit* source, uint32 emote)
|
||||
source->HandleEmoteCommand(emote);
|
||||
}
|
||||
|
||||
void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id)
|
||||
{
|
||||
if (!source)
|
||||
return;
|
||||
|
||||
CreatureTextRepeatIds& repeats = mTextRepeatMap[source->GetGUID()][textGroup];
|
||||
if (std::find(repeats.begin(), repeats.end(), id) == repeats.end())
|
||||
repeats.push_back(id);
|
||||
else
|
||||
LOG_ERROR("sql.sql", "CreatureTextMgr: TextGroup {} for Creature {} ({}), id {} already added",
|
||||
uint32(textGroup), source->GetName(), source->GetGUID().ToString(), uint32(id));
|
||||
}
|
||||
|
||||
CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup)
|
||||
{
|
||||
ASSERT(source);//should never happen
|
||||
CreatureTextRepeatIds ids;
|
||||
|
||||
CreatureTextRepeatMap::const_iterator mapItr = mTextRepeatMap.find(source->GetGUID());
|
||||
if (mapItr != mTextRepeatMap.end())
|
||||
{
|
||||
CreatureTextRepeatGroup::const_iterator groupItr = (*mapItr).second.find(textGroup);
|
||||
if (groupItr != mapItr->second.end())
|
||||
ids = groupItr->second;
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup)
|
||||
{
|
||||
if (!sourceEntry)
|
||||
|
||||
@ -77,11 +77,6 @@ typedef std::unordered_map<uint32, CreatureTextHolder> CreatureTextMap; // a
|
||||
|
||||
typedef std::map<CreatureTextId, CreatureTextLocale> LocaleCreatureTextMap;
|
||||
|
||||
//used for handling non-repeatable random texts
|
||||
typedef std::vector<uint8> CreatureTextRepeatIds;
|
||||
typedef std::unordered_map<uint8, CreatureTextRepeatIds> CreatureTextRepeatGroup;
|
||||
typedef std::unordered_map<ObjectGuid, CreatureTextRepeatGroup> CreatureTextRepeatMap;//guid based
|
||||
|
||||
class CreatureTextMgr
|
||||
{
|
||||
CreatureTextMgr() { }
|
||||
@ -105,14 +100,10 @@ public:
|
||||
template<class Builder> void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* target = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, TeamId teamId = TEAM_NEUTRAL, bool gmOnly = false) const;
|
||||
|
||||
private:
|
||||
CreatureTextRepeatIds GetRepeatGroup(Creature* source, uint8 textGroup);
|
||||
void SetRepeatId(Creature* source, uint8 textGroup, uint8 id);
|
||||
|
||||
void SendNonChatPacket(WorldObject* source, WorldPacket const* data, ChatMsg msgType, WorldObject const* target, CreatureTextRange range, TeamId teamId, bool gmOnly) const;
|
||||
float GetRangeForChatType(ChatMsg msgType) const;
|
||||
|
||||
CreatureTextMap mTextMap;
|
||||
CreatureTextRepeatMap mTextRepeatMap;
|
||||
LocaleCreatureTextMap mLocaleTextMap;
|
||||
};
|
||||
|
||||
|
||||
@ -162,7 +162,7 @@ void WorldUpdateTime::SetRecordUpdateTimeInterval(Milliseconds t)
|
||||
|
||||
void WorldUpdateTime::RecordUpdateTime(Milliseconds gameTimeMs, uint32 diff, uint32 sessionCount)
|
||||
{
|
||||
if (_recordUpdateTimeInverval > 0s && diff > _recordUpdateTimeMin.count())
|
||||
if (_recordUpdateTimeInverval > 0ms && diff > _recordUpdateTimeMin.count())
|
||||
{
|
||||
if (GetMSTimeDiff(_lastRecordTime, gameTimeMs) > _recordUpdateTimeInverval)
|
||||
{
|
||||
|
||||
@ -852,7 +852,7 @@ void WorldState::HandleSunsReachSubPhaseTransition(int32 subPhaseMask, bool init
|
||||
if (!initial)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(m_sunsReachData.m_sunsReachReclamationMutex);
|
||||
for (ObjectGuid& guid : m_sunsReachData.m_sunsReachReclamationPlayers)
|
||||
for (ObjectGuid const& guid : m_sunsReachData.m_sunsReachReclamationPlayers)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
{
|
||||
if (start)
|
||||
|
||||
@ -213,7 +213,7 @@ public:
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_RESET, 5000);
|
||||
events.ScheduleEvent(EVENT_CHECK_RESET, 5s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,12 +27,13 @@
|
||||
|
||||
enum IronhandData
|
||||
{
|
||||
IRONHAND_FLAMES_TIMER = 16000,
|
||||
IRONHAND_FLAMES_TIMER_RAND = 3000,
|
||||
IRONHAND_N_GROUPS = 3,
|
||||
SPELL_GOUT_OF_FLAMES = 15529
|
||||
};
|
||||
|
||||
constexpr Milliseconds IRONHAND_FLAMES_TIMER = 16s;
|
||||
constexpr Milliseconds IRONHAND_FLAMES_TIMER_RAND = 3s;
|
||||
|
||||
class go_shadowforge_brazier : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
@ -110,7 +111,7 @@ public:
|
||||
{
|
||||
case SPELL_GOUT_OF_FLAMES:
|
||||
DoCast(SPELL_GOUT_OF_FLAMES);
|
||||
events.RescheduleEvent(SPELL_GOUT_OF_FLAMES, urand(IRONHAND_FLAMES_TIMER - IRONHAND_FLAMES_TIMER_RAND, IRONHAND_FLAMES_TIMER + IRONHAND_FLAMES_TIMER_RAND));
|
||||
events.RescheduleEvent(SPELL_GOUT_OF_FLAMES, IRONHAND_FLAMES_TIMER - IRONHAND_FLAMES_TIMER_RAND, IRONHAND_FLAMES_TIMER + IRONHAND_FLAMES_TIMER_RAND);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -28,14 +28,11 @@ enum Spells
|
||||
SPELL_ENVELOPING_WEB = 15471
|
||||
};
|
||||
|
||||
enum Timers
|
||||
{
|
||||
TIMER_SHADOWBOLT = 7000,
|
||||
TIMER_CURSE_TONGUES = 24000,
|
||||
TIMER_CURSE_WEAKNESS = 12000,
|
||||
TIMER_DEMON_ARMOR = 3000, // virtually only cast once
|
||||
TIMER_ENVELOPING_WEB = 16000
|
||||
};
|
||||
constexpr Milliseconds TIMER_SHADOWBOLT = 7s;
|
||||
constexpr Milliseconds TIMER_CURSE_TONGUES = 24s;
|
||||
constexpr Milliseconds TIMER_CURSE_WEAKNESS = 12s;
|
||||
constexpr Milliseconds TIMER_DEMON_ARMOR = 3s; //virtually only cast once
|
||||
constexpr Milliseconds TIMER_ENVELOPING_WEB = 16s;
|
||||
|
||||
class boss_anubshiah : public CreatureScript
|
||||
{
|
||||
@ -54,11 +51,11 @@ public:
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT, 0.2 * (int)TIMER_SHADOWBOLT);
|
||||
events.ScheduleEvent(SPELL_CURSE_TONGUES, 0.2 * (int)TIMER_CURSE_TONGUES);
|
||||
events.ScheduleEvent(SPELL_CURSE_WEAKNESS, 0.2 * (int)TIMER_CURSE_WEAKNESS);
|
||||
events.ScheduleEvent(SPELL_DEMON_ARMOR, 0.2 * (int)TIMER_DEMON_ARMOR);
|
||||
events.ScheduleEvent(SPELL_ENVELOPING_WEB, 0.2 * (int)TIMER_ENVELOPING_WEB);
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT, TIMER_SHADOWBOLT / 5);
|
||||
events.ScheduleEvent(SPELL_CURSE_TONGUES, TIMER_CURSE_TONGUES / 5);
|
||||
events.ScheduleEvent(SPELL_CURSE_WEAKNESS, TIMER_CURSE_WEAKNESS / 5);
|
||||
events.ScheduleEvent(SPELL_DEMON_ARMOR, TIMER_DEMON_ARMOR / 5);
|
||||
events.ScheduleEvent(SPELL_ENVELOPING_WEB, TIMER_ENVELOPING_WEB / 5);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -80,21 +77,21 @@ public:
|
||||
{
|
||||
case SPELL_SHADOWBOLT:
|
||||
DoCastVictim(SPELL_SHADOWBOLT);
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT, urand(TIMER_SHADOWBOLT - 2000, TIMER_SHADOWBOLT + 2000));
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT, TIMER_SHADOWBOLT - 2s, TIMER_SHADOWBOLT + 2s);
|
||||
break;
|
||||
case SPELL_CURSE_TONGUES:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
{
|
||||
DoCast(target, SPELL_CURSE_TONGUES);
|
||||
}
|
||||
events.ScheduleEvent(SPELL_CURSE_TONGUES, urand(TIMER_CURSE_TONGUES - 2000, TIMER_CURSE_TONGUES + 2000));
|
||||
events.ScheduleEvent(SPELL_CURSE_TONGUES, TIMER_CURSE_TONGUES - 2s, TIMER_CURSE_TONGUES + 2s);
|
||||
break;
|
||||
case SPELL_CURSE_WEAKNESS:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
{
|
||||
DoCast(target, SPELL_CURSE_WEAKNESS);
|
||||
}
|
||||
events.ScheduleEvent(SPELL_CURSE_WEAKNESS, urand(TIMER_CURSE_WEAKNESS - 2000, TIMER_CURSE_WEAKNESS + 2000));
|
||||
events.ScheduleEvent(SPELL_CURSE_WEAKNESS, TIMER_CURSE_WEAKNESS - 2s, TIMER_CURSE_WEAKNESS + 2s);
|
||||
break;
|
||||
case SPELL_DEMON_ARMOR:
|
||||
DoCast(me, SPELL_DEMON_ARMOR);
|
||||
@ -103,7 +100,7 @@ public:
|
||||
case SPELL_ENVELOPING_WEB:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
DoCast(target, SPELL_ENVELOPING_WEB);
|
||||
events.ScheduleEvent(SPELL_ENVELOPING_WEB, urand(TIMER_ENVELOPING_WEB - 2000, TIMER_ENVELOPING_WEB + 2000));
|
||||
events.ScheduleEvent(SPELL_ENVELOPING_WEB, TIMER_ENVELOPING_WEB - 2s, TIMER_ENVELOPING_WEB + 2s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -26,12 +26,9 @@ enum Spells
|
||||
SPELL_SHIELD = 7121
|
||||
};
|
||||
|
||||
enum Timers
|
||||
{
|
||||
TIMER_SHADOWBOLT_VOLLEY = 7000,
|
||||
TIMER_REND = 20000,
|
||||
TIMER_SHIELD = 12000
|
||||
};
|
||||
constexpr Milliseconds TIMER_SHADOWBOLT_VOLLEY = 7s;
|
||||
constexpr Milliseconds TIMER_REND = 20s;
|
||||
constexpr Milliseconds TIMER_SHIELD = 12s;
|
||||
|
||||
class boss_eviscerator : public CreatureScript
|
||||
{
|
||||
@ -52,9 +49,9 @@ public:
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT_VOLLEY, 0.2 * (int)TIMER_SHADOWBOLT_VOLLEY);
|
||||
events.ScheduleEvent(SPELL_REND, 0.2 * (int) TIMER_REND);
|
||||
events.ScheduleEvent(SPELL_SHIELD, 0.2 * (int) TIMER_SHIELD);
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT_VOLLEY, TIMER_SHADOWBOLT_VOLLEY / 5);
|
||||
events.ScheduleEvent(SPELL_REND, TIMER_REND / 5);
|
||||
events.ScheduleEvent(SPELL_SHIELD, TIMER_SHIELD / 5);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /* doneBy */, uint32& /* damage */, DamageEffectType /* damagetype */, SpellSchoolMask damageSchoolMask) override
|
||||
@ -86,11 +83,11 @@ public:
|
||||
{
|
||||
case SPELL_SHADOWBOLT_VOLLEY:
|
||||
DoCastVictim(SPELL_SHADOWBOLT_VOLLEY);
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT_VOLLEY, urand(TIMER_SHADOWBOLT_VOLLEY - 2000, TIMER_SHADOWBOLT_VOLLEY + 2000));
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT_VOLLEY, TIMER_SHADOWBOLT_VOLLEY - 2s, TIMER_SHADOWBOLT_VOLLEY + 2s);
|
||||
break;
|
||||
case SPELL_REND:
|
||||
DoCastVictim(SPELL_REND);
|
||||
events.ScheduleEvent(SPELL_REND, urand(TIMER_REND - 2000, TIMER_REND + 2000));
|
||||
events.ScheduleEvent(SPELL_REND, TIMER_REND - 2s, TIMER_REND + 2s);
|
||||
break;
|
||||
case SPELL_SHIELD:
|
||||
SpellShieldReady = true;
|
||||
|
||||
@ -26,12 +26,9 @@ enum Spells
|
||||
SPELL_BLOODLUST = 21049
|
||||
};
|
||||
|
||||
enum Timers
|
||||
{
|
||||
TIMER_WHIRLWIND = 12000,
|
||||
TIMER_MORTAL = 22000,
|
||||
TIMER_BLOODLUST = 30000
|
||||
};
|
||||
constexpr Milliseconds TIMER_WHIRLWIND = 12s;
|
||||
constexpr Milliseconds TIMER_MORTAL = 22s;
|
||||
constexpr Milliseconds TIMER_BLOODLUST = 30s;
|
||||
|
||||
class boss_gorosh_the_dervish : public CreatureScript
|
||||
{
|
||||
@ -47,14 +44,14 @@ public:
|
||||
{
|
||||
boss_gorosh_the_dervishAI(Creature* creature) : BossAI(creature, DATA_GOROSH) { }
|
||||
|
||||
uint32 nextWhirlwindTime;
|
||||
Milliseconds nextWhirlwindTime;
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
events.ScheduleEvent(SPELL_WHIRLWIND, 0.2 * (int) TIMER_WHIRLWIND);
|
||||
events.ScheduleEvent(SPELL_MORTALSTRIKE, 0.2 * (int) TIMER_MORTAL);
|
||||
events.ScheduleEvent(SPELL_BLOODLUST, 0.2 * (int) TIMER_BLOODLUST);
|
||||
events.ScheduleEvent(SPELL_WHIRLWIND, TIMER_WHIRLWIND / 5);
|
||||
events.ScheduleEvent(SPELL_MORTALSTRIKE, TIMER_MORTAL / 5);
|
||||
events.ScheduleEvent(SPELL_BLOODLUST, TIMER_BLOODLUST / 5);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -78,22 +75,22 @@ public:
|
||||
if (me->GetDistance2d(me->GetVictim()) < 10.0f)
|
||||
{
|
||||
DoCastVictim(SPELL_WHIRLWIND);
|
||||
nextWhirlwindTime = urand(TIMER_WHIRLWIND - 2000, TIMER_WHIRLWIND + 2000);
|
||||
nextWhirlwindTime = randtime(TIMER_WHIRLWIND - 2s, TIMER_WHIRLWIND + 2s);
|
||||
}
|
||||
else
|
||||
{
|
||||
// reschedule sooner
|
||||
nextWhirlwindTime = 0.3 * urand(TIMER_WHIRLWIND - 2000, TIMER_WHIRLWIND + 2000);
|
||||
nextWhirlwindTime = randtime(TIMER_WHIRLWIND - 2s, TIMER_WHIRLWIND + 2s) / 3;
|
||||
}
|
||||
events.ScheduleEvent(SPELL_WHIRLWIND, nextWhirlwindTime);
|
||||
break;
|
||||
case SPELL_MORTALSTRIKE:
|
||||
DoCastVictim(SPELL_MORTALSTRIKE);
|
||||
events.ScheduleEvent(SPELL_MORTALSTRIKE, urand(TIMER_MORTAL - 2000, TIMER_MORTAL + 2000));
|
||||
events.ScheduleEvent(SPELL_MORTALSTRIKE, TIMER_MORTAL - 2s, TIMER_MORTAL + 2s);
|
||||
break;
|
||||
case SPELL_BLOODLUST:
|
||||
DoCastSelf(SPELL_BLOODLUST);
|
||||
events.ScheduleEvent(SPELL_BLOODLUST, urand(TIMER_BLOODLUST - 2000, TIMER_BLOODLUST + 2000));
|
||||
events.ScheduleEvent(SPELL_BLOODLUST, TIMER_BLOODLUST - 2s, TIMER_BLOODLUST + 2s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -26,11 +26,8 @@ enum Grizzle
|
||||
EMOTE_FRENZY_KILL = 0
|
||||
};
|
||||
|
||||
enum Timer
|
||||
{
|
||||
TIMER_GROUNDTREMOR = 10000,
|
||||
TIMER_FRENZY = 15000
|
||||
};
|
||||
constexpr Milliseconds TIMER_GROUNDTREMOR = 10s;
|
||||
constexpr Milliseconds TIMER_FRENZY = 15s;
|
||||
|
||||
class boss_grizzle : public CreatureScript
|
||||
{
|
||||
@ -46,13 +43,13 @@ public:
|
||||
{
|
||||
boss_grizzleAI(Creature* creature) : BossAI(creature, DATA_GRIZZLE) {}
|
||||
|
||||
uint32 nextTremorTime;
|
||||
Milliseconds nextTremorTime;
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
events.ScheduleEvent(SPELL_GROUNDTREMOR, 0.2 * (int) TIMER_GROUNDTREMOR);
|
||||
events.ScheduleEvent(SPELL_FRENZY, 0.2 * (int) TIMER_FRENZY);
|
||||
events.ScheduleEvent(SPELL_GROUNDTREMOR, TIMER_GROUNDTREMOR / 5);
|
||||
events.ScheduleEvent(SPELL_FRENZY, TIMER_FRENZY / 5);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -77,17 +74,17 @@ public:
|
||||
if (me->GetDistance2d(me->GetVictim()) < 10.0f)
|
||||
{
|
||||
DoCastVictim(SPELL_GROUNDTREMOR);
|
||||
nextTremorTime = urand(TIMER_GROUNDTREMOR - 2000, TIMER_GROUNDTREMOR + 2000);
|
||||
nextTremorTime = randtime(TIMER_GROUNDTREMOR - 2s, TIMER_GROUNDTREMOR + 2s);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextTremorTime = 0.3*urand(TIMER_GROUNDTREMOR - 2000, TIMER_GROUNDTREMOR + 2000);
|
||||
nextTremorTime = randtime(TIMER_GROUNDTREMOR - 2s, TIMER_GROUNDTREMOR + 2s) / 3;
|
||||
}
|
||||
events.ScheduleEvent(SPELL_GROUNDTREMOR, nextTremorTime);
|
||||
break;
|
||||
case SPELL_FRENZY:
|
||||
DoCastSelf(SPELL_FRENZY);
|
||||
events.ScheduleEvent(SPELL_FRENZY, urand(TIMER_FRENZY - 2000, TIMER_FRENZY + 2000));
|
||||
events.ScheduleEvent(SPELL_FRENZY, TIMER_FRENZY - 2s, TIMER_FRENZY + 2s);
|
||||
Talk(EMOTE_FRENZY_KILL);
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -26,12 +26,9 @@ enum Spells
|
||||
SPELL_WEB_EXPLOSION = 15474
|
||||
};
|
||||
|
||||
enum Timers
|
||||
{
|
||||
TIMER_PARALYZING = 20000,
|
||||
TIMER_BANEFUL = 24000,
|
||||
TIMER_WEB_EXPLOSION = 20000
|
||||
};
|
||||
constexpr Milliseconds TIMER_PARALYZING = 20s;
|
||||
constexpr Milliseconds TIMER_BANEFUL = 24s;
|
||||
constexpr Milliseconds TIMER_WEB_EXPLOSION = 20s;
|
||||
|
||||
class boss_hedrum : public CreatureScript
|
||||
{
|
||||
@ -50,9 +47,9 @@ public:
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
events.ScheduleEvent(SPELL_PARALYZING, 0.2 * (int) TIMER_PARALYZING);
|
||||
events.ScheduleEvent(SPELL_BANEFUL, 0.2 * (int) TIMER_BANEFUL);
|
||||
events.ScheduleEvent(SPELL_WEB_EXPLOSION, 0.2 * (int) TIMER_WEB_EXPLOSION);
|
||||
events.ScheduleEvent(SPELL_PARALYZING, TIMER_PARALYZING / 5);
|
||||
events.ScheduleEvent(SPELL_BANEFUL, TIMER_BANEFUL / 5);
|
||||
events.ScheduleEvent(SPELL_WEB_EXPLOSION, TIMER_WEB_EXPLOSION / 5);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -74,18 +71,18 @@ public:
|
||||
{
|
||||
case SPELL_PARALYZING:
|
||||
DoCastVictim(SPELL_PARALYZING);
|
||||
events.ScheduleEvent(SPELL_PARALYZING, urand(TIMER_PARALYZING - 2000, TIMER_PARALYZING + 2000));
|
||||
events.ScheduleEvent(SPELL_PARALYZING, TIMER_PARALYZING - 2s, TIMER_PARALYZING + 2s);
|
||||
break;
|
||||
case SPELL_BANEFUL:
|
||||
DoCastVictim(SPELL_BANEFUL);
|
||||
events.ScheduleEvent(SPELL_BANEFUL, urand(TIMER_BANEFUL - 2000, TIMER_BANEFUL + 2000));
|
||||
events.ScheduleEvent(SPELL_BANEFUL, TIMER_BANEFUL - 2s, TIMER_BANEFUL + 2s);
|
||||
break;
|
||||
case SPELL_WEB_EXPLOSION:
|
||||
if (me->GetDistance2d(me->GetVictim()) < 100.0f)
|
||||
{
|
||||
DoCast(SPELL_WEB_EXPLOSION);
|
||||
}
|
||||
events.ScheduleEvent(SPELL_WEB_EXPLOSION, urand(TIMER_WEB_EXPLOSION - 2000, TIMER_WEB_EXPLOSION + 2000));
|
||||
events.ScheduleEvent(SPELL_WEB_EXPLOSION, TIMER_WEB_EXPLOSION - 2s, TIMER_WEB_EXPLOSION + 2s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -28,14 +28,11 @@ enum Spells
|
||||
SPELL_WORDPAIN = 15654,
|
||||
};
|
||||
|
||||
enum SpellTimers
|
||||
{
|
||||
TIMER_HEAL = 12000,
|
||||
TIMER_MINDBLAST = 16000,
|
||||
TIMER_RENEW = 12000,
|
||||
TIMER_SHADOWBOLT = 16000,
|
||||
TIMER_WORDPAIN = 12000,
|
||||
};
|
||||
constexpr Milliseconds TIMER_HEAL = 12s;
|
||||
constexpr Milliseconds TIMER_MINDBLAST = 16s;
|
||||
constexpr Milliseconds TIMER_RENEW = 12s;
|
||||
constexpr Milliseconds TIMER_SHADOWBOLT = 16s;
|
||||
constexpr Milliseconds TIMER_WORDPAIN = 12s;
|
||||
|
||||
struct boss_moira_bronzebeardAI : public BossAI
|
||||
{
|
||||
@ -44,9 +41,9 @@ struct boss_moira_bronzebeardAI : public BossAI
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
events.ScheduleEvent(SPELL_MINDBLAST, 0.5 * (int) TIMER_MINDBLAST);
|
||||
events.ScheduleEvent(SPELL_HEAL, 0.5 * (int) TIMER_HEAL);
|
||||
events.ScheduleEvent(SPELL_RENEW, 0.5 * (int) TIMER_RENEW);
|
||||
events.ScheduleEvent(SPELL_MINDBLAST, TIMER_MINDBLAST / 2);
|
||||
events.ScheduleEvent(SPELL_HEAL, TIMER_HEAL / 2);
|
||||
events.ScheduleEvent(SPELL_RENEW, TIMER_RENEW / 2);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -67,7 +64,7 @@ struct boss_moira_bronzebeardAI : public BossAI
|
||||
{
|
||||
case SPELL_MINDBLAST:
|
||||
DoCastVictim(SPELL_MINDBLAST);
|
||||
events.ScheduleEvent(SPELL_MINDBLAST, urand(TIMER_MINDBLAST - 2000, TIMER_MINDBLAST + 2000));
|
||||
events.ScheduleEvent(SPELL_MINDBLAST, TIMER_MINDBLAST - 2s, TIMER_MINDBLAST + 2s);
|
||||
break;
|
||||
case SPELL_HEAL:
|
||||
CastOnEmperorIfPossible(SPELL_HEAL, TIMER_HEAL);
|
||||
@ -82,7 +79,7 @@ struct boss_moira_bronzebeardAI : public BossAI
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void CastOnEmperorIfPossible(uint32 spell, uint32 timer)
|
||||
void CastOnEmperorIfPossible(uint32 spell, Milliseconds timer)
|
||||
{
|
||||
Creature* emperor = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_EMPEROR));
|
||||
if (emperor && emperor->HealthBelowPct(90))
|
||||
@ -93,7 +90,7 @@ struct boss_moira_bronzebeardAI : public BossAI
|
||||
{
|
||||
DoCastSelf(spell);
|
||||
}
|
||||
events.ScheduleEvent(spell, urand(timer - 2000, timer + 2000));
|
||||
events.ScheduleEvent(spell, timer - 2s, timer + 2s);
|
||||
}
|
||||
};
|
||||
|
||||
@ -107,10 +104,10 @@ struct boss_high_priestess_thaurissanAI : public boss_moira_bronzebeardAI
|
||||
{
|
||||
_JustEngagedWith();
|
||||
Talk(0);
|
||||
events.ScheduleEvent(SPELL_WORDPAIN, 0.5 * (int)TIMER_WORDPAIN);
|
||||
events.ScheduleEvent(SPELL_HEAL, 0.5 * (int) TIMER_HEAL);
|
||||
events.ScheduleEvent(SPELL_RENEW, 0.5 * (int) TIMER_RENEW);
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT, 0.5 * (int) TIMER_SHADOWBOLT);
|
||||
events.ScheduleEvent(SPELL_WORDPAIN, TIMER_WORDPAIN / 2);
|
||||
events.ScheduleEvent(SPELL_HEAL, TIMER_HEAL / 2);
|
||||
events.ScheduleEvent(SPELL_RENEW, TIMER_RENEW / 2);
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT, TIMER_SHADOWBOLT / 2);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -131,7 +128,7 @@ struct boss_high_priestess_thaurissanAI : public boss_moira_bronzebeardAI
|
||||
{
|
||||
case SPELL_WORDPAIN:
|
||||
DoCastVictim(SPELL_WORDPAIN);
|
||||
events.ScheduleEvent(SPELL_WORDPAIN, urand(TIMER_WORDPAIN - 2000, TIMER_WORDPAIN + 2000));
|
||||
events.ScheduleEvent(SPELL_WORDPAIN, TIMER_WORDPAIN - 2s, TIMER_WORDPAIN + 2s);
|
||||
break;
|
||||
case SPELL_HEAL:
|
||||
CastOnEmperorIfPossible(SPELL_HEAL, TIMER_HEAL);
|
||||
@ -141,7 +138,7 @@ struct boss_high_priestess_thaurissanAI : public boss_moira_bronzebeardAI
|
||||
break;
|
||||
case SPELL_SHADOWBOLT:
|
||||
DoCastVictim(SPELL_SHADOWBOLT);
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT, urand(TIMER_SHADOWBOLT - 2000, TIMER_SHADOWBOLT + 2000));
|
||||
events.ScheduleEvent(SPELL_SHADOWBOLT, TIMER_SHADOWBOLT - 2s, TIMER_SHADOWBOLT + 2s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -27,13 +27,10 @@ enum Spells
|
||||
SPELL_SLOW = 19137
|
||||
};
|
||||
|
||||
enum Timers
|
||||
{
|
||||
TIMER_ARCANE_BOLT = 7000,
|
||||
TIMER_ARCANE_EXPLOSION = 24000,
|
||||
TIMER_POLYMORPH = 12000,
|
||||
TIMER_SLOW = 15000
|
||||
};
|
||||
constexpr Milliseconds TIMER_ARCANE_BOLT = 7s;
|
||||
constexpr Milliseconds TIMER_ARCANE_EXPLOSION = 24s;
|
||||
constexpr Milliseconds TIMER_POLYMORPH = 12s;
|
||||
constexpr Milliseconds TIMER_SLOW = 15s;
|
||||
|
||||
class boss_okthor : public CreatureScript
|
||||
{
|
||||
@ -49,15 +46,15 @@ public:
|
||||
{
|
||||
boss_okthorAI(Creature* creature) : BossAI(creature, DATA_OKTHOR) {}
|
||||
|
||||
uint32 nextArcaneExplosionTime;
|
||||
Milliseconds nextArcaneExplosionTime;
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
events.ScheduleEvent(SPELL_ARCANE_BOLT, 0.2 * (int) TIMER_ARCANE_BOLT);
|
||||
events.ScheduleEvent(SPELL_ARCANE_EXPLOSION, 0.2 * (int) TIMER_ARCANE_EXPLOSION);
|
||||
events.ScheduleEvent(SPELL_POLYMORPH, 0.2 * (int) TIMER_POLYMORPH);
|
||||
events.ScheduleEvent(SPELL_SLOW, 500);
|
||||
events.ScheduleEvent(SPELL_ARCANE_BOLT, TIMER_ARCANE_BOLT / 5);
|
||||
events.ScheduleEvent(SPELL_ARCANE_EXPLOSION, TIMER_ARCANE_EXPLOSION / 5);
|
||||
events.ScheduleEvent(SPELL_POLYMORPH, TIMER_POLYMORPH / 5);
|
||||
events.ScheduleEvent(SPELL_SLOW, 500ms);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -82,17 +79,17 @@ public:
|
||||
{
|
||||
DoCast(target, SPELL_ARCANE_BOLT);
|
||||
}
|
||||
events.ScheduleEvent(SPELL_ARCANE_BOLT, urand(TIMER_ARCANE_BOLT - 2000, TIMER_ARCANE_BOLT + 2000));
|
||||
events.ScheduleEvent(SPELL_ARCANE_BOLT, TIMER_ARCANE_BOLT - 2s, TIMER_ARCANE_BOLT + 2s);
|
||||
break;
|
||||
case SPELL_ARCANE_EXPLOSION:
|
||||
if (me->GetDistance2d(me->GetVictim()) < 50.0f)
|
||||
{
|
||||
DoCast(SPELL_ARCANE_EXPLOSION);
|
||||
nextArcaneExplosionTime = urand(TIMER_ARCANE_EXPLOSION - 2000, TIMER_ARCANE_EXPLOSION + 2000);
|
||||
nextArcaneExplosionTime = randtime(TIMER_ARCANE_EXPLOSION - 2s, TIMER_ARCANE_EXPLOSION + 2s);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextArcaneExplosionTime = 0.3*urand(TIMER_ARCANE_EXPLOSION - 2000, TIMER_ARCANE_EXPLOSION + 2000);
|
||||
nextArcaneExplosionTime = randtime(TIMER_ARCANE_EXPLOSION - 2s, TIMER_ARCANE_EXPLOSION + 2s) / 3;
|
||||
}
|
||||
events.ScheduleEvent(SPELL_ARCANE_EXPLOSION, nextArcaneExplosionTime);
|
||||
break;
|
||||
@ -101,7 +98,7 @@ public:
|
||||
{
|
||||
DoCast(target, SPELL_POLYMORPH);
|
||||
}
|
||||
events.ScheduleEvent(SPELL_POLYMORPH, urand(TIMER_POLYMORPH - 2000, TIMER_POLYMORPH + 2000));
|
||||
events.ScheduleEvent(SPELL_POLYMORPH, TIMER_POLYMORPH - 2s, TIMER_POLYMORPH + 2s);
|
||||
break;
|
||||
case SPELL_SLOW:
|
||||
if (me->GetDistance2d(me->GetVictim()) < 50.0f)
|
||||
|
||||
@ -96,7 +96,7 @@ public:
|
||||
|
||||
void IsSummonedBy(WorldObject* /*summoner*/) override
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SUMMONED_1, 1000);
|
||||
events.ScheduleEvent(EVENT_SUMMONED_1, 1s);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
|
||||
@ -71,7 +71,7 @@ public:
|
||||
|
||||
void IsSummonedBy(WorldObject* /*summoner*/) override
|
||||
{
|
||||
StartTalking(TALK_SUMMON, 8 * IN_MILLISECONDS);
|
||||
StartTalking(TALK_SUMMON, 8s);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
@ -92,7 +92,7 @@ public:
|
||||
instance->SetData(DATA_LORD_VALTHALAK, DONE);
|
||||
}
|
||||
|
||||
void StartTalking(uint32 talkGroupId, uint32 timer)
|
||||
void StartTalking(uint32 talkGroupId, Milliseconds timer)
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
@ -123,7 +123,7 @@ public:
|
||||
|
||||
events.CancelEvent(EVENT_SUMMON_SPECTRAL_ASSASSIN);
|
||||
|
||||
StartTalking(TALK_40_HP, 5 * IN_MILLISECONDS);
|
||||
StartTalking(TALK_40_HP, 5s);
|
||||
}
|
||||
|
||||
if (!frenzy15 && me->HealthBelowPctDamaged(15, damage))
|
||||
@ -132,7 +132,7 @@ public:
|
||||
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 12s, 19s, 0, EVENT_PHASE_FIGHT);
|
||||
|
||||
StartTalking(TALK_15_HP, 5 * IN_MILLISECONDS);
|
||||
StartTalking(TALK_15_HP, 5s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -108,11 +108,11 @@ struct boss_quartermaster_zigris : public BossAI
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
DoCastVictim(SPELL_HOOKEDNET);
|
||||
events.RepeatEvent(16000);
|
||||
events.Repeat(16s);
|
||||
}
|
||||
else
|
||||
{
|
||||
events.RepeatEvent(3000);
|
||||
events.Repeat(3s);
|
||||
}
|
||||
break;
|
||||
case EVENT_SHOOT:
|
||||
@ -128,7 +128,7 @@ struct boss_quartermaster_zigris : public BossAI
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
}
|
||||
events.RepeatEvent(2000);
|
||||
events.Repeat(2s);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -222,7 +222,7 @@ public:
|
||||
if (GameObject* portcullis = me->FindNearestGameObject(GO_DR_PORTCULLIS, 50.0f))
|
||||
waveDoorGUID = portcullis->GetGUID();
|
||||
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0ms);
|
||||
events.ScheduleEvent(EVENT_START_1, 1s);
|
||||
}
|
||||
}
|
||||
@ -264,7 +264,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_START_2, 4s);
|
||||
break;
|
||||
case EVENT_START_2:
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0ms);
|
||||
if (Creature* victor = ObjectAccessor::GetCreature(*me, victorGUID))
|
||||
victor->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
|
||||
events.ScheduleEvent(EVENT_START_3, 4s);
|
||||
@ -314,14 +314,14 @@ public:
|
||||
events.ScheduleEvent(EVENT_SPAWN_WAVE, 3s);
|
||||
break;
|
||||
case EVENT_WAVES_TEXT_2:
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0ms);
|
||||
if (Creature* victor = ObjectAccessor::GetCreature(*me, victorGUID))
|
||||
victor->AI()->Talk(SAY_NEFARIUS_3);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_FACING_1, 4s);
|
||||
events.ScheduleEvent(EVENT_SPAWN_WAVE, 3s);
|
||||
break;
|
||||
case EVENT_WAVES_TEXT_3:
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0ms);
|
||||
if (Creature* victor = ObjectAccessor::GetCreature(*me, victorGUID))
|
||||
victor->AI()->Talk(SAY_NEFARIUS_4);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_FACING_1, 4s);
|
||||
@ -334,14 +334,14 @@ public:
|
||||
events.ScheduleEvent(EVENT_SPAWN_WAVE, 3s);
|
||||
break;
|
||||
case EVENT_WAVES_TEXT_5:
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0ms);
|
||||
if (Creature* victor = ObjectAccessor::GetCreature(*me, victorGUID))
|
||||
victor->AI()->Talk(SAY_NEFARIUS_5);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_FACING_1, 4s);
|
||||
events.ScheduleEvent(EVENT_SPAWN_WAVE, 3s);
|
||||
break;
|
||||
case EVENT_WAVES_COMPLETE_TEXT_1:
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0ms);
|
||||
if (Creature* victor = ObjectAccessor::GetCreature(*me, victorGUID))
|
||||
victor->AI()->Talk(SAY_NEFARIUS_6);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_FACING_1, 4s);
|
||||
|
||||
@ -227,7 +227,7 @@ public:
|
||||
case EVENT_FIREBALL:
|
||||
DoCastVictim(SPELL_FIREBALL);
|
||||
events.ScheduleEvent(EVENT_FIREBALL, 8s, 21s);
|
||||
if (events.GetNextEventTime(EVENT_FIREBLAST) < 3 * IN_MILLISECONDS)
|
||||
if (events.GetTimeUntilEvent(EVENT_FIREBLAST) < 3s)
|
||||
{
|
||||
events.RescheduleEvent(EVENT_FIREBLAST, 3s);
|
||||
}
|
||||
@ -235,7 +235,7 @@ public:
|
||||
case EVENT_FIREBLAST:
|
||||
DoCastVictim(SPELL_FIREBLAST);
|
||||
events.ScheduleEvent(EVENT_FIREBLAST, 5s, 8s);
|
||||
if (events.GetNextEventTime(EVENT_FIREBALL) < 3 * IN_MILLISECONDS)
|
||||
if (events.GetTimeUntilEvent(EVENT_FIREBALL) < 3s)
|
||||
{
|
||||
events.RescheduleEvent(EVENT_FIREBALL, 3s);
|
||||
}
|
||||
|
||||
@ -98,31 +98,31 @@ public:
|
||||
{
|
||||
case EVENT_SNAP_KICK:
|
||||
DoCastVictim(SPELL_SNAPKICK);
|
||||
events.RepeatEvent(6 * IN_MILLISECONDS);
|
||||
events.Repeat(6s);
|
||||
break;
|
||||
case EVENT_CLEAVE:
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
events.RepeatEvent(12 * IN_MILLISECONDS);
|
||||
events.Repeat(12s);
|
||||
break;
|
||||
case EVENT_UPPERCUT:
|
||||
DoCastVictim(SPELL_UPPERCUT);
|
||||
events.RepeatEvent(14 * IN_MILLISECONDS);
|
||||
events.Repeat(14s);
|
||||
break;
|
||||
case EVENT_MORTAL_STRIKE:
|
||||
DoCastVictim(SPELL_MORTALSTRIKE);
|
||||
events.RepeatEvent(10 * IN_MILLISECONDS);
|
||||
events.Repeat(10s);
|
||||
break;
|
||||
case EVENT_PUMMEL:
|
||||
DoCastVictim(SPELL_PUMMEL);
|
||||
events.RepeatEvent(16 * IN_MILLISECONDS);
|
||||
events.Repeat(16s);
|
||||
break;
|
||||
case EVENT_THROW_AXE:
|
||||
DoCastRandomTarget(SPELL_THROWAXE);
|
||||
events.RepeatEvent(8 * IN_MILLISECONDS);
|
||||
events.Repeat(8s);
|
||||
break;
|
||||
case EVENT_THRASH:
|
||||
DoCastSelf(SPELL_THRASH);
|
||||
events.RepeatEvent(10 * IN_MILLISECONDS);
|
||||
events.Repeat(10s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,10 +39,7 @@ enum EventIds
|
||||
EVENT_SOLAKAR_WAVE = 3
|
||||
};
|
||||
|
||||
enum Timers
|
||||
{
|
||||
TIMER_SOLAKAR_WAVE = 30000
|
||||
};
|
||||
constexpr Milliseconds TIMER_SOLAKAR_WAVE = 30s;
|
||||
|
||||
enum SolakarWaves
|
||||
{
|
||||
@ -1049,7 +1046,7 @@ public:
|
||||
break;
|
||||
case EVENT_VAEL_3_DESPAWN:
|
||||
DoCast(me, SPELL_VAELASTRASZ_SPAWN);
|
||||
me->DespawnOrUnsummon(1500);
|
||||
me->DespawnOrUnsummon(1500ms);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -118,7 +118,7 @@ public:
|
||||
return !victim->HasAura(SPELL_TIMELAPSE);
|
||||
}
|
||||
|
||||
void SetGUID(ObjectGuid guid, int32 id) override
|
||||
void SetGUID(ObjectGuid const& guid, int32 id) override
|
||||
{
|
||||
if (id == GUID_LEVER_USER)
|
||||
{
|
||||
|
||||
@ -435,7 +435,7 @@ public:
|
||||
break;
|
||||
case EVENT_SUCCESS_2:
|
||||
DoCast(me, SPELL_VAELASTRASZZ_SPAWN);
|
||||
me->DespawnOrUnsummon(1000);
|
||||
me->DespawnOrUnsummon(1s);
|
||||
break;
|
||||
case EVENT_PATH_3:
|
||||
me->GetMotionMaster()->MovePath(NEFARIUS_PATH_3, false);
|
||||
|
||||
@ -152,7 +152,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SetGUID(ObjectGuid const guid, int32 /*id*/) override
|
||||
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
|
||||
{
|
||||
_charmerGUID = guid;
|
||||
}
|
||||
|
||||
@ -345,7 +345,7 @@ public:
|
||||
{
|
||||
case NPC_BLACKWING_DRAGON:
|
||||
--addsCount[0];
|
||||
if (EggEvent != DONE && _events.GetTimeUntilEvent(EVENT_RAZOR_SPAWN) == Milliseconds::max())
|
||||
if (EggEvent != DONE && !_events.HasTimeUntilEvent(EVENT_RAZOR_SPAWN))
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_RAZOR_SPAWN, 1s);
|
||||
}
|
||||
@ -353,7 +353,7 @@ public:
|
||||
case NPC_BLACKWING_LEGIONAIRE:
|
||||
case NPC_BLACKWING_MAGE:
|
||||
--addsCount[1];
|
||||
if (EggEvent != DONE && _events.GetTimeUntilEvent(EVENT_RAZOR_SPAWN) == Milliseconds::max())
|
||||
if (EggEvent != DONE && !_events.HasTimeUntilEvent(EVENT_RAZOR_SPAWN))
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_RAZOR_SPAWN, 1s);
|
||||
}
|
||||
@ -413,7 +413,7 @@ public:
|
||||
|
||||
if (spawnMoreAdds)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_RAZOR_SPAWN, 15000);
|
||||
_events.ScheduleEvent(EVENT_RAZOR_SPAWN, 15s);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -91,7 +91,7 @@ public:
|
||||
case EVENT_INFERNO:
|
||||
{
|
||||
DoCastAOE(SPELL_INFERNO);
|
||||
events.RepeatEvent(urand(21000, 26000));
|
||||
events.Repeat(21s, 26s);
|
||||
break;
|
||||
}
|
||||
case EVENT_IGNITE_MANA:
|
||||
@ -101,7 +101,7 @@ public:
|
||||
DoCast(target, SPELL_IGNITE_MANA);
|
||||
}
|
||||
|
||||
events.RepeatEvent(urand(27000, 32000));
|
||||
events.Repeat(27s, 32s);
|
||||
break;
|
||||
}
|
||||
case EVENT_LIVING_BOMB:
|
||||
@ -111,7 +111,7 @@ public:
|
||||
DoCast(target, SPELL_LIVING_BOMB);
|
||||
}
|
||||
|
||||
events.RepeatEvent(urand(11000, 16000));
|
||||
events.Repeat(11s, 16s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,13 +111,13 @@ public:
|
||||
case EVENT_ANTIMAGIC_PULSE:
|
||||
{
|
||||
DoCastSelf(SPELL_ANTIMAGIC_PULSE);
|
||||
events.RepeatEvent(20000);
|
||||
events.Repeat(20s);
|
||||
break;
|
||||
}
|
||||
case EVENT_MAGMA_SHACKLES:
|
||||
{
|
||||
DoCastSelf(SPELL_MAGMA_SHACKLES);
|
||||
events.RepeatEvent(15000);
|
||||
events.Repeat(15s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ public:
|
||||
case EVENT_GEHENNAS_CURSE:
|
||||
{
|
||||
DoCastVictim(SPELL_GEHENNAS_CURSE);
|
||||
events.RepeatEvent(urand(25000, 30000));
|
||||
events.Repeat(25s, 30s);
|
||||
break;
|
||||
}
|
||||
case EVENT_RAIN_OF_FIRE:
|
||||
@ -67,7 +67,7 @@ public:
|
||||
{
|
||||
DoCast(target, SPELL_RAIN_OF_FIRE, true);
|
||||
}
|
||||
events.RepeatEvent(6000);
|
||||
events.Repeat(6s);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHADOW_BOLT:
|
||||
@ -88,7 +88,7 @@ public:
|
||||
DoCastVictim(SPELL_SHADOW_BOLT_VICTIM);
|
||||
}
|
||||
|
||||
events.RepeatEvent(5000);
|
||||
events.Repeat(5s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,19 +57,19 @@ public:
|
||||
case EVENT_IMPENDING_DOOM:
|
||||
{
|
||||
DoCastVictim(SPELL_IMPENDING_DOOM);
|
||||
events.RepeatEvent(20000);
|
||||
events.Repeat(20s);
|
||||
break;
|
||||
}
|
||||
case EVENT_LUCIFRON_CURSE:
|
||||
{
|
||||
DoCastVictim(SPELL_LUCIFRON_CURSE);
|
||||
events.RepeatEvent(20000);
|
||||
events.Repeat(20s);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHADOW_SHOCK:
|
||||
{
|
||||
DoCastVictim(SPELL_SHADOW_SHOCK);
|
||||
events.RepeatEvent(5000);
|
||||
events.Repeat(5s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,13 +73,13 @@ public:
|
||||
{
|
||||
Talk(EMOTE_FRENZY);
|
||||
DoCastSelf(SPELL_FRENZY);
|
||||
events.RepeatEvent(urand(15000, 20000));
|
||||
events.Repeat(15s, 20s);
|
||||
break;
|
||||
}
|
||||
case EVENT_PANIC:
|
||||
{
|
||||
DoCastVictim(SPELL_PANIC);
|
||||
events.RepeatEvent(urand(31000, 38000));
|
||||
events.Repeat(31s, 38s);
|
||||
break;
|
||||
}
|
||||
case EVENT_LAVA_BOMB:
|
||||
@ -89,7 +89,7 @@ public:
|
||||
DoCast(target, SPELL_LAVA_BOMB);
|
||||
}
|
||||
|
||||
events.RepeatEvent(urand(12000, 15000));
|
||||
events.Repeat(12s, 15s);
|
||||
break;
|
||||
}
|
||||
case EVENT_LAVA_BOMB_RANGED:
|
||||
@ -104,7 +104,7 @@ public:
|
||||
{
|
||||
DoCast(targets.front() , SPELL_LAVA_BOMB_RANGED);
|
||||
}
|
||||
events.RepeatEvent(urand(12000, 15000));
|
||||
events.Repeat(12s, 15s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ public:
|
||||
{
|
||||
DoCastSelf(SPELL_DAMAGE_REFLECTION);
|
||||
}
|
||||
events.RepeatEvent(30000);
|
||||
events.Repeat(30s);
|
||||
break;
|
||||
}
|
||||
case EVENT_TELEPORT_RANDOM:
|
||||
@ -359,14 +359,14 @@ public:
|
||||
DoCast(target, SPELL_TELEPORT_RANDOM);
|
||||
}
|
||||
|
||||
events.RepeatEvent(30000);
|
||||
events.Repeat(30s);
|
||||
break;
|
||||
}
|
||||
case EVENT_TELEPORT_TARGET:
|
||||
{
|
||||
DoCastSelf(SPELL_HATE_TO_ZERO, true);
|
||||
DoCastAOE(SPELL_TELEPORT_TARGET);
|
||||
events.RepeatEvent(30000);
|
||||
events.Repeat(30s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,13 +183,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SetGUID(ObjectGuid guid, int32 index) override
|
||||
void SetGUID(ObjectGuid const& guid, int32 index) override
|
||||
{
|
||||
if (index == GO_LAVA_BURST)
|
||||
{
|
||||
if (_lavaBurstGUIDS.empty())
|
||||
{
|
||||
extraEvents.ScheduleEvent(EVENT_LAVA_BURST_TRIGGER, 1);
|
||||
extraEvents.ScheduleEvent(EVENT_LAVA_BURST_TRIGGER, 1ms);
|
||||
}
|
||||
|
||||
_lavaBurstGUIDS.insert(guid);
|
||||
@ -309,7 +309,7 @@ public:
|
||||
}
|
||||
|
||||
_lavaBurstGUIDS.erase(lavaBurstGUID);
|
||||
extraEvents.RepeatEvent(1000);
|
||||
extraEvents.Repeat(1s);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -350,7 +350,7 @@ public:
|
||||
{
|
||||
Talk(SAY_WRATH);
|
||||
}
|
||||
events.RepeatEvent(25000);
|
||||
events.Repeat(25s);
|
||||
break;
|
||||
}
|
||||
case EVENT_HAND_OF_RAGNAROS:
|
||||
@ -362,7 +362,7 @@ public:
|
||||
_isKnockbackEmoteAllowed = false;
|
||||
extraEvents.RescheduleEvent(EVENT_RESET_KNOCKBACK_EMOTE, 5s);
|
||||
}
|
||||
events.RepeatEvent(20000);
|
||||
events.Repeat(20s);
|
||||
break;
|
||||
}
|
||||
case EVENT_LAVA_BURST:
|
||||
@ -401,7 +401,7 @@ public:
|
||||
extraEvents.RescheduleEvent(EVENT_RESET_KNOCKBACK_EMOTE, 5s);
|
||||
}
|
||||
}
|
||||
events.RepeatEvent(urand(11000, 30000));
|
||||
events.Repeat(11s, 30s);
|
||||
break;
|
||||
}
|
||||
case EVENT_SUBMERGE:
|
||||
|
||||
@ -67,7 +67,7 @@ public:
|
||||
case EVENT_ARCANE_EXPLOSION:
|
||||
{
|
||||
DoCastVictim(SPELL_ARCANE_EXPLOSION);
|
||||
events.RepeatEvent(urand(4000, 5000));
|
||||
events.Repeat(4s, 5s);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHAZZRAH_CURSE:
|
||||
@ -76,26 +76,26 @@ public:
|
||||
{
|
||||
DoCast(target, SPELL_SHAZZRAH_CURSE);
|
||||
}
|
||||
events.RepeatEvent(urand(23000, 26000));
|
||||
events.Repeat(23s, 26s);
|
||||
break;
|
||||
}
|
||||
case EVENT_MAGIC_GROUNDING:
|
||||
{
|
||||
DoCastSelf(SPELL_MAGIC_GROUNDING);
|
||||
events.RepeatEvent(urand(7000, 9000));
|
||||
events.Repeat(7s, 9s);
|
||||
break;
|
||||
}
|
||||
case EVENT_COUNTERSPELL:
|
||||
{
|
||||
DoCastAOE(SPELL_COUNTERSPELL);
|
||||
events.RepeatEvent(urand(15000, 18000));
|
||||
events.Repeat(15s, 18s);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHAZZRAH_GATE:
|
||||
{
|
||||
DoCastAOE(SPELL_SHAZZRAH_GATE_DUMMY);
|
||||
events.RescheduleEvent(EVENT_ARCANE_EXPLOSION, 3s, 6s);
|
||||
events.RepeatEvent(45000);
|
||||
events.Repeat(45s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ public:
|
||||
case EVENT_DEMORALIZING_SHOUT:
|
||||
{
|
||||
DoCastVictim(SPELL_DEMORALIZING_SHOUT);
|
||||
events.RepeatEvent(urand(12000, 18000));
|
||||
events.Repeat(12s, 18s);
|
||||
break;
|
||||
}
|
||||
case EVENT_INSPIRE:
|
||||
@ -84,19 +84,19 @@ public:
|
||||
}
|
||||
|
||||
DoCastSelf(SPELL_INSPIRE);
|
||||
events.RepeatEvent(urand(13000, 20000));
|
||||
events.Repeat(13s, 20s);
|
||||
break;
|
||||
}
|
||||
case EVENT_KNOCKDOWN:
|
||||
{
|
||||
DoCastVictim(SPELL_KNOCKDOWN);
|
||||
events.RepeatEvent(urand(10000, 20000));
|
||||
events.Repeat(10s, 20s);
|
||||
break;
|
||||
}
|
||||
case EVENT_FLAMESPEAR:
|
||||
{
|
||||
DoCastRandomTarget(SPELL_FLAMESPEAR);
|
||||
events.RepeatEvent(urand(12000, 16000));
|
||||
events.Repeat(12s, 16s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -133,7 +133,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_DARK_STRIKE, 4s, 7s);
|
||||
events.ScheduleEvent(EVENT_DARK_MENDING, 15s, 30s);
|
||||
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 2s, 4s);
|
||||
events.ScheduleEvent(EVENT_IMMOLATE, 3500ms, 6000ms);
|
||||
events.ScheduleEvent(EVENT_IMMOLATE, 3500ms, 6s);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -157,7 +157,7 @@ public:
|
||||
case EVENT_DARK_STRIKE:
|
||||
{
|
||||
DoCastVictim(SPELL_DARK_STRIKE);
|
||||
events.RepeatEvent(urand(4000, 7000));
|
||||
events.Repeat(4s, 7s);
|
||||
break;
|
||||
}
|
||||
case EVENT_DARK_MENDING:
|
||||
@ -169,7 +169,7 @@ public:
|
||||
DoCast(target, SPELL_DARK_MENDING);
|
||||
}
|
||||
}
|
||||
events.RepeatEvent(urand(15000, 20000));
|
||||
events.Repeat(15s, 20s);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHADOW_WORD_PAIN:
|
||||
@ -178,7 +178,7 @@ public:
|
||||
{
|
||||
DoCast(target, SPELL_SHADOW_WORD_PAIN);
|
||||
}
|
||||
events.RepeatEvent(urand(2500, 5000));
|
||||
events.Repeat(2500ms, 5s);
|
||||
break;
|
||||
}
|
||||
case EVENT_IMMOLATE:
|
||||
@ -187,7 +187,7 @@ public:
|
||||
{
|
||||
DoCast(target, SPELL_IMMOLATE);
|
||||
}
|
||||
events.RepeatEvent(urand(5000, 7000));
|
||||
events.Repeat(5s, 7s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ class spell_mc_play_dead_aura : public AuraScript
|
||||
else
|
||||
{
|
||||
Unit::Kill(creatureTarget, creatureTarget);
|
||||
creatureTarget->DespawnOrUnsummon(14000);
|
||||
creatureTarget->DespawnOrUnsummon(14s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ public:
|
||||
if (me->HealthBelowPct(67) && !health67)
|
||||
{
|
||||
me->CastSpell(me, SPELL_SMITE_STOMP, false);
|
||||
events.DelayEvents(10000);
|
||||
events.DelayEvents(10s);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(EQUIP_TWO_SWORDS, 1.859f, -780.72f, 9.831f);
|
||||
Talk(SAY_SWAP1);
|
||||
@ -105,7 +105,7 @@ public:
|
||||
if (me->HealthBelowPct(34) && !health34)
|
||||
{
|
||||
me->CastSpell(me, SPELL_SMITE_STOMP, false);
|
||||
events.DelayEvents(10000);
|
||||
events.DelayEvents(10s);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(EQUIP_MACE, 1.859f, -780.72f, 9.831f);
|
||||
Talk(SAY_SWAP2);
|
||||
|
||||
@ -131,7 +131,7 @@ public:
|
||||
uint32 checkTimer;
|
||||
ObjectGuid playerGUID;
|
||||
|
||||
void SetGUID(ObjectGuid guid, int32) override
|
||||
void SetGUID(ObjectGuid const& guid, int32) override
|
||||
{
|
||||
playerGUID = guid;
|
||||
}
|
||||
@ -146,7 +146,7 @@ public:
|
||||
{
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
player->GroupEventHappens(QUEST_A_FINE_MESS, me);
|
||||
me->DespawnOrUnsummon(1000);
|
||||
me->DespawnOrUnsummon(1s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ struct boss_shade_of_aran : public BossAI
|
||||
return me->GetDistance2d(roomCenter.GetPositionX(), roomCenter.GetPositionY()) < 45.0f;
|
||||
}
|
||||
|
||||
void SetGUID(ObjectGuid guid, int32 id) override
|
||||
void SetGUID(ObjectGuid const& guid, int32 id) override
|
||||
{
|
||||
if (id == ACTION_ATIESH_REACT && !_atieshReaction)
|
||||
{
|
||||
|
||||
@ -88,7 +88,7 @@ struct npc_kilrek : public ScriptedAI
|
||||
DoCast(Terestian, SPELL_BROKEN_PACT, true);
|
||||
}
|
||||
}
|
||||
me->DespawnOrUnsummon(15000);
|
||||
me->DespawnOrUnsummon(15s);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
@ -523,9 +523,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
me->DespawnOrUnsummon(100);
|
||||
me->DespawnOrUnsummon(100ms);
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->DespawnOrUnsummon(100);
|
||||
arca->DespawnOrUnsummon(100ms);
|
||||
|
||||
return 5000;
|
||||
default:
|
||||
|
||||
@ -138,7 +138,7 @@ struct boss_felblood_kaelthas : public BossAI
|
||||
|
||||
ScheduleTimedEvent(0ms, [&]{
|
||||
DoCastVictim(SPELL_FIREBALL);
|
||||
}, 3000ms, 4500ms);
|
||||
}, 3s, 4500ms);
|
||||
ScheduleTimedEvent(15s, [&]{
|
||||
Talk(SAY_PHOENIX);
|
||||
DoCastSelf(SPELL_PHOENIX);
|
||||
|
||||
@ -95,7 +95,7 @@ struct boss_selin_fireheart : public BossAI
|
||||
BossAI::JustEngagedWith(who);
|
||||
ScheduleTimedEvent(2500ms, [&]{
|
||||
DoCastRandomTarget(SPELL_DRAIN_LIFE);
|
||||
}, 10000ms);
|
||||
}, 10s);
|
||||
ScheduleTimedEvent(2s, [&]{
|
||||
me->RemoveAuraFromStack(SPELL_MANA_RAGE_TRIGGER);
|
||||
DoCastAOE(SPELL_FEL_EXPLOSION);
|
||||
|
||||
@ -141,7 +141,7 @@ struct boss_vexallus : public BossAI
|
||||
void SummonedCreatureDies(Creature* summon, Unit* killer) override
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
summon->DespawnOrUnsummon(1);
|
||||
summon->DespawnOrUnsummon(1ms);
|
||||
if (killer)
|
||||
killer->CastSpell(killer, SPELL_ENERGY_FEEDBACK, true, 0, 0, summon->GetGUID());
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ public:
|
||||
me->RemoveAllAuras();
|
||||
me->CastSpell(attacker, SPELL_DUEL_VICTORY, true);
|
||||
me->RestoreFaction();
|
||||
me->DespawnOrUnsummon(10000);
|
||||
me->DespawnOrUnsummon(10s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -396,7 +396,7 @@ public:
|
||||
AttackStart(attacker);
|
||||
}
|
||||
|
||||
void SetGUID(ObjectGuid guid, int32) override
|
||||
void SetGUID(ObjectGuid const& guid, int32) override
|
||||
{
|
||||
gothikGUID = guid;
|
||||
events.ScheduleEvent(EVENT_GHOUL_MOVE_TO_PIT, 3s);
|
||||
@ -407,7 +407,7 @@ public:
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && point == 1)
|
||||
{
|
||||
me->DespawnOrUnsummon(1500);
|
||||
me->DespawnOrUnsummon(1500ms);
|
||||
me->CastSpell(me, SPELL_GHOUL_SUBMERGE, true);
|
||||
}
|
||||
}
|
||||
@ -438,7 +438,7 @@ public:
|
||||
if (owner->GetVictim())
|
||||
AttackStart(owner->GetVictim());
|
||||
|
||||
events.RepeatEvent(1000);
|
||||
events.Repeat(1s);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -760,22 +760,22 @@ public:
|
||||
{
|
||||
case EVENT_ICY_TOUCH:
|
||||
DoCastVictim(SPELL_ICY_TOUCH);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.DelayEvents(1s, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_ICY_TOUCH, 5s, GCD_CAST);
|
||||
break;
|
||||
case EVENT_PLAGUE_STRIKE:
|
||||
DoCastVictim(SPELL_PLAGUE_STRIKE);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.DelayEvents(1s, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_PLAGUE_STRIKE, 5s, GCD_CAST);
|
||||
break;
|
||||
case EVENT_BLOOD_STRIKE:
|
||||
DoCastVictim(SPELL_BLOOD_STRIKE);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.DelayEvents(1s, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5s, GCD_CAST);
|
||||
break;
|
||||
case EVENT_DEATH_COIL:
|
||||
DoCastVictim(SPELL_DEATH_COIL);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.DelayEvents(1s, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_DEATH_COIL, 5s, GCD_CAST);
|
||||
break;
|
||||
}
|
||||
@ -806,7 +806,7 @@ public:
|
||||
|
||||
ObjectGuid prisonerGUID;
|
||||
|
||||
void SetGUID(ObjectGuid guid, int32 /*id*/) override
|
||||
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
|
||||
{
|
||||
if (!prisonerGUID)
|
||||
prisonerGUID = guid;
|
||||
@ -866,7 +866,7 @@ public:
|
||||
|
||||
ObjectGuid minerGUID;
|
||||
|
||||
void SetGUID(ObjectGuid guid, int32 /*id*/) override
|
||||
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
|
||||
{
|
||||
minerGUID = guid;
|
||||
}
|
||||
|
||||
@ -613,7 +613,7 @@ public:
|
||||
me->GetMotionMaster()->MovePath(pathId, true); // true = repeatable
|
||||
}
|
||||
// Schedule the first ritual after 20-30s
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, urand(20000, 30000));
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, 20s, 30s);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -628,7 +628,7 @@ public:
|
||||
{
|
||||
if (isOnRitual) // Already performing ritual
|
||||
{
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, urand(5000, 10000));
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, 5s, 10s);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -655,7 +655,7 @@ public:
|
||||
if (!nearestCorpse)
|
||||
{
|
||||
// No corpse found nearby: try again later
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, urand(5000, 10000));
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, 5s, 10s);
|
||||
break;
|
||||
}
|
||||
// Start ritual
|
||||
@ -702,7 +702,7 @@ public:
|
||||
// Resume paused waypoint movement
|
||||
me->ResumeMovement();
|
||||
// Schedule next ritual in 20-30s
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, urand(20000, 30000));
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, 20s, 30s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -723,9 +723,9 @@ public:
|
||||
me->SetFacingToObject(geist);
|
||||
geistGUID = geist->GetGUID();
|
||||
// Geist found: schedule Ghoulplosion at +3s, then raising at +6s, then resume at +9s
|
||||
events.ScheduleEvent(EVENT_GHOULPLOSION, 3000);
|
||||
events.ScheduleEvent(EVENT_RAISE_GHOUL, 6000);
|
||||
events.ScheduleEvent(EVENT_RESUME_WP, 9000);
|
||||
events.ScheduleEvent(EVENT_GHOULPLOSION, 3s);
|
||||
events.ScheduleEvent(EVENT_RAISE_GHOUL, 6s);
|
||||
events.ScheduleEvent(EVENT_RESUME_WP, 9s);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -737,8 +737,8 @@ public:
|
||||
me->SetFacingToObject(corpse);
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_RAISE_GHOUL, 3000);
|
||||
events.ScheduleEvent(EVENT_RESUME_WP, 6000);
|
||||
events.ScheduleEvent(EVENT_RAISE_GHOUL, 3s);
|
||||
events.ScheduleEvent(EVENT_RESUME_WP, 6s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -800,7 +800,7 @@ public:
|
||||
me->GetMotionMaster()->MovePath(pathId, true); // true = repeatable
|
||||
}
|
||||
// Schedule the first ritual after 50-60s
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, urand(50000, 60000));
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, 50s, 60s);
|
||||
}
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
@ -814,7 +814,7 @@ public:
|
||||
{
|
||||
if (isOnRitual) // Already performing ritual
|
||||
{
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, urand(5000, 10000));
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, 5s, 10s);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -841,7 +841,7 @@ public:
|
||||
}
|
||||
if (!nearestCorpse)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, urand(5000, 10000));
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, 5s, 10s);
|
||||
break;
|
||||
}
|
||||
// Start ritual
|
||||
@ -894,7 +894,7 @@ public:
|
||||
// Resume paused waypoint movement
|
||||
me->ResumeMovement();
|
||||
// Schedule next ritual in 50-60s
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, urand(50000, 60000));
|
||||
events.ScheduleEvent(EVENT_START_RITUAL, 50s, 60s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -923,15 +923,15 @@ public:
|
||||
me->SetFacingToObject(geist);
|
||||
geistGUID = geist->GetGUID();
|
||||
// Geist present: Ghoulplosion in 3s (with SAY_GEIST), raise in 6s, resume in 9s
|
||||
events.ScheduleEvent(EVENT_GHOULPLOSION, 3000);
|
||||
events.ScheduleEvent(EVENT_RAISE_DEAD, 6000);
|
||||
events.ScheduleEvent(EVENT_RESUME_WP, 9000);
|
||||
events.ScheduleEvent(EVENT_GHOULPLOSION, 3s);
|
||||
events.ScheduleEvent(EVENT_RAISE_DEAD, 6s);
|
||||
events.ScheduleEvent(EVENT_RESUME_WP, 9s);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No Geist: raise in 3s, resume in 6s
|
||||
events.ScheduleEvent(EVENT_RAISE_DEAD, 3000);
|
||||
events.ScheduleEvent(EVENT_RESUME_WP, 6000);
|
||||
events.ScheduleEvent(EVENT_RAISE_DEAD, 3s);
|
||||
events.ScheduleEvent(EVENT_RESUME_WP, 6s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -526,11 +526,11 @@ public:
|
||||
if (battleStarted != ENCOUNTER_STATE_FIGHT)
|
||||
return;
|
||||
|
||||
events.RescheduleEvent(EVENT_SPELL_ANTI_MAGIC_ZONE, 15000);
|
||||
events.RescheduleEvent(EVENT_SPELL_DEATH_STRIKE, 8000);
|
||||
events.RescheduleEvent(EVENT_SPELL_DEATH_EMBRACE, 5000);
|
||||
events.RescheduleEvent(EVENT_SPELL_UNHOLY_BLIGHT, 10000);
|
||||
events.RescheduleEvent(EVENT_SPELL_DARION_MOD_DAMAGE, 500);
|
||||
events.RescheduleEvent(EVENT_SPELL_ANTI_MAGIC_ZONE, 15s);
|
||||
events.RescheduleEvent(EVENT_SPELL_DEATH_STRIKE, 8s);
|
||||
events.RescheduleEvent(EVENT_SPELL_DEATH_EMBRACE, 5s);
|
||||
events.RescheduleEvent(EVENT_SPELL_UNHOLY_BLIGHT, 10s);
|
||||
events.RescheduleEvent(EVENT_SPELL_DARION_MOD_DAMAGE, 500ms);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
@ -692,7 +692,7 @@ public:
|
||||
orbaz->SetReactState(REACT_PASSIVE);
|
||||
orbaz->AI()->Talk(EMOTE_LIGHT_OF_DAWN04);
|
||||
orbaz->GetMotionMaster()->MovePoint(2, LightOfDawnPos[2], true, true);
|
||||
orbaz->DespawnOrUnsummon(7000);
|
||||
orbaz->DespawnOrUnsummon(7s);
|
||||
}
|
||||
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
@ -839,7 +839,7 @@ public:
|
||||
alex->AI()->Talk(SAY_LIGHT_OF_DAWN41);
|
||||
|
||||
if (Creature* darion = GetEntryFromSummons(NPC_DARION_MOGRAINE))
|
||||
darion->DespawnOrUnsummon(3000);
|
||||
darion->DespawnOrUnsummon(3s);
|
||||
break;
|
||||
case EVENT_OUTRO_SCENE_19:
|
||||
if (Creature* alex = GetEntryFromSummons(NPC_HIGHLORD_ALEXANDROS_MOGRAINE))
|
||||
@ -886,7 +886,7 @@ public:
|
||||
case EVENT_OUTRO_SCENE_23:
|
||||
if (Creature* alex = GetEntryFromSummons(NPC_HIGHLORD_ALEXANDROS_MOGRAINE))
|
||||
{
|
||||
alex->DespawnOrUnsummon(5000);
|
||||
alex->DespawnOrUnsummon(5s);
|
||||
alex->SetVisible(false);
|
||||
}
|
||||
break;
|
||||
@ -1055,7 +1055,7 @@ public:
|
||||
if (Creature* lk = GetEntryFromSummons(NPC_THE_LICH_KING))
|
||||
{
|
||||
lk->CastSpell(lk, SPELL_EXIT_TELEPORT_VISUAL, true);
|
||||
lk->DespawnOrUnsummon(1500);
|
||||
lk->DespawnOrUnsummon(1500ms);
|
||||
}
|
||||
|
||||
if (Creature* tirion = GetEntryFromSummons(NPC_HIGHLORD_TIRION_FORDRING))
|
||||
@ -1145,7 +1145,7 @@ public:
|
||||
}
|
||||
case EVENT_OUTRO_SCENE_61:
|
||||
summons.DespawnAll();
|
||||
me->DespawnOrUnsummon(1);
|
||||
me->DespawnOrUnsummon(1ms);
|
||||
events.Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -36,16 +36,13 @@ enum BossData
|
||||
GANDLING_ROOM_TO_USE
|
||||
};
|
||||
|
||||
enum Timers
|
||||
{
|
||||
TIMER_ARCANE_MIN = 8000,
|
||||
TIMER_ARCANE_MAX = 14000,
|
||||
TIMER_CURSE_MIN = 20000,
|
||||
TIMER_CURSE_MAX = 30000,
|
||||
TIMER_SHIELD_MIN = 30000,
|
||||
TIMER_SHIELD_MAX = 40000,
|
||||
TIMER_PORTAL = 25000
|
||||
};
|
||||
constexpr Milliseconds TIMER_ARCANE_MIN = 8s;
|
||||
constexpr Milliseconds TIMER_ARCANE_MAX = 14s;
|
||||
constexpr Milliseconds TIMER_CURSE_MIN = 20s;
|
||||
//constexpr Milliseconds TIMER_CURSE_MAX = 30s;
|
||||
constexpr Milliseconds TIMER_SHIELD_MIN = 30s;
|
||||
//constexpr Milliseconds TIMER_SHIELD_MAX = 40s;
|
||||
constexpr Milliseconds TIMER_PORTAL = 25s;
|
||||
|
||||
enum IdPortalSpells
|
||||
{
|
||||
@ -335,18 +332,18 @@ public:
|
||||
{
|
||||
case SPELL_ARCANE_MISSILES:
|
||||
DoCastVictim(SPELL_ARCANE_MISSILES);
|
||||
events.ScheduleEvent(SPELL_ARCANE_MISSILES, urand(TIMER_ARCANE_MIN, TIMER_ARCANE_MAX));
|
||||
events.ScheduleEvent(SPELL_ARCANE_MISSILES, TIMER_ARCANE_MIN, TIMER_ARCANE_MAX);
|
||||
break;
|
||||
case SPELL_CURSE_DARKMASTER:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
||||
{
|
||||
DoCast(target, SPELL_CURSE_DARKMASTER);
|
||||
}
|
||||
events.ScheduleEvent(SPELL_ARCANE_MISSILES, urand(TIMER_ARCANE_MIN, TIMER_ARCANE_MAX));
|
||||
events.ScheduleEvent(SPELL_ARCANE_MISSILES, TIMER_ARCANE_MIN, TIMER_ARCANE_MAX);
|
||||
break;
|
||||
case SPELL_SHADOW_SHIELD:
|
||||
DoCastSelf(SPELL_SHADOW_SHIELD);
|
||||
events.ScheduleEvent(SPELL_ARCANE_MISSILES, urand(TIMER_ARCANE_MIN, TIMER_ARCANE_MAX));
|
||||
events.ScheduleEvent(SPELL_ARCANE_MISSILES, TIMER_ARCANE_MIN, TIMER_ARCANE_MAX);
|
||||
break;
|
||||
|
||||
case SPELL_SHADOW_PORTAL:
|
||||
|
||||
@ -103,7 +103,7 @@ public:
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
instance->SetData(DATA_KIRTONOS_THE_HERALD, FAIL);
|
||||
me->DespawnOrUnsummon(1);
|
||||
me->DespawnOrUnsummon(1ms);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
|
||||
@ -399,17 +399,17 @@ public:
|
||||
{
|
||||
case 1:
|
||||
me->CastSpell(me, BONE_ARMOR_SPELL, false);
|
||||
events.RepeatEvent(60000);
|
||||
events.Repeat(60s);
|
||||
break;
|
||||
case 2:
|
||||
if (Unit* target = SelectUnitCasting())
|
||||
{
|
||||
me->CastSpell(target, COUNTER_SPELL, false);
|
||||
events.RepeatEvent(urand(10000, 20000));
|
||||
events.Repeat(10s, 20s);
|
||||
}
|
||||
else
|
||||
{
|
||||
events.RepeatEvent(400);
|
||||
events.Repeat(400ms);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@ -417,11 +417,11 @@ public:
|
||||
{
|
||||
me->CastSpell(target, DRAIN_MANA_SPELL, false);
|
||||
}
|
||||
events.RepeatEvent(urand(13000, 20000));
|
||||
events.Repeat(13s, 20s);
|
||||
break;
|
||||
case 4:
|
||||
me->CastSpell(me->GetVictim(), SHADOWBOLT_VOLLEY_SPELL, true);
|
||||
events.RepeatEvent(urand(11000, 17000));
|
||||
events.Repeat(11s, 17s);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -135,14 +135,14 @@ public:
|
||||
if (_slaughterProgress == 2)
|
||||
{
|
||||
for (uint32 i = 0; i < 33; ++i)
|
||||
events.ScheduleEvent(EVENT_SPAWN_MINDLESS, 5000 + i * 210);
|
||||
events.ScheduleEvent(EVENT_SPAWN_MINDLESS, Milliseconds(5000 + i * 210));
|
||||
if (Creature* baron = instance->GetCreature(_baronRivendareGUID))
|
||||
if (GameObject* gate = baron->FindNearestGameObject(GO_SLAUGHTER_GATE_SIDE, 200.0f))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
if (_slaughterProgress == 3)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPAWN_BLACK_GUARD, 20000);
|
||||
events.ScheduleEvent(EVENT_SPAWN_BLACK_GUARD, 20s);
|
||||
}
|
||||
if (_slaughterProgress == 4)
|
||||
{
|
||||
@ -296,7 +296,7 @@ public:
|
||||
_baronRunProgress = DATA_BARON_RUN_GATE;
|
||||
_baronRunTime = 45;
|
||||
DoCastSpellOnPlayers(SPELL_BARON_ULTIMATUM);
|
||||
events.ScheduleEvent(EVENT_BARON_TIME, 60000);
|
||||
events.ScheduleEvent(EVENT_BARON_TIME, 60s);
|
||||
|
||||
if (Creature* baron = instance->GetCreature(_baronRivendareGUID))
|
||||
baron->AI()->Talk(SAY_BARON_INIT_YELL);
|
||||
@ -379,12 +379,12 @@ public:
|
||||
data >> _barthilasrunProgress;
|
||||
if (_baronRunTime)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_BARON_TIME, 60000);
|
||||
events.ScheduleEvent(EVENT_BARON_TIME, 60s);
|
||||
}
|
||||
|
||||
if (_slaughterProgress > 0 && _slaughterProgress < 4)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 5000);
|
||||
events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 5s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,20 +455,20 @@ public:
|
||||
if (i == 0)
|
||||
{
|
||||
// set timer to reset the trap
|
||||
events.ScheduleEvent(EVENT_GATE1_TRAP, 30 * MINUTE * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_GATE1_TRAP, 1800s);
|
||||
// set timer to reopen gates
|
||||
events.ScheduleEvent(EVENT_GATE1_DELAY, 20 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_GATE1_DELAY, 20s);
|
||||
// set timer to spawn the plagued critters
|
||||
events.ScheduleEvent(EVENT_GATE1_CRITTER_DELAY, 2 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_GATE1_CRITTER_DELAY, 2s);
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
// set timer to reset the trap
|
||||
events.ScheduleEvent(EVENT_GATE2_TRAP, 30 * MINUTE * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_GATE2_TRAP, 1800s);
|
||||
// set timer to reopen gates
|
||||
events.ScheduleEvent(EVENT_GATE2_DELAY, 20 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_GATE2_DELAY, 20s);
|
||||
// set timer to spawn the plagued critters
|
||||
events.ScheduleEvent(EVENT_GATE2_CRITTER_DELAY, 2 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_GATE2_CRITTER_DELAY, 2s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,10 +196,10 @@ struct npc_madrigosa : public NullCreatureAI
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->SendMovementFlagUpdate();
|
||||
|
||||
events.ScheduleEvent(EVENT_MAD_1, 2000);
|
||||
events.ScheduleEvent(EVENT_MAD_1, 2s);
|
||||
}
|
||||
else if (param == ACTION_SPAWN_FELMYST)
|
||||
events.ScheduleEvent(EVENT_SPAWN_FELMYST, 60000);
|
||||
events.ScheduleEvent(EVENT_SPAWN_FELMYST, 60s);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -217,27 +217,27 @@ struct npc_madrigosa : public NullCreatureAI
|
||||
}
|
||||
me->GetMotionMaster()->MoveTakeoff(1, 1477.94f, 643.22f, 21.21f);
|
||||
me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD);
|
||||
events.ScheduleEvent(EVENT_MAD_2, 4000);
|
||||
events.ScheduleEvent(EVENT_MAD_2, 4s);
|
||||
break;
|
||||
case EVENT_MAD_2:
|
||||
Talk(SAY_MAD_1);
|
||||
me->CastSpell(me, SPELL_MADRIGOSA_FREEZE, false);
|
||||
events.ScheduleEvent(EVENT_MAD_2_1, 1000);
|
||||
events.ScheduleEvent(EVENT_MAD_2_1, 1s);
|
||||
break;
|
||||
case EVENT_MAD_2_1:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
|
||||
me->SetDisableGravity(false);
|
||||
me->CastSpell(me, SPELL_MADRIGOSA_FROST_BREATH, false);
|
||||
events.ScheduleEvent(EVENT_MAD_3, 7000);
|
||||
events.ScheduleEvent(EVENT_MAD_3, 7s);
|
||||
break;
|
||||
case EVENT_MAD_3:
|
||||
Talk(SAY_MAD_2);
|
||||
events.ScheduleEvent(EVENT_MAD_4, 7000);
|
||||
events.ScheduleEvent(EVENT_MAD_4, 7s);
|
||||
break;
|
||||
case EVENT_MAD_4:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
brutallus->AI()->Talk(YELL_INTRO);
|
||||
events.ScheduleEvent(EVENT_MAD_5, 5000);
|
||||
events.ScheduleEvent(EVENT_MAD_5, 5s);
|
||||
break;
|
||||
case EVENT_MAD_5:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
@ -245,7 +245,7 @@ struct npc_madrigosa : public NullCreatureAI
|
||||
brutallus->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK1H);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK1H);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MAD_6, 10000);
|
||||
events.ScheduleEvent(EVENT_MAD_6, 10s);
|
||||
break;
|
||||
case EVENT_MAD_6:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
@ -255,21 +255,21 @@ struct npc_madrigosa : public NullCreatureAI
|
||||
}
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
|
||||
me->SetDisableGravity(true);
|
||||
events.ScheduleEvent(EVENT_MAD_7, 4000);
|
||||
events.ScheduleEvent(EVENT_MAD_7, 4s);
|
||||
break;
|
||||
case EVENT_MAD_7:
|
||||
Talk(SAY_MAD_3);
|
||||
me->CastSpell(me, SPELL_MADRIGOSA_FROST_BLAST, false);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 3000);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 5000);
|
||||
events.ScheduleEvent(EVENT_MAD_8_1, 6000);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 6500);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 7500);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 8500);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 9500);
|
||||
events.ScheduleEvent(EVENT_MAD_9, 11000);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 12000);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 14000);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 3s);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 5s);
|
||||
events.ScheduleEvent(EVENT_MAD_8_1, 6s);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 6500ms);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 7500ms);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 8500ms);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 9500ms);
|
||||
events.ScheduleEvent(EVENT_MAD_9, 11s);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 12s);
|
||||
events.ScheduleEvent(EVENT_MAD_8, 14s);
|
||||
break;
|
||||
case EVENT_MAD_8:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
@ -286,19 +286,19 @@ struct npc_madrigosa : public NullCreatureAI
|
||||
brutallus->CastSpell(brutallus, SPELL_BRUTALLUS_FEL_FIREBALL, false);
|
||||
brutallus->AI()->Talk(YELL_INTRO_BREAK_ICE);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MAD_11, 6000);
|
||||
events.ScheduleEvent(EVENT_MAD_11, 6s);
|
||||
break;
|
||||
//case EVENT_MAD_10:
|
||||
case EVENT_MAD_11:
|
||||
me->SetDisableGravity(false);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
|
||||
events.ScheduleEvent(EVENT_MAD_13, 2500);
|
||||
events.ScheduleEvent(EVENT_MAD_13, 2500ms);
|
||||
break;
|
||||
case EVENT_MAD_13:
|
||||
Talk(SAY_MAD_4);
|
||||
me->RemoveAllAuras();
|
||||
me->CastSpell(me, SPELL_MADRIGOSA_ENCAPSULATE, false);
|
||||
events.ScheduleEvent(EVENT_MAD_14, 2000);
|
||||
events.ScheduleEvent(EVENT_MAD_14, 2s);
|
||||
break;
|
||||
case EVENT_MAD_14:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
@ -306,7 +306,7 @@ struct npc_madrigosa : public NullCreatureAI
|
||||
brutallus->SetDisableGravity(true);
|
||||
brutallus->GetMotionMaster()->MovePoint(0, brutallus->GetPositionX(), brutallus->GetPositionY() - 30.0f, brutallus->GetPositionZ() + 15.0f, false, true);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MAD_15, 10000);
|
||||
events.ScheduleEvent(EVENT_MAD_15, 10s);
|
||||
break;
|
||||
case EVENT_MAD_15:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
@ -316,28 +316,28 @@ struct npc_madrigosa : public NullCreatureAI
|
||||
brutallus->GetMotionMaster()->MoveFall();
|
||||
brutallus->AI()->Talk(YELL_INTRO_CHARGE);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MAD_16, 1400);
|
||||
events.ScheduleEvent(EVENT_MAD_16, 1400ms);
|
||||
break;
|
||||
case EVENT_MAD_16:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
brutallus->CastSpell(me, SPELL_BRUTALLUS_CHARGE, true);
|
||||
events.ScheduleEvent(EVENT_MAD_17, 1200);
|
||||
events.ScheduleEvent(EVENT_MAD_17, 1200ms);
|
||||
break;
|
||||
case EVENT_MAD_17:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
brutallus->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK1H);
|
||||
events.ScheduleEvent(EVENT_MAD_18, 500);
|
||||
events.ScheduleEvent(EVENT_MAD_18, 500ms);
|
||||
break;
|
||||
case EVENT_MAD_18:
|
||||
Talk(SAY_MAD_5);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
events.ScheduleEvent(EVENT_MAD_19, 6000);
|
||||
events.ScheduleEvent(EVENT_MAD_19, 6s);
|
||||
break;
|
||||
case EVENT_MAD_19:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
brutallus->AI()->Talk(YELL_INTRO_KILL_MADRIGOSA);
|
||||
events.ScheduleEvent(EVENT_MAD_20, 7000);
|
||||
events.ScheduleEvent(EVENT_MAD_20, 7s);
|
||||
break;
|
||||
case EVENT_MAD_20:
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
@ -347,7 +347,7 @@ struct npc_madrigosa : public NullCreatureAI
|
||||
brutallus->AI()->Talk(YELL_INTRO_TAUNT);
|
||||
brutallus->CastSpell(brutallus, SPELL_BRUTALLUS_BREAK_ICE, false);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MAD_21, 4000);
|
||||
events.ScheduleEvent(EVENT_MAD_21, 4s);
|
||||
break;
|
||||
case EVENT_MAD_21:
|
||||
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
|
||||
@ -360,7 +360,7 @@ struct npc_madrigosa : public NullCreatureAI
|
||||
break;
|
||||
case EVENT_SPAWN_FELMYST:
|
||||
DoCastAOE(SPELL_SUMMON_FELBLAZE, true);
|
||||
me->DespawnOrUnsummon(1);
|
||||
me->DespawnOrUnsummon(1ms);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ struct npc_demonic_vapor_trail : public NullCreatureAI
|
||||
void Reset() override
|
||||
{
|
||||
me->CastSpell(me, SPELL_DEMONIC_VAPOR_TRAIL_PERIODIC, true);
|
||||
me->DespawnOrUnsummon(20000);
|
||||
me->DespawnOrUnsummon(20s);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* /*unit*/, SpellInfo const* spellInfo) override
|
||||
|
||||
@ -387,7 +387,7 @@ struct boss_kiljaeden : public BossAI
|
||||
{
|
||||
anveena->RemoveAllAuras();
|
||||
anveena->CastSpell(anveena, SPELL_SACRIFICE_OF_ANVEENA, true);
|
||||
anveena->DespawnOrUnsummon(1500);
|
||||
anveena->DespawnOrUnsummon(1500ms);
|
||||
DoCastSelf(SPELL_CUSTOM_08_STATE, true);
|
||||
me->SetUnitFlag(UNIT_FLAG_PACIFIED);
|
||||
scheduler.CancelAll();
|
||||
@ -555,7 +555,7 @@ struct boss_kiljaeden : public BossAI
|
||||
summon->CastSpell(summon, SPELL_ARMAGEDDON_VISUAL, true);
|
||||
summon->SetPosition(summon->GetPositionX(), summon->GetPositionY(), summon->GetPositionZ() + 20.0f, 0.0f);
|
||||
summon->m_Events.AddEvent(new CastArmageddon(summon), summon->m_Events.CalculateTime(6000));
|
||||
summon->DespawnOrUnsummon(urand(8000, 10000));
|
||||
summon->DespawnOrUnsummon(randtime(8s, 10s));
|
||||
}
|
||||
}
|
||||
|
||||
@ -719,7 +719,7 @@ struct npc_kalecgos_kj : public NullCreatureAI
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->CastSpell(me, SPELL_TELEPORT_AND_TRANSFORM, true);
|
||||
events.ScheduleEvent(EVENT_SCENE_01, 35000);
|
||||
events.ScheduleEvent(EVENT_SCENE_01, 35s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -775,21 +775,21 @@ struct npc_kalecgos_kj : public NullCreatureAI
|
||||
{
|
||||
case EVENT_SCENE_01:
|
||||
Talk(SAY_KALECGOS_GOODBYE);
|
||||
events.ScheduleEvent(eventId + 1, 15000);
|
||||
events.ScheduleEvent(eventId + 1, 15s);
|
||||
break;
|
||||
case EVENT_SCENE_02:
|
||||
me->SummonCreature(NPC_SHATTERED_SUN_RIFTWAKER, 1688.42f, 641.82f, 27.60f, 0.67f);
|
||||
me->SummonCreature(NPC_SHATTERED_SUN_RIFTWAKER, 1712.58f, 616.29f, 27.78f, 0.76f);
|
||||
events.ScheduleEvent(eventId + 1, 6000);
|
||||
events.ScheduleEvent(eventId + 1, 6s);
|
||||
break;
|
||||
case EVENT_SCENE_03:
|
||||
me->SummonCreature(NPC_SHATTRATH_PORTAL_DUMMY, 1727.08f + cos(5.14f), 656.82f + std::sin(5.14f), 28.37f + 2.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
me->SummonCreature(NPC_SHATTRATH_PORTAL_DUMMY, 1738.84f + cos(2.0f), 627.32f + std::sin(2.0f), 28.26f + 2.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
events.ScheduleEvent(eventId + 1, 11000);
|
||||
events.ScheduleEvent(eventId + 1, 11s);
|
||||
break;
|
||||
case EVENT_SCENE_04:
|
||||
me->SummonCreature(NPC_INERT_PORTAL, 1734.96f, 642.43f, 28.06f, 3.49f);
|
||||
events.ScheduleEvent(eventId + 1, 4000);
|
||||
events.ScheduleEvent(eventId + 1, 4s);
|
||||
break;
|
||||
case EVENT_SCENE_05:
|
||||
if (Creature* first = me->SummonCreature(NPC_SHATTERED_SUN_SOLDIER, 1729.48f, 640.49f, 28.06f, 3.49f))
|
||||
@ -800,7 +800,7 @@ struct npc_kalecgos_kj : public NullCreatureAI
|
||||
if (Creature* follower = me->SummonCreature(NPC_SHATTERED_SUN_SOLDIER, 1729.48f + 5 * cos(i * 2.0f * M_PI / 9), 640.49f + 5 * std::sin(i * 2.0f * M_PI / 9), 28.06f, 3.49f))
|
||||
follower->GetMotionMaster()->MoveFollow(first, 3.0f, follower->GetAngle(first));
|
||||
}
|
||||
events.ScheduleEvent(eventId + 1, 10000);
|
||||
events.ScheduleEvent(eventId + 1, 10s);
|
||||
break;
|
||||
case EVENT_SCENE_06:
|
||||
if (Creature* first = me->SummonCreature(NPC_SHATTERED_SUN_SOLDIER, 1729.48f, 640.49f, 28.06f, 3.49f))
|
||||
@ -811,33 +811,33 @@ struct npc_kalecgos_kj : public NullCreatureAI
|
||||
if (Creature* follower = me->SummonCreature(NPC_SHATTERED_SUN_SOLDIER, 1729.48f + 5 * cos(i * 2.0f * M_PI / 9), 640.49f + 5 * std::sin(i * 2.0f * M_PI / 9), 28.06f, 3.49f))
|
||||
follower->GetMotionMaster()->MoveFollow(first, 3.0f, follower->GetAngle(first));
|
||||
}
|
||||
events.ScheduleEvent(eventId + 1, 12000);
|
||||
events.ScheduleEvent(eventId + 1, 12s);
|
||||
break;
|
||||
case EVENT_SCENE_07:
|
||||
me->SummonCreature(NPC_LADY_LIADRIN, 1719.87f, 644.265f, 28.06f, 3.83f);
|
||||
me->SummonCreature(NPC_PROPHET_VELEN, 1717.97f, 646.44f, 28.06f, 3.94f);
|
||||
events.ScheduleEvent(eventId + 1, 7000);
|
||||
events.ScheduleEvent(eventId + 1, 7s);
|
||||
break;
|
||||
case EVENT_SCENE_08:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
velen->AI()->Talk(SAY_VELEN_01);
|
||||
events.ScheduleEvent(eventId + 1, 25000);
|
||||
events.ScheduleEvent(eventId + 1, 25s);
|
||||
break;
|
||||
case EVENT_SCENE_09:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
velen->AI()->Talk(SAY_VELEN_02);
|
||||
events.ScheduleEvent(eventId + 1, 14500);
|
||||
events.ScheduleEvent(eventId + 1, 14500ms);
|
||||
break;
|
||||
case EVENT_SCENE_10:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
velen->AI()->Talk(SAY_VELEN_03);
|
||||
events.ScheduleEvent(eventId + 1, 12500);
|
||||
events.ScheduleEvent(eventId + 1, 12500ms);
|
||||
break;
|
||||
case EVENT_SCENE_11:
|
||||
me->SummonCreature(NPC_THE_CORE_OF_ENTROPIUS, 1698.86f, 628.73f, 92.83f, 0.0f);
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
velen->CastSpell(velen, SPELL_CALL_ENTROPIUS, false);
|
||||
events.ScheduleEvent(eventId + 1, 8000);
|
||||
events.ScheduleEvent(eventId + 1, 8s);
|
||||
break;
|
||||
case EVENT_SCENE_12:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
@ -845,32 +845,32 @@ struct npc_kalecgos_kj : public NullCreatureAI
|
||||
velen->InterruptNonMeleeSpells(false);
|
||||
velen->AI()->Talk(SAY_VELEN_04);
|
||||
}
|
||||
events.ScheduleEvent(eventId + 1, 20000);
|
||||
events.ScheduleEvent(eventId + 1, 20s);
|
||||
break;
|
||||
case EVENT_SCENE_13:
|
||||
if (Creature* liadrin = summons.GetCreatureWithEntry(NPC_LADY_LIADRIN))
|
||||
liadrin->GetMotionMaster()->MovePoint(0, 1711.28f, 637.29f, 27.29f);
|
||||
events.ScheduleEvent(eventId + 1, 6000);
|
||||
events.ScheduleEvent(eventId + 1, 6s);
|
||||
break;
|
||||
case EVENT_SCENE_14:
|
||||
if (Creature* liadrin = summons.GetCreatureWithEntry(NPC_LADY_LIADRIN))
|
||||
liadrin->AI()->Talk(SAY_LIADRIN_01);
|
||||
events.ScheduleEvent(eventId + 1, 10000);
|
||||
events.ScheduleEvent(eventId + 1, 10s);
|
||||
break;
|
||||
case EVENT_SCENE_15:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
velen->AI()->Talk(SAY_VELEN_05);
|
||||
events.ScheduleEvent(eventId + 1, 14000);
|
||||
events.ScheduleEvent(eventId + 1, 14s);
|
||||
break;
|
||||
case EVENT_SCENE_16:
|
||||
if (Creature* liadrin = summons.GetCreatureWithEntry(NPC_LADY_LIADRIN))
|
||||
liadrin->AI()->Talk(SAY_LIADRIN_02);
|
||||
events.ScheduleEvent(eventId + 1, 2000);
|
||||
events.ScheduleEvent(eventId + 1, 2s);
|
||||
break;
|
||||
case EVENT_SCENE_17:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
velen->AI()->Talk(SAY_VELEN_06);
|
||||
events.ScheduleEvent(eventId + 1, 3000);
|
||||
events.ScheduleEvent(eventId + 1, 3s);
|
||||
break;
|
||||
case EVENT_SCENE_18:
|
||||
if (Creature* core = summons.GetCreatureWithEntry(NPC_THE_CORE_OF_ENTROPIUS))
|
||||
@ -878,7 +878,7 @@ struct npc_kalecgos_kj : public NullCreatureAI
|
||||
core->RemoveAllAuras();
|
||||
core->CastSpell(core, SPELL_BLAZE_TO_LIGHT, true);
|
||||
}
|
||||
events.ScheduleEvent(eventId + 1, 8000);
|
||||
events.ScheduleEvent(eventId + 1, 8s);
|
||||
break;
|
||||
case EVENT_SCENE_19:
|
||||
if (Creature* core = summons.GetCreatureWithEntry(NPC_THE_CORE_OF_ENTROPIUS))
|
||||
@ -886,42 +886,42 @@ struct npc_kalecgos_kj : public NullCreatureAI
|
||||
core->SetObjectScale(0.75f);
|
||||
core->GetMotionMaster()->MovePoint(0, core->GetPositionX(), core->GetPositionY(), 28.0f);
|
||||
}
|
||||
events.ScheduleEvent(eventId + 1, 2000);
|
||||
events.ScheduleEvent(eventId + 1, 2s);
|
||||
break;
|
||||
case EVENT_SCENE_20:
|
||||
if (Creature* core = summons.GetCreatureWithEntry(NPC_THE_CORE_OF_ENTROPIUS))
|
||||
core->CastSpell(core, SPELL_SUNWELL_IGNITION, true);
|
||||
events.ScheduleEvent(eventId + 1, 3000);
|
||||
events.ScheduleEvent(eventId + 1, 3s);
|
||||
break;
|
||||
case EVENT_SCENE_21:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
velen->AI()->Talk(SAY_VELEN_07);
|
||||
events.ScheduleEvent(eventId + 1, 15000);
|
||||
events.ScheduleEvent(eventId + 1, 15s);
|
||||
break;
|
||||
case EVENT_SCENE_22:
|
||||
if (Creature* liadrin = summons.GetCreatureWithEntry(NPC_LADY_LIADRIN))
|
||||
liadrin->AI()->Talk(SAY_LIADRIN_03);
|
||||
events.ScheduleEvent(eventId + 1, 20000);
|
||||
events.ScheduleEvent(eventId + 1, 20s);
|
||||
break;
|
||||
case EVENT_SCENE_23:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
velen->AI()->Talk(SAY_VELEN_08);
|
||||
if (Creature* liadrin = summons.GetCreatureWithEntry(NPC_LADY_LIADRIN))
|
||||
liadrin->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
events.ScheduleEvent(eventId + 1, 8000);
|
||||
events.ScheduleEvent(eventId + 1, 8s);
|
||||
break;
|
||||
case EVENT_SCENE_24:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
velen->AI()->Talk(SAY_VELEN_09);
|
||||
events.ScheduleEvent(eventId + 1, 5000);
|
||||
events.ScheduleEvent(eventId + 1, 5s);
|
||||
break;
|
||||
case EVENT_SCENE_25:
|
||||
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
|
||||
{
|
||||
velen->GetMotionMaster()->MovePoint(0, 1739.38f, 643.79f, 28.06f);
|
||||
velen->DespawnOrUnsummon(5000);
|
||||
velen->DespawnOrUnsummon(5s);
|
||||
}
|
||||
events.ScheduleEvent(eventId + 1, 3000);
|
||||
events.ScheduleEvent(eventId + 1, 3s);
|
||||
break;
|
||||
case EVENT_SCENE_26:
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
@ -929,9 +929,9 @@ struct npc_kalecgos_kj : public NullCreatureAI
|
||||
if (summon->GetEntry() == NPC_SHATTERED_SUN_SOLDIER)
|
||||
{
|
||||
summon->GetMotionMaster()->MovePoint(0, 1739.38f, 643.79f, 28.06f);
|
||||
summon->DespawnOrUnsummon(summon->GetExactDist2d(1734.96f, 642.43f) * 100);
|
||||
summon->DespawnOrUnsummon(Milliseconds(uint32(summon->GetExactDist2d(1734.96f, 642.43f) * 100)));
|
||||
}
|
||||
events.ScheduleEvent(eventId + 1, 7000);
|
||||
events.ScheduleEvent(eventId + 1, 7s);
|
||||
break;
|
||||
case EVENT_SCENE_27:
|
||||
me->setActive(false);
|
||||
|
||||
@ -274,7 +274,7 @@ struct npc_singularity : public NullCreatureAI
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
me->DespawnOrUnsummon(18000);
|
||||
me->DespawnOrUnsummon(18s);
|
||||
|
||||
me->m_Events.AddEventAtOffset([&] {
|
||||
DoCastSelf(SPELL_BLACK_HOLE_SUMMON_VISUAL, true);
|
||||
|
||||
@ -161,72 +161,72 @@ static PlayerAbilityStruct PlayerAbility[13][3] =
|
||||
// 0 UNK class (should never be set)
|
||||
{
|
||||
// Warrior as fallback behavior if for some reason UNK class
|
||||
{ SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6000ms }
|
||||
{ SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6s }
|
||||
},
|
||||
// 1 warrior
|
||||
{ { SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6000ms }
|
||||
{ { SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6s }
|
||||
},
|
||||
// 2 paladin
|
||||
{ { SPELL_PA_CONSECRATION, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_PA_HOLY_LIGHT, ABILITY_TARGET_HEAL, 10000ms },
|
||||
{ SPELL_PA_AVENGING_WRATH, ABILITY_TARGET_SELF, 10000ms }
|
||||
{ { SPELL_PA_CONSECRATION, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_PA_HOLY_LIGHT, ABILITY_TARGET_HEAL, 10s },
|
||||
{ SPELL_PA_AVENGING_WRATH, ABILITY_TARGET_SELF, 10s }
|
||||
},
|
||||
// 3 hunter
|
||||
{ { SPELL_HU_EXPLOSIVE_TRAP, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_HU_FREEZING_TRAP, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_HU_SNAKE_TRAP, ABILITY_TARGET_SELF, 10000ms }
|
||||
{ { SPELL_HU_EXPLOSIVE_TRAP, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_HU_FREEZING_TRAP, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_HU_SNAKE_TRAP, ABILITY_TARGET_SELF, 10s }
|
||||
},
|
||||
// 4 rogue
|
||||
{ { SPELL_RO_WOUND_POISON, ABILITY_TARGET_VICTIM, 3000ms },
|
||||
{ SPELL_RO_SLICE_DICE, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_RO_BLIND, ABILITY_TARGET_ENEMY, 10000ms }
|
||||
{ { SPELL_RO_WOUND_POISON, ABILITY_TARGET_VICTIM, 3s },
|
||||
{ SPELL_RO_SLICE_DICE, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_RO_BLIND, ABILITY_TARGET_ENEMY, 10s }
|
||||
},
|
||||
// 5 priest
|
||||
{ { SPELL_PR_PAIN_SUPP, ABILITY_TARGET_HEAL, 10000ms },
|
||||
{ SPELL_PR_HEAL, ABILITY_TARGET_HEAL, 10000ms },
|
||||
{ SPELL_PR_PSYCHIC_SCREAM, ABILITY_TARGET_SELF, 10000ms }
|
||||
{ { SPELL_PR_PAIN_SUPP, ABILITY_TARGET_HEAL, 10s },
|
||||
{ SPELL_PR_HEAL, ABILITY_TARGET_HEAL, 10s },
|
||||
{ SPELL_PR_PSYCHIC_SCREAM, ABILITY_TARGET_SELF, 10s }
|
||||
},
|
||||
// 6 death knight
|
||||
{
|
||||
{ SPELL_DK_PLAGUE_STRIKE, ABILITY_TARGET_ENEMY, 2000ms },
|
||||
{ SPELL_DK_DEATH_AND_DECAY, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_DK_BLOOD_WORMS, ABILITY_TARGET_ENEMY, 5000ms }
|
||||
{ SPELL_DK_PLAGUE_STRIKE, ABILITY_TARGET_ENEMY, 2s },
|
||||
{ SPELL_DK_DEATH_AND_DECAY, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_DK_BLOOD_WORMS, ABILITY_TARGET_ENEMY, 5s }
|
||||
},
|
||||
// 7 shaman
|
||||
{ { SPELL_SH_FIRE_NOVA, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_SH_HEALING_WAVE, ABILITY_TARGET_HEAL, 10000ms },
|
||||
{ SPELL_SH_CHAIN_LIGHT, ABILITY_TARGET_ENEMY, 8000ms }
|
||||
{ { SPELL_SH_FIRE_NOVA, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_SH_HEALING_WAVE, ABILITY_TARGET_HEAL, 10s },
|
||||
{ SPELL_SH_CHAIN_LIGHT, ABILITY_TARGET_ENEMY, 8s }
|
||||
},
|
||||
// 8 mage
|
||||
{ { SPELL_MG_FIREBALL, ABILITY_TARGET_ENEMY, 5000ms },
|
||||
{ SPELL_MG_FROSTBOLT, ABILITY_TARGET_ENEMY, 5000ms },
|
||||
{ SPELL_MG_ICE_LANCE, ABILITY_TARGET_SPECIAL, 2000ms }
|
||||
{ { SPELL_MG_FIREBALL, ABILITY_TARGET_ENEMY, 5s },
|
||||
{ SPELL_MG_FROSTBOLT, ABILITY_TARGET_ENEMY, 5s },
|
||||
{ SPELL_MG_ICE_LANCE, ABILITY_TARGET_SPECIAL, 2s }
|
||||
},
|
||||
// 9 warlock
|
||||
{ { SPELL_WL_CURSE_OF_DOOM, ABILITY_TARGET_ENEMY, 10000ms },
|
||||
{ SPELL_WL_RAIN_OF_FIRE, ABILITY_TARGET_ENEMY, 10000ms },
|
||||
{ SPELL_WL_UNSTABLE_AFFL, ABILITY_TARGET_ENEMY, 10000ms }
|
||||
{ { SPELL_WL_CURSE_OF_DOOM, ABILITY_TARGET_ENEMY, 10s },
|
||||
{ SPELL_WL_RAIN_OF_FIRE, ABILITY_TARGET_ENEMY, 10s },
|
||||
{ SPELL_WL_UNSTABLE_AFFL, ABILITY_TARGET_ENEMY, 10s }
|
||||
},
|
||||
// 10 UNK class (should never be set)
|
||||
{
|
||||
// Warrior as fallback behavior if for some reason UNK class
|
||||
{ SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6000ms }
|
||||
{ SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6s }
|
||||
},
|
||||
// 11 druid
|
||||
{ { SPELL_DR_LIFEBLOOM, ABILITY_TARGET_HEAL, 10000ms },
|
||||
{ SPELL_DR_THORNS, ABILITY_TARGET_SELF, 10000ms },
|
||||
{ SPELL_DR_MOONFIRE, ABILITY_TARGET_ENEMY, 8000ms }
|
||||
{ { SPELL_DR_LIFEBLOOM, ABILITY_TARGET_HEAL, 10s },
|
||||
{ SPELL_DR_THORNS, ABILITY_TARGET_SELF, 10s },
|
||||
{ SPELL_DR_MOONFIRE, ABILITY_TARGET_ENEMY, 8s }
|
||||
},
|
||||
// MISC shadow priest
|
||||
{ { SPELL_PR_MIND_CONTROL, ABILITY_TARGET_ENEMY, 15000ms },
|
||||
{ SPELL_PR_MIND_BLAST, ABILITY_TARGET_ENEMY, 5000ms },
|
||||
{ SPELL_PR_SW_DEATH, ABILITY_TARGET_ENEMY, 10000ms }
|
||||
{ { SPELL_PR_MIND_CONTROL, ABILITY_TARGET_ENEMY, 15s },
|
||||
{ SPELL_PR_MIND_BLAST, ABILITY_TARGET_ENEMY, 5s },
|
||||
{ SPELL_PR_SW_DEATH, ABILITY_TARGET_ENEMY, 10s }
|
||||
}
|
||||
};
|
||||
|
||||
@ -244,7 +244,7 @@ struct boss_hexlord_malacrass : public BossAI
|
||||
{
|
||||
BossAI::Reset();
|
||||
_currentClass = CLASS_NONE;
|
||||
_classAbilityTimer = 10000ms;
|
||||
_classAbilityTimer = 10s;
|
||||
_timeUntilNextDrainPower = 0ms;
|
||||
SpawnAdds();
|
||||
ScheduleHealthCheckEvent(80, [&] {
|
||||
|
||||
@ -285,10 +285,7 @@ struct boss_zuljin : public BossAI
|
||||
instance->SetBossState(DATA_ZULJIN, DONE);
|
||||
Talk(SAY_DEATH);
|
||||
summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
|
||||
|
||||
me->m_Events.AddEventAtOffset( [this] {
|
||||
summons.DespawnAll();
|
||||
}, 3s);
|
||||
summons.DespawnAll(3s);
|
||||
}
|
||||
|
||||
void SpawnAdds()
|
||||
|
||||
@ -78,7 +78,7 @@ struct npc_forest_frog : public ScriptedAI
|
||||
void MovementInform(uint32 type, uint32 data) override
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && data == POINT_DESPAWN)
|
||||
me->DespawnOrUnsummon(1000);
|
||||
me->DespawnOrUnsummon(1s);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@ -103,7 +103,7 @@ struct npc_forest_frog : public ScriptedAI
|
||||
Talk(SAY_THANKS_FREED, player);
|
||||
|
||||
eventTimer = 2;
|
||||
events.ScheduleEvent(eventTimer, urand(4000, 5000));
|
||||
events.ScheduleEvent(eventTimer, 4s, 5s);
|
||||
break;
|
||||
case 2:
|
||||
if (me->GetEntry() != NPC_GUNTER && me->GetEntry() != NPC_KYREN) // vendors don't kneel?
|
||||
@ -140,7 +140,7 @@ struct npc_forest_frog : public ScriptedAI
|
||||
break;
|
||||
}
|
||||
eventTimer = 3;
|
||||
events.ScheduleEvent(eventTimer, urand(6000, 7000));
|
||||
events.ScheduleEvent(eventTimer, 6s, 7s);
|
||||
break;
|
||||
case 3:
|
||||
me->SetStandState(EMOTE_ONESHOT_NONE);
|
||||
@ -152,9 +152,9 @@ struct npc_forest_frog : public ScriptedAI
|
||||
|
||||
eventTimer = 4;
|
||||
if (me->GetEntry() == NPC_GUNTER || me->GetEntry() == NPC_KYREN)
|
||||
events.ScheduleEvent(eventTimer, 5 * MINUTE * IN_MILLISECONDS); // vendors wait for 5 minutes before running away and despawning
|
||||
events.ScheduleEvent(eventTimer, 300s); // vendors wait for 5 minutes before running away and despawning
|
||||
else
|
||||
events.ScheduleEvent(eventTimer, 6000);
|
||||
events.ScheduleEvent(eventTimer, 6s);
|
||||
break;
|
||||
case 4:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
|
||||
@ -165,7 +165,7 @@ struct npc_forest_frog : public ScriptedAI
|
||||
Talk(SAY_GOODBYE, player);
|
||||
|
||||
eventTimer = 5;
|
||||
events.ScheduleEvent(eventTimer, 2000);
|
||||
events.ScheduleEvent(eventTimer, 2s);
|
||||
break;
|
||||
case 5:
|
||||
|
||||
@ -205,7 +205,7 @@ struct npc_forest_frog : public ScriptedAI
|
||||
|
||||
// start generic rp
|
||||
eventTimer = 1;
|
||||
events.ScheduleEvent(eventTimer, 3000);
|
||||
events.ScheduleEvent(eventTimer, 3s);
|
||||
|
||||
me->UpdateEntry(cEntry);
|
||||
|
||||
|
||||
@ -330,7 +330,7 @@ public:
|
||||
|
||||
if (Unit* arlokk = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(NPC_ARLOKK)))
|
||||
me->GetMotionMaster()->MovePoint(0, arlokk->GetPositionX(), arlokk->GetPositionY(), arlokk->GetPositionZ());
|
||||
_events.ScheduleEvent(EVENT_ATTACK, 6000);
|
||||
_events.ScheduleEvent(EVENT_ATTACK, 6s);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
@ -355,7 +355,7 @@ public:
|
||||
if (arlokk->IsAlive())
|
||||
arlokk->GetAI()->SetData(_sideData, 0);
|
||||
}
|
||||
me->DespawnOrUnsummon(4000);
|
||||
me->DespawnOrUnsummon(4s);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user