當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。