Example #1
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (m_Salts.Deleted || m_Salts.RootParent != from)
            {
                return;
            }

            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            VeterinarySalts targetSalts = target as VeterinarySalts;

            if (targetSalts != null)
            {
                if (targetSalts.Charges >= 5)
                {
                    from.SendMessage("That bottle of veterinary salts is full.");

                    return;
                }

                int maxChargesToAdd = 5 - targetSalts.Charges;
                int chargesAdded    = m_Salts.Charges;

                if (chargesAdded > maxChargesToAdd)
                {
                    chargesAdded = maxChargesToAdd;
                }

                targetSalts.Charges += chargesAdded;

                if (m_Salts.Charges - chargesAdded <= 0)
                {
                    m_Salts.Delete();
                }

                else
                {
                    m_Salts.Charges -= chargesAdded;
                }

                from.SendMessage("You combine the veterinary salts.");
                from.SendSound(0x5AF);

                return;
            }

            BaseCreature deadFollower = target as BaseCreature;

            if (deadFollower == null || !deadFollower.IsDeadPet)
            {
                from.SendMessage("That is not a deceased creature.");
                return;
            }

            /*
             *      else if (!deadFollower.CanBeResurrectedThroughVeterinary && deadFollower.Controlled && deadFollower.ControlMaster is PlayerMobile)
             *      {
             * if (m_Salts.Charges >= deadFollower.ControlSlots)
             * {
             *  //Creature That Has Limited Resurrections And Somehow Hasn't Been Deleted
             *  if (deadFollower.ResurrectionsRemaining == 0)
             *  {
             *      from.SendMessage("That follower is no longer resurrectable.");
             *      return;
             *  }
             *
             *  from.SendMessage("The creature springs to life.");
             *
             *  from.CloseGump(typeof(PetResurrectGump));
             *  from.SendGump(new PetResurrectGump(from, deadFollower, m_Salts));
             * }
             *
             * else
             *  from.SendMessage("There are insufficent charges remaining to resurrect that.");
             *      }
             * */

            //else
            from.SendMessage("That creature cannot be resurrected with this item.");
        }
Example #2
0
 public PetResurrectTarget(VeterinarySalts salts) : base(5, false, TargetFlags.None)
 {
     m_Salts = salts;
 }