• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Items.BankCheck类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Server.Items.BankCheck的典型用法代码示例。如果您正苦于以下问题:C# BankCheck类的具体用法?C# BankCheck怎么用?C# BankCheck使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BankCheck类属于Server.Items命名空间,在下文中一共展示了BankCheck类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GiveRewards

        public override void GiveRewards()
        {
            //Random gold amount to add
            BankCheck gold = new BankCheck(Utility.RandomMinMax(5000, 6000));
            if (!Owner.AddToBackpack(gold))
            {
                gold.MoveToWorld(Owner.Location, Owner.Map);
            }

            //Adding Quest Reward Token(s)
            for (int x = 0; x < 1; x++)
            {
                RandomTalisman talisman = new RandomTalisman();
                if (!Owner.AddToBackpack(talisman))
                {
                    talisman.MoveToWorld(Owner.Location, Owner.Map);
                }
            }
            Item bonusitem;
            bonusitem = new RamaRobe();
            //Adding Bonus Item #1
            if (!Owner.AddToBackpack(bonusitem))
            {
                bonusitem.MoveToWorld(Owner.Location, Owner.Map);
            }


            base.GiveRewards();
        }
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:29,代码来源:Ramayan.cs


示例2: Deposit

        public static bool Deposit(Mobile from, int amount)
        {
            // If for whatever reason the TOL checks fail, we should still try old methods for depositing currency.
            if (AccountGold.Enabled && from.Account != null && from.Account.DepositGold(amount))
            {
                return true;
            }

            var box = from.FindBankNoCreate();

            if (box == null)
            {
                return false;
            }

            var items = new List<Item>();

            while (amount > 0)
            {
                Item item;
                if (amount < 5000)
                {
                    item = new Gold(amount);
                    amount = 0;
                }
                else if (amount <= 1000000)
                {
                    item = new BankCheck(amount);
                    amount = 0;
                }
                else
                {
                    item = new BankCheck(1000000);
                    amount -= 1000000;
                }

                if (box.TryDropItem(from, item, false))
                {
                    items.Add(item);
                }
                else
                {
                    item.Delete();
                    foreach (var curItem in items)
                    {
                        curItem.Delete();
                    }

                    return false;
                }
            }

            return true;
        }
开发者ID:runuo,项目名称:runuo,代码行数:54,代码来源:Banker.cs


示例3: GiveRewards

        public override void GiveRewards()
		{
			//Random gold amount to add
			BankCheck gold = new BankCheck( Utility.RandomMinMax( 100, 150 ) );
			if( !Owner.AddToBackpack( gold ) )
			{
				gold.MoveToWorld(Owner.Location,Owner.Map);
			}

			base.GiveRewards();
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:11,代码来源:QuestPart1.cs


示例4: GiveRewards

		public override void GiveRewards()
		{
			//Give Gold to player in form of a bank check
			BankCheck gold = new BankCheck(Utility.RandomMinMax(500, 1000));
			if(!Owner.AddToBackpack( gold ))
				gold.MoveToWorld(Owner.Location,Owner.Map);

			Item item;

			//Random Magic Item #1
			item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
			if( item is BaseWeapon )
				BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, 3, 10, 50 );
			if( item is BaseArmor )
				BaseRunicTool.ApplyAttributesTo((BaseArmor)item, 3, 10, 50 );
			if( item is BaseJewel )
				BaseRunicTool.ApplyAttributesTo((BaseJewel)item, 3, 10, 50 );
			if( item is BaseHat )
				BaseRunicTool.ApplyAttributesTo((BaseHat)item, 3, 10, 50 );
			if(!Owner.AddToBackpack( item ) )
			{
				item.MoveToWorld(Owner.Location,Owner.Map);
			}

			//Random Magic Item #2
			item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
			if( item is BaseWeapon )
				BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, 3, 10, 50 );
			if( item is BaseArmor )
				BaseRunicTool.ApplyAttributesTo((BaseArmor)item, 3, 10, 50 );
			if( item is BaseJewel )
				BaseRunicTool.ApplyAttributesTo((BaseJewel)item, 3, 10, 50 );
			if( item is BaseHat )
				BaseRunicTool.ApplyAttributesTo((BaseHat)item, 3, 10, 50 );
			if(!Owner.AddToBackpack( item ) )
			{
				item.MoveToWorld(Owner.Location,Owner.Map);
			}

			//Chance of Special Item
			if ( Utility.RandomMinMax( 1, 1 ) == 1 )
			{
				item = new RalphiesWelcomeNecklace(  );
				if(!Owner.AddToBackpack( item ) )
				{
					item.MoveToWorld(Owner.Location,Owner.Map);
				}
			}


			base.GiveRewards();
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:52,代码来源:UODevProWelcome.cs


