Esempio n. 1
0
 public VaultActionsEntry(VaultManager manager, AccountVault vault)
     : base(1157978, 8)
 {
     Manager = manager;
     Vault   = vault;
 }
Esempio n. 2
0
 public VaultLocationsEntry(VaultManager manager)
     : base(1158143, 8)
 {
     Manager = manager;
 }
Esempio n. 3
0
 public ClaimVaultEntry(VaultManager manager)
     : base(1157735, 8)
 {
     Manager = manager;
 }
Esempio n. 4
0
 public RentVaultEntry(VaultManager manager)
     : base(1157733, 8)
 {
     Manager = manager;
 }
Esempio n. 5
0
 public OpenVaultEntry(VaultManager manager)
     : base(1157734, 8)
 {
     Manager = manager;
 }
Esempio n. 6
0
        public static void TryRentVault(PlayerMobile pm, AccountVault vault, VaultManager manager)
        {
            if (pm != null && pm.Account != null && !HasVault(pm))
            {
                if (vault == null)
                {
                    vault = FindNearest <AccountVault>(pm, v => v.Account == null);
                }

                if (vault != null)
                {
                    if (!ValidateLocation(vault))
                    {
                        Utility.WriteConsoleColor(ConsoleColor.Red, "Invalid Account Vault Location: {0} [{1}]", vault.Location.ToString(), vault.Map != null ? vault.Map.ToString() : "null map");
                        pm.SendMessage("You cannot rent an account vault in this location!");
                    }
                    else if (!SystemSettings.HasBalance(pm))
                    {
                        if (manager == null)
                        {
                            manager = FindNearest <VaultManager>(pm);
                        }

                        if (SystemSettings.UseTokens)
                        {
                            if (manager != null)
                            {
                                manager.SayTo(pm, 1158313, 0x3B2); // But thou hast not the vault tokens! Please visit the Ultima Store for more details.
                            }
                            else
                            {
                                pm.SendLocalizedMessage(1158313); // But thou hast not the vault tokens! Please visit the Ultima Store for more details.
                            }

                            var entry = UltimaStore.GetEntry(typeof(VaultToken));

                            if (entry != null)
                            {
                                BaseGump.SendGump(new PromoItemGump(pm, entry, 0x9CCB));
                            }
                        }
                        else if (manager != null)
                        {
                            manager.SayTo(pm, 0x3B2, "But thou hast not the gold! You need {0} to rent a vault!", SystemSettings.RentGoldValue.ToString("N0", CultureInfo.GetCultureInfo("en-US")));
                        }
                        else
                        {
                            pm.SendMessage("But thou hast not the gold! You need {0} to rent a vault!", SystemSettings.RentGoldValue.ToString("N0", CultureInfo.GetCultureInfo("en-US")));
                        }
                    }
                    else
                    {
                        BaseGump.SendGump(new PetTrainingStyleConfirmGump(pm, 1074974, SystemSettings.RentMessage(), () =>
                        {
                            if (CanAssignVault(pm, vault))
                            {
                                vault.TakeOwnership(pm);
                            }
                        }));
                    }
                }
                else
                {
                    // TODO: Message?
                }
            }
        }
Esempio n. 7
0
 public static void TryRentVault(PlayerMobile pm, VaultManager manager)
 {
     TryRentVault(pm, null, manager);
 }