コード例 #1
0
			public InternalTarget( PowderOfTranslocation powder ) : base( -1, false, TargetFlags.None )
			{
				m_Powder = powder;
			}
コード例 #2
0
ファイル: SolenMatriarch.cs プロジェクト: Ravenwolfe/xrunuo
        public void OnGivenFungi( PlayerMobile player, ZoogiFungus fungi )
        {
            this.Direction = this.GetDirectionTo( player );

            SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

            if ( qs != null && qs.RedSolen == this.RedSolen )
            {
                QuestObjective obj = qs.FindObjective( typeof( ProcessFungiObjective ) );

                if ( obj != null && !obj.Completed )
                {
                    int amount = fungi.Amount / 2;

                    if ( amount > 100 )
                    {
                        amount = 100;
                    }

                    if ( amount > 0 )
                    {
                        if ( amount * 2 >= fungi.Amount )
                        {
                            fungi.Delete();
                        }
                        else
                        {
                            fungi.Amount -= amount * 2;
                        }

                        PowderOfTranslocation powder = new PowderOfTranslocation( amount );
                        player.AddToBackpack( powder );

                        player.SendLocalizedMessage( 1054100 ); // You receive some powder of translocation.

                        obj.Complete();
                    }
                }
            }
        }
コード例 #3
0
 public InternalTarget(PowderOfTranslocation powder)
     : base(-1, false, TargetFlags.None)
 {
     this.m_Powder = powder;
 }
コード例 #4
0
		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();
				}
			}
		}