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


C# Gold.GetDropSound方法代码示例

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


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

示例1: OnTick

                protected override void OnTick()
                {
                    Container theirPack = m_Target.Backpack;

                    double badKarmaChance = 0.5 - ((double)m_From.Karma / 8570);

                    if ( theirPack == null )
                    {
                        m_From.SendLocalizedMessage( 500404 ); // They seem unwilling to give you any money.
                    }
                    else if ( m_From.Karma < 0 && badKarmaChance > Utility.RandomDouble() )
                    {
                        m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500406 ); // Thou dost not look trustworthy... no gold for thee today!
                    }
                    else if ( m_From.CheckTargetSkill( SkillName.Begging, m_Target, 0.0, 100.0 ) )
                    {
                        int toConsume = theirPack.GetAmount( typeof( Gold ) ) / 10;
                        int max = 10 + (m_From.Fame / 2500);

                        if ( max > 14 )
                            max = 14;
                        else if ( max < 10 )
                            max = 10;

                        if ( toConsume > max )
                            toConsume = max;

                        if ( toConsume > 0 )
                        {
                            int consumed = theirPack.ConsumeUpTo( typeof( Gold ), toConsume );

                            if ( consumed > 0 )
                            {
                                m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500405 ); // I feel sorry for thee...

                                Gold gold = new Gold( consumed );

                                m_From.AddToBackpack( gold );
                                m_From.PlaySound( gold.GetDropSound() );

                                if ( m_From.Karma > -3000 )
                                {
                                    int toLose = m_From.Karma + 3000;

                                    if ( toLose > 40 )
                                        toLose = 40;

                                    Titles.AwardKarma( m_From, -toLose, true );
                                }
                            }
                            else
                            {
                                m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500407 ); // I have not enough money to give thee any!
                            }
                        }
                        else
                        {
                            m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500407 ); // I have not enough money to give thee any!
                        }
                    }
                    else
                    {
                        m_Target.SendLocalizedMessage( 500404 ); // They seem unwilling to give you any money.
                    }

                    m_From.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
                }
开发者ID:bugraerdogan,项目名称:silverlight-uo-client,代码行数:67,代码来源:Begging.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()
                {
                    Container theirPack = m_Target.Backpack;

                    if (theirPack == null || ( m_Target is Mobiles.BaseCreature && ((Mobiles.BaseCreature)m_Target).FightMode == Server.Mobiles.FightMode.Closest ) )
                    {
                        m_From.SendLocalizedMessage(500404); // They seem unwilling to give you any money.
                    }
                    else if ((m_From.Karma < 0 && 0.5 > Utility.RandomDouble()) || m_From.Criminal)
                    {
                        m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500406); // Thou dost not look trustworthy... no gold for thee today!
                    }
                    else if (m_From.CheckTargetSkill(SkillName.Begging, m_Target, 0.0, 100.0))
                    {
                        int totalGold = theirPack.GetAmount(typeof(Gold));
                        if (totalGold >= 25)
                        {
                            int toConsume = (int)(totalGold * m_From.Skills[SkillName.Begging].Value / 1000.0 * Utility.RandomDouble());
                            if (toConsume <= 0)
                                toConsume = 1;
                            toConsume = theirPack.ConsumeUpTo(typeof(Gold), toConsume);

                            if (toConsume > 0)
                            {
                                m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500405); // I feel sorry for thee...

                                Gold gold = new Gold(toConsume);
                                m_From.AddToBackpack(gold);
                                m_From.PlaySound(gold.GetDropSound());

                                if (m_From.Karma > -3000)
                                {
                                    int toLose = m_From.Karma + 3000;

                                    if (toLose > 40)
                                        toLose = 40;

                                    Titles.AwardKarma(m_From, -toLose, true);
                                }
                            }
                            else
                            {
                                m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407); // I have not enough money to give thee any!
                            }
                        }
                        else
                        {
                            m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407); // I have not enough money to give thee any!
                        }
                    }
                    else
                    {
                        m_Target.SendLocalizedMessage(500404); // They seem unwilling to give you any money.
                    }

                    m_From.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(10.0);
                }
