Exemple #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);
        }
Exemple #2
0
        private static void GetCastInstant()
        {
            //var petcurent =BattlePet.PetJournal.GetPetInfoByPetID(BattlePet.PetJournal.GetActivePetIDBySlot(BattlePet.PetJournal.PetSlotAvailable));
            //if (petcurent.EntryId == 71488)
            //{
            //    Logging.Write("Играю Деревом");
            //    Logic.Logic.Npc71488();
            //    return;
            //}
            //if (petcurent.EntryId == 68659)
            //{
            //    Logging.Write("Играю анубисата");
            //    Logic.Logic.Npc68659();
            //    return;
            //}
            var best = BattlePet.Skills.GetBestAbility();

            // Logging.Write(CanCast(1).ToString());
            if (GoldenPet.CanCast(BattlePet.Skills.PetAbilityIndex.Ability1) && best == PetBattleEasy.Oldabily)
            {
                PetBattleEasy.Oldabily = BattlePet.Skills.PetAbilityIndex.Ability1;
                GoldenPet.Cast(PetBattleEasy.Oldabily);
                return;
            }
            if (best != PetBattleEasy.Oldabily && GoldenPet.CanCast(best))
            {
                PetBattleEasy.Oldabily = best;

                GoldenPet.Cast(best);
            }
            //await Task.Delay(1000);

            //Lua.FrameScript_Execute("C_PetBattles.SkipTurn()");
        }
Exemple #3
0
        private static void GetOnly1()
        {
            Logging.Write("Мой ход ");

            GoldenPet.Cast(BattlePet.Skills.PetAbilityIndex.Ability1);
        }