Ejemplo n.º 1
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is BaseCreature)
            {
                BaseCreature t = (BaseCreature)target;

                if (t.IsBonded == true)
                {
                    from.SendLocalizedMessage(1152925); // That pet is already bonded to you.
                }
                else if (t.ControlMaster != from)
                {
                    from.SendLocalizedMessage(1114368); // This is not your pet!
                }
                else
                {
                    t.IsBonded = !t.IsBonded;
                    from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
                    m_Potion.Delete();
                }
            }
            else
            {
                from.SendLocalizedMessage(1152924);  // That is not a valid pet.
            }
        }
Ejemplo n.º 2
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
            {
                return;
            }

            if (target is BaseCreature)
            {
                BaseCreature t = (BaseCreature)target;

                if (t.IsBonded == true)
                {
                    from.SendLocalizedMessage(1152925); // That pet is already bonded to you.
                }
                else if (t.ControlMaster != from)
                {
                    from.SendLocalizedMessage(1114368); // This is not your pet!
                }
                else if (t.Allured || t.Summoned)
                {
                    from.SendLocalizedMessage(1152924); // That is not a valid pet.
                }
                else if (target is BaseTalismanSummon)
                {
                    from.SendLocalizedMessage(1152924); // That is not a valid pet.
                }
                else
                {
                    t.IsBonded = !t.IsBonded;
                    from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
                    m_Potion.Delete();
                }
            }
            else
            {
                from.SendLocalizedMessage(1152924);  // That is not a valid pet.
            }
        }