开发者ID:greeduomacro,项目名称:divinity,代码行数:57,代码来源:Begging.cs

示例4: EndGoldExplosion

        public static void EndGoldExplosion(
            ExplodeFX fx, Point3D center, Map map, int range, int minGold, int maxGold, int[] dropSounds = null)
        {
            BaseExplodeEffect efx = fx.CreateInstance(center, map, range);

            if (efx == null)
            {
                return;
            }

            efx.AverageZ = false;

            efx.Callback = () =>
            {
                var points = new List<Point3D>();

                center.ScanRange(
                    map,
                    range,
                    r =>
                    {
                        if (!r.Excluded)
                        {
                            if (r.QueryMap.CanFit(r.Current, 1, false, false) || r.QueryMap.HasWater(r.Current))
                            {
                                points.Add(r.Current);
                            }
                            else
                            {
                                r.Exclude();
                            }
                        }

                        return false;
                    });

                if (points.Count == 0)
                {
                    return;
                }

                dropSounds = dropSounds ?? new[] {553, 554};

                Timer goldTimer = null;

                goldTimer = Timer.DelayCall(
                    TimeSpan.FromSeconds(1),
                    TimeSpan.FromMilliseconds(100),
                    points.Count,
                    () =>
                    {
                        if (points.Count == 0)
                        {
                            if (goldTimer != null)
                            {
                                goldTimer.Running = false;
                                goldTimer = null;
                            }

                            return;
                        }

                        Point3D p = points.GetRandom();
                        points.Remove(p);

                        Effects.PlaySound(p, map, dropSounds.GetRandom());

                        new MovingEffectInfo(p.Clone3D(0, 0, Utility.RandomMinMax(30, 50)), p, map, 3823, 0, 10,
                            EffectRender.Lighten)
                            .MovingImpact(
                                e =>
                                {
                                    int amount = Utility.RandomMinMax(minGold, maxGold);

                                    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());
                                });
                    });
            };

            efx.Send();
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:90,代码来源:BaseChampion.cs

示例5: OnTick

                protected override void OnTick()
                {
                    Container theirPack = m_Target.Backpack;

                    if ( theirPack == null )
                    {
                        m_From.SendLocalizedMessage( 500404 ); // They seem unwilling to give you any money.
                    }
                    else if ( ( m_From.Karma < 0 && 0.5 > Utility.RandomDouble() ) || m_From.Criminal )
                    {
                        m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500406 ); // Thou dost not look trustworthy... no gold for thee today!
                    }
                    else if ( m_From.CheckTargetSkill( SkillName.Begging, m_Target, 0.0, 100.0 ) )
                    {
                        int totalGold = theirPack.GetAmount( typeof( Gold ) );
                        if ( totalGold >= 25 )
                        {
                            int toConsume = (int)(totalGold * m_From.Skills[SkillName.Begging].Value / 100.0);
                            if ( toConsume <= 0 )
                                toConsume = 1;
                            toConsume = theirPack.ConsumeUpTo( typeof( Gold ), toConsume );

                            if ( toConsume > 0 )
                            {
                                m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500405 ); // I feel sorry for thee...

                                Gold gold = new Gold( toConsume );
                                m_From.AddToBackpack( gold );
                                m_From.PlaySound( gold.GetDropSound() );
                                Titles.AlterNotoriety( m_From, -1, NotoCap.Dishonorable );
                            }
                            else
                            {
                                m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500407 ); // I have not enough money to give thee any!
                            }
                        }
                        else
                        {
                            m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500407 ); // I have not enough money to give thee any!
                        }
                    }
                    else
                    {
                        m_Target.SendLocalizedMessage( 500404 ); // They seem unwilling to give you any money.
                    }

                    m_From.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
                }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:48,代码来源:Begging.cs