示例5: GoldBar

		/*public override Item Dupe( int amount )
		{
			return base.Dupe( new GoldBar( amount ), amount );
		}here for ruo rc1 and maybe rc2*/

		public override void OnDoubleClick( Mobile from )
		{
			BankBox box = from.BankBox;

			if ( box != null && IsChildOf( box ) )
			{
				PlayerMobile pm = from as PlayerMobile;

				base.OnDoubleClick( from );
				
				BankCheck check;

				if( this.Amount == 1 )
				{
					check = new BankCheck( 500000 );
					
					this.Delete();

					if ( box.TryDropItem( pm, check, false ) )
					{
						pm.SendMessage("You return your gold bar to the bank and receive a 500,000 gp check.");
					}
					else
					{
						check.Delete();
						pm.AddToBackpack( new BankCheck( 500000 ) );
						pm.SendMessage("You return your gold bar to the bank and receive a 500,000 gp check.");
					}
				}
				else if( this.Amount >= 2 )
					{
					check = new BankCheck( 500000 );
                                
					if ( box.TryDropItem( pm, check, false ) )
					{
						this.Amount -= 1;
						pm.SendMessage("You return your gold bar to the bank and receive a 500,000 gp check.");
					}
					else
					{
						check.Delete();
						pm.SendMessage("There is not enough room in your bank box for the check.");
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 1047026 ); // That must be in your bank box to use it.
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:55,代码来源:GoldBar.cs


示例6: Deposit

        public static bool Deposit( Mobile from, int amount )
        {
            BankBox box = from.FindBankNoCreate();
            if ( box == null )
                return false;

            List<Item> items = new List<Item>();

            while ( amount > 0 )
            {
                Item item;
                if ( amount < 5000 )
                {
                    item = new Gold( amount );
                    amount = 0;
                }
                else if ( amount <= 1000000 )
                {
                    item = new BankCheck( amount );
                    amount = 0;
                }
                else
                {
                    item = new BankCheck( 1000000 );
                    amount -= 1000000;
                }

                if ( box.TryDropItem( from, item, false ) )
                {
                    items.Add( item );
                }
                else
                {
                    item.Delete();
                    foreach ( Item curItem in items )
                    {
                        curItem.Delete();
                    }

                    return false;
                }
            }

            return true;
        }
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:45,代码来源:Banker.cs


示例7: Deposit

        public static bool Deposit( Mobile from, int amount )
        {
            BankBox box = from.BankBox;
            if ( box == null )
                return false;

            ArrayList items = new ArrayList();

            while ( amount > 0 )
            {
                Item item;
                if ( amount < 5000 )
                {
                    item = new Copper( amount );
                    amount = 0;
                }
                else if ( amount <= 1000000 )
                {
                    item = new BankCheck( amount );
                    amount = 0;
                }
                else
                {
                    item = new BankCheck( 1000000 );
                    amount -= 1000000;
                }

                if ( box.TryDropItem( from, item, false ) )
                {
                    items.Add( item );
                }
                else
                {
                    item.Delete();
                    foreach ( Item curItem in items )
                    {
                        curItem.Delete();
                    }

                    return false;
                }
            }

            return true;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:45,代码来源:Banker.cs


示例8: GiveRewards

		public override void GiveRewards()
		{
			//Random gold amount to add
			BankCheck gold = new BankCheck( Utility.RandomMinMax( 200, 300 ) );
			if( !Owner.AddToBackpack( gold ) )
			{
				gold.MoveToWorld(Owner.Location,Owner.Map);
			}

			//Adding Quest Reward Token(s)
			for(int x = 0; x < 1; x++)
			{
				RandomTalisman talisman = new RandomTalisman();
				if(!Owner.AddToBackpack( talisman ) )
				{
					talisman.MoveToWorld(Owner.Location,Owner.Map);
				}
			}
			Item bonusitem;
			bonusitem = new Bandage( 10 );
			//Adding Bonus Item #1
			if(!Owner.AddToBackpack( bonusitem ) )
			{
				bonusitem.MoveToWorld(Owner.Location,Owner.Map);
			}

			Item item;
			//Add Reward Item #1
			item = new AdventurersMachete();
			if( item is BaseWeapon )
				BaseRunicTool.ApplyAttributesTo((BaseWeapon)item,  Utility.RandomMinMax( 1,4 ), 10, 50 );
			if( item is BaseArmor )
				BaseRunicTool.ApplyAttributesTo((BaseArmor)item,  Utility.RandomMinMax( 1,4 ), 10, 50 );
			if( item is BaseJewel )
				BaseRunicTool.ApplyAttributesTo((BaseJewel)item,  Utility.RandomMinMax( 1,4 ), 10, 50 );
			if( item is BaseHat )
				BaseRunicTool.ApplyAttributesTo((BaseHat)item,  Utility.RandomMinMax( 1,4 ), 10, 50 );
			if(!Owner.AddToBackpack( item ) )
			{
				item.MoveToWorld(Owner.Location,Owner.Map);
			}

			base.GiveRewards();
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:44,代码来源:Help.cs


示例9: GetBalance

		public static int GetBalance(Mobile from, Type currencyType, out Item[] currency, out BankCheck[] checks)
		{
			int balance = 0;

			BankBox bank = from.FindBankNoCreate();

			if (bank != null)
			{
				currency = bank.FindItemsByType(currencyType, true).ToArray();
				checks = bank.FindItemsByType<BankCheck>(true).Where(c => c.TypeOfCurrency == currencyType).ToArray();

				balance += currency.Sum(t => t.Amount);
				balance += checks.Sum(t => t.Worth);
			}
			else
			{
				currency = new Item[0];
				checks = new BankCheck[0];
			}

			return balance;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:22,代码来源:Banker.cs


示例10: GiveRewards

		public override void GiveRewards()
		{
			//Random gold amount to add
			BankCheck gold = new BankCheck( Utility.RandomMinMax( 2000, 3000 ) );
			if( !Owner.AddToBackpack( gold ) )
			{
				gold.MoveToWorld(Owner.Location,Owner.Map);
			}

			//Add Quest Reward Token(s)
			//Owner.AddToBackpack( new QuestRewardToken( 1 ) );

			//Adding Quest Reward Token(s)
			for(int x = 0; x < 1; x++)
			{
				RandomTalisman talisman = new RandomTalisman();
				if(!Owner.AddToBackpack( talisman ) )
				{
					talisman.MoveToWorld(Owner.Location,Owner.Map);
				}
			}
			base.GiveRewards();
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:23,代码来源:IntotheDarkness.cs


示例11: StarterPack

		public StarterPack() : base()
		{
			Name = "Welcome bag";
			Hue = 196;

			Item item = new BankCheck(100);
			DropItem( item );
			item.X = 53;
			item.Y = 36; 

			item = new BagOfReagents( 50 );
			DropItem( item );
			item.X = 71;
			item.Y = 55;

		    Container bag = new Bag();
			bag.DropItem( new LeatherCap() );
			bag.DropItem( new LeatherChest() );
			bag.DropItem( new LeatherLegs() );
			bag.DropItem( new LeatherGloves() );
			bag.DropItem( new LeatherArms() );
			bag.DropItem( new LeatherGorget() );
			DropItem( bag );
			bag.X = 63;
			bag.Y = 75;

			  /*  item = new HalfApron ();
				item.LootType = LootType.Blessed;
                item.Name = "Launch Day 2013";
				DropItem( item );
				item.X = 72;
				item.Y = 92;

				item = new FireworksWand();
				item.Name = "Launch Day 2013";
				DropItem( item );
				item.X = 94;
				item.Y = 34;*/

/*			if ( TestCenter.Enabled )
			{
	//			item = new SmallBrickHouseDeed();
	//			DropItem( item );
	//			item.X = 23;
	//			item.Y = 53; */

				

			/*	item = new Runebook();
				DropItem( item );
				item.X = 93;
				item.Y = 92;

				item = new EtherealLlama();
				item.Name = "a beta testers ethereal llama";
				DropItem( item );
				item.X = 94;
				item.Y = 34;
			}
			else
			{ */
			//	item = new BankCheck( 1000 );
			//	DropItem( item );
			//	item.X = 52;
			//	item.Y = 36;
			//}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:67,代码来源:StarterPack.cs


示例12: DepositUpTo

        public static int DepositUpTo( Mobile from, int amount )
        {
            BankBox box = from.BankBox;
            if ( box == null )
                return 0;

            int amountLeft = amount;
            while ( amountLeft > 0 )
            {
                Item item;
                int amountGiven;

                if ( amountLeft < 5000 )
                {
                    item = new Copper( amountLeft );
                    amountGiven = amountLeft;
                }
                else if ( amountLeft <= 1000000 )
                {
                    item = new BankCheck( amountLeft );
                    amountGiven = amountLeft;
                }
                else
                {
                    item = new BankCheck( 1000000 );
                    amountGiven = 1000000;
                }

                if ( box.TryDropItem( from, item, false ) )
                {
                    amountLeft -= amountGiven;
                }
                else
                {
                    item.Delete();
                    break;
                }
            }

            return amount - amountLeft;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:41,代码来源:Banker.cs


示例13: OnSpeech


//.........这里部分代码省略.........

                                    if ( box == null || !box.ConsumeTotal( typeof( Copper ), amount ) )
                                    {
                                        this.Say( "Ah, art thou trying to fool me? Thou hast not so much copper!" );
                                    }
                                    else
                                    {
                                        e.Mobile.AddToBackpack( new Copper( amount ) );

                                        this.Say( "Thou hast withdrawn copper from thy account." );
                                    }
                                }
                            }

                            break;
                        }
                        case 0x0001: // *balance*
                        {
                            e.Handled = true;

                            BankBox box = e.Mobile.BankBox;

                            if ( box != null )
                            {
                                this.Say( "Thy current bank balance is " + box.TotalGold.ToString() + " copper." );
                            }

                            break;
                        }
                        case 0x0002: // *bank*
                        {
                            e.Handled = true;

                            BankBox box = e.Mobile.BankBox;

                            PlayerMobile pm = e.Mobile as PlayerMobile;

                            if ( box != null )
                                box.Open();

                            break;
                        }
                        case 0x0003: // *check*
                        {
                            e.Handled = true;

                            string[] split = e.Speech.Split( ' ' );

                            if ( split.Length >= 2 )
                            {
                                int amount;

                                try
                                {
                                    amount = Convert.ToInt32( split[1] );
                                }
                                catch
                                {
                                    break;
                                }

                                if ( amount < 5000 )
                                {
                                    this.Say( "We cannot create checks for such a paltry amount of copper!" ); //
                                }
                                else if ( amount > 1000000 )
                                {
                                    this.Say( 1010007 ); // Our policies prevent us from creating checks worth that much!
                                }
                                else
                                {
                                    BankCheck check = new BankCheck( amount );

                                    BankBox box = e.Mobile.BankBox;

                                    if ( box == null || !box.TryDropItem( e.Mobile, check, false ) )
                                    {
                                        this.Say( 500386 ); // There's not enough room in your bankbox for the check!
                                        check.Delete();
                                    }
                                    else if ( !box.ConsumeTotal( typeof( Copper ), amount ) )
                                    {
                                        this.Say( "Ah, art thou trying to fool me? Thou hast not so much copper!" ); //
                                        check.Delete();
                                    }
                                    else
                                    {
                                        this.Say( 1042673, AffixType.Append, amount.ToString(), "" ); // Into your bank box I have placed a check in the amount of:
                                    }
                                }
                            }

                            break;
                        }
                    }
                }
            }

            base.OnSpeech( e );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:101,代码来源:Banker.cs


示例14: AwardTeamWinnings

        public void AwardTeamWinnings(int team, int amount)
        {
            if(team == 0) return;

            int count = 0;
            // go through all of the team members
            foreach(IChallengeEntry entry in Participants)
            {
                if(entry.Team == team)
                {
                    count++;
                }
            }

            if(count == 0) return;

            int split = amount/count;

            // and split the purse
            foreach(IChallengeEntry entry in Participants)
            {
                if(entry.Team == team)
                {
                    Mobile m = entry.Participant;
                    if(m.Backpack != null && amount > 0)
                    {
                        // give them a check for the winnings
                        BankCheck check = new BankCheck( split);
                        check.Name = String.Format(XmlPoints.GetText(m, 100300),ChallengeName); // "Prize from {0}"
                        m.AddToBackpack( check );
                        XmlPoints.SendText(m, 100301, split); // "You have received a bank check for {0}"
                    }
                }
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:35,代码来源:BaseChallengeGame.cs


示例15: RefundBuyIn

        public void RefundBuyIn(PlayerMobile pm, int amount)
        {
            BankBox box = (BankBox)pm.BankBox;

            if (amount >= 5000)
            {
                BankCheck check = new BankCheck(amount);
                box.DropItem(check);
            }
            else
            {
                Gold gold = new Gold(amount);
                box.DropItem(gold);
            }

            Handeling.BuyIn = 0;
            pm.SendMessage("The buy in has been refunded.");
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:18,代码来源:FieldSetup_SetBuyIn.cs


示例16: OnResponse

        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 1 && !this.m_House.Deleted)
            {
                if (this.m_House.IsOwner(this.m_Mobile))
                {
                    if (this.m_House.MovingCrate != null || this.m_House.InternalizedVendors.Count > 0)
                    {
                        this.m_Mobile.SendLocalizedMessage(1080455); // You can not resize your house at this time. Please remove all items fom the moving crate and try again.
                        return;
                    }
                    else if (!Guilds.Guild.NewGuildSystem && this.m_House.FindGuildstone() != null)
                    {
                        this.m_Mobile.SendLocalizedMessage(501389); // You cannot redeed a house with a guildstone inside.
                        return;
                    }
                    /*else if ( m_House.PlayerVendors.Count > 0 )
                    {
                    m_Mobile.SendLocalizedMessage( 503236 ); // You need to collect your vendor's belongings before moving.
                    return;
                    }*/
                    else if (this.m_House.HasRentedVendors && this.m_House.VendorInventories.Count > 0)
                    {
                        this.m_Mobile.SendLocalizedMessage(1062679); // You cannot do that that while you still have contract vendors or unclaimed contract vendor inventory in your house.
                        return;
                    }
                    else if (this.m_House.HasRentedVendors)
                    {
                        this.m_Mobile.SendLocalizedMessage(1062680); // You cannot do that that while you still have contract vendors in your house.
                        return;
                    }
                    else if (this.m_House.VendorInventories.Count > 0)
                    {
                        this.m_Mobile.SendLocalizedMessage(1062681); // You cannot do that that while you still have unclaimed contract vendor inventory in your house.
                        return;
                    }

                    if (this.m_Mobile.AccessLevel >= AccessLevel.GameMaster)
                    {
                        this.m_Mobile.SendMessage("You do not get a refund for your house as you are not a player");
                        this.m_House.RemoveKeys(this.m_Mobile);
                        new TempNoHousingRegion(this.m_House, this.m_Mobile);
                        this.m_House.Delete();
                    }
                    else
                    {
                        Item toGive = null;

                        if (this.m_House.IsAosRules)
                        {
                            if (this.m_House.Price > 0)
                                toGive = new BankCheck(this.m_House.Price);
                            else
                                toGive = this.m_House.GetDeed();
                        }
                        else
                        {
                            toGive = this.m_House.GetDeed();

                            if (toGive == null && this.m_House.Price > 0)
                                toGive = new BankCheck(this.m_House.Price);
                        }

                        if (toGive != null)
                        {
                            BankBox box = this.m_Mobile.BankBox;

                            if (box.TryDropItem(this.m_Mobile, toGive, false))
                            {
                                if (toGive is BankCheck)
                                    this.m_Mobile.SendLocalizedMessage(1060397, ((BankCheck)toGive).Worth.ToString()); // ~1_AMOUNT~ gold has been deposited into your bank box.

                                this.m_House.RemoveKeys(this.m_Mobile);
                                new TempNoHousingRegion(this.m_House, this.m_Mobile);
                                this.m_House.Delete();
                            }
                            else
                            {
                                toGive.Delete();
                                this.m_Mobile.SendLocalizedMessage(500390); // Your bank box is full.
                            }
                        }
                        else
                        {
                            this.m_Mobile.SendMessage("Unable to refund house.");
                        }
                    }
                }
                else
                {
                    this.m_Mobile.SendLocalizedMessage(501320); // Only the house owner may do this.
                }
            }
            else if (info.ButtonID == 0)
            {
                this.m_Mobile.CloseGump(typeof(ConfirmHouseResize));
                this.m_Mobile.SendGump(new HouseGumpAOS(HouseGumpPageAOS.Customize, this.m_Mobile, this.m_House));
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:99,代码来源:ConfirmHouseResize.cs


示例17: AwardWinnings

		public virtual void AwardWinnings(Mobile m, int amount)
        {
            if(m == null) return;

            if(m.Backpack != null && amount > 0)
            {
                // give them a check for the winnings
                BankCheck check = new BankCheck( amount);
                check.Name = String.Format(XmlPoints.GetText(m, 100300),ChallengeName); // "Prize from {0}"
                m.AddToBackpack( check );
                XmlPoints.SendText(m, 100301, amount); // "You have received a bank check for {0}"
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:13,代码来源:BaseChallengeGame.cs


示例18: PayBuyIn

        public void PayBuyIn(PlayerMobile pm, int teamid)
        {
            if (Handeling.BuyIn <= 0)
                return;

            int playercount = 0;
            int sharecount = 0;
            IEnumerator key = Handeling.Teams.Keys.GetEnumerator();
            for (int i = 0; i < Handeling.Teams.Count; ++i)
            {
                key.MoveNext();
                Field_Team d_team = (Field_Team)Handeling.Teams[(int)key.Current];

                for (int i2 = 0; i2 < d_team.Players.Count; ++i2)
                {
                    object o = (object)d_team.Players[i2];

                    if (o != "@null")
                        playercount += 1;

                    if ((int)key.Current == teamid && o != "@null")
                        sharecount += 1;
                }
            }

            int goldshare = (playercount * Handeling.BuyIn) / sharecount;

            BankBox box = (BankBox)pm.BankBox;
            if (goldshare >= 5000)
            {
                BankCheck check = new BankCheck(goldshare);
                box.DropItem(check);
            }
            else
            {
                Gold gold = new Gold(goldshare);
                box.DropItem(gold);
            }

            pm.SendMessage(String.Format("Congragulations! you have won {0}gp.", goldshare.ToString()));
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:41,代码来源:FieldController.cs


示例19: HandleSpeech


//.........这里部分代码省略.........
									break;
								}

								if (AccountGold.Enabled && e.Mobile.Account != null)
								{
									vendor.Say(
										"Thy current bank balance is {0:#,0} platinum and {1:#,0} gold.",
										e.Mobile.Account.TotalPlat,
										e.Mobile.Account.TotalGold);
								}
								else
								{
									// Thy current bank balance is ~1_AMOUNT~ gold.
									vendor.Say(1042759, GetBalance(e.Mobile).ToString("#,0"));
								}
							}
							break;
						case 0x0002: // *bank*
							{
								e.Handled = true;

								if (e.Mobile.Criminal)
								{
									// Thou art a criminal and cannot access thy bank box.
									vendor.Say(500378);
									break;
								}

								e.Mobile.BankBox.Open();
							}
							break;
						case 0x0003: // *check*
							{
								e.Handled = true;

								if (e.Mobile.Criminal)
								{
									// I will not do business with a criminal!
									vendor.Say(500389);
									break;
								}

								if (AccountGold.Enabled && e.Mobile.Account != null)
								{
									vendor.Say("We no longer offer a checking service.");
									break;
								}

								var split = e.Speech.Split(' ');

								if (split.Length >= 2)
								{
									int amount;

									if (!int.TryParse(split[1], out amount))
									{
										break;
									}

									if (amount < 5000)
									{
										// We cannot create checks for such a paltry amount of gold!
										vendor.Say(1010006);
									}
									else if (amount > 1000000)
									{
										// Our policies prevent us from creating checks worth that much!
										vendor.Say(1010007);
									}
									else
									{
										var check = new BankCheck(amount);

										var box = e.Mobile.BankBox;

										if (!box.TryDropItem(e.Mobile, check, false))
										{
											// There's not enough room in your bankbox for the check!
											vendor.Say(500386);
											check.Delete();
										}
										else if (!box.ConsumeTotal(typeof(Gold), amount))
										{
											// Ah, art thou trying to fool me? Thou hast not so much gold!
											vendor.Say(500384);
											check.Delete();
										}
										else
										{
											// Into your bank box I have placed a check in the amount of:
											vendor.Say(1042673, AffixType.Append, amount.ToString("#,0"), "");
										}
									}
								}
							}
							break;
					}
				}
			}
	    }
开发者ID:aj9251,项目名称:ServUO,代码行数:101,代码来源:Banker.cs


示例20: GiveAwards

        private void GiveAwards(ArrayList players, TrophyRank rank, int cash)
        {
            if (players.Count == 0)
                return;

            if (players.Count > 1)
                cash /= (players.Count - 1);

            cash += 500;
            cash /= 1000;
            cash *= 1000;

            StringBuilder sb = new StringBuilder();

            if (this.m_TournyType == TournyType.FreeForAll)
            {
                sb.Append(this.m_Participants.Count * this.m_PlayersPerParticipant);
                sb.Append("-man FFA");
            }
            else if (this.m_TournyType == TournyType.RandomTeam)
            {
                sb.Append(this.m_ParticipantsPerMatch);
                sb.Append("-team");
            }
            else if (this.m_TournyType == TournyType.RedVsBlue)
            {
                sb.Append("Red v Blue");
            }
            else
            {
                for (int i = 0; i < this.m_ParticipantsPerMatch; ++i)
                {
                    if (sb.Length > 0)
                        sb.Append('v');

                    sb.Append(this.m_PlayersPerParticipant);
                }
            }

            if (this.m_EventController != null)
                sb.Append(' ').Append(this.m_EventController.Title);

            sb.Append(" Champion");

            string title = sb.ToString();

            for (int i = 0; i < players.Count; ++i)
            {
                Mobile mob = (Mobile)players[i];

                if (mob == null || mob.Deleted)
                    continue;

                Item item = new Trophy(title, rank);

                if (!mob.PlaceInBackpack(item))
                    mob.BankBox.DropItem(item);

                if (cash > 0)
                {
                    item = new BankCheck(cash);

                    if (!mob.PlaceInBackpack(item))
                        mob.BankBox.DropItem(item);

                    mob.SendMessage("You have been awarded a {0} trophy and {1:N0}gp for your participation in this tournament.", rank.ToString().ToLower(), cash);
                }
                else
                {
                    mob.SendMessage("You have been awarded a {0} trophy for your participation in this tournament.", rank.ToString().ToLower());
                }
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:73,代码来源:Tournament.cs



注:本文中的Server.Items.BankCheck类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Items.BaseAddon类代码示例发布时间:2022-05-26
下一篇:
C# Items.Bandage类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap