コード例 #1
0
        public override void OnThink()
        {
            base.OnThink();


            // Chug pots
            if (this.Poisoned)
            {
                GreaterCurePotion m_CPot = (GreaterCurePotion)this.Backpack.FindItemByType(typeof(GreaterCurePotion));
                if (m_CPot != null)
                {
                    m_CPot.Drink(this);
                }
            }

            if (this.Hits <= (this.HitsMax * .7))               // Will try to use heal pots if he's at or below 70% health
            {
                GreaterHealPotion m_HPot = (GreaterHealPotion)this.Backpack.FindItemByType(typeof(GreaterHealPotion));
                if (m_HPot != null)
                {
                    m_HPot.Drink(this);
                }
            }

            if (this.Stam <= (this.StamMax * .25))               // Will use a refresh pot if he's at or below 25% stam
            {
                TotalRefreshPotion m_RPot = (TotalRefreshPotion)this.Backpack.FindItemByType(typeof(TotalRefreshPotion));
                if (m_RPot != null)
                {
                    m_RPot.Drink(this);
                }
            }
        }