Exemple #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!m_PropsLoaded)
            {
                PreloadProperties();
            }

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (m_Pet == null || m_Pet.Deleted || ItemID == 0xFAA)
            {
                from.SendMessage("Due to unforseen circumstances your pet is lost forever.");
            }

            else if (m_Locked && m_Owner != from)
            {
                from.SendMessage("This is locked and only the owner can claim this pet while locked.");
                from.SendMessage("This item is now being returned to its owner.");
                m_Owner.AddToBackpack(this);
                m_Owner.SendMessage("Your pet {0} has been returned to you because it was locked and {1} was trying to claim it.", m_Breed, from.Name);
            }
            else if (from.Followers + m_Pet.ControlSlots > from.FollowersMax)
            {
                from.SendMessage("You have to many followers to claim this pet.");
            }

            else if (Server.Spells.SpellHelper.CheckCombat(from))
            {
                from.SendMessage("You cannot reclaim your pet while your fighting.");
            }

            else if (ShrinkCommands.LockDown == true && !m_IgnoreLockDown)
            {
                from.SendMessage(54, "The server is on a shrinkitem lockdown. You cannot unshrink your pet at this time.");
            }

            else if (!m_Pet.CanBeControlledBy(from))
            {
                from.SendMessage("You do not have the required skills to control this pet.");
            }

            else
            {
                UnshrinkPet(from);
            }
        }
Exemple #2
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target == from)
                {
                    m_Post.Say("You can't place yourself in a stable!");
                }
                else if (target is PlayerMobile)
                {
                    m_Post.Say("You can't place other players in a stable!");
                }
                else if (target is Item)
                {
                    m_Post.Say("Why would you want to stable an item?");
                }
                else if (Server.Spells.SpellHelper.CheckCombat(from))
                {
                    m_Post.Say("You cannot stable your pet while you're fighting.");
                }
                else if ((target is BaseCreature) && m_Post.Controlled == null)
                {
                    BaseCreature c = (BaseCreature)target;

                    if (c.ControlMaster == null || !c.Controlled)
                    {
                        m_Post.Say("You can only stable a pet that has been tamed.");
                    }
                    if (c.ControlMaster != from && c.Controlled)
                    {
                        m_Post.Say("You can only stable a pet you control.");
                    }
                    else if (c.Summoned)
                    {
                        m_Post.Say("You cannot stable a summoned creature.");
                    }
                    else if (c.Combatant != null && c.InRange(c.Combatant, 12) && c.Map == c.Combatant.Map)
                    {
                        m_Post.Say("Your pet is fighting, You cannot stable it yet.");
                    }
                    else if (c.Controlled && c.ControlMaster == from)
                    {
                        m_Post.Owner    = c.ControlMaster;             //
                        c.ControlMaster = null;                        //
//						m_Post.IsStabled = c.IsStabled;
                        c.IsStabled = true;                            //
                        //	m_Post.IsStabled = true;//
                        //	m_Post.Blessed = c.Blessed;
                        c.Blessed = true;                        //
//						m_Post.Blessed = true; //Note causes the player to become blessed when put pet
//						m_Post.Tamable = c.Tamable;
                        c.Tamable = false;                                                     //
//						m_Post.Tamable = false;//Note I think this will also
                        m_Post.Controlled       = c;                                           //
                        c.Home                  = m_Post.Location;                             //
                        c.RangeHome             = m_Post.HomeRange;                            //
                        m_Post.Loyal            = c.Loyalty;                                   //
                        c.Loyalty               = 100;                                         //
                        m_Post.IsBonded         = c.IsBonded;                                  //
                        m_Post.Mode             = c.FightMode;                                 //
                        c.FightMode             = FightMode.Aggressor;                         //
                        m_Post.Order            = c.ControlOrder;                              //
                        c.ControlOrder          = OrderType.None;                              //
                        c.CurrentSpeed          = 0.5;                                         //
                        m_Post.Command          = c.Controlled;                                //
                        m_Post.BondingBegin     = c.BondingBegin;                              //
                        c.BondingBegin          = DateTime.MaxValue;                           //
                        m_Post.OwnerAbandonTime = c.OwnerAbandonTime;                          //
                        c.OwnerAbandonTime      = DateTime.MaxValue;                           //
                        m_Post.MinTameSkill     = c.MinTameSkill;                              //
                        m_Post.PetName          = c.Name;                                      //
                        c.Name                  = m_Post.Owner.Name + "'s: " + m_Post.PetName; //
                        m_Post.Name             = "In use by: " + m_Post.Owner.Name + " Attached to: " + m_Post.PetName;
                    }
                }
                else if ((target is BaseCreature) && m_Post.Controlled != null)
                {
                    BaseCreature c = null;
                    if (m_Post.Controlled == (BaseCreature)target && m_Post.Owner == from)
                    {
                        c = (BaseCreature)target;
                        if ((from.Followers + c.ControlSlots) > from.FollowersMax)
                        {
                            from.SendMessage(38, "You can not release that creature at this time because you are unable to control it. You would have TO MANY FOLLOWERS.");
                            return;
                        }
                        if (!c.CanBeControlledBy(from))
                        {
                            from.SendMessage(38, "You do not have the required skills to control this pet.");
                            return;
                        }

                        c.ControlMaster = m_Post.Owner;                    //
                        c.Home          = m_Post.Owner.Location;           //
                        c.RangeHome     = 0;                               //
                        c.Loyalty       = m_Post.Loyal;                    //
                        m_Post.Loyal    = 100;                             //
                        c.IsBonded      = m_Post.IsBonded;                 //
                        //	m_Post.IsBonded = false;
                        c.FightMode    = m_Post.Mode;                      //
                        m_Post.Mode    = FightMode.None;
                        c.ControlOrder = m_Post.Order;                     //
                        m_Post.Order   = OrderType.None;
                        c.CurrentSpeed = 0.1;                              //
                        c.Controlled   = m_Post.Command;                   //
                        m_Post.Command = false;                            //
                        //	c.Blessed = m_Post.Blessed;
                        c.Blessed = false;                                 //
//						m_Post.Blessed = false;// Note since the put causes problem no need for it here
                        c.BondingBegin          = m_Post.BondingBegin;     //
                        m_Post.BondingBegin     = DateTime.MaxValue;       //
                        c.OwnerAbandonTime      = m_Post.OwnerAbandonTime; //
                        m_Post.OwnerAbandonTime = DateTime.MaxValue;       //
                        c.MinTameSkill          = m_Post.MinTameSkill;     //
                        m_Post.MinTameSkill     = 0.0;                     //
                        //	c.Tamable = m_Post.Tamable;
                        c.Tamable = true;                                  //
//						m_Post.Tamable = true;// Note since the put causes problem no need for it here
                        //	c.IsStabled = m_Post.IsStabled;
                        c.IsStabled = false;
//						m_Post.IsStabled = false;
                        c.Name            = m_Post.PetName;
                        c.NameMod         = null;
                        m_Post.NameMod    = null;
                        m_Post.Controlled = null;
                        m_Post.Owner      = null;
                        m_Post.Name       = "Hitching Post: Unused.";
                    }
                    else
                    {
                        from.SendMessage(38, "This post already has a creature stabled. (Unstable the other first)");
                    }
                }
            }