示例6: OnTick


//.........这里部分代码省略.........
                                        break;
                                    case 5:
                                        item = new Begging_PitcherOfLiquor1();
                                        name = "a pitcher of liquor.";
                                        break;
                                    case 6:
                                        item = new Begging_PitcherOfLiquor2();
                                        name = "a pitcher of liquor.";
                                        break;
                                    case 7:
                                        item = new Begging_Shirt();
                                        name = "a shirt.";
                                        break;
                                    case 8:
                                        item = new Begging_Pizza();
                                        name = "a pizza.";
                                        break;
                                }
                            }
                            else
                            {
                                switch ( Utility.RandomMinMax( 1, 3 ) )
                                {
                                    case 1:
                                        item = new Begging_FrenchBread();
                                        name = "a french bread.";
                                        break;
                                    case 2:
                                        item = new Begging_PitcherOfWater1();
                                        name = "a pitcher of water.";
                                        break;
                                    case 3:
                                        item = new Begging_PitcherOfWater2();
                                        name = "a pitcher of water.";
                                        break;
                                }
                            }

                            m_Target.Say( 1074854 ); // Here, take this...

                            m_From.AddToBackpack( item );
                            m_From.SendLocalizedMessage( 1074853, name ); // You have been given ~1_name~

                            if ( m_From.Karma > -3000 )
                            {
                                int toLose = m_From.Karma + 3000;

                                Utility.FixMax( ref toLose, 40 );

                                Titles.AwardKarma( m_From, -toLose, true );
                            }
                        }
                        else
                        {
                            int toConsume = theirPack.GetAmount( typeof( Gold ) ) / 10;
                            int max = 10 + ( m_From.Fame / 2500 );

                            Utility.FixMinMax( ref max, 10, 14 );
                            Utility.FixMax( ref toConsume, max );

                            if ( toConsume > 0 )
                            {
                                int consumed = theirPack.ConsumeUpTo( typeof( Gold ), toConsume );

                                if ( consumed > 0 )
                                {
                                    m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500405 ); // I feel sorry for thee...

                                    Gold gold = new Gold( consumed );

                                    m_From.AddToBackpack( gold );
                                    m_From.PlaySound( gold.GetDropSound() );

                                    if ( m_From.Karma > -3000 )
                                    {
                                        int toLose = m_From.Karma + 3000;

                                        Utility.FixMax( ref toLose, 40 );

                                        Titles.AwardKarma( m_From, -toLose, true );
                                    }
                                }
                                else
                                {
                                    m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500407 ); // I have not enough money to give thee any!
                                }
                            }
                            else
                            {
                                m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500407 ); // I have not enough money to give thee any!
                            }
                        }
                    }
                    else
                    {
                        m_Target.SendLocalizedMessage( 500404 ); // They seem unwilling to give you any money.
                    }

                    m_From.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
                }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:101,代码来源:Begging.cs

