当前位置: 首页>>代码示例>>C#>>正文


C# Items.BankCheck类代码示例

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


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


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