Exemplo n.º 1
0
        public static void DrinkRefresh_OnCommand(CommandEventArgs e)
        {
            // Added to fix the missing check to region. Ugly fix but this script is so ugly anyways. :p
            if (e.Mobile.Region != null && !e.Mobile.Region.OnDoubleClick(e.Mobile, new RefreshPotion()))
            {
                return;
            }

            RefreshPotion      r_potion  = (RefreshPotion)e.Mobile.Backpack.FindItemByType(typeof(RefreshPotion));
            TotalRefreshPotion tr_potion = (TotalRefreshPotion)e.Mobile.Backpack.FindItemByType(typeof(TotalRefreshPotion));

            int rp = e.Mobile.Backpack.GetAmount(typeof(RefreshPotion));

            if (rp != 0)
            {
                e.Mobile.SendMessage("Refresh potion found");
                r_potion.OnDoubleClick(e.Mobile);
                Targeting.Target.Cancel(e.Mobile);
            }
            else
            {
                int trp = e.Mobile.Backpack.GetAmount(typeof(TotalRefreshPotion));

                if (trp != 0)
                {
                    e.Mobile.SendMessage("Total refresh potion found");
                    tr_potion.OnDoubleClick(e.Mobile);
                    Targeting.Target.Cancel(e.Mobile);
                }
                else
                {
                    e.Mobile.SendMessage("Refresh potion not found");
                }
            }
        }
Exemplo n.º 2
0
        public static void DrinkRefresh_OnCommand(CommandEventArgs e)
        {
            TotalRefreshPotion m_TotalRefreshPotion = (TotalRefreshPotion)e.Mobile.Backpack.FindItemByType(typeof(TotalRefreshPotion));
            RefreshPotion      m_RefreshPotion      = (RefreshPotion)e.Mobile.Backpack.FindItemByType(typeof(RefreshPotion));

            int m_Exists  = e.Mobile.Backpack.GetAmount(typeof(TotalRefreshPotion));
            int m_Existss = e.Mobile.Backpack.GetAmount(typeof(RefreshPotion));


            if (m_Exists != 0)
            {
                e.Mobile.SendMessage("Refresh Potion found");

                m_TotalRefreshPotion.OnDoubleClick(e.Mobile);
            }
            else if (m_Existss != 0)
            {
                e.Mobile.SendMessage("Refresh Potion found");

                m_RefreshPotion.OnDoubleClick(e.Mobile);
            }

            else
            {
                e.Mobile.SendMessage("Cannot find Refresh Potion");
            }
        }