Exemplo n.º 1
0
 public static void AddVault(AuctionVault vault)
 {
     if (!Vaults.Contains(vault))
     {
         Vaults.Add(vault);
     }
 }
Exemplo n.º 2
0
 public static void RemoveVault(AuctionVault vault)
 {
     if (Vaults.Contains(vault))
     {
         Vaults.Remove(vault);
     }
 }
Exemplo n.º 3
0
        public static void Initialize()
        {
            if (Vaults.Count == 0)
            {
                var map = Siege.SiegeShard ? Map.Felucca : Map.Trammel;

                for (int i = 0; i < Locs.Length; i++)
                {
                    var vault = new AuctionVault(i + 1);
                    vault.MoveToWorld(Locs[i], map);
                }
            }
        }
Exemplo n.º 4
0
        internal void ClearVault()
        {
            if (_Container != null)
            {
                var auctionVault = AuctionVault.GetFirstAvailable();

                if (auctionVault != null)
                {
                    var auction = auctionVault.Auction;

                    auction.AuctionItem = _Container;

                    _Container.AuctionItem = true;
                    _Container.Movable     = false;
                    _Container.MoveToWorld(new Point3D(auctionVault.X, auctionVault.Y, auctionVault.Z + 7), auctionVault.Map);

                    auction.Description = "Contents of an unpaid vault.";
                    auction.Duration    = SystemSettings.AuctionDuration;
                    auction.StartBid    = 1000;
                    auction.OnBegin();

                    var m = GetAccountMobile();

                    if (m != null)
                    {
                        var region = Region.Find(GetWorldLocation(), Map).Name;

                        if (!string.IsNullOrEmpty(region))
                        {
                            MaginciaLottoSystem.SendMessageTo(
                                m,
                                new NewMaginciaMessage(
                                    1158081, // Rent Past Due
                                    1158053, // Your vault contents have been put up for auction and no longer can be claimed. This vault was located in ~1_CITY~.
                                    SystemSettings.PastDuePeriod,
                                    region,
                                    true));
                        }
                        else
                        {
                            MaginciaLottoSystem.SendMessageTo(
                                m,
                                new NewMaginciaMessage(
                                    1158081, // Rent Past Due
                                    string.Format("Your vault contents have been put up for auction and no longer can be claimed. This vault is located at {0} [{1}].", GetWorldLocation().ToString(), Map.ToString()),
                                    SystemSettings.PastDuePeriod,
                                    true));
                        }
                    }

                    _Container = null;
                }
                else
                {
                    // None available, so we'll delay a day
                    NextRent = DateTime.UtcNow + TimeSpan.FromDays(1);
                }
            }

            Account  = null;
            NextRent = DateTime.MinValue;

            ColUtility.SafeDelete(Items);

            InvalidateProperties();
            Hue     = 0;
            Balance = 0;
            PastDue = false;
        }