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


C# Gold.Delete方法代码示例

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


在下文中一共展示了Gold.Delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDoubleClick

public override void OnDoubleClick( Mobile from )
{

if( m_Placer == null || m_Placer.Deleted )
m_Placer = from;

if( from.InRange( this.GetWorldLocation(), 10 ) )
{
if( m_Placer == null || from == m_Placer || from.AccessLevel >= AccessLevel.GameMaster )
{
Container c = m_Placer.Backpack;
Gold t = new Gold( m_Value );
if( c.TryDropItem( m_Placer, t, true ) )
{
this.Delete();
m_Placer.SendMessage( "The item disolves and gives you a refund" );
}
else
{
t.Delete();
m_Placer.SendMessage("For some reason, the refund didn't work! Please page a GM");
}
}
else
{
from.SendMessage( "Stay out of my yard!" );
}
}
else
{
from.SendMessage( "The item is too far away" );
}
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:33,代码来源:YardItem.cs

示例2: OnClick

		public override void OnClick()
		{
			Container c = m_From.Backpack;
			Gold t = new Gold( value );
			if( c.TryDropItem( m_From, t, true ) )
			{
				m_Stair.Delete();
				m_From.SendMessage( "The item disolves and gives you a refund" );
			}
			else
			{
				t.Delete();
				m_From.SendMessage("For some reason, the refund didn't work!  Please page a GM");
			}
		}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:15,代码来源:StairRefundEntry.cs

示例3: OnDoubleClick

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

			if ( box != null && IsChildOf( box ) )
			{
				Delete();

				int deposited = 0;

				int toAdd = m_Worth;

				Gold gold;

				while ( toAdd > 60000 )
				{
					gold = new Gold( 60000 );

					if ( box.TryDropItem( from, gold, false ) )
					{
						toAdd -= 60000;
						deposited += 60000;
					}
					else
					{
						gold.Delete();

						from.AddToBackpack( new BankCheck( toAdd ) );
						toAdd = 0;

						break;
					}
				}

				if ( toAdd > 0 )
				{
					gold = new Gold( toAdd );

					if ( box.TryDropItem( from, gold, false ) )
					{
						deposited += toAdd;
					}
					else
					{
						gold.Delete();

						from.AddToBackpack( new BankCheck( toAdd ) );
					}
				}

				// Gold was deposited in your account:
				from.SendLocalizedMessage( 1042672, true, " " + deposited.ToString() );
			}
			else
			{
				from.SendLocalizedMessage( 1047026 ); // That must be in your bank box to use it.
			}
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:58,代码来源:BankCheck.cs

示例4: OnGoldGiven

		public virtual bool OnGoldGiven( Mobile from, Gold dropped )
		{
			if ( CheckTeachingMatch( from ) )
			{
				if ( Teach( m_Teaching, from, dropped.Amount, true ) )
				{
					dropped.Delete();
					return true;
				}
			}
			else if ( IsHumanInTown() )
			{
				Direction = GetDirectionTo( from );

				int oldSpeechHue = this.SpeechHue;

				this.SpeechHue = 0x23F;
				SayTo( from, "Thou art giving me gold?" );

				if ( dropped.Amount >= 400 )
					SayTo( from, "'Tis a noble gift." );
				else
					SayTo( from, "Money is always welcome." );

				this.SpeechHue = 0x3B2;
				SayTo( from, 501548 ); // I thank thee.

				this.SpeechHue = oldSpeechHue;

				dropped.Delete();
				return true;
			}

			return false;
		}
开发者ID:greeduomacro,项目名称:uotitan,代码行数:35,代码来源:BaseCreature.cs

示例5: RefundForVine

		public static bool RefundForVine( Mobile m_From )
		{
			Container c = m_From.Backpack;
			Gold t = new Gold( ( m_VinePrice ) );
			
			if( c.TryDropItem( m_From, t, true ) )
			{
				m_From.SendMessage( "You have been refunded "+m_VinePrice.ToString()+" gold for the deleted vine." );
				
				return true;
			}
			else
			{
				t.Delete();
				m_From.SendMessage("For some reason, the refund didn't work!  Please page a GM");
				
				return false;
			}
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:19,代码来源:VinePlacement.cs

示例6: OnDelete

        public override void OnDelete()
        {
            // if the game is in progress, then return all Entry fees
            if(GameInProgress)
            {
                GameBroadcast(100003,ChallengeName);  // "{0} cancelled"

                // go through the participants and return their fees and clear noto
                if(Participants != null)
                {
                    foreach(IChallengeEntry entry in Participants)
                    {
                        if(entry.Status == ChallengeStatus.Forfeit) continue;

                        Mobile from = entry.Participant;

                        // return the entry fee
                        if(from != null && from.BankBox != null && EntryFee > 0)
                        {
                            Item gold = new Gold(EntryFee);

                            if ( !from.BankBox.TryDropItem( from, gold, false ) )
        					{
        						gold.Delete();
        						from.AddToBackpack( new BankCheck( EntryFee ) );
        						XmlPoints.SendText(from, 100000, EntryFee); // "Entry fee of {0} gold has been returned to you."
        					} else
        					{
                                XmlPoints.SendText(from, 100001, EntryFee);  // "Entry fee of {0} gold has been returned to your bank account."
                            }
                        }

                        entry.Status = ChallengeStatus.None;
                    }

                    // clear all noto
                    foreach(IChallengeEntry entry in Participants)
                    {
                        RefreshNoto(entry.Participant);
                    }
                }
                
                EndGame();
            } else
            if(!GameCompleted)
            {
                // this is when a game is cancelled during setup
                GameBroadcast(100003,ChallengeName); // "{0} cancelled"
            }

            base.OnDelete();
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:52,代码来源:BaseChallengeGame.cs

示例7: OnGoldGiven

		public virtual bool OnGoldGiven( Mobile from, Gold dropped )
		{
			if ( CheckTeachingMatch( from ) )
			{
				int goldtaken = Teach( m_Teaching, from, dropped.Amount / TeachScalar, true ) * TeachScalar;

				if ( goldtaken > 0 )
				{
					dropped.Consume( goldtaken );
					return dropped == null || dropped.Deleted || dropped.Amount <= 0;
				}
			}
			else if ( IsHumanInTown() )
			{
				Direction = GetDirectionTo( from );

				int oldSpeechHue = this.SpeechHue;

				this.SpeechHue = 0x23F;
				SayTo( from, "Thou art giving me gold?" );

				if ( dropped.Amount >= 400 )
					SayTo( from, "'Tis a noble gift." );
				else
					SayTo( from, "Money is always welcome." );

				from.Karma += Math.Max( dropped.Amount / 10, 100 );

				this.SpeechHue = 0x3B2;
				SayTo( from, 501548 ); // I thank thee.

				this.SpeechHue = oldSpeechHue;

				dropped.Delete();
				return true;
			}

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

示例8: OnGoldGiven

        public override bool OnGoldGiven( Mobile from, Gold dropped )
        {
            if ( from is PlayerMobile && dropped.Amount == 700 )
            {
                PlayerMobile pm = (PlayerMobile) from;

                if ( pm.NpcGuild == NpcGuild.ThievesGuild )
                {
                    from.AddToBackpack( new DisguiseKit() );

                    dropped.Delete();
                    return true;
                }
            }

            return base.OnGoldGiven( from, dropped );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:17,代码来源:ThiefGuildmaster.cs

示例9: OnGoldGiven

        public override bool OnGoldGiven( Mobile from, Gold dropped )
        {
            if ( from is PlayerMobile && dropped.Amount == JoinCost )
            {
                PlayerMobile pm = (PlayerMobile)from;

                if ( pm.NpcGuild == this.NpcGuild )
                {
                    SayTo( from, 501047 ); // Thou art already a member of our guild.
                }
                else if ( pm.NpcGuild != NpcGuild.None )
                {
                    SayTo( from, 501046 ); // Thou must resign from thy other guild first.
                }
                else if ( pm.GameTime < JoinGameAge || (pm.CreationTime + JoinAge) > DateTime.UtcNow )
                {
                    SayTo( from, 501048 ); // You are too young to join my guild...
                }
                else if ( CheckCustomReqs( pm ) )
                {
                    SayWelcomeTo( from );

                    pm.NpcGuild = this.NpcGuild;
                    pm.NpcGuildJoinTime = DateTime.UtcNow;
                    pm.NpcGuildGameTime = pm.GameTime;

                    dropped.Delete();
                    return true;
                }

                return false;
            }

            return base.OnGoldGiven( from, dropped );
        }
开发者ID:nathanvy,项目名称:runuo,代码行数:35,代码来源:BaseGuildmaster.cs

示例10: OnDoubleClick

		public override void OnDoubleClick(Mobile from)
		{
			// This probably isn't OSI accurate, but we can't just make the quests redundant.
			// Double-clicking the BankCheck in your pack will now credit your account.

			var box = AccountGold.Enabled ? from.Backpack : from.FindBankNoCreate();

			if (box == null || !IsChildOf(box))
			{
				from.SendLocalizedMessage(AccountGold.Enabled ? 1080058 : 1047026); 
				// This must be in your backpack to use it. : That must be in your bank box to use it.
				return;
			}

			Delete();

			var deposited = 0;
			var toAdd = m_Worth;

			if (AccountGold.Enabled && from.Account != null && from.Account.DepositGold(toAdd))
			{
				deposited = toAdd;
				toAdd = 0;
			}

			if (toAdd > 0)
			{
				Gold gold;

				while (toAdd > 60000)
				{
					gold = new Gold(60000);

					if (box.TryDropItem(from, gold, false))
					{
						toAdd -= 60000;
						deposited += 60000;
					}
					else
					{
						gold.Delete();

						from.AddToBackpack(new BankCheck(toAdd));
						toAdd = 0;

						break;
					}
				}

				if (toAdd > 0)
				{
					gold = new Gold(toAdd);

					if (box.TryDropItem(from, gold, false))
					{
						deposited += toAdd;
					}
					else
					{
						gold.Delete();

						from.AddToBackpack(new BankCheck(toAdd));
					}
				}
			}

			// Gold was deposited in your account:
			from.SendLocalizedMessage(1042672, true, deposited.ToString("#,0"));

			var pm = from as PlayerMobile;

			if (pm != null)
			{
				var qs = pm.Quest;

				if (qs is DarkTidesQuest)
				{
					var obj = qs.FindObjective(typeof(CashBankCheckObjective));

					if (obj != null && !obj.Completed)
					{
						obj.Complete();
					}
				}

				if (qs is UzeraanTurmoilQuest)
				{
					var obj = qs.FindObjective(typeof(Engines.Quests.Haven.CashBankCheckObjective));

					if (obj != null && !obj.Completed)
					{
						obj.Complete();
					}
				}
			}
		}
开发者ID:g4idrijs,项目名称:ServUO,代码行数:96,代码来源:BankCheck.cs

示例11: Refund

 public void Refund()
 {
     Gold toGive = new Gold(Price);
     if (Placer.BankBox.TryDropItem(Placer, toGive, false))
     {
         Delete();
         Placer.SendLocalizedMessage(1060397, toGive.Amount.ToString()); // ~1_AMOUNT~ gold has been deposited into your bank box.
     }
     else
     {
         toGive.Delete();
         Placer.SendMessage("Your bankbox is full!");
     }
 }
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:14,代码来源:YardItem.cs

示例12: OnGoldGiven

 public override bool OnGoldGiven(Mobile from, Gold dropped)
 {
     Direction = GetDirectionTo(from);
     SayTo(from, 1153420); // Oh, thank you dearie!
     dropped.Delete();
     return true;
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:Mobiles.cs

示例13: GoldSweep

        public static void GoldSweep(Mobile m, Gold gold)
        {
            Item item = m.Backpack.FindItemByType(typeof(GoldLedger));

            GoldLedger ledger = item as GoldLedger;

            if (ledger == null)
                return;

            if (!ledger.GoldSweeper || !GoldLedger.GoldSweeperAvailable)
                return;

            if (gold != null)
            {
                if (ledger.Gold < 999999999)
                {
                    double maxWeight = (WeightOverloading.GetMaxWeight(m));
                    if ((Mobile.BodyWeight + m.TotalWeight) < (maxWeight))
                    {
                        int golda = gold.Amount;
                        if ((gold.Amount + ledger.Gold) > 999999999)
                            golda = (999999999 - ledger.Gold);
                        double maxgold = golda;
                        if (ledger.d_WeightScale > 0)
                            maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)m.TotalWeight)) / ledger.d_WeightScale);
                        if (golda > maxgold)
                            golda = (int)maxgold;
                        int GoldID = 0;
                        if (golda == 1)
                            GoldID = gold.ItemID;
                        else if (golda > 1 && golda < 6)
                            GoldID = gold.ItemID + 1;
                        else if (golda >= 6)
                            GoldID = gold.ItemID + 2;
                        if (golda < gold.Amount)
                            gold.Amount -= golda;
                        else
                            gold.Delete();
                        ledger.Gold += golda;
                        if (ledger.b_open && golda > 0)
                        {
                            m.CloseGump(typeof(GoldLedgerGump));
                            m.SendGump(new GoldLedgerGump(ledger));
                        }

                        if (golda > 0)
                        {
                            m.SendMessage(2125, "You deposit {0} gold into your gold ledger.", golda.ToString("#,0"));
                            if (!m.Mounted)
                                m.Animate(32, 5, 1, true, false, 0);
                            Effects.SendMovingEffect(gold, m, GoldID, 5, 50, true, false);
                            m.PlaySound(0x2E6);
                        }
                    }
                }}}}}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:55,代码来源:GoldLedger.cs

