當前位置: 首頁>>代碼示例>>C#>>正文


C# Items.Gold類代碼示例

本文整理匯總了C#中Server.Items.Gold的典型用法代碼示例。如果您正苦於以下問題:C# Gold類的具體用法?C# Gold怎麽用?C# Gold使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Gold類屬於Server.Items命名空間,在下文中一共展示了Gold類的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: OnTick

            protected override void OnTick()
            {
                if (cycles == 15)
                {
                    new MovingEffectInfo(new Point3D(corpse.X, corpse.Y, 100), corpse, corpse.Map, 3823, 0, 10,
                        EffectRender.Lighten)
                        .MovingImpact(
                            e =>
                            {
                                int amount = Utility.RandomMinMax(200, 400);

                                if (amount <= 0)
                                {
                                    return;
                                }

                                var g = new Gold(amount);
                                g.MoveToWorld(e.Target.Location, e.Map);

                                new EffectInfo(e.Target, e.Map, 14202, 51, 10, 40, EffectRender.Lighten).Send();
                                Effects.PlaySound(e.Target, e.Map, g.GetDropSound());
                            });
                    Stop();
                    return;
                }
                if (count == 9)
                {
                    count = 1;
                    cycles++;
                }
                corpse.Hue = Utility.RandomBrightHue();
                corpse.Direction = (Direction) count;
                count++;
            }
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:34,代碼來源:WheelofCorptune.cs

示例3: OnTick

			protected override void OnTick()
			{
				if(m_PilesDone >= m_PilesMax)
				{
					Stop();
					return;
				}

				Point3D p = FindGoldLocation(m_Map, m_Location, m_PilesMax / 8);
				Gold g = new Gold(m_MinAmount, m_MaxAmount);
				g.DropToWorld(p, this.m_Map);

				switch (Utility.Random(3))
				{
					case 0: // Fire column
						Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
						Effects.PlaySound(g, g.Map, 0x208);
						break;
					case 1: // Explosion
						Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);
						Effects.PlaySound(g, g.Map, 0x307);
						break;
					case 2: // Ball of fire
						Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);
						break;
				}
				++m_PilesDone;
			}
開發者ID:Crome696,項目名稱:ServUO,代碼行數:28,代碼來源:GoldShower.cs

示例4: Target

        public void Target(Gold weapon)
        {
            if (!Caster.CanSee(weapon))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }

            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(AncientFalseCoinSpell)))
                {
                    if (this.Scroll != null)
                        Scroll.Consume();
                    FakeGold fake = new FakeGold();
                    fake.m_Amount = weapon.Amount * 5;
                    fake.Name = "" + (weapon.Amount * 5) + " Gold Coins";
                    m_Fake = fake;
                    Caster.AddToBackpack(fake);
                    Caster.PlaySound(0x2E6);

                    IEntity from = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z + 50), Caster.Map);
                    IEntity to = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z), Caster.Map);
                    Effects.SendMovingParticles(from, to, 0x1EC6, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
                    StopTimer(Caster);

                    Timer t = new InternalTimer(Caster, m_Fake);

                    m_Timers[Caster] = t;

                    t.Start();
                }
            }

            FinishSequence();
        }
開發者ID:evildude807,項目名稱:kaltar,代碼行數:35,代碼來源:FalseCoinSpell.cs

示例5: Carve

        public void Carve( Mobile from, Item item )
        {
            Effects.PlaySound( GetWorldLocation(), Map, 0x48F );
            Effects.SendLocationEffect( GetWorldLocation(), Map, 0x3728, 10, 10, 0, 0 );

            if ( breakChance > Utility.RandomDouble() )
            {
                from.SendMessage( "You destroy the skull." );

                if( Utility.RandomDouble() < 0.1 )
                {
                    Gold gold = new Gold( 750, 1000 );
                    gold.MoveToWorld( GetWorldLocation(), Map );
                }

                Delete();

                m_Timer.Stop();
            }
            else
            {
                from.SendMessage( "You damage the skull." );
                breakChance += Utility.RandomDouble() * 0.15 + 0.15;
            }
        }
