Example #1
0
        private static Action ParseLogic(this int slot)
        {
            _act = null;
            var petGuid    = GoldenPet.GetGuidInSlot(slot);
            var petInfo    = GoldenPet.GetPetInfo(petGuid);
            var objectType = new Logic.Logic();
            var name       = "Npc" + petInfo.EntryId;
            var methodInfo = objectType.GetType().GetMethod(name);

            if (methodInfo != null)
            {
                Logging.Write(Color.MediumSpringGreen, "Найдена логика для пета ID:{0} из слота:{1}", petInfo.EntryId, slot);
                Action method = delegate { methodInfo.Invoke(objectType, null); };
                _act = method;
            }
            if (methodInfo != null)
            {
                return(_act);
            }
            Logging.Write(Color.MediumSpringGreen, "Не найдена логика для пета ID:{0} из слота:{1}", petInfo.EntryId, slot);
            if (PetBattleEasy.Only1)
            {
                _act = GetOnly1;
            }
            if (!PetBattleEasy.Only1)
            {
                _act = GetCastInstant;
            }

            //_act += delegate { GoldenPet.GetChangePet(); };

            return(_act);
        }