Пример #1
0
 protected override void OnTarget(Mobile from, object targeted)
 {
     if (targeted is BaseCreature)
     {
         BaseCreature m_Creature = (BaseCreature)targeted;
         if (!m_Creature.Controled || m_Creature.ControlMaster != from)
         {
             m_Trainer.SayTo(from, false, "You've no claim to that animal.");
         }
         else if (!m_Creature.Alive || m_Creature == null)
         {
             m_Trainer.SayTo(from, false, "They don't look up to the task.");
         }
         else
         {
             m_Trainer.SayTo(from, false, "and the other?");
             from.SendMessage("Please target the second animal you wish to breed.");
             from.Target = new SecondTarget(m_Trainer, m_Creature);
         }
     }
     else if (targeted == from)
     {
         m_Trainer.SayTo(from, 502672); // HA HA HA! Sorry, I am not an inn.
     }
     else
     {
         m_Trainer.SayTo(from, false, "I'm afraid I wouldn't know anything about that."); // You can't stable that!
     }
 }
Пример #2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is BaseCreature)
                {
                    BaseCreature m_Creature = (BaseCreature)targeted;
                    if (!m_Creature.InLOS(from))
                    {
                        from.SendMessage("You cannot see your target.");
                    }

                    if (m_Creature.IsUndeadNPC() || m_Creature.IsDemonNPC())
                    {
                        m_Trainer.SayTo(from, "I won't stable that!");
                    }
                    else
                    {
                        m_Trainer.EndStable(from, (BaseCreature)targeted);
                    }
                }
                else if (targeted == from)
                {
                    m_Trainer.SayTo(from, 502672);                       // HA HA HA! Sorry, I am not an inn.
                }
                else
                {
                    m_Trainer.SayTo(from, 1048053);                       // You can't stable that!
                }
            }
 protected override void OnTarget(Mobile from, object targeted)
 {
     if (targeted is BaseCreature)
     {
         m_Trainer.EndStable(from, (BaseCreature)targeted);
     }
     else if (targeted == from)
     {
         m_Trainer.SayTo(from, 502672);                       // HA HA HA! Sorry, I am not an inn.
     }
     else
     {
         m_Trainer.SayTo(from, 1048053);                       // You can't stable that!
     }
 }
Пример #4
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is BaseCreature)
                {
                    BaseCreature m_Creature = (BaseCreature)targeted;
                    if (!m_Creature.Controled || m_Creature.ControlMaster != from)
                    {
                        m_Trainer.SayTo(from, false, "You've no claim to that animal.");
                    }
                    else if (!m_Creature.Alive || m_Creature == null)
                    {
                        m_Trainer.SayTo(from, false, "They don't look up to the task.");
                    }
                    else if (m_Creature.Female == m_First.Female || m_Creature.GetType() != m_First.GetType())
                    {
                        m_Trainer.SayTo(from, false, "I'm afraid that's biologically impossible.");
                        // DEBUG TEXT
                        //from.SendMessage("{0},{1}",m_First.GetType().ToString(), m_Creature.GetType().ToString());
                    }
                    else if (from.Stabled.Count + 3 >= GetMaxStabled(from))
                    {
                        m_Trainer.SayTo(from, false, "I'm afraid there's no room in the stable to breed these animals.");
                    }
                    else
                    {
                        Type type = m_First.GetType();
                        if (type != null)
                        {
                            try
                            {
                                object o = Activator.CreateInstance(type);

                                if (o is BaseCreature)
                                {
                                    BaseCreature child = (BaseCreature)o;

                                    m_First.ControlTarget = null;
                                    m_First.ControlOrder  = OrderType.Stay;

                                    m_First.SetControlMaster(null);
                                    m_First.SummonMaster = null;

                                    m_First.IsStabled = true;

                                    m_Creature.ControlTarget = null;
                                    m_Creature.ControlOrder  = OrderType.Stay;

                                    m_Creature.SetControlMaster(null);
                                    m_Creature.SummonMaster = null;

                                    m_Creature.IsStabled = true;

                                    child.IsStabled = true;

                                    from.Stabled.Add(child);
                                    from.Stabled.Add(m_First);
                                    from.Stabled.Add(m_Creature);
                                    child.BardEndTime      = DateTime.Now.AddDays(1);
                                    m_First.BardEndTime    = DateTime.Now.AddDays(1);
                                    m_Creature.BardEndTime = DateTime.Now.AddDays(1);
                                    child.Internalize();
                                    m_First.Internalize();
                                    m_Creature.Internalize();
                                    TAVUtilities.Reproduce(m_Creature, m_First, child);
                                    from.SendMessage("The animals have been stabled, neither the new born nor the parents may be removed from the stable for 24 hours.");
                                    m_Trainer.SayTo(from, false, "Very well, the animals will be stored in the stable overnight.");
                                }
                            }
                            catch
                            {
                            }
                        }
                    }
                }
                else if (targeted == from)
                {
                    m_Trainer.SayTo(from, 502672); // HA HA HA! Sorry, I am not an inn.
                }
                else
                {
                    m_Trainer.SayTo(from, false, "I'm afraid I wouldn't know anything about that."); // You can't stable that!
                }
            }