示例7: OnTick

                protected override void OnTick()
                {
                    Container theirPack = m_Target.Backpack;

                    double badKarmaChance = 0.5 - ((double)m_From.Karma / 8570);

                    if (theirPack == null && m_Target.Race != Race.Elf)
                    {
                        m_From.SendLocalizedMessage(500404); // They seem unwilling to give you any money.
                    }
                    else if (m_From.Karma < 0 && badKarmaChance > Utility.RandomDouble())
                    {
                        m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500406);
                        // Thou dost not look trustworthy... no gold for thee today!
                    }
                    else if (m_From.CheckTargetSkill(SkillName.Begging, m_Target, 0.0, 100.0))
                    {
                        if (m_Target.Race != Race.Elf)
                        {
                            int toConsume = theirPack.GetAmount(typeof(Gold)) / 10;
                            int max = 10 + (m_From.Fame / 2500);

                            if (max > 14)
                            {
                                max = 14;
                            }
                            else if (max < 10)
                            {
                                max = 10;
                            }

                            if (toConsume > max)
                            {
                                toConsume = max;
                            }

                            if (toConsume > 0)
                            {
                                int consumed = theirPack.ConsumeUpTo(typeof(Gold), toConsume);

                                if (consumed > 0)
                                {
                                    m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500405);
                                    // I feel sorry for thee...

                                    Gold gold = new Gold(consumed);

                                    m_From.AddToBackpack(gold);
                                    m_From.PlaySound(gold.GetDropSound());

                                    if (m_From.Karma > -3000)
                                    {
                                        int toLose = m_From.Karma + 3000;

                                        if (toLose > 40)
                                        {
                                            toLose = 40;
                                        }

                                        Titles.AwardKarma(m_From, -toLose, true);
                                    }
                                }
                                else
                                {
                                    m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407);
                                    // I have not enough money to give thee any!
                                }
                            }
                            else
                            {
                                m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407);
                                // I have not enough money to give thee any!
                            }
                        }
                        else
                        {
                            double chance = Utility.RandomDouble();
                            Item reward = new Gold(1);
                            string rewardName = "";
                            if (chance >= .99)
                            {
                                int rand = Utility.Random(8);

                                if (rand == 0)
                                {
                                    reward = new BegBedRoll();
                                    rewardName = "a bedroll";
                                }
                                else if (rand == 1)
                                {
                                    reward = new BegCookies();
                                    rewardName = "a plate of cookies.";
                                }
                                else if (rand == 2)
                                {
                                    reward = new BegFishSteak();
                                    rewardName = "a fish steak.";
                                }
                                else if (rand == 3)
                                {
//.........这里部分代码省略.........
开发者ID:Crome696,项目名称:ServUO,代码行数:101,代码来源:Begging.cs

示例8: Gold

        public static bool Gold(Mobile from, Item item)
        {
            if (item is Gold)
            {
                Party party = Party.Get(from);

                if (party != null)
                {
                    int dividedGold = item.Amount / party.Members.Count;

                    if (dividedGold > 0)
                    {
                        item.Delete();

                        for (int j = 0; j < party.Members.Count; j++)
                        {
                            PartyMemberInfo info = party.Members[j] as PartyMemberInfo;

                            if (info != null && info.Mobile != null && info.Mobile is PlayerMobile)
                            {
                                PlayerMobile pm = info.Mobile as PlayerMobile;

                                if (pm.Backpack != null)
                                {
                                    if (pm != from)
                                    {
                                        pm.SendMessage("{0} takes gold from the corpse and divides equally among the party members: {1} for each.", from.Name, dividedGold);
                                    }
                                    else
                                    {
                                        pm.SendMessage("You take gold from the corpse and divide equally among the party members: {0} for each.", dividedGold);
                                    }

                                    Item playerGold = pm.Backpack.FindItemByType(typeof(Gold));

                                    Gold gold = new Gold(dividedGold);

                                    if (playerGold != null)
                                    {
                                        playerGold.Amount += gold.Amount;
                                    }
                                    else
                                    {
                                        pm.Backpack.AddItem(gold);
                                    }

                                    if (pm != from && WeightOverloading.IsOverloaded(pm))
                                    {
                                        pm.SendMessage("{0} keeps your share, cause you are overloaded.", from.Name);
                                        from.SendMessage("You keep {0}'s share, who is overloaded.", pm.Name);
                                        Item goldAdded = pm.Backpack.FindItemByType(typeof(Gold));
                                        goldAdded.Amount -= gold.Amount;
                                        Item goldReturned = from.Backpack.FindItemByType(typeof(Gold));
                                        goldReturned.Amount += gold.Amount;
                                    }
                                    else
                                    {
                                        pm.PlaySound(gold.GetDropSound());
                                    }
                                }
                            }
                        }

                        return true;
                    }
                }
            }

            return false;
        }
开发者ID:greeduomacro,项目名称:last-wish,代码行数:70,代码来源:AutoSplit.cs


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