開發者ID:kamronbatman,項目名稱:Defiance-AOS-Pre-2012,代碼行數:25,代碼來源:PlaguedSkull.cs

示例6: Carve

		public void Carve( Mobile from, Item item )
		{
			Effects.PlaySound( GetWorldLocation(), Map, 0x48F );
			Effects.SendLocationEffect( GetWorldLocation(), Map, 0x3728, 10, 10, 0, 0 );

			if ( 0.3 > Utility.RandomDouble() )
			{
				if ( ItemID == 0xF7E )
					from.SendMessage( "You destroy the bone." );
				else
					from.SendMessage( "You destroy the bone pile." );

				Gold gold = new Gold( 25, 100 );

				gold.MoveToWorld( GetWorldLocation(), Map );

				Delete();

				m_Timer.Stop();
			}
			else
			{
				if ( ItemID == 0xF7E )
					from.SendMessage( "You damage the bone." );
				else
					from.SendMessage( "You damage the bone pile." );
			}
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:28,代碼來源:UnholyBone.cs

示例7: OnBeforeDeath

		public override bool OnBeforeDeath()
		{
			Gold gold = new Gold( Utility.RandomMinMax( 190, 230 ) );
			gold.MoveToWorld( Location, Map );

			Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
			return true;
		}
開發者ID:jsrn,項目名稱:MidnightWatchServer,代碼行數:8,代碼來源:MorgBergen.cs

示例8: OnBeforeDeath

		public override bool OnBeforeDeath()
		{
			if ( !base.OnBeforeDeath() )
				return false;

			Gold gold = new Gold( Utility.RandomMinMax( 240, 375 ) );
			gold.MoveToWorld( Location, Map );

			Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
			return true;
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:11,代碼來源:SpectralArmour.cs

示例9: 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

示例10: OnBeforeDeath

		public override bool OnBeforeDeath()
		{
			Gold gold = new Gold( Utility.RandomMinMax( 190, 230 ) );
			gold.MoveToWorld( Location, Map );

			if ( Utility.Random( 3 ) == 0 )
			{
				BaseBook journal = Loot.RandomTavarasJournal();
				journal.MoveToWorld( Location, Map );
			}

			Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
			return true;
		}
開發者ID:FreeReign,項目名稱:imaginenation,代碼行數:14,代碼來源:TavaraSewel.cs

示例11: 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

示例12: OnBeforeDeath

		public override bool OnBeforeDeath()
		{
			Gold gold = new Gold(150, 250);
			gold.Map = this.Map;
			gold.Location = this.Location;

			Scimitar weapon = new Scimitar();
			weapon.DamageLevel = (WeaponDamageLevel)Utility.Random( 1, 5 );
			weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random( 0, 5 );
			weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random( 0, 5 );
			weapon.Map = this.Map;
			weapon.Location = this.Location;

			this.Delete();
			return false;
		}
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:16,代碼來源:SpectralArmour.cs

示例13: 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:Grimoric,項目名稱:RunUO.T2A,代碼行數:17,代碼來源:ThiefGuildmaster.cs

示例14: 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

示例15: OnBeforeDeath

        public override bool OnBeforeDeath()
        {
            if (Utility.RandomDouble() < 0.05)
            {
                if (!base.OnBeforeDeath())
                    return false;

                //VileTentacles VT = new VileTentacles();
                //VT.MoveToWorld(Location, Map);
            }

            if (!base.OnBeforeDeath())
                return false;

            var gold = new Gold(Utility.RandomMinMax(1767, 1800));
            gold.MoveToWorld(Location, Map);

            Effects.SendLocationEffect(Location, Map, 0x376A, 10, 1);
            return true;
        }
開發者ID:rokann,項目名稱:JustUO,代碼行數:20,代碼來源:MaddeningHorror.cs


注:本文中的Server.Items.Gold類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。