public void OnSpawnGlobalEntity(SpawnGlobalEntity packet) { }
static void Run() { const int MinX = 0; const int MaxX = 10; const int MinZ = 0; const int MaxZ = 10; while (true) { try { Thread.Sleep(2000); if (nextThunder < DateTime.Now) { nextThunder = DateTime.Now.AddSeconds(rand.Next(2, 30)); SpawnGlobalEntity tb = new SpawnGlobalEntity(new CoordDouble(rand.Next(MinX, MaxX), 0, rand.Next(MinZ, MaxZ))); tb.EID = 0; foreach (Client p in PlayerList.List) { if (p.Session.CurrentRegion == null) { continue; } if (p.Session.CurrentRegion.Type != Type) { continue; } if (p.Session.Mode == GameMode.Creative) { continue; } p.Queue.Queue(tb); } } if (nextSound < DateTime.Now) { nextSound = DateTime.Now.AddSeconds(rand.Next(30, 70)); Explosion ex = new Explosion(new CoordDouble(rand.Next(MinX, MaxX), 0, rand.Next(MinZ, MaxZ))); ex.Radius = 3; foreach (Client p in PlayerList.List) { WorldSession ws = p.Session; if (ws == null) { continue; } if (ws.CurrentRegion == null) { continue; } if (ws.CurrentRegion.Type != Type) { continue; } if (ws.Mode == GameMode.Creative) { continue; } p.Queue.Queue(ex); } } } catch (Exception e) { Log.WriteServer(e); } } }
private void InvokeSpawnGlobalEntity(SpawnGlobalEntity packet) { packetListener.OnSpawnGlobalEntity(packet); }