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


C# Bag.MoveToWorld方法代码示例

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


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

示例1: GiveRewardTo

        //        /*
        //        public static void GiveRewardTo( PlayerMobile player )
        //        {
        //            player.PlaceInBackpack( new RewardBag() );
        //            //Item reward = new PowderOfTemperament();
        //            //player.PlaceInBackpack( reward );
        //            /*
        //            //if( Utility.RandomDouble() < 0.95 )
        //                //{
        //                player.PlaceInBackpack( new RewardBag() );
        //                //player.PlaceInBackpack( new BallOfSummoning() );
        //                //player.PlaceInBackpack( new MidasTouch() );
        //                //PackItem( new BallOfSummoning() );
        //                //}
        //            */
        //            Map map = player.Map;
        //            DemonKnight daemon = new DemonKnight();
        //
        //                    daemon.MoveToWorld( player.Location, map );
        //        }*/
        public static void GiveRewardTo( PlayerMobile player )
        {
            Map map = player.Map;
            Bag rewardBag = new Bag();
            rewardBag.Hue = Utility.RandomDyedHue();
            LootPackEntry.AddRandomLoot(rewardBag, 5, 600,  5, 5, 50, 100);
            rewardBag.DropItem(new BankCheck( 5000 ));
            if (0.08 > Utility.RandomDouble())
                    rewardBag.DropItem(new TreasureMap(6, Map.Felucca));
                else
                    rewardBag.DropItem(new TreasureMap(Utility.RandomMinMax(3, 5), Map.Felucca));
            //Add arty
            if (0.1 > Utility.RandomDouble())
            {
            int rnd = Utility.Random(4);
            switch (rnd)
            {
                case 0: rewardBag.DropItem(new YetisPads()); break; //Yetis pads
                case 1: rewardBag.DropItem(new Necronomicon()); break;
                case 2: rewardBag.DropItem(new Behemoth()); break;
                case 3: rewardBag.DropItem(new DragonClenchingClaws()); break;
                //case 4: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateGorget), "Platemail Gorget", Utility.Random(5))); break;
            }
                if (0.80 > Utility.RandomDouble())
                {
                rewardBag.DropItem(new MidasTouch());
                }

            }
            else if (0.80 > Utility.RandomDouble())
            {
                rewardBag.DropItem(new MidasTouch());
            }
            //player.PlaceInBackpack( rewardBag );
            //if(!player.KarmaLocked)
                //player.Karma = Math.Min(15000, player.Karma + 1500);

            //player.SendMessage( "Reward bag has been placed in your backpack." );
            if (player.PlaceInBackpack(rewardBag))
                        {
                            //obj.Complete();
                            player.SendMessage( "Reward bag has been placed in your backpack." );
                            if (!player.KarmaLocked)
                                player.Karma = Math.Min(15000, player.Karma + 1500);
                        }
                        else
                        {
                            if (!player.KarmaLocked)
                                player.Karma = Math.Min(15000, player.Karma + 1500);
                            player.SendMessage( "Your backpack if full, reward is on the ground." );
                            rewardBag.MoveToWorld( player.Location, map );
                        }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:73,代码来源:MidasQuest.cs


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