コード例 #1
0
ファイル: BuffCondition.cs プロジェクト: catontheway/myevo
        private bool HasBuffByName(PUnit target, string buffIds)
        {
            string[] buffId = buffIds.Split(',');
            foreach (string s in buffId)
            {
                try
                {
                    switch (OwnerCondition)
                    {
                    case BuffOwnerConditionEnum.Owner:
                        if (target.HasBuff(s, true))
                        {
                            return(true);
                        }
                        break;

                    case BuffOwnerConditionEnum.NotOwner:
                        if (target.HasBuff(s, false))
                        {
                            return(true);
                        }
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }
                catch (Exception)
                {
                    //Logging.Write("Could not convert " + s + " to int when checking buffs - fix your BuffCondition: ");
                }
            }
            return(false);
        }
コード例 #2
0
ファイル: BuffCondition.cs プロジェクト: catontheway/myevo
        private bool HasBuffId(PUnit target, string buffIds)
        {
            string[] buffId = buffIds.Split(',');
            foreach (string s in buffId)
            {
                try
                {
                    switch (OwnerCondition)
                    {
                    case BuffOwnerConditionEnum.Owner:
                        if (target.HasBuff(Convert.ToInt32(s), true))
                        {
                            return(true);
                        }
                        break;

                    case BuffOwnerConditionEnum.NotOwner:
                        if (target.HasBuff(Convert.ToInt32(s), false))
                        {
                            return(true);
                        }
                        break;

                    case BuffOwnerConditionEnum.DoesNotMatter:
                        if (target.HasBuff(Convert.ToInt32(s), false))
                        {
                            return(true);
                        }
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }
                catch (ThreadAbortException)
                {
                }
                catch (Exception e)
                {
                    Logging.Write("Error checking buff: " + e);
                }
            }
            return(false);
        }
コード例 #3
0
        /*
         * internal static bool IsUsabelAction(int slot)
         * {
         *  var foo = (uint)Pointers.ActionBar.IsUsableAction + (uint)slot * 0x04;
         *  var isUsabelAction = Memory.Read<int>(ObjectManager.BaseAddressModule + foo);
         *  foo = (uint)Pointers.ActionBar.IsUsableActionNoMana + (uint)slot * 0x04;
         *  var isUsabelActionNoMana = Memory.Read<int>(ObjectManager.BaseAddressModule + foo);
         *
         *  if (isUsabelAction == 0 && isUsabelActionNoMana == 0)
         *  {
         *      Logging.Write("Slot: " + slot + " is usabel");
         *      return true;
         *  }
         *  Logging.Write("Slot: " + slot + " is not usabel");
         *  return false;
         * }
         */

        public static bool HasBuff(PUnit check, string name)
        {
            List <int> ids = GetIdsFromName(name);

            if (ObjectManager.Initialized)
            {
                if (check.HasBuff(ids))
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #4
0
        public static bool HasBuff(PUnit check, string name)
        {
            List <int> idsFromName = BarMapper.GetIdsFromName(name);

            return(ObjectManager.Initialized && check.HasBuff(idsFromName));
        }