Scripts/Spells: Fix shaman Mastery: Elemental Overload + Stormkeeper and Unlimited Power talents
Port From (https://github.com/TrinityCore/TrinityCore/commit/bd19e225137377a0d6925960b715f58ea18652bc)
This commit is contained in:
@@ -96,8 +96,12 @@ namespace Framework.Dynamic
|
||||
m_events.Add(e_time, Event);
|
||||
}
|
||||
|
||||
public void AddEvent(Action action, ulong e_time, bool set_addtime = true) { AddEvent(new LambdaBasicEvent(action), e_time, set_addtime); }
|
||||
|
||||
public void AddEventAtOffset(BasicEvent Event, TimeSpan offset) { AddEvent(Event, CalculateTime((ulong)offset.TotalMilliseconds)); }
|
||||
|
||||
public void AddEventAtOffset(Action action, TimeSpan offset) { AddEventAtOffset(new LambdaBasicEvent(action), offset); }
|
||||
|
||||
public void ModifyEventTime(BasicEvent Event, ulong newTime)
|
||||
{
|
||||
foreach (var pair in m_events)
|
||||
@@ -157,6 +161,22 @@ namespace Framework.Dynamic
|
||||
public ulong m_execTime; // planned time of next execution, filled by event handler
|
||||
}
|
||||
|
||||
class LambdaBasicEvent : BasicEvent
|
||||
{
|
||||
Action _callback;
|
||||
|
||||
public LambdaBasicEvent(Action callback) : base()
|
||||
{
|
||||
_callback = callback;
|
||||
}
|
||||
|
||||
public override bool Execute(ulong e_time, uint p_time)
|
||||
{
|
||||
_callback();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
enum AbortState
|
||||
{
|
||||
Running,
|
||||
|
||||
Reference in New Issue
Block a user