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


C# PlayerMobile.PlaceInBackpack方法代码示例

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


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

示例1: OnTalk

        public override void OnTalk( PlayerMobile player, bool contextMenu )
        {
            QuestSystem qs = player.Quest;

            if ( qs is CollectorQuest )
            {
                Direction = this.GetDirectionTo( player );

                QuestObjective obj = qs.FindObjective( typeof( FindTomasObjective ) );

                if ( obj != null && !obj.Completed )
                {
                    Item paints = new EnchantedPaints();

                    if ( !player.PlaceInBackpack( paints ) )
                    {
                        paints.Delete();
                        player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                    }
                    else
                    {
                        obj.Complete();
                    }
                }
                else if ( qs.IsObjectiveInProgress( typeof( CaptureImagesObjective ) ) )
                {
                    qs.AddConversation( new TomasDuringCollectingConversation() );
                }
                else
                {
                    obj = qs.FindObjective( typeof( ReturnImagesObjective ) );

                    if ( obj != null && !obj.Completed )
                    {
                        if ( player.Backpack != null )
                        {
                            player.Backpack.ConsumeUpTo( typeof( EnchantedPaints ), 1 );
                        }

                        obj.Complete();
                    }
                }
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:44,代码来源:TomasONeerlan.cs

示例2: GiveRewardTo

        public static bool GiveRewardTo( PlayerMobile player )
        {
            Gold gold = new Gold( Utility.RandomMinMax( 250, 350 ) );

            if ( player.PlaceInBackpack( gold ) )
            {
                player.SendLocalizedMessage( 1054076 ); // You have been given some gold.
                return true;
            }
            else
            {
                gold.Delete();
                return false;
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:15,代码来源:SolenMatriarchQuest.cs

示例3: OnTalk

        public override void OnTalk( PlayerMobile player, bool contextMenu )
        {
            QuestSystem qs = player.Quest;

            if ( qs is UzeraanTurmoilQuest )
            {
                if ( UzeraanTurmoilQuest.HasLostScrollOfPower( player ) )
                {
                    qs.AddConversation( new LostScrollOfPowerConversation( true ) );
                }
                else if ( UzeraanTurmoilQuest.HasLostFertileDirt( player ) )
                {
                    qs.AddConversation( new LostFertileDirtConversation( true ) );
                }
                else if ( UzeraanTurmoilQuest.HasLostDaemonBlood( player ) )
                {
                    qs.AddConversation( new LostDaemonBloodConversation() );
                }
                else if ( UzeraanTurmoilQuest.HasLostDaemonBone( player ) )
                {
                    qs.AddConversation( new LostDaemonBoneConversation() );
                }
                else
                {
                    if ( player.Profession == 2 ) // magician
                    {
                        Container backpack = player.Backpack;

                        if ( backpack == null || backpack.GetAmount( typeof( BlackPearl ) ) < 30 || backpack.GetAmount( typeof( Bloodmoss ) ) < 30 || backpack.GetAmount( typeof( Garlic ) ) < 30 || backpack.GetAmount( typeof( Ginseng ) ) < 30 || backpack.GetAmount( typeof( MandrakeRoot ) ) < 30 || backpack.GetAmount( typeof( Nightshade ) ) < 30 || backpack.GetAmount( typeof( SulfurousAsh ) ) < 30 || backpack.GetAmount( typeof( SpidersSilk ) ) < 30 )
                        {
                            qs.AddConversation( new FewReagentsConversation() );
                        }
                    }

                    QuestObjective obj = qs.FindObjective( typeof( FindUzeraanBeginObjective ) );

                    if ( obj != null && !obj.Completed )
                    {
                        obj.Complete();
                    }
                    else
                    {
                        obj = qs.FindObjective( typeof( FindUzeraanFirstTaskObjective ) );

                        if ( obj != null && !obj.Completed )
                        {
                            obj.Complete();
                        }
                        else
                        {
                            obj = qs.FindObjective( typeof( FindUzeraanAboutReportObjective ) );

                            if ( obj != null && !obj.Completed )
                            {
                                Container cont = GetNewContainer();

                                if ( player.Profession == 2 ) // magician
                                {
                                    cont.DropItem( new MarkScroll( 5 ) );
                                    cont.DropItem( new RecallScroll( 5 ) );
                                    for ( int i = 0; i < 5; i++ )
                                    {
                                        cont.DropItem( new RecallRune() );
                                    }
                                }
                                else
                                {
                                    cont.DropItem( new Gold( 300 ) );
                                    for ( int i = 0; i < 6; i++ )
                                    {
                                        cont.DropItem( new NightSightPotion() );
                                        cont.DropItem( new LesserHealPotion() );
                                    }
                                }

                                if ( !player.PlaceInBackpack( cont ) )
                                {
                                    cont.Delete();
                                    player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                }
                                else
                                {
                                    obj.Complete();
                                }
                            }
                            else
                            {
                                obj = qs.FindObjective( typeof( ReturnScrollOfPowerObjective ) );

                                if ( obj != null && !obj.Completed )
                                {
                                    FocusTo( player );
                                    SayTo( player, 1049378 ); // Hand me the scroll, if you have it.
                                }
                                else
                                {
                                    obj = qs.FindObjective( typeof( ReturnFertileDirtObjective ) );

                                    if ( obj != null && !obj.Completed )
                                    {
//.........这里部分代码省略.........
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:101,代码来源:Uzeraan.cs

示例4: OnTalk

        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            Direction = GetDirectionTo(player);
            QuestSystem qs = player.Quest;

            // Doing this quest
            if (qs is ElderWizardQuest)
            {
                if (qs.IsObjectiveInProgress(typeof(FindPlantObjective)))
                {
                    qs.AddConversation(new DuringFindPlantConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(ReportBackObjective));

                    if (obj != null && !obj.Completed)
                    {
                        QuestReagentBag.ReagentBagType bagType = QuestReagentBag.ReagentBagType.Mage;

                        if (player.Skills[SkillName.Necromancy].Base > player.Skills[SkillName.Magery].Base)
                            bagType = QuestReagentBag.ReagentBagType.Necro;
                        else if (player.Skills[SkillName.Necromancy].Base == player.Skills[SkillName.Magery].Base && Utility.RandomBool() )
                            bagType = QuestReagentBag.ReagentBagType.Necro;

                        Bag rewardBag = new QuestReagentBag(bagType);

                        if (player.PlaceInBackpack(rewardBag))
                            obj.Complete();
                        else
                        {
                            rewardBag.Delete();
                            player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                        }
                    }
                }
            }
            else
            {
                // Busy with another quest
                if (qs != null)
                {
                    qs.AddConversation(new DontOfferConversation());
                }
                // Offer Quest
                else if (qs == null && QuestSystem.CanOfferQuest(player, typeof(ElderWizardQuest)))
                {
                    Direction = GetDirectionTo(player);
                    new ElderWizardQuest(player).SendOffer();
                }
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:52,代码来源:GabrielleTheElderWizard.cs

示例5: OnTalk

		public override void OnTalk( PlayerMobile player, bool contextMenu )
		{
			StudyOfSolenQuest qs = player.Quest as StudyOfSolenQuest;

			if ( qs != null && qs.Naturalist == this )
			{
				StudyNestsObjective study = qs.FindObjective( typeof( StudyNestsObjective ) ) as StudyNestsObjective;

				if ( study != null )
				{
					if ( !study.Completed )
					{
						PlaySound( 0x41F );
						qs.AddConversation( new NaturalistDuringStudyConversation() );
					}
					else
					{
						QuestObjective obj = qs.FindObjective( typeof( ReturnToNaturalistObjective ) );

						if ( obj != null && !obj.Completed )
						{
							Seed reward;

							PlantType type;
							switch ( Utility.Random( 17 ) )
							{
								case 0: type = PlantType.CampionFlowers; break;
								case 1: type = PlantType.Poppies; break;
								case 2: type = PlantType.Snowdrops; break;
								case 3: type = PlantType.Bulrushes; break;
								case 4: type = PlantType.Lilies; break;
								case 5: type = PlantType.PampasGrass; break;
								case 6: type = PlantType.Rushes; break;
								case 7: type = PlantType.ElephantEarPlant; break;
								case 8: type = PlantType.Fern; break;
								case 9: type = PlantType.PonytailPalm; break;
								case 10: type = PlantType.SmallPalm; break;
								case 11: type = PlantType.CenturyPlant; break;
								case 12: type = PlantType.WaterPlant; break;
								case 13: type = PlantType.SnakePlant; break;
								case 14: type = PlantType.PricklyPearCactus; break;
								case 15: type = PlantType.BarrelCactus; break;
								default: type = PlantType.TribarrelCactus; break;
							}

							if ( study.StudiedSpecialNest )
							{
								reward = new Seed( type, PlantHue.FireRed, false );
							}
							else
							{
								PlantHue hue;
								switch ( Utility.Random( 3 ) )
								{
									case 0: hue = PlantHue.Pink; break;
									case 1: hue = PlantHue.Magenta; break;
									default: hue = PlantHue.Aqua; break;
								}

								reward = new Seed( type, hue, false );
							}

							if ( player.PlaceInBackpack( reward ) )
							{
								obj.Complete();

								PlaySound( 0x449 );
								PlaySound( 0x41B );

								if ( study.StudiedSpecialNest )
									qs.AddConversation( new SpecialEndConversation() );
								else
									qs.AddConversation( new EndConversation() );
							}
							else
							{
								reward.Delete();

								qs.AddConversation( new FullBackpackConversation() );
							}
						}
					}
				}
			}
			else
			{
				QuestSystem newQuest = new StudyOfSolenQuest( player, this );

				if ( player.Quest == null && QuestSystem.CanOfferQuest( player, typeof( StudyOfSolenQuest ) ) )
				{
					PlaySound( 0x42F );
					newQuest.SendOffer();
				}
				else
				{
					PlaySound( 0x448 );
					newQuest.AddConversation( new DontOfferConversation() );
				}
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:100,代码来源:Naturalist.cs

示例6: OnTalk


//.........这里部分代码省略.........
								cont.DropItem( new Ginseng( 30 ) );
								cont.DropItem( new MandrakeRoot( 30 ) );
								cont.DropItem( new Nightshade( 30 ) );
								cont.DropItem( new SulfurousAsh( 30 ) );
								cont.DropItem( new SpidersSilk( 30 ) );

								cont.DropItem( new Cauldron() );
								cont.DropItem( new MoonfireBrew() );
								cont.DropItem( new TreasureMap( Utility.RandomMinMax( 1, 4 ), this.Map ) );
								cont.DropItem( new Gold( 2000, 2200 ) );

								if ( Utility.RandomBool() )
								{
									BaseWeapon weapon = Loot.RandomWeapon();

									if ( Core.AOS )
									{
										BaseRunicTool.ApplyAttributesTo( weapon, 2, 20, 30 );
									}
									else
									{
										weapon.DamageLevel = (WeaponDamageLevel)BaseCreature.RandomMinMaxScaled( 2, 3 );
										weapon.AccuracyLevel = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled( 2, 3 );
										weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled( 2, 3 );
									}

									cont.DropItem( weapon );
								}
								else
								{
									Item item;
							
									if ( Core.AOS )
									{
										item = Loot.RandomArmorOrShieldOrJewelry();

										if ( item is BaseArmor )
											BaseRunicTool.ApplyAttributesTo( (BaseArmor)item, 2, 20, 30 );
										else if ( item is BaseJewel )
											BaseRunicTool.ApplyAttributesTo( (BaseJewel)item, 2, 20, 30 );
									}
									else
									{
										BaseArmor armor = Loot.RandomArmorOrShield();
										item = armor;

										armor.ProtectionLevel = (ArmorProtectionLevel)BaseCreature.RandomMinMaxScaled( 2, 3 );
										armor.Durability = (ArmorDurabilityLevel)BaseCreature.RandomMinMaxScaled( 2, 3 );
									}

									cont.DropItem( item );
								}

								if ( player.BAC > 0 )
									cont.DropItem( new HangoverCure() );

								if ( player.PlaceInBackpack( cont ) )
								{
									bool gainedPath = false;

									if ( VirtueHelper.Award( player, VirtueName.Sacrifice, 250, ref gainedPath ) ) // TODO: Check amount on OSI.
										player.SendLocalizedMessage( 1054160 ); // You have gained in sacrifice.

									PlaySound( 0x253 );
									PlaySound( 0x20 );
									obj.Complete();
								}
								else
								{
									cont.Delete();
									player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
								}
							}
						}
					}
				}
			}
			else
			{
				QuestSystem newQuest = new WitchApprenticeQuest( player );
				bool inRestartPeriod = false;

				if ( qs != null )
				{
					newQuest.AddConversation( new DontOfferConversation() );
				}
				else if ( QuestSystem.CanOfferQuest( player, typeof( WitchApprenticeQuest ), out inRestartPeriod ) )
				{
					PlaySound( 0x20 );
					PlaySound( 0x206 );
					newQuest.SendOffer();
				}
				else if ( inRestartPeriod )
				{
					PlaySound( 0x259 );
					PlaySound( 0x206 );
					newQuest.AddConversation( new RecentlyFinishedConversation() );
				}
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:101,代码来源:Grizelda.cs

示例7: GiveRewardTo

		public static void GiveRewardTo( PlayerMobile player, ref bool bagOfSending, ref bool powderOfTranslocation, ref bool gold )
		{
			if ( bagOfSending )
			{
				Item reward = new BagOfSending();

				if ( player.PlaceInBackpack( reward ) )
				{
					player.SendLocalizedMessage( 1054074, "", 0x59 ); // You have been given a bag of sending.
					bagOfSending = false;
				}
				else
				{
					reward.Delete();
				}
			}

			if ( powderOfTranslocation )
			{
				Item reward = new PowderOfTranslocation( Utility.RandomMinMax( 10, 12 ) );

				if ( player.PlaceInBackpack( reward ) )
				{
					player.SendLocalizedMessage( 1054075, "", 0x59 ); // You have been given some powder of translocation.
					powderOfTranslocation = false;
				}
				else
				{
					reward.Delete();
				}
			}

			if ( gold )
			{
				Item reward = new Gold( Utility.RandomMinMax( 250, 350 ) );

				if ( player.PlaceInBackpack( reward ) )
				{
					player.SendLocalizedMessage( 1054076, "", 0x59 ); // You have been given some gold.
					gold = false;
				}
				else
				{
					reward.Delete();
				}
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:47,代码来源:AmbitiousQueenQuest.cs

示例8: OnTalk

		public override void OnTalk( PlayerMobile player, bool contextMenu )
		{
			QuestSystem qs = player.Quest;

			if ( qs is DarkTidesQuest )
			{
				if ( DarkTidesQuest.HasLostCallingScroll( player ) )
				{
					qs.AddConversation( new LostCallingScrollConversation( true ) );
				}
				else
				{
					QuestObjective obj = qs.FindObjective( typeof( FindMardothAboutVaultObjective ) );

					if ( obj != null && !obj.Completed )
					{
						obj.Complete();
					}
					else
					{
						obj = qs.FindObjective( typeof( FindMardothAboutKronusObjective ) );

						if ( obj != null && !obj.Completed )
						{
							obj.Complete();
						}
						else
						{
							obj = qs.FindObjective( typeof( FindMardothEndObjective ) );

							if ( obj != null && !obj.Completed )
							{
								Container cont = GetNewContainer();

								cont.DropItem( new PigIron( 20 ) );
								cont.DropItem( new NoxCrystal( 20 ) );
								cont.DropItem( new BatWing( 25 ) );
								cont.DropItem( new DaemonBlood( 20 ) );
								cont.DropItem( new GraveDust( 20 ) );

								BaseWeapon weapon = new BoneHarvester();

								weapon.Slayer = SlayerName.OrcSlaying;

                                int damageLevel = BaseCreature.RandomMinMaxScaled(2, 4);
                                if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel)
                                {
                                    if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls) { cont.DropItem(PuzzleChest.CreateRandomSkillScroll()); }
                                    int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn);
                                    if (platAmount > 0) cont.DropItem(new Platinum(platAmount));
                                    damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn;
                                }
                                weapon.DamageLevel = (WeaponDamageLevel)damageLevel;
								weapon.AccuracyLevel = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled( 2, 4 );
								weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled( 2, 4 );

								cont.DropItem( weapon );

								cont.DropItem( new BankCheck( 2000 ) );
								cont.DropItem( new EnchantedSextant() );

								if ( !player.PlaceInBackpack( cont ) )
								{
									cont.Delete();
									player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
								}
								else
								{
									obj.Complete();
								}
							}
							else if ( contextMenu )
							{
								FocusTo( player );
								player.SendLocalizedMessage( 1061821 ); // Mardoth has nothing more for you at this time.
							}
						}
					}
				}
			}
			else if ( qs == null && QuestSystem.CanOfferQuest( player, typeof( DarkTidesQuest ) ) )
			{
				new DarkTidesQuest( player ).SendOffer();
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:85,代码来源:Mardoth.cs

示例9: OnTalk

		public override void OnTalk( PlayerMobile player, bool contextMenu )
		{
			QuestSystem qs = player.Quest;

			if ( qs is EminosUndertakingQuest )
			{
				if ( EminosUndertakingQuest.HasLostNoteForZoel( player ) )
				{
					Item note = new NoteForZoel();

					if ( player.PlaceInBackpack( note ) )
					{
						qs.AddConversation( new LostNoteConversation() );
					}
					else
					{
						note.Delete();
						player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
					}
				}
				else if ( EminosUndertakingQuest.HasLostEminosKatana( player ) )
				{
					qs.AddConversation( new LostSwordConversation() );
				}
				else
				{
					QuestObjective obj = qs.FindObjective( typeof( FindEminoBeginObjective ) );

					if ( obj != null && !obj.Completed )
					{
						obj.Complete();
					}
					else
					{
						obj = qs.FindObjective( typeof( UseTeleporterObjective ) );

						if ( obj != null && !obj.Completed )
						{
							Item note = new NoteForZoel();

							if ( player.PlaceInBackpack( note ) )
							{
								obj.Complete();

								player.AddToBackpack( new LeatherNinjaPants() );
								player.AddToBackpack( new LeatherNinjaMitts() );
							}
							else
							{
								note.Delete();
								player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
							}
						}
						else
						{
							obj = qs.FindObjective( typeof( ReturnFromInnObjective ) );

							if ( obj != null && !obj.Completed )
							{
								Container cont = GetNewContainer();

								for ( int i = 0; i < 10; i++ )
									cont.DropItem( new LesserHealPotion() );

								cont.DropItem( new LeatherNinjaHood() );
								cont.DropItem( new LeatherNinjaJacket() );

								if ( player.PlaceInBackpack( cont ) )
								{
									obj.Complete();
								}
								else
								{
									cont.Delete();
									player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
								}
							}
							else
							{
								if ( qs.IsObjectiveInProgress( typeof( SlayHenchmenObjective ) ) )
								{
									qs.AddConversation( new ContinueSlayHenchmenConversation() );
								}
								else
								{
									obj = qs.FindObjective( typeof( GiveEminoSwordObjective ) );

									if ( obj != null && !obj.Completed )
									{
										Item katana = null;

										if ( player.Backpack != null )
											katana = player.Backpack.FindItemByType( typeof( EminosKatana ) );

										if ( katana != null )
										{
											bool stolenTreasure = false;

											HallwayWalkObjective walk = qs.FindObjective( typeof( HallwayWalkObjective ) ) as HallwayWalkObjective;
											if ( walk != null )
//.........这里部分代码省略.........
开发者ID:FreeReign,项目名称:imaginenation,代码行数:101,代码来源:Emino.cs

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

示例11: AddReward

        private bool AddReward(PlayerMobile player)
        {
            Bag rewardBag = new Bag();

            rewardBag.Hue = Utility.RandomDyedHue();
            LootPackEntry.AddRandomLoot(rewardBag, 5, 50, 5, 5, 50, 100);
            rewardBag.DropItem(new Gold(2000, 4000));

            if (0.05 > Utility.RandomDouble())
                rewardBag.DropItem(new BloodPentagramPartDeed());

            if (player.PlaceInBackpack(rewardBag))
                return true;
            else
            {
                rewardBag.Delete();
                player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                return false;
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:20,代码来源:EldaTheQuestionableAlchemist.cs

示例12: OnTalk

		public override void OnTalk( PlayerMobile player, bool contextMenu )
		{
			QuestSystem qs = player.Quest;

			if ( qs is TheGraveDiggerQuest )
			{
				Direction = GetDirectionTo( player );

				QuestObjective obj = qs.FindObjective( typeof( FindVincentObjective ) );

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

					if ( player.Backpack != null )
					{
						player.Backpack.ConsumeUpTo( typeof( Yeast ), 1 );
						player.Backpack.ConsumeUpTo( typeof( AsianOil ), 1 );
						player.Backpack.ConsumeUpTo( typeof( RiceFlavorSticks ), 1 );
						player.Backpack.ConsumeUpTo( typeof( PureGrainAlcohol ), 1 );
					}
				}
				else if ( qs.IsObjectiveInProgress( typeof( VincentsLittleGirlObjective ) ) )
				{
					qs.AddConversation( new DuringSearchConversation() );
				}
				else
				{
					obj = qs.FindObjective( typeof( ReturnToVincentObjective ) );

					if ( obj != null && !obj.Completed )
					{
						Item brew = new VincentsBrew();

						if ( !player.PlaceInBackpack( brew ) )
						{
							brew.Delete();
							player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
						}
						else
						{
							obj.Complete();
						}
					}
				}
			}
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:47,代码来源:Vincent.cs

示例13: OnTalk


//.........这里部分代码省略.........
							PlaySound( 0x206 );
							qs.AddConversation( new HagDuringIngredientsConversation() );
						}
						else
						{
							obj = qs.FindObjective( typeof( ReturnIngredientsObjective ) );

							if ( obj != null && !obj.Completed )
							{
								Container cont = GetNewContainer();

								cont.DropItem( new BlackPearl( 30 ) );
								cont.DropItem( new Bloodmoss( 30 ) );
								cont.DropItem( new Garlic( 30 ) );
								cont.DropItem( new Ginseng( 30 ) );
								cont.DropItem( new MandrakeRoot( 30 ) );
								cont.DropItem( new Nightshade( 30 ) );
								cont.DropItem( new SulfurousAsh( 30 ) );
								cont.DropItem( new SpidersSilk( 30 ) );

								cont.DropItem( new Cauldron() );
								cont.DropItem( new MoonfireBrew() );
								cont.DropItem( new TreasureMap( Utility.RandomMinMax( 1, 4 ), this.Map ) );
								cont.DropItem( new Gold( 2000, 2200 ) );

								if ( Utility.RandomBool() )
								{
									BaseWeapon weapon = Loot.RandomWeapon();


                                    int damageLevel = BaseCreature.RandomMinMaxScaled(2, 3);
                                    if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel)
                                    {
                                        if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls) { cont.DropItem(PuzzleChest.CreateRandomSkillScroll()); }
                                        int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn);
                                        if (platAmount > 0) cont.DropItem(new Platinum(platAmount));
                                        damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn;
                                    }
                                    weapon.DamageLevel = (WeaponDamageLevel)damageLevel;
									weapon.AccuracyLevel = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled( 2, 3 );
									weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled( 2, 3 );

									cont.DropItem( weapon );
								}
								else
								{
									Item item;

									
									BaseArmor armor = Loot.RandomArmorOrShield();
									item = armor;

									armor.ProtectionLevel = (ArmorProtectionLevel)BaseCreature.RandomMinMaxScaled( 2, 3 );
									armor.Durability = (ArmorDurabilityLevel)BaseCreature.RandomMinMaxScaled( 2, 3 );

									cont.DropItem( item );
								}

								if ( player.BAC > 0 )
									cont.DropItem( new HangoverCure() );

								if ( player.PlaceInBackpack( cont ) )
								{
									PlaySound( 0x253 );
									PlaySound( 0x20 );
									obj.Complete();
								}
								else
								{
									cont.Delete();
									player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
								}
							}
						}
					}
				}
			}
			else
			{
				QuestSystem newQuest = new WitchApprenticeQuest( player );
				bool inRestartPeriod = false;

				if ( qs != null )
				{
					newQuest.AddConversation( new DontOfferConversation() );
				}
				else if ( QuestSystem.CanOfferQuest( player, typeof( WitchApprenticeQuest ), out inRestartPeriod ) )
				{
					PlaySound( 0x20 );
					PlaySound( 0x206 );
					newQuest.SendOffer();
				}
				else if ( inRestartPeriod )
				{
					PlaySound( 0x259 );
					PlaySound( 0x206 );
					newQuest.AddConversation( new RecentlyFinishedConversation() );
				}
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:101,代码来源:Grizelda.cs

示例14: OnTalk

        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            Direction = GetDirectionTo(player);
            QuestSystem qs = player.Quest;

            // Doing this quest
            if (qs is CursedCaveQuest)
            {
                if (qs.IsObjectiveInProgress(typeof(CursedCaveBeginObjective)))
                {
                    qs.AddConversation(new DuringKillTaskConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(ReportBackObjective));

                    if (obj != null && !obj.Completed)
                    {
                        Bag rewardBag = new Bag();
                        rewardBag.Hue = Utility.RandomDyedHue();
                        LootPackEntry.AddRandomLoot(rewardBag, 5, 600,  5, 5, 50, 100);
                        rewardBag.DropItem(new Bandage(Utility.RandomMinMax(200, 300)));
                        rewardBag.DropItem(new Gold(2000, 4000));
                        if (0.08 > Utility.RandomDouble())
                            rewardBag.DropItem(new TreasureMap(6, Map.Felucca));
                        else
                            rewardBag.DropItem(new TreasureMap(Utility.RandomMinMax(3, 5), Map.Felucca));

                        // Add Artifact ***
                        if (0.05 > Utility.RandomDouble())
                        {
                            if (GetBestFightingSkill(player) == SkillName.Archery)
                                rewardBag.DropItem(new BowOfHephaestus());
                            else
                                rewardBag.DropItem(new LongswordOfJustice());
                        }
                        else if (0.2 > Utility.RandomDouble())
                        {
                            int rnd = Utility.Random(5);
                            switch (rnd)
                            {
                                case 0: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateChest), "Platemail Tunic", Utility.Random(5))); break; //Up to 4 props + Chivalry
                                case 1: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateArms), "Platemail Arms", Utility.Random(5))); break;
                                case 2: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateGloves), "Platemail Gloves", Utility.Random(5))); break;
                                case 3: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateLegs), "Platemail Legs", Utility.Random(5))); break;
                                case 4: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateGorget), "Platemail Gorget", Utility.Random(5))); break;
                            }
                        }

                        if (player.PlaceInBackpack(rewardBag))
                        {
                            obj.Complete();
                            if (!player.KarmaLocked)
                                player.Karma = Math.Min(15000, player.Karma + 1500);
                        }
                        else
                        {
                            rewardBag.Delete();
                            player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                        }
                    }
                }
            }
            else
            {
                // Busy with another quest
                if (qs != null)
                {
                    qs.AddConversation(new DontOfferConversation());
                }
                // Offer Quest
                else if (qs == null && QuestSystem.CanOfferQuest(player, typeof(CursedCaveQuest)))
                {
                    Direction = GetDirectionTo(player);
                    new CursedCaveQuest(player).SendOffer();
                }
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:78,代码来源:WarrenTheGuard.cs

示例15: OnTalk

        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (qs is DarkTidesQuest)
            {
                if (DarkTidesQuest.HasLostCallingScroll(player))
                {
                    qs.AddConversation(new LostCallingScrollConversation(true));
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(FindMardothAboutVaultObjective));

                    if (obj != null && !obj.Completed)
                    {
                        obj.Complete();
                    }
                    else
                    {
                        obj = qs.FindObjective(typeof(FindMardothAboutKronusObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                        }
                        else
                        {
                            obj = qs.FindObjective(typeof(FindMardothEndObjective));

                            if (obj != null && !obj.Completed)
                            {
                                Container cont = GetNewContainer();

                                cont.DropItem(new PigIron(20));
                                cont.DropItem(new NoxCrystal(20));
                                cont.DropItem(new BatWing(25));
                                cont.DropItem(new DaemonBlood(20));
                                cont.DropItem(new GraveDust(20));

                                BaseWeapon weapon = new BoneHarvester();

                                weapon.Slayer = SlayerName.OrcSlaying;

                                if (Core.AOS)
                                {
                                    BaseRunicTool.ApplyAttributesTo(weapon, 3, 20, 40);
                                }
                                else
                                {
                                    weapon.DamageLevel = (WeaponDamageLevel)BaseCreature.RandomMinMaxScaled(2, 4);
                                    weapon.AccuracyLevel = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled(2, 4);
                                    weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 4);
                                }

                                cont.DropItem(weapon);

                                cont.DropItem(new BankCheck(2000));
                                cont.DropItem(new EnchantedSextant());

                                if (!player.PlaceInBackpack(cont))
                                {
                                    cont.Delete();
                                    player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                                }
                                else
                                {
                                    obj.Complete();
                                }
                            }
                            else if (contextMenu)
                            {
                                this.FocusTo(player);
                                player.SendLocalizedMessage(1061821); // Mardoth has nothing more for you at this time.
                            }
                        }
                    }
                }
            }
            else if (qs == null && QuestSystem.CanOfferQuest(player, typeof(DarkTidesQuest)))
            {
                new DarkTidesQuest(player).SendOffer();
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:84,代码来源:Mardoth.cs


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