Пример #1
0
        public static void StartEvent(WorldEvent worldEvent)
        {
            WorldEvent worldEvent1        = worldEvent;
            TimeSpan?  timeUntilNextStart = worldEvent1.TimeUntilNextStart;
            TimeSpan   occurence          = worldEvent.Occurence;

            worldEvent1.TimeUntilNextStart = timeUntilNextStart.HasValue
                ? new TimeSpan?(timeUntilNextStart.GetValueOrDefault() + occurence)
                : new TimeSpan?();
            if (WorldEventMgr.IsEventActive(worldEvent.Id))
            {
                return;
            }
            WorldEventMgr.Log.Info("Starting event {0}: {1}", (object)worldEvent.Id, (object)worldEvent.Description);
            ArrayUtil.Set <WorldEvent>(ref WorldEventMgr.ActiveEvents, worldEvent.Id, worldEvent);
            WorldEventMgr.SpawnEvent(worldEvent);
            WorldEventMgr.ApplyEventNPCData(worldEvent);
        }
Пример #2
0
 public static void SpawnEvent(uint eventId)
 {
     WorldEventMgr.SpawnEvent(WorldEventMgr.GetEvent(eventId));
 }