public static void GeneratePTS(int Vnum, ClientSession host) { List <ClientSession> sessions = new List <ClientSession>(); if (host.Character.Group != null) { sessions = host.Character.Group.Sessions.Where(s => s.Character.MapInstance.MapInstanceType == MapInstanceType.ExpMap); } else { sessions.Add(host); } List <Tuple <MapInstance, byte> > maps = new List <Tuple <MapInstance, byte> >(); MapInstance map = null; byte instancelevel = 1; if (Vnum == 1805) { instancelevel = 55; } if (Vnum == 1824) { instancelevel = 65; } if (Vnum == 1825) { instancelevel = 75; } if (Vnum == 1826) { instancelevel = 80; } if (Vnum == 1827) { instancelevel = 88; } map = ServerManager.GenerateMapInstance(2100, MapInstanceType.ExpMap, new InstanceBag()); maps.Add(new Tuple <MapInstance, byte>(map, instancelevel)); if (map != null) { foreach (ClientSession s in sessions) { ServerManager.Instance.TeleportOnRandomPlaceInMap(s, map.MapInstanceId); } } foreach (Tuple <MapInstance, byte> mapinstance in maps) { PSTTask task = new PSTTask(); Observable.Timer(TimeSpan.FromMinutes(0)).Subscribe(X => PSTTask.Run(mapinstance)); } }
public static void GeneratePTS(int Vnum, ClientSession host) { List <ClientSession> sessions = new List <ClientSession>(); if (host.Character.Group != null) { sessions = host.Character.Group.Sessions.Where(s => s.Character.MapInstance.MapInstanceType == MapInstanceType.BaseMapInstance); } else { sessions.Add(host); } List <Tuple <MapInstance, byte> > maps = new List <Tuple <MapInstance, byte> >(); MapInstance map = null; byte instancelevel = 1; if (host.Character.Level < 20) { map = ServerManager.GenerateMapInstance(2100, MapInstanceType.TimeSpaceInstance, new InstanceBag()); instancelevel = 15; } if (host.Character.Level > 19 && host.Character.Level < 30) { map = ServerManager.GenerateMapInstance(2103, MapInstanceType.TimeSpaceInstance, new InstanceBag()); instancelevel = 25; } if (host.Character.Level > 29 && host.Character.Level < 46) { map = ServerManager.GenerateMapInstance(4214, MapInstanceType.TimeSpaceInstance, new InstanceBag()); instancelevel = 35; } if (host.Character.Level > 45 && host.Character.Level < 55) { map = ServerManager.GenerateMapInstance(4311, MapInstanceType.TimeSpaceInstance, new InstanceBag()); instancelevel = 45; } if (host.Character.Level > 54 && host.Character.Level < 65) { map = ServerManager.GenerateMapInstance(4503, MapInstanceType.TimeSpaceInstance, new InstanceBag()); instancelevel = 55; } if (host.Character.Level > 64 && host.Character.Level < 75) { map = ServerManager.GenerateMapInstance(2105, MapInstanceType.TimeSpaceInstance, new InstanceBag()); instancelevel = 65; } if (host.Character.Level > 74 && host.Character.Level < 80) { map = ServerManager.GenerateMapInstance(4643, MapInstanceType.TimeSpaceInstance, new InstanceBag()); instancelevel = 75; } if (host.Character.Level > 79 && host.Character.Level < 88) { map = ServerManager.GenerateMapInstance(2101, MapInstanceType.TimeSpaceInstance, new InstanceBag()); instancelevel = 80; } if (host.Character.Level > 87) { map = ServerManager.GenerateMapInstance(5417, MapInstanceType.TimeSpaceInstance, new InstanceBag()); instancelevel = 88; } maps.Add(new Tuple <MapInstance, byte>(map, instancelevel)); if (map != null) { foreach (ClientSession s in sessions) { ServerManager.Instance.TeleportOnRandomPlaceInMap(s, map.MapInstanceId); } } foreach (Tuple <MapInstance, byte> mapinstance in maps) { PSTTask task = new PSTTask(); Observable.Timer(TimeSpan.FromMinutes(0)).Subscribe(X => PSTTask.Run(mapinstance)); } }