Beispiel #1
0
        internal static void ZoneAll(Level lvl, string owner)
        {
            Level.Zone zn = default(Level.Zone);
            zn.bigX  = (ushort)(lvl.Width - 1);
            zn.bigY  = (ushort)(lvl.Height - 1);
            zn.bigZ  = (ushort)(lvl.Length - 1);
            zn.Owner = owner;

            lvl.ZoneList.Add(zn);
            LevelDB.CreateZone(lvl.name, zn);
        }
Beispiel #2
0
        protected internal override void OnBuyCommand(Player p, string message, string[] args)
        {
            if (args.Length < 3)
            {
                OnStoreCommand(p); return;
            }
            LevelPreset preset = FindPreset(args[1]);

            if (preset == null)
            {
                Player.Message(p, "%cThat isn't a level preset"); return;
            }

            if (p.money < preset.price)
            {
                Player.Message(p, "%cYou don't have enough %3" + Server.moneys + "%c to buy that map"); return;
            }
            string name = p.name + "_" + args[2];

            try {
                Command.all.Find("newlvl").Use(null, name + " " + preset.x + " " + preset.y + " " + preset.z + " " + preset.type);
                Player.Message(p, "%aCreating level: '%f" + name + "%a' . . .");

                CmdLoad.LoadLevel(null, name);
                Level level = LevelInfo.FindExact(name);
                if (level.permissionbuild > p.Rank)
                {
                    level.permissionbuild = p.Rank;
                }
                if (level.permissionvisit > p.Rank)
                {
                    level.permissionvisit = p.Rank;
                }
                PlayerActions.ChangeMap(p, name);

                Player.Message(p, "%aSuccessfully created your map: '%f" + name + "%a'");
                try {
                    Level.Zone zn = default(Level.Zone);
                    zn.bigX  = (ushort)(level.Width - 1);
                    zn.bigY  = (ushort)(level.Height - 1);
                    zn.bigZ  = (ushort)(level.Length - 1);
                    zn.Owner = p.name;
                    level.ZoneList.Add(zn);
                    LevelDB.CreateZone(level.name, zn);
                    Player.Message(p, "%aZoning Succesful");
                } catch { Player.Message(p, "%cZoning Failed"); }
            } catch {
                Player.Message(p, "%cSomething went wrong, Money untouched"); return;
            }
            Economy.MakePurchase(p, preset.price, "%3Map: %f" + preset.name);
        }
Beispiel #3
0
        bool AddZone(Player p, Vec3S32[] marks, object state, byte type, byte extType)
        {
            Level.Zone Zn;
            Zn.smallX = (ushort)Math.Min(marks[0].X, marks[1].X);
            Zn.smallY = (ushort)Math.Min(marks[0].Y, marks[1].Y);
            Zn.smallZ = (ushort)Math.Min(marks[0].Z, marks[1].Z);
            Zn.bigX   = (ushort)Math.Max(marks[0].X, marks[1].X);
            Zn.bigY   = (ushort)Math.Max(marks[0].Y, marks[1].Y);
            Zn.bigZ   = (ushort)Math.Max(marks[0].Z, marks[1].Z);
            Zn.Owner  = (string)state;

            p.level.ZoneList.Add(Zn);
            LevelDB.CreateZone(p.level.name, Zn);
            Player.Message(p, "Added zone for &b" + (string)state);
            return(false);
        }