Пример #1
0
 public RealmEvent(
     string Name,
     MapSetPiece MapSetPiece
     )
 {
     this.Name        = Name;
     this.MapSetPiece = MapSetPiece;
 }
Пример #2
0
 public RealmEvent(
     string Name,
     MapSetPiece MapSetPiece,
     string Message
     )
 {
     this.Name        = Name;
     this.MapSetPiece = MapSetPiece;
     this.Message     = Message;
 }
Пример #3
0
 public RealmEvent(
     string Name,
     double Probability,
     bool Once,
     MapSetPiece MapSetPiece,
     string Message
     )
 {
     this.Name        = Name;
     this.Probability = Probability;
     this.Once        = Once;
     this.MapSetPiece = MapSetPiece;
     this.Message     = Message;
 }
Пример #4
0
 protected override bool Process(Player player, RealmTime time, string[] args)
 {
     try
     {
         MapSetPiece piece = (MapSetPiece)Activator.CreateInstance(System.Type.GetType(
                                                                       "LoESoft.GameServer.realm.mapsetpieces." + args[0], true, true));
         piece.RenderSetPiece(player.Owner, new IntPoint((int)player.X + 1, (int)player.Y + 1));
         return(true);
     }
     catch
     {
         player.SendError("Invalid SetPiece.");
         return(false);
     }
 }
Пример #5
0
        private void SpawnEvent(string name, MapSetPiece setpiece)
        {
            var pt = new IntPoint();

            do
            {
                pt.X = rand.Next(0, world.Map.Width);
                pt.Y = rand.Next(0, world.Map.Height);
            } while ((world.Map[pt.X, pt.Y].Terrain <WmapTerrain.Mountains ||
                                                     world.Map[pt.X, pt.Y].Terrain> WmapTerrain.MidForest) ||
                     !world.IsPassable(pt.X, pt.Y) ||
                     world.AnyPlayerNearby(pt.X, pt.Y));

            pt.X -= (setpiece.Size - 1) / 2;
            pt.Y -= (setpiece.Size - 1) / 2;
            setpiece.RenderSetPiece(world, pt);
            log.InfoFormat("Oryx spawned {0} at ({1}, {2}).", name, pt.X, pt.Y);
        }
Пример #6
0
        public void SpawnEvent(string name, MapSetPiece setpiece)
        {
            var pt = new IntPoint();

            do
            {
                pt.X = rand.Next(0, world.Map.Width);
                pt.Y = rand.Next(0, world.Map.Height);
            } while ((world.Map[pt.X, pt.Y].Terrain <WmapTerrain.Mountains ||
                                                     world.Map[pt.X, pt.Y].Terrain> WmapTerrain.MidForest) ||
                     !world.IsPassable(pt.X, pt.Y) ||
                     world.AnyPlayerNearby(pt.X, pt.Y));

            pt.X -= (setpiece.Size - 1) / 2;
            pt.Y -= (setpiece.Size - 1) / 2;

            setpiece.RenderSetPiece(world, pt);

            Log.Info($"Oryx spawned '{name}' at (X: {pt.X}, Y: {pt.Y}).");
        }