示例14: getGold

        private static void getGold(string charUID, Mobile pm)
        {
            int amount = 0; // montants d'or
            int bankboxAmount = 0;
            string backpack = getPlayerItemSerial(charUID, SphereFiles.backFile);   // sac du joueur
            string bankbox = getPlayerItemSerial(charUID, SphereFiles.bankFile);    // banque du joueur

            // On parcourt le fichier qui contient tous les enregistrements d'or
            foreach (string line in File.ReadAllLines(SphereFiles.goldFile))
            {
                if (line.StartsWith("AMOUNT="))
                    amount = Int32.Parse(line.Split('=')[1]);

                if (amount > 0 && line.StartsWith("CONT=") && line.Split('=')[1] == backpack)
                {
                    Item gold = new Gold(amount);
                    Container pack = pm.Backpack;

                    if (pack != null)
                        pack.DropItem(gold);
                    else
                        gold.Delete();

                    amount = 0;
                }
                else if (amount > 0 && line.StartsWith("CONT=") && line.Split('=')[1] == bankbox)
                {
                    bankboxAmount += amount;
                    amount = 0;
                    //Item gold = new Gold(amount);
                    //Container bank = pm.BankBox;

                    //if (bank != null)
                    //    bank.DropItem(gold);
                    //else
                    //    gold.Delete();
                }
            }

            if (bankboxAmount > 0)
            {
                Container bank = pm.BankBox;
                if (bank != null)
                {
                    BankCheck check = new BankCheck(bankboxAmount);
                    check.Name = "Or Banque";
                    bank.DropItem(check);
                }
            }
            bankboxAmount = 0;
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:51,代码来源:SpherePlayerMobileImporter.cs

示例15: CashCheck

		public static void CashCheck(Mobile from, BankCheck check)
		{
			BankBox box = from.BankBox;

			if (box != null)
			{
				int deposited = 0;
				int toAdd = check.Worth;

				check.Delete();
				Gold gold;

				while (toAdd > 60000)
				{
					gold = new Gold(60000);

					if (box.TryDropItem(from, gold, false))
					{
						toAdd -= 60000;
						deposited += 60000;
					}
					else
					{
						gold.Delete();

						from.AddToBackpack(new BankCheck(toAdd));
						toAdd = 0;

						break;
					}
				}

				if (toAdd > 0)
				{
					gold = new Gold(toAdd);

					if (box.TryDropItem(from, gold, false))
					{
						deposited += toAdd;
					}
					else
					{
						gold.Delete();

						from.AddToBackpack(new BankCheck(toAdd));
					}
				}
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:49,代码来源:Banker.cs


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