コード例 #1
0
                public override void OnDoubleClick( Mobile from )
                
                 { 
                   Eggs eg = new Eggs(); 

                   eg.MoveToWorld( this.Location, this.Map );
                 } 
コード例 #2
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(this.GetWorldLocation(), 1))
     {
         if (m_Owner != null)
         {
             if (m_HasEggs > 0)
             {
                 if (m_Owner is BaseAnimal)
                 {
                     BaseAnimal ba = (BaseAnimal)m_Owner;
                     if (ba.Owner != from && ba.Owner != null)
                     {
                         ba.Combatant = from;
                     }
                     if (ba.IsPregnant)
                     {
                         ba.IsPregnant = false;
                     }
                 }
                 Eggs egg = new Eggs();
                 from.AddToBackpack(egg);
                 m_HasEggs -= 1;
                 InvalidateProperties();
                 from.SendMessage("You take an egg from the nest.");
                 if (m_HasEggs < 1)
                 {
                     ItemID = 6869;
                 }
             }
             else
             {
                 from.SendMessage("The nest is empty.");
                 ItemID = 6869;
             }
         }
         else
         {
             Movable = true;
             m_Owner = from;
             from.SendMessage("You free the nest.");
         }
     }
     else
     {
         from.SendMessage("You are too far away!");
     }
 }
コード例 #3
0
		protected override void OnTick()
		{
			if (Mare.Map != Map.Internal)
				{
				Eggs eggs = new Eggs();
				eggs.MoveToWorld( Mare.Location, Mare.Map );
				Effects.PlaySound( Mare.Location, Mare.Map, 110);//Can change number of sound played 110 = chicken cluck
				Mare.PublicOverheadMessage( MessageType.Regular, 62, true, "Cluck" );//FYI: Mare.PublicOverheadMessage( MessageType.Regular, 62 this is for the hue colot, true is for cursive, "Cluck" );
				
								
				}
			else
				{
				Effects.PlaySound( Mare.Location, Mare.Map, 130);//Can change number of sound played, 130 = Moose sound
				Mare.PublicOverheadMessage( MessageType.Regular, 38, true, "Eggs spawning on internal Map. Tell a GM." );
				}
			}
コード例 #4
0
ファイル: Eggs.cs プロジェクト: justdanofficial/khaeros
 public InternalTarget( Eggs item )
     : base(1, false, TargetFlags.None)
 {
     m_Item = item;
 }
コード例 #5
0
ファイル: Eggs.cs プロジェクト: zerodowned/cov-shard-svn-1
 public InternalTarget(Eggs item) : base(1, false, TargetFlags.None)
 {
     m_Item = item;
 }
コード例 #6
0
ファイル: Chicken.cs プロジェクト: justdanofficial/khaeros
        public override void OnDoubleClick( Mobile from )
        {
            int eggs = 0;

            if( !this.InRange( from, 1 ) )
               	{
               	from.SendMessage( "You are too far away to do that." );
               	return;
               	}

            if( from != null )
            {
                if ( DateTime.Compare( DateTime.Now, ( this.LastEgg + TimeSpan.FromHours( 1 ) ) ) > 0 )
                {
                    eggs++;

                    if ( DateTime.Compare( DateTime.Now, ( this.LastEgg + TimeSpan.FromHours( 2 ) ) ) > 0 )
                    {
                        eggs++;

                        if ( DateTime.Compare( DateTime.Now, ( this.LastEgg + TimeSpan.FromHours( 3 ) ) ) > 0 )
                        {
                            eggs++;
                        }
                    }

                    if ( from is PlayerMobile )
                    {
                        PlayerMobile pm = from as PlayerMobile;
                        Container pack = pm.Backpack;
                        Eggs neweggs = new Eggs();
                        neweggs.Amount = eggs;
                        pack.DropItem( neweggs );
                    }

                    this.LastEgg = DateTime.Now;
                    from.SendMessage( "You collect some of the chicken's eggs." );
                }

                else
                {
                    from.SendMessage( "It is too early to get any more eggs from this chicken." );
                }
            }
        }