protected override bool OnProcess() { var curr = Common.Clock; if (curr >= _nextTrigger) { _nextTrigger += THREAD_SPEED; var offset = (curr - _nextTrigger) / Common.MS_PER_SECOND; if (Math.Abs(offset) > TIMER_OFFSET_LIMIT) { _nextTrigger = curr + THREAD_SPEED; } //Run managers foreach (var map in MapManager.ActiveMaps.Values) { if (!map.IsActive) { continue; } foreach (var spawn in map.Spawns) { spawn.SpawnManager_Timer(); } } PetManager.PetManager_Tick(); } return(true); }
#pragma warning restore IDE0051 public HunterSurvival(WowInterface wowInterface, AmeisenBotStateMachine stateMachine) : base(wowInterface, stateMachine) { PetManager = new PetManager( WowInterface.ObjectManager.Pet, TimeSpan.FromSeconds(15), () => CastSpellIfPossible(mendPetSpell, 0, true), () => CastSpellIfPossible(callPetSpell, 0), () => CastSpellIfPossible(revivePetSpell, 0)); MyAuraManager.BuffsToKeepActive = new Dictionary <string, CastFunction>() { { aspectOfTheDragonhawkSpell, () => CastSpellIfPossible(aspectOfTheDragonhawkSpell, 0, true) } }; TargetAuraManager.DebuffsToKeepActive = new Dictionary <string, CastFunction>() { { huntersMarkSpell, () => CastSpellIfPossible(huntersMarkSpell, WowInterface.ObjectManager.TargetGuid, true) }, { serpentStingSpell, () => CastSpellIfPossible(serpentStingSpell, WowInterface.ObjectManager.TargetGuid, true) }, { blackArrowSpell, () => CastSpellIfPossible(blackArrowSpell, WowInterface.ObjectManager.TargetGuid, true) } }; TargetInterruptManager.InterruptSpells = new SortedList <int, CastInterruptFunction>() { { 0, (x) => CastSpellIfPossible(wyvernStingSpell, x.Guid, true) } }; AutoAttackEvent = new TimegatedEvent(TimeSpan.FromMilliseconds(4000)); }
private static Composite PetBuffUnit(string name, UnitSelectionDelegate onUnit, SimpleBooleanDelegate requirements, params string[] myMutexBuffs) { return (new Decorator( ret => onUnit(ret) != null && (PartyBuffType.None != (onUnit(ret).GetMissingPartyBuffs() & GetPartyBuffForSpell(name))) && (myMutexBuffs == null || myMutexBuffs.Count() == 0 || !onUnit(ret).GetAllAuras().Any(a => a.CreatorGuid == StyxWoW.Me.Guid && myMutexBuffs.Contains(a.Name))), new Sequence( PetManager.Buff(name, onUnit, requirements, myMutexBuffs), new Wait(1, until => StyxWoW.Me.HasPartyBuff(name), new ActionAlwaysSucceed()), new Action(ret => { System.Diagnostics.Debug.Assert(PartyBuffType.None != GetPartyBuffForSpell(name)); if (PartyBuffType.None != GetPartyBuffForSpell(name)) { ResetReadyToPartyBuffTimer(); } else { Logger.WriteDebug("Programmer Error: should use Spell.Buff(\"{0}\") instead", name); } }) ) )); }
public void SetItem(PetInfo petInfo = null, Pet dataPet = null, bool islimit = false) { if (petInfo != null) { ResourceManager.SetSprite(this.m_spImageFrame, PetManager.GetPetFrame01(petInfo.star)); ResourceManager.SetSprite(this.m_spImageFramePet, PetManager.GetPetFrame02(petInfo.star)); ResourceManager.SetSprite(this.m_spImageIcon, PetManager.Instance.GetSelfPetIcon2(dataPet)); if (this.m_spImageQuality != null) { ResourceManager.SetSprite(this.m_spImageQuality, PetManager.GetPetQualityIcon(petInfo.star)); } if (this.m_lblTextPower != null) { this.m_lblTextPower.set_text(petInfo.publicBaseInfo.simpleInfo.Fighting.ToString()); } this.m_lblTextName.set_text(GameDataUtils.GetChineseContent(dataPet.name, false)); this.m_lblTextLV.GetComponent <Text>().set_text("Lv." + petInfo.lv); this.ShowHave(true); this.ShowLimit(islimit); } else { this.ShowHave(false); } }
public void SetPetInfo(int petId, int obtain_star, int decompose_star, bool exist, bool replace, string petName) { Pet pet = DataReader <Pet> .Get(petId); if (pet != null) { PetObtainUIView.Instance.SetBackground(pet.petType); this.PetName = PetManager.GetPetName(pet, obtain_star); this.PetStar = PetManager.GetPetQualityIcon(obtain_star); if (exist) { this.ShowTip = true; if (!replace) { this.TipName = string.Format(GameDataUtils.GetChineseContent(500116, false), petName, PetManager.GetReturnFragment(pet, decompose_star)); } else { this.TipName = string.Format(GameDataUtils.GetChineseContent(500117, false), petName, PetManager.GetReturnFragment(pet, decompose_star)); } } else { this.ShowTip = false; } } }
public HunterMarksmanship(WowInterface wowInterface) : base(wowInterface) { PetManager = new PetManager( WowInterface.ObjectManager.Pet, TimeSpan.FromSeconds(15), () => CastSpellIfPossible(mendPetSpell, 0, true), () => CastSpellIfPossible(callPetSpell, 0), () => CastSpellIfPossible(revivePetSpell, 0)); MyAuraManager.BuffsToKeepActive = new Dictionary <string, CastFunction>() { { aspectOfTheDragonhawkSpell, () => CastSpellIfPossible(aspectOfTheDragonhawkSpell, 0, true) } }; TargetAuraManager.DebuffsToKeepActive = new Dictionary <string, CastFunction>() { { huntersMarkSpell, () => CastSpellIfPossible(huntersMarkSpell, WowInterface.ObjectManager.TargetGuid, true) }, { serpentStingSpell, () => CastSpellIfPossible(serpentStingSpell, WowInterface.ObjectManager.TargetGuid, true) } }; TargetInterruptManager.InterruptSpells = new SortedList <int, CastInterruptFunction>() { { 0, () => CastSpellIfPossible(silencingShotSpell, WowInterface.ObjectManager.TargetGuid, true) } }; }
// Update is called once per frame void Update() { #region UpdateLevel L&I if (CurrentPet != null) { if (Input.GetKeyDown(KeyCode.L)) { CurrentPet.Level++; PetManager.PrintDataPet(CurrentPet); PrintLevelInName(); } if (Input.GetKeyDown(KeyCode.I)) { CurrentPet.Level--; if (CurrentPet.Level < 0) { CurrentPet.Level = 0; } PetManager.PrintDataPet(CurrentPet); PrintLevelInName(); } if (Input.GetKeyDown(KeyCode.P)) { GameMode = !GameMode; } } #endregion if (CurrentPet != null && Pet != null) { LookForward(); Pet.transform.LookAt(FinalPos); CatchBall(); } }
public WarlockDemonology(WowInterface wowInterface, AmeisenBotFsm stateMachine) : base(wowInterface, stateMachine) { PetManager = new PetManager ( WowInterface, TimeSpan.FromSeconds(1), null, () => (WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonFelguardSpell) && WowInterface.CharacterManager.Inventory.HasItemByName("Soul Shard") && TryCastSpell(summonFelguardSpell, 0, true)) || (WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonImpSpell) && TryCastSpell(summonImpSpell, 0, true)), () => (WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonFelguardSpell) && WowInterface.CharacterManager.Inventory.HasItemByName("Soul Shard") && TryCastSpell(summonFelguardSpell, 0, true)) || (WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonImpSpell) && TryCastSpell(summonImpSpell, 0, true)) ); MyAuraManager.Jobs.Add(new KeepBestActiveAuraJob(new List <(string, Func <bool>)>() { (felArmorSpell, () => TryCastSpell(felArmorSpell, 0, true)), (demonArmorSpell, () => TryCastSpell(demonArmorSpell, 0, true)), (demonSkinSpell, () => TryCastSpell(demonSkinSpell, 0, true)), })); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(corruptionSpell, () => WowInterface.Target != null && !WowInterface.Target.HasBuffByName(seedOfCorruptionSpell) && TryCastSpell(corruptionSpell, WowInterface.TargetGuid, true))); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(curseOfTonguesSpell, () => TryCastSpell(curseOfTonguesSpell, WowInterface.TargetGuid, true))); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(immolateSpell, () => TryCastSpell(immolateSpell, WowInterface.TargetGuid, true))); }
public void FoundPet(string _Name) { PetManager.PrintDataPet(PetManager.GetPetByName(_Name)); if (PlayerPrefs.HasKey("Info_" + _Name)) { //Si se encuentra en los PlayerPrefs, leemos la pet CurrentPet = PetManager.ClonePet ( _Name, PlayerPrefs.GetInt(_Name + "_Level"), PlayerPrefs.GetFloat(_Name + "_SpeedMove"), PlayerPrefs.GetFloat(_Name + "_JumpForce"), PlayerPrefs.GetFloat(_Name + "_TotalTimeHungry"), PlayerPrefs.GetFloat(_Name + "_TotalTimeClean"), PlayerPrefs.GetInt(_Name + "_HungryPercent"), PlayerPrefs.GetInt(_Name + "_HappyPercent"), PlayerPrefs.GetInt(_Name + "_LifePercent"), PlayerPrefs.GetInt(_Name + "_CleanPercent") ); } else { CurrentPet = PetManager.GetPetByName(_Name); } CurrentPet.Pf_Pet = AssignObject(_Name); Pet = AssignObject(_Name).transform.GetChild(0).gameObject; PrintLevelInName(); PetInitPos = Vector3.zero; }
public WarlockDestruction(AmeisenBotStateMachine stateMachine) : base(stateMachine) { PetManager = new PetManager ( WowInterface, TimeSpan.FromSeconds(1), null, () => WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonImpSpell) && TryCastSpell(summonImpSpell, 0, true), () => WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonImpSpell) && TryCastSpell(summonImpSpell, 0, true) ); MyAuraManager.BuffsToKeepActive = new Dictionary <string, CastFunction>(); WowInterface.CharacterManager.SpellBook.OnSpellBookUpdate += () => { if (SpellChain.Get(WowInterface.CharacterManager.SpellBook.IsSpellKnown, out string armorToUse, felArmorSpell, demonArmorSpell, demonSkinSpell)) { MyAuraManager.BuffsToKeepActive.Add(armorToUse, () => TryCastSpell(armorToUse, 0, true)); } }; TargetAuraManager.DebuffsToKeepActive = new Dictionary <string, CastFunction>() { { corruptionSpell, () => !WowInterface.ObjectManager.Target.HasBuffByName(seedOfCorruptionSpell) && TryCastSpell(corruptionSpell, WowInterface.ObjectManager.TargetGuid, true) }, { curseOfTheElementsSpell, () => TryCastSpell(curseOfTheElementsSpell, WowInterface.ObjectManager.TargetGuid, true) }, { immolateSpell, () => TryCastSpell(immolateSpell, WowInterface.ObjectManager.TargetGuid, true) } }; }
public override void Execute() { base.Execute(); if (SelectTarget(TargetManagerDps)) { if (PetManager.Tick()) { return; } if (WowInterface.ObjectManager.Player.ManaPercentage < 20 && WowInterface.ObjectManager.Player.HealthPercentage > 60 && TryCastSpell(lifeTapSpell, 0) || (WowInterface.ObjectManager.Player.HealthPercentage < 80 && TryCastSpell(deathCoilSpell, WowInterface.ObjectManager.TargetGuid, true)) || (WowInterface.ObjectManager.Player.HealthPercentage < 50 && TryCastSpell(drainLifeSpell, WowInterface.ObjectManager.TargetGuid, true))) { return; } if (WowInterface.ObjectManager.Target != null) { if (WowInterface.ObjectManager.Target.GetType() == typeof(WowPlayer)) { if (DateTime.Now - LastFearAttempt > TimeSpan.FromSeconds(5) && ((WowInterface.ObjectManager.Player.Position.GetDistance(WowInterface.ObjectManager.Target.Position) < 6 && TryCastSpell(howlOfTerrorSpell, 0, true)) || (WowInterface.ObjectManager.Player.Position.GetDistance(WowInterface.ObjectManager.Target.Position) < 12 && TryCastSpell(fearSpell, WowInterface.ObjectManager.TargetGuid, true)))) { LastFearAttempt = DateTime.Now; return; } } if (WowInterface.CharacterManager.Inventory.Items.Count(e => e.Name.Equals("Soul Shard", StringComparison.OrdinalIgnoreCase)) < 5 && WowInterface.ObjectManager.Target.HealthPercentage < 25.0 && TryCastSpell(drainSoulSpell, WowInterface.ObjectManager.TargetGuid, true)) { return; } } if (WowInterface.ObjectManager.GetNearEnemies <WowUnit>(WowInterface.ObjectManager.Target.Position, 16.0).Count() > 2 && !WowInterface.ObjectManager.Target.HasBuffByName(seedOfCorruptionSpell) && TryCastSpell(seedOfCorruptionSpell, WowInterface.ObjectManager.TargetGuid, true)) { return; } if (TryCastSpell(chaosBoltSpell, WowInterface.ObjectManager.TargetGuid, true) // || CastSpellIfPossible(conflagrateSpell, WowInterface.ObjectManager.TargetGuid, true) || TryCastSpell(incinerateSpell, WowInterface.ObjectManager.TargetGuid, true)) { return; } } }
/// <summary> /// Pet helper for misc pet abilitys. /// </summary> public static Composite HandlePetHelpers() { return(new Decorator(ret => !Buff.PlayerHasBuff("Feign Death"), new PrioritySelector( Spell.CastSpell("Mend Pet", ret => Me.GotAlivePet && (Me.Pet.HealthPercent < CLUSettings.Instance.Hunter.MendPetPercent) && !PetManager.PetHasBuff("Mend Pet"), "Mend Pet"), PetManager.CastPetSpell("Heart of the Phoenix", ret => !Me.GotAlivePet && CLUSettings.Instance.Hunter.UseHeartofthePhoenix, "Heart of the Phoenix")))); }
public HunterMarksmanship(AmeisenBotStateMachine stateMachine) : base(stateMachine) { PetManager = new PetManager ( WowInterface, TimeSpan.FromSeconds(15), () => TryCastSpell(mendPetSpell, 0, true), () => TryCastSpell(callPetSpell, 0), () => TryCastSpell(revivePetSpell, 0) ); MyAuraManager.BuffsToKeepActive = new Dictionary <string, CastFunction>() { { aspectOfTheViperSpell, () => WowInterface.ObjectManager.Player.ManaPercentage < 20.0 && TryCastSpell(aspectOfTheViperSpell, 0, true) } }; WowInterface.CharacterManager.SpellBook.OnSpellBookUpdate += () => { if (SpellChain.Run(WowInterface.CharacterManager.SpellBook.IsSpellKnown, out string aspectToUse, aspectOfTheDragonhawkSpell, aspectOfTheHawkSpell)) { MyAuraManager.BuffsToKeepActive.Add(aspectToUse, () => WowInterface.ObjectManager.Player.ManaPercentage > 50.0 && TryCastSpell(aspectToUse, 0, true)); } }; TargetAuraManager.DebuffsToKeepActive = new Dictionary <string, CastFunction>() { { huntersMarkSpell, () => TryCastSpell(huntersMarkSpell, WowInterface.ObjectManager.TargetGuid, true) }, { serpentStingSpell, () => TryCastSpell(serpentStingSpell, WowInterface.ObjectManager.TargetGuid, true) } }; TargetInterruptManager.InterruptSpells = new SortedList <int, CastInterruptFunction>() { { 0, (x) => TryCastSpell(silencingShotSpell, x.Guid, true) } }; }
public Character(CharacterType type, TCharacter cha) : base(type, cha.TID, cha.Level, new Core.Vector3Int(cha.MapPosX, cha.MapPosY, cha.MapPosZ), new Core.Vector3Int(100, 0, 0)) { this.AI = new AIAgent(this); this.Data = cha; this.Id = cha.ID; this.Info.Id = cha.ID; this.Info.Exp = cha.Exp; this.Info.Class = (CharacterClass)cha.Class; this.Info.mapId = cha.MapID; this.Info.Gold = cha.Gold; this.Info.Ride = 0; this.Info.Name = cha.Name; this.ItemManager = new ItemManager(this); this.ItemManager.GetItemInfos(this.Info.Items); this.Info.Bag = new NBagInfo(); this.Info.Bag.Unlocked = this.Data.Bag.Unlocked; this.Info.Bag.Items = this.Data.Bag.Items; this.Info.Equips = this.Data.Equips; this.QuestManager = new QuestManager(this); this.QuestManager.GetQuestInfos(this.Info.Quests); this.StatusManager = new StatusManager(this); this.FriendManager = new FriendManager(this); this.FriendManager.GetFriendInfos(this.Info.Friends); this.PetManager = new PetManager(this); this.Guild = GuildManager.Instance.GetGuild(this.Data.GuildId); this.Chat = new Chat(this); this.Info.attrDynamic = new NAttributeDynamic(); this.Info.attrDynamic.Hp = cha.HP; this.Info.attrDynamic.Mp = cha.MP; }
public async Task GetCatsByOwnerGender() { GetPetsModel petDetails = null; // Arrange PetRepository repository = new PetRepository(); PetManager manager = new PetManager(repository); PetController controller = new PetController(manager); // controller.Request = new HttpRequestMessage(); controller.Configuration = new HttpConfiguration(); // Act var response = await controller.GetPetsByOwnerGender(PetType.Cat); if (response.IsSuccessStatusCode) { petDetails = await response.Content.ReadAsAsync <GetPetsModel>(); } // Assert Assert.IsNotNull(petDetails); // Assert.AreEqual(4, petDetails.MaleOwnedCats.Count()); Assert.AreEqual(3, petDetails.FemaleOwnedCats.Count()); // Assert.AreEqual("Garfield", petDetails.MaleOwnedCats.ElementAt(0).Name); Assert.AreEqual("Jim", petDetails.MaleOwnedCats.ElementAt(1).Name); Assert.AreEqual("Max", petDetails.MaleOwnedCats.ElementAt(2).Name); Assert.AreEqual("Tom", petDetails.MaleOwnedCats.ElementAt(3).Name); // Assert.AreEqual("Garfield", petDetails.FemaleOwnedCats.ElementAt(0).Name); Assert.AreEqual("Simba", petDetails.FemaleOwnedCats.ElementAt(1).Name); Assert.AreEqual("Tabby", petDetails.FemaleOwnedCats.ElementAt(2).Name); }
public WarlockDemonology(AmeisenBotInterfaces bot) : base(bot) { PetManager = new PetManager ( Bot, TimeSpan.FromSeconds(1), null, () => (Bot.Character.SpellBook.IsSpellKnown(Warlock335a.SummonFelguard) && Bot.Character.Inventory.HasItemByName("Soul Shard") && TryCastSpell(Warlock335a.SummonFelguard, 0, true)) || (Bot.Character.SpellBook.IsSpellKnown(Warlock335a.SummonImp) && TryCastSpell(Warlock335a.SummonImp, 0, true)), () => (Bot.Character.SpellBook.IsSpellKnown(Warlock335a.SummonFelguard) && Bot.Character.Inventory.HasItemByName("Soul Shard") && TryCastSpell(Warlock335a.SummonFelguard, 0, true)) || (Bot.Character.SpellBook.IsSpellKnown(Warlock335a.SummonImp) && TryCastSpell(Warlock335a.SummonImp, 0, true)) ); MyAuraManager.Jobs.Add(new KeepBestActiveAuraJob(bot.Db, new List <(string, Func <bool>)>() { (Warlock335a.FelArmor, () => TryCastSpell(Warlock335a.FelArmor, 0, true)), (Warlock335a.DemonArmor, () => TryCastSpell(Warlock335a.DemonArmor, 0, true)), (Warlock335a.DemonSkin, () => TryCastSpell(Warlock335a.DemonSkin, 0, true)), })); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(bot.Db, Warlock335a.Corruption, () => Bot.Target != null && !Bot.Target.Auras.Any(e => Bot.Db.GetSpellName(e.SpellId) == Warlock335a.SeedOfCorruption) && TryCastSpell(Warlock335a.Corruption, Bot.Wow.TargetGuid, true))); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(bot.Db, Warlock335a.CurseOfTongues, () => TryCastSpell(Warlock335a.CurseOfTongues, Bot.Wow.TargetGuid, true))); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(bot.Db, Warlock335a.Immolate, () => TryCastSpell(Warlock335a.Immolate, Bot.Wow.TargetGuid, true))); }
public static void PetCast(this PetSpellData spell, GameObject tar, [CallerMemberName] string name = "") { if (Core.Me.Pet == null) { return; } if (tar == null) { return; } if (Core.Me.Pet.IsCasting) { return; } if (spell.Cooldown != TimeSpan.Zero) { return; } if (!PetManager.CanCast(spell, tar)) { return; } PetManager.DoAction(spell.LocalizedName, tar); }
public static async Task <bool> Pull() { if (Target == null || !Target.CanAttack) { return(false); } if (EikoSettingsModel.Instance.UseOpener) { return(await Common_Utils.Opener()); } if (Me.Pet != null && PetManager.PetMode != PetMode.Obey) { PetManager.DoAction(Spells.Obey.LocalizedName, Target); } if (Me.ClassLevel >= 26) { return(await Spells.BioII.CastDot(Target, EikoSettingsModel.Instance.UseDoTs)); } if (Me.ClassLevel >= 38) { return(await Spells.RuinII.Use(Target, true)); } return(await Spells.Ruin.Use(Target, true)); }
// Token: 0x06002846 RID: 10310 RVA: 0x00446118 File Offset: 0x00444318 public void UpdateLevelState() { PetManager instance = PetManager.Instance; PetTbl recordByKey = instance.PetTable.GetRecordByKey(this.ID); bool flag = true; for (int i = 0; i < 4; i++) { if (recordByKey.PetSkill[i] != 0) { PetSkillTbl recordByKey2 = instance.PetSkillTable.GetRecordByKey(recordByKey.PetSkill[i]); if (recordByKey2.UpLevel != 0 && this.SkillLv[i] < recordByKey2.UpLevel) { flag = false; } } } if (flag && this.Level == 60) { this.AddState(PetManager.EPetState.Limit); } else { this.Remove(PetManager.EPetState.Limit); uint needExp = instance.GetNeedExp(this.Level, recordByKey.Rare); if (this.Level >= this.GetMaxLevel(false) && this.Level != 60 && this.Exp >= needExp - 1u) { this.AddState(PetManager.EPetState.LockLimit); } else { this.Remove(PetManager.EPetState.LockLimit); } } }
public HunterMarksmanship(WowInterface wowInterface, AmeisenBotFsm stateMachine) : base(wowInterface, stateMachine) { PetManager = new PetManager ( WowInterface, TimeSpan.FromSeconds(15), () => TryCastSpell(mendPetSpell, 0, true), () => TryCastSpell(callPetSpell, 0), () => TryCastSpell(revivePetSpell, 0) ); MyAuraManager.Jobs.Add(new KeepBestActiveAuraJob(new List <(string, Func <bool>)>() { (aspectOfTheViperSpell, () => WowInterface.Player.ManaPercentage < 25.0 && TryCastSpell(aspectOfTheViperSpell, 0, true)), (aspectOfTheDragonhawkSpell, () => (!wowInterface.CharacterManager.SpellBook.IsSpellKnown(aspectOfTheViperSpell) || WowInterface.Player.ManaPercentage > 80.0) && TryCastSpell(aspectOfTheDragonhawkSpell, 0, true)), (aspectOfTheHawkSpell, () => TryCastSpell(aspectOfTheHawkSpell, 0, true)) })); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(huntersMarkSpell, () => TryCastSpell(huntersMarkSpell, WowInterface.TargetGuid, true))); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(serpentStingSpell, () => TryCastSpell(serpentStingSpell, WowInterface.TargetGuid, true))); InterruptManager.InterruptSpells = new() { { 0, (x) => TryCastSpell(silencingShotSpell, x.Guid, true) } }; }
private void SetType(RankDataUnite data) { string text = string.Empty; long num = 0L; switch (data.rankingType) { case RankingType.ENUM.Lv: this.SetHideHeadAndPetHead(false); text = "主角等级"; num = data.num; ResourceManager.SetSprite(this.m_headIcon, UIUtils.GetRoleSmallIcon((int)data.career)); if (this.m_headBgImg != null) { ResourceManager.SetSprite(this.m_headBgImg, GameDataUtils.GetItemFrameByColor(1)); } if (this.m_headBgImg2 != null) { this.m_headBgImg2.set_enabled(false); } break; case RankingType.ENUM.Fighting: this.SetHideHeadAndPetHead(false); text = "综合战斗力"; num = data.num; ResourceManager.SetSprite(this.m_headIcon, UIUtils.GetRoleSmallIcon((int)data.career)); if (this.m_headBgImg != null) { ResourceManager.SetSprite(this.m_headBgImg, GameDataUtils.GetItemFrameByColor(1)); } if (this.m_headBgImg2 != null) { this.m_headBgImg2.set_enabled(false); } break; case RankingType.ENUM.PetFighting: this.SetHideHeadAndPetHead(true); text = "宠物战斗力"; num = data.num; if (this.m_headIcon != null) { ResourceManager.SetSprite(this.m_headIcon, PetManagerBase.GetPlayerPetIcon2((int)data.petId, data.petStar)); } if (this.m_headBgImg != null) { ResourceManager.SetSprite(this.m_headBgImg, PetManager.GetPetFrame01(data.petStar)); } if (this.m_headBgImg2 != null) { this.m_headBgImg2.set_enabled(true); ResourceManager.SetSprite(this.m_headBgImg2, PetManager.GetPetFrame02(data.petStar)); } break; } this.roleName.set_text(data.roleName); this.roleLevelName.set_text(text + ":"); this.level.set_text(num.ToString()); }
void Awake() { //tag Tr 잡아서 PetManager에 접근 petManagerTag = FindTag.getInstance().petManager; petManagerTr = Find.getInstance().FindTagTransform(petManagerTag); petManagerInfo = petManagerTr.GetComponent <PetManager>(); }
public HunterMarksmanship(AmeisenBotInterfaces bot) : base(bot) { PetManager = new PetManager ( Bot, TimeSpan.FromSeconds(15), () => TryCastSpell(Hunter335a.MendPet, 0, true), () => TryCastSpell(Hunter335a.CallPet, 0), () => TryCastSpell(Hunter335a.RevivePet, 0) ); MyAuraManager.Jobs.Add(new KeepBestActiveAuraJob(bot.Db, new List <(string, Func <bool>)>() { (Hunter335a.AspectOfTheViper, () => Bot.Player.ManaPercentage < 25.0 && TryCastSpell(Hunter335a.AspectOfTheViper, 0, true)), (Hunter335a.AspectOfTheDragonhawk, () => (!bot.Character.SpellBook.IsSpellKnown(Hunter335a.AspectOfTheViper) || Bot.Player.ManaPercentage > 80.0) && TryCastSpell(Hunter335a.AspectOfTheDragonhawk, 0, true)), (Hunter335a.AspectOfTheHawk, () => TryCastSpell(Hunter335a.AspectOfTheHawk, 0, true)) })); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(bot.Db, Hunter335a.HuntersMark, () => TryCastSpell(Hunter335a.HuntersMark, Bot.Wow.TargetGuid, true))); TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(bot.Db, Hunter335a.SerpentSting, () => TryCastSpell(Hunter335a.SerpentSting, Bot.Wow.TargetGuid, true))); InterruptManager.InterruptSpells = new() { { 0, (x) => TryCastSpell(Hunter335a.SilencingShot, x.Guid, true) } }; }
public override bool Test(Sim a, Terrain target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (a.IsCat && !a.IsKitten) { return(PetManager.PetSkillFatigueTest(a, ref greyedOutTooltipCallback)); } return(false); }
public override void OutOfCombatExecute() { if (MyAuraManager.Tick() || PetManager.Tick()) { return; } }
private void Start() { if (_Instance == null) { DontDestroyOnLoad(this); _Instance = this; } }
public void RetrievePetImageByInvalidID() { //Arrange var mockPetAccessor = new PetAccessorMock(); var petManager = new PetManager(mockPetAccessor); //Act int invalidTestID = 110000; var result = petManager.RetrievePetImageFilenameByPetID(invalidTestID); }
// Token: 0x06001721 RID: 5921 RVA: 0x0027D5B4 File Offset: 0x0027B7B4 public void SetData(int DataIndex, int ItemBegin, int ItemCount, byte LockCheck) { PetManager instance = PetManager.Instance; int num = DataIndex * 4; int num2 = ItemCount; if (ItemCount == 0) { ItemCount = 1; } ushort[] sortPetItemData = instance.sortPetItemData; List <byte> sortPetData = instance.sortPetData; for (int i = 0; i < 4; i++) { if (num + i < ItemCount) { int num3 = num + i; if (num2 > num3) { PetItem itemData; if (ItemBegin + num3 < sortPetItemData.Length && (itemData = instance.GetItemData((int)sortPetItemData[ItemBegin + num3])) != null) { this.PetCell[i].gameobject.SetActive(true); this.PetCell[i].SetData(itemData.ItemID, num3, _PetItem._ItemType.Item); } else { this.PetCell[i].gameobject.SetActive(false); } } else if (ItemCount == 1 && num2 == 0) { this.PetCell[i].gameobject.SetActive(true); this.PetCell[i].SetData(0, 0, _PetItem._ItemType.Def); } else { this.PetCell[i].gameobject.SetActive(false); } } else { int num3 = num + i - ItemCount; if ((int)instance.PetDataCount > num3) { this.PetCell[i].gameobject.SetActive(true); this.PetCell[i].SetData(PetManager.Instance.GetPetData((int)sortPetData[num3]).ID, num3, _PetItem._ItemType.Pet); this.PetCell[i].UpdateState(LockCheck); } else { this.PetCell[i].gameobject.SetActive(false); } } } }
public override void OutOfCombatExecute() { base.OutOfCombatExecute(); if (PetManager.Tick()) { return; } }
public static Composite CreateMageFrostPvPPullAndCombat() { return(new PrioritySelector( Safers.EnsureTarget(), Common.CreateStayAwayFromFrozenTargetsBehavior(), Movement.CreateMoveToLosBehavior(), Movement.CreateFaceTargetBehavior(), Helpers.Common.CreateAutoAttack(true), Spell.WaitForCast(true), // We want our pet alive ! new Decorator( ret => !StyxWoW.Me.GotAlivePet && PetManager.PetTimer.IsFinished && SpellManager.CanCast("Summon Water Elemental"), new Sequence( new Action(ret => PetManager.CallPet("Summon Water Elemental")), Helpers.Common.CreateWaitForLagDuration())), // Defensive stuff new Decorator( ret => StyxWoW.Me.ActiveAuras.ContainsKey("Ice Block"), new ActionIdle()), Spell.BuffSelf("Ice Block", ret => StyxWoW.Me.HealthPercent < 10 && !StyxWoW.Me.ActiveAuras.ContainsKey("Hypothermia")), Spell.BuffSelf("Blink", ret => SingularSettings.Instance.IsCombatRoutineMovementAllowed() && (StyxWoW.Me.IsStunned() || StyxWoW.Me.IsRooted())), Spell.BuffSelf("Mana Shield", ret => StyxWoW.Me.HealthPercent <= 75), Pet.CreateCastPetActionOnLocation("Freeze", ret => !StyxWoW.Me.Mounted && !StyxWoW.Me.CurrentTarget.HasAura("Frost Nova") && StyxWoW.Me.GotAlivePet && StyxWoW.Me.Pet.ManaPercent >= 12), Spell.BuffSelf("Frost Nova", ret => Unit.NearbyUnfriendlyUnits.Any(u => u.DistanceSqr <= 8 * 8 && !u.HasAura("Freeze") && !u.HasAura("Frost Nova") && !u.Stunned)), Common.CreateUseManaGemBehavior(ret => StyxWoW.Me.ManaPercent < 80), // Cooldowns Spell.BuffSelf("Evocation", ret => StyxWoW.Me.ManaPercent < 30), Spell.BuffSelf("Mirror Image"), Spell.BuffSelf("Mage Ward", ret => StyxWoW.Me.HealthPercent <= 75), Spell.BuffSelf("Icy Veins"), // Rotation Spell.Cast("Frost Bomb", ret => Unit.UnfriendlyUnitsNearTarget(10f).Count() >= 3), Spell.Cast("Deep Freeze", ret => StyxWoW.Me.ActiveAuras.ContainsKey("Fingers of Frost") || StyxWoW.Me.CurrentTarget.HasAura("Freeze") || StyxWoW.Me.CurrentTarget.HasAura("Frost Nova")), new Decorator( ret => StyxWoW.Me.ActiveAuras.ContainsKey("Brain Freeze"), new PrioritySelector( Spell.Cast("Frostfire Bolt"), Spell.Cast("Fireball") )), Spell.Cast("Ice Lance", ret => StyxWoW.Me.ActiveAuras.ContainsKey("Fingers of Frost") || StyxWoW.Me.CurrentTarget.HasAura("Freeze") || StyxWoW.Me.CurrentTarget.HasAura("Frost Nova") || StyxWoW.Me.IsMoving), Spell.Cast("Frostbolt"), Movement.CreateMoveToTargetBehavior(true, 39f) )); }