Heal() public method

public Heal ( Mobile patient ) : void
patient Mobile
return void
コード例 #1
0
        public static bool DoPotionHeal(BaseCreature creature)
        {
            creature.AIObject.NextMove = DateTime.UtcNow + TimeSpan.FromSeconds(1.5);
            creature.LastSwingTime     = DateTime.UtcNow + TimeSpan.FromSeconds(1.5);

            if (creature.Body.IsHuman)
            {
                creature.Animate(34, 5, 1, true, false, 0);
            }

            else
            {
                creature.Animate(11, 5, 1, true, false, 0);
            }

            //Percent Healing Amounts
            double MinHealingAmount = .15;
            double MaxHealingAmount = .25;

            double amountHealed = (double)creature.HitsMax * (MinHealingAmount + ((MaxHealingAmount - MinHealingAmount) * Utility.RandomDouble()));

            if (amountHealed > 50)
            {
                amountHealed = 50;
            }

            creature.Heal((int)amountHealed);
            creature.PlaySound(0x031);

            return(true);
        }
コード例 #2
0
        protected override void OnTick()
        {
            --m_Count;

            if (m_Golem == null || m_Healer == null)
            {
                Stop();
            }
            else if (!m_Healer.Meditating)
            {
                m_Healer.SendMessage("You are interrupted during rebinding and fail.");
                Stop();
            }
            else if (!m_Healer.InRange(m_Golem, 2))
            {
                m_Healer.Meditating = false;
                m_Healer.SendLocalizedMessage(500963);                   // You did not stay close enough to heal your patient!
                Stop();
            }
            else if (m_Count < 1)
            {
                m_Healer.Meditating = false;
                m_Golem.Heal(1000 + ((int)m_Healer.Skills[SkillName.ItemID].Value));
                Stop();
            }
        }