Пример #1
0
            protected override void OnTarget(Mobile from, object obj)
            {
                if (!from.Alive)
                {
                    from.SendMessage("You may not do that while dead.");
                }
                else if (obj is EvolutionDragon && obj is BaseCreature)
                {
                    BaseCreature    bc = (BaseCreature)obj;
                    EvolutionDragon ed = (EvolutionDragon)obj;

                    if (ed.Controlled == true && ed.ControlMaster == from)
                    {
                        ed.PublicOverheadMessage(MessageType.Regular, ed.SpeechHue, true, ed.Name + " has " + ed.KP + " kill points.", false);
                    }
                    else
                    {
                        from.SendMessage("You do not control this dragon!");
                    }
                }
                else
                {
                    from.SendMessage("That is not a dragon!");
                }
            }
 public BreatheTimer(Mobile m, EvolutionDragon owner, Mobile from, TimeSpan duration) : base(duration)
 {
     ed       = owner;
     m_Mobile = m;
     m_From   = from;
     Priority = TimerPriority.TwoFiftyMS;
 }
        public MatingGump(Mobile from, Mobile mobile, EvolutionDragon ed1, EvolutionDragon ed2) : base(25, 50)
        {
            Closable = false;
            Dragable = false;

            m_From   = from;
            m_Mobile = mobile;
            m_ED1    = ed1;
            m_ED2    = ed2;

            AddPage(0);

            AddBackground(25, 10, 420, 200, 5054);

            AddImageTiled(33, 20, 401, 181, 2624);
            AddAlphaRegion(33, 20, 401, 181);

            AddLabel(125, 148, 1152, m_From.Name + " would like to mate " + m_ED1.Name + " with");
            AddLabel(125, 158, 1152, m_ED2.Name + ".");

            AddButton(100, 50, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddLabel(130, 50, 1152, "Allow them to mate.");
            AddButton(100, 75, 4005, 4007, 0, GumpButtonType.Reply, 0);
            AddLabel(130, 75, 1152, "Do not allow them to mate.");
        }
 public PetLoyaltyTimer(EvolutionDragon owner, TimeSpan duration) : base(duration)
 {
     Priority = TimerPriority.OneSecond;
     ed       = owner;
 }
        private void MatingTarget_Callback(Mobile from, object obj)
        {
            if (obj is EvolutionDragon && obj is BaseCreature)
            {
                BaseCreature    bc = (BaseCreature)obj;
                EvolutionDragon ed = (EvolutionDragon)obj;

                if (ed.Controled == true && ed.ControlMaster == from)
                {
                    if (ed.Female == false)
                    {
                        if (ed.AllowMating == true)
                        {
                            this.Blessed  = true;
                            this.Pregnant = true;

                            m_MatingTimer = new MatingTimer(this, TimeSpan.FromDays(3.0));
                            m_MatingTimer.Start();

                            m_EndMating = DateTime.Now + TimeSpan.FromDays(3.0);
                        }
                        else
                        {
                            from.SendMessage("This male dragon is not old enough to mate!");
                        }
                    }
                    else
                    {
                        from.SendMessage("This dragon is not male!");
                    }
                }
                else if (ed.Controled == true)
                {
                    if (ed.Female == false)
                    {
                        if (ed.AllowMating == true)
                        {
                            if (ed.ControlMaster != null)
                            {
                                ed.ControlMaster.SendGump(new MatingGump(from, ed.ControlMaster, this, ed));
                                from.SendMessage("You ask the owner of the dragon if they will let your female mate with their male.");
                            }
                            else
                            {
                                from.SendMessage("This dragon is wild.");
                            }
                        }
                        else
                        {
                            from.SendMessage("This male dragon is not old enough to mate!");
                        }
                    }
                    else
                    {
                        from.SendMessage("This dragon is not male!");
                    }
                }
                else
                {
                    from.SendMessage("This dragon is wild.");
                }
            }
            else
            {
                from.SendMessage("That is not a dragon!");
            }
        }
		public MatingGump( Mobile from, Mobile mobile, EvolutionDragon ed1, EvolutionDragon ed2 ) : base( 25, 50 )
		{
			Closable = false;
			Dragable = false;
			mobile.Frozen = true;

			m_From = from;
			m_Mobile = mobile;
			m_ED1 = ed1;
			m_ED2 = ed2;

			AddPage( 0 );

			AddBackground( 25, 10, 420, 200, 5054 );

			AddImageTiled( 33, 20, 401, 181, 2624 );
			AddAlphaRegion( 33, 20, 401, 181 );

			AddLabel( 125, 148, 1152, m_From.Name +" would like to mate "+ m_ED1.Name +" with" );
			AddLabel( 125, 158, 1152, m_ED2.Name +"." );

			AddButton( 100, 50, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddLabel( 130, 50, 1152, "Allow them to mate." );
			AddButton( 100, 75, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddLabel( 130, 75, 1152, "Do not allow them to mate." );
		}
		public MatingTimer( EvolutionDragon owner, TimeSpan duration ) : base( duration )
		{
			Priority = TimerPriority.OneSecond;
			ed = owner;
		}
			public BreatheTimer( Mobile m, EvolutionDragon owner, Mobile from, TimeSpan duration ) : base( duration )
			{
				ed = owner;
				m_Mobile = m;
				m_From = from;
				Priority = TimerPriority.TwoFiftyMS;
			}