Revert "Core/Event: prevent seasonal quests from resetting at server restart
Port From (https://github.com/TrinityCore/TrinityCore/commit/306022054bec6010a63e80407c8d2f8d672b935b)
This commit is contained in:
@@ -137,8 +137,6 @@ namespace Game
|
|||||||
data.end = data.start + data.length;
|
data.end = data.start + data.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When event is started, set its worldstate to current time
|
|
||||||
Global.WorldMgr.SetWorldState(event_id, GameTime.GetGameTime());
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -174,9 +172,6 @@ namespace Game
|
|||||||
RemoveActiveEvent(event_id);
|
RemoveActiveEvent(event_id);
|
||||||
UnApplyEvent(event_id);
|
UnApplyEvent(event_id);
|
||||||
|
|
||||||
// When event is stopped, clean up its worldstate
|
|
||||||
Global.WorldMgr.SetWorldState(event_id, 0);
|
|
||||||
|
|
||||||
if (overwrite && !serverwide_evt)
|
if (overwrite && !serverwide_evt)
|
||||||
{
|
{
|
||||||
data.start = GameTime.GetGameTime() - data.length * Time.Minute;
|
data.start = GameTime.GetGameTime() - data.length * Time.Minute;
|
||||||
@@ -1017,8 +1012,6 @@ namespace Game
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If event is inactive, periodically clean up its worldstate
|
|
||||||
Global.WorldMgr.SetWorldState(id, 0);
|
|
||||||
Log.outDebug(LogFilter.Misc, "GameEvent {0} is not active", id);
|
Log.outDebug(LogFilter.Misc, "GameEvent {0} is not active", id);
|
||||||
if (IsActiveEvent(id))
|
if (IsActiveEvent(id))
|
||||||
deactivate.Add(id);
|
deactivate.Add(id);
|
||||||
@@ -1106,10 +1099,8 @@ namespace Game
|
|||||||
//! Run SAI scripts with SMART_EVENT_GAME_EVENT_START
|
//! Run SAI scripts with SMART_EVENT_GAME_EVENT_START
|
||||||
RunSmartAIScripts(event_id, true);
|
RunSmartAIScripts(event_id, true);
|
||||||
|
|
||||||
// If event's worldstate is 0, it means the event hasn't been started yet. In that case, reset seasonal quests.
|
// check for seasonal quest reset.
|
||||||
// When event ends (if it expires or if it's stopped via commands) worldstate will be set to 0 again, ready for another seasonal quest reset.
|
Global.WorldMgr.ResetEventSeasonalQuests(event_id);
|
||||||
if (Global.WorldMgr.GetWorldState(event_id) == 0)
|
|
||||||
Global.WorldMgr.ResetEventSeasonalQuests(event_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateEventNPCFlags(ushort event_id)
|
void UpdateEventNPCFlags(ushort event_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user