Exemple #1
0
    public int GetChosenActiveSkillSprite(ActiveSkills active)
    {
        switch (active)
        {
        case ActiveSkills.None:
            return(0);

        case ActiveSkills.DropMine:
            return(0);

        case ActiveSkills.Rewind:
            return(1);

        case ActiveSkills.Shotgun:
            return(2);

        case ActiveSkills.Stealth:
            return(3);

        case ActiveSkills.TempShield:
            return(4);

        default:
            return(0);
        }
    }
Exemple #2
0
        public static void GetTargetAndAim()
        {
            var castingId = LocalPlayer.Instance.AbilitySystem.CastingAbilityId;
            var skill     = ActiveSkills.Get(castingId);

            if (skill == null)
            {
                return;
            }
            if (OrbLogic(skill, true))
            {
                return;
            }

            var prediction = TargetSelection.GetTargetPrediction(skill, ActiveSkills.GetData(skill.Slot));

            if (!prediction.CanHit)
            {
                if (OrbLogic(skill))
                {
                    Main.DebugOutput = "Attacking orb (no valid targets)";
                }
                else if (MenuHandler.InterruptSpells)
                {
                    LocalPlayer.PressAbility(AbilitySlot.Interrupt, true);
                }
                return;
            }

            Main.DebugOutput            = "Aiming at " + prediction.Target.CharName;
            LocalPlayer.EditAimPosition = true;
            LocalPlayer.Aim(prediction.CastPosition);
        }
Exemple #3
0
        private static void Update(EventArgs args)
        {
            if (!MenuHandler.Enabled || !_shouldUse || !_isCasting || Game.CurrentMatchState != MatchState.InRound)
            {
                return;
            }
            var skill = ActiveSkills.Get(_castingId);

            if (skill == null)
            {
                return;
            }

            if (MenuHandler.Get(skill.Slot))
            {
                if (OrbLogic(skill, true))
                {
                    return;
                }
                var pred = TargetSelection.GetTargetPrediction(skill, AbilityDatabase.Get(_castingId));
                if (!pred.CanHit && !OrbLogic(skill))
                {
                    if (MenuHandler.Interrupt)
                    {
                        LocalPlayer.PressAbility(AbilitySlot.Interrupt, true);
                    }
                    LocalPlayer.EditAimPosition = false;
                    return;
                }

                LocalPlayer.EditAimPosition = true;
                LocalPlayer.Aim(pred.CastPosition);
            }
        }
Exemple #4
0
 private void SpellInit()
 {
     if (LocalPlayer.Instance.CharName != "Varesh")
     {
         return;
     }
     ActiveSkills.AddFromDatabase();
 }
Exemple #5
0
 private void SpellInit()
 {
     if (LocalPlayer.Instance.CharName == "Shen Rao" || string.IsNullOrEmpty(LocalPlayer.Instance.CharName))
     {
         ActiveSkills.AddFromDatabase();
         AM1Info    = AbilityDatabase.Get("LightningBolt");
         AscendedM1 = new SkillBase(AbilitySlot.Ability1, SkillType.Circle, AM1Info.Range, AM1Info.Speed, AM1Info.Radius, AM1Info.FixedDelay);
     }
 }
Exemple #6
0
 public void EquipActiveSkill(int skillIndex, ActiveSkills skill)
 {
     if (activeSkillEquip[skillIndex] != null)
     {
         activeSkillEquip[skillIndex].DestroySkill();
     }
     activeSkillEquip[skillIndex] = skill;
     activeSkillEquip[skillIndex].SetParent(gameObject);
 }
 public ActiveSkills[] GetActiveSkills()
 {
     ActiveSkills[] skills = new ActiveSkills[thisMatchActiveSkills.Count];
     for (int i = 0; i < thisMatchActiveSkills.Count; i++)
     {
         skills[i] = thisMatchActiveSkills[i];
     }
     return(skills);
 }
Exemple #8
0
    public override void Execute(CharacterMono speller, Vector3 position)
    {
        base.Execute(speller, position);

        //========================================
        // 为延迟技能(只能对非指向型技能)增加监听事件
        for (int i = 0; i < ActiveSkills.Count(); i++)
        {
            var skill          = ActiveSkills[i];
            var delayAttribute = SkillDelayAttributes[i];
            if (delayAttribute.isDelay && !skill.IsMustDesignation)
            {
                var activeSkill = ActiveSkills[delayAttribute.index];
                if (!activeSkill.IsMustDesignation)
                {
                    OnSkillCompeleteHandler delayExcute = null;
                    delayExcute = () => {
                        skill.Execute(speller, position);
                    };
                    activeSkill.OnCompelte += delayExcute;
                }
            }
        }



        // 首先遍历技能组,释放该技能组中的所有无需对目标单位释放的技能
        for (int i = 0; i < ActiveSkills.Count(); i++)
        {
            var skill          = ActiveSkills[i];
            var delayAttribute = SkillDelayAttributes[i];
            if (!skill.IsMustDesignation && !delayAttribute.isDelay)
            {
                skill.Execute(speller, position);
            }
        }

        // 在目标地点产生一个球形检测区域,半径由skillInflence决定,
        // 对检测区域内所有CharacterMono单位释放技能组中的单体技能
        Collider[] colliders = Physics.OverlapSphere(position, skillModel.SkillInfluenceRadius);
        foreach (var collider in colliders)
        {
            CharacterMono target = collider.GetComponent <CharacterMono>();
            if (target != null)
            {
                foreach (var skill in ActiveSkills)
                {
                    if (skill.IsMustDesignation)
                    {
                        skill.Execute(speller, target);
                    }
                }
            }
        }
    }
Exemple #9
0
            private void RefreshHotbar()
            {
                using (new PerformanceLogger("RefreshHotbar"))
                {
                    var cPlayer = ZetaDia.CPlayer;

                    LastUpdated = DateTime.UtcNow;

                    PassiveSkills = new HashSet <SNOPower>(cPlayer.PassiveSkills);

                    for (int i = 0; i <= 5; i++)
                    {
                        var diaActiveSkill = cPlayer.GetActiveSkillByIndex(i, ZetaDia.Me.SkillOverrideActive);
                        if (diaActiveSkill == null || diaActiveSkill.Power == SNOPower.None)
                        {
                            continue;
                        }

                        var power     = diaActiveSkill.Power;
                        var runeIndex = diaActiveSkill.RuneIndex;

                        var hotbarskill = new HotbarSkill
                        {
                            Power           = diaActiveSkill.Power,
                            Slot            = (HotbarSlot)i,
                            RuneIndex       = runeIndex,
                            HasRuneEquipped = diaActiveSkill.HasRuneEquipped,
                            Skill           = SkillUtils.ById(power),
                            //Charges = ZetaDia.Me.CommonData.GetAttribute<int>(((int)diaActiveSkill.Power << 12) + ((int)ActorAttributeType.SkillCharges & 0xFFF)),
                        };

                        ActivePowers.Add(power);
                        ActiveSkills.Add(hotbarskill);
                        _skillBySNOPower.Add(power, hotbarskill);
                        _skillBySlot.Add((HotbarSlot)i, hotbarskill);



                        if (!DataDictionary.LastUseAbilityTimeDefaults.ContainsKey(power))
                        {
                            DataDictionary.LastUseAbilityTimeDefaults.Add(power, DateTime.MinValue);
                        }

                        if (!AbilityLastUsed.ContainsKey(power))
                        {
                            AbilityLastUsed.Add(power, DateTime.MinValue);
                        }
                    }

                    Logger.Log(TrinityLogLevel.Debug, LogCategory.CacheManagement,
                               "Refreshed Hotbar: ActiveSkills={0} PassiveSkills={1}",
                               ActiveSkills.Count,
                               PassiveSkills.Count);
                }
            }
Exemple #10
0
        public bool HasSkillActive(SkillDefinition definition)
        {
            for (int i = 0; i < ActiveSkills.Count; i++)
            {
                if (ActiveSkills.Contains(definition))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #11
0
 public void OnInit()
 {
     Init = delegate { };
     AbilityDatabase.Setup();
     AddonMenus.Setup();
     StealthPrediction.Setup();
     HideNames.Setup();
     ActiveSkills.Setup();
     ObjectTracker.Setup();
     MenuEvents.Setup();
     DebugHelper.Setup();
     BuffTracker.Setup();
     Game.OnPreUpdate += Game_OnPreUpdate;
     DelayAction(Init.Invoke, 0.5f);
 }
    public override void Execute(CharacterMono speller, CharacterMono target)
    {
        base.Execute(speller, target);

        //========================================
        // 为延迟技能增加监听事件
        for (int i = 0; i < ActiveSkills.Count(); i++)
        {
            var skill          = ActiveSkills[i];
            var delayAttribute = SkillDelayAttributes[i];
            if (delayAttribute.isDelay)
            {
                var activeSkill = ActiveSkills[delayAttribute.index];

                OnSkillCompeleteHandler delayExcute = null;
                delayExcute = () => {
                    if (skill.IsMustDesignation)
                    {
                        skill.Execute(speller, target);
                    }
                    else
                    {
                        skill.Execute(speller, target.transform.position);
                    }
                };
                activeSkill.OnCompelte += delayExcute;
            }
        }

        //=============================================
        // 执行每一个非延迟技能
        for (int i = 0; i < ActiveSkills.Count(); i++)
        {
            var skill          = ActiveSkills[i];
            var delayAttribute = SkillDelayAttributes[i];
            if (!delayAttribute.isDelay)
            {
                if (skill.IsMustDesignation)
                {
                    skill.Execute(speller, target);
                }
                else
                {
                    skill.Execute(speller, target.transform.position);
                }
            }
        }
    }
Exemple #13
0
 public void Dump()
 {
     using (new MemoryHelper())
     {
         foreach (var hotbarskill in ActiveSkills.ToList())
         {
             Logger.Log("Power={0} SkillName={1} Slot={2} DBRuneIndex={3} ProperRuneIndex={4} RuneName={5}",
                        hotbarskill.Power,
                        hotbarskill.Skill.Name,
                        hotbarskill.Slot,
                        hotbarskill.RuneIndex,
                        hotbarskill.Rune.Index,
                        hotbarskill.Rune.Name);
         }
     }
 }
Exemple #14
0
 public void OnUnload()
 {
     Console.WriteLine("Unload Common Started");
     Init = null;
     AbilityDatabase.Unload();
     AddonMenus.Unload();
     StealthPrediction.Unload();
     HideNames.Unload();
     ActiveSkills.Unload();
     ObjectTracker.Unload();
     MenuEvents.Unload();
     DebugHelper.Unload();
     BuffTracker.Unload();
     Game.OnPreUpdate -= Game_OnPreUpdate;
     Console.WriteLine("Unload Common Ended");
 }
Exemple #15
0
        public static void GetTargetAndAim()
        {
            var castingId = LocalPlayer.Instance.AbilitySystem.CastingAbilityId;

            if (castingId == 238454699 && MenuHandler.SkillBool("close_a3") && EnemiesInRange(2.5f).Count > 0)
            {
                Main.DebugOutput            = "Shielding self";
                LocalPlayer.EditAimPosition = true;
                LocalPlayer.Aim(LocalPlayer.Instance.Pos());
                return;
            }
            var skill = ActiveSkills.Get(castingId);

            if (skill == null)
            {
                return;
            }
            if (OrbLogic(skill, true))
            {
                return;
            }
            var prediction = skill.Slot == AbilitySlot.Ability5 ?
                             GetEPrediction(skill, ActiveSkills.GetData(skill.Slot)) :
                             TargetSelection.GetTargetPrediction(skill, ActiveSkills.GetData(skill.Slot), skill.Slot == AbilitySlot.Ability2);

            if (!prediction.CanHit)
            {
                if (OrbLogic(skill))
                {
                    Main.DebugOutput = "Attacking orb (no valid targets)";
                }
                else
                {
                    if (MenuHandler.InterruptSpells && (!MenuHandler.NeverInterruptE || skill.Slot != AbilitySlot.Ability5))
                    {
                        LocalPlayer.PressAbility(AbilitySlot.Interrupt, true);
                    }
                }
                return;
            }

            Main.DebugOutput            = "Aiming at " + prediction.Target.CharName;
            LocalPlayer.EditAimPosition = true;
            LocalPlayer.Aim(prediction.CastPosition);
        }
Exemple #16
0
        public static void AimUlt()
        {
            var skill = ActiveSkills.Active.Get(AbilitySlot.Ability7);

            if (OrbLogic(skill, true))
            {
                return;
            }
            var prediction = TargetSelection.GetTargetPrediction(skill, ActiveSkills.GetData(skill.Slot), true);

            if (!prediction.CanHit)
            {
                Main.DebugOutput = OrbLogic(skill) ? "Attacking orb (no valid targets)" : "Cant find any targets";
                return;
            }
            Main.DebugOutput            = "Aiming at " + prediction.Target.CharName;
            LocalPlayer.EditAimPosition = true;
            LocalPlayer.Aim(prediction.CastPosition);
        }
Exemple #17
0
 private static void Game_OnMatchStart(EventArgs args)
 {
     _shouldUse = false;
     Main.DelayAction(delegate
     {
         try
         {
             var addons = AddonMenus.Active.Where(a => a.SupportedCharacters.Contains(LocalPlayer.Instance.CharName)).ToArray();
             _shouldUse = !addons.Any();
             if (_shouldUse)
             {
                 ActiveSkills.AddFromDatabase();
             }
             MenuHandler.AimbotMenu.Hidden = !_shouldUse;
         }
         catch (Exception e)
         {
             Console.WriteLine(e);
         }
     }, 0.2f);
 }
Exemple #18
0
        public static void GetTargetAndAim()
        {
            var castingId = LocalPlayer.Instance.AbilitySystem.CastingAbilityId;
            var skill     = ActiveSkills.Get(castingId);

            if (skill == null)
            {
                return;
            }
            if (OrbLogic(skill, true))
            {
                return;
            }
            var useOnIncaps = skill.Slot == AbilitySlot.Ability2 || skill.Slot == AbilitySlot.Ability5 ||
                              skill.Slot == AbilitySlot.Ability7;

            var prediction = skill.Slot == AbilitySlot.Ability1 && LocalPlayer.Instance.HasBuff("AscensionBuff")
                ? TargetSelection.GetTargetPrediction(Main.AscendedM1, Main.AM1Info, true) :
                             TargetSelection.GetTargetPrediction(skill, ActiveSkills.GetData(skill.Slot), useOnIncaps);

            if (!prediction.CanHit)
            {
                if (OrbLogic(skill))
                {
                    Main.DebugOutput = "Attacking orb (no valid targets)";
                }
                else
                {
                    if (skill.SkillType == SkillType.Line && skill.Slot != AbilitySlot.Ability7 && MenuHandler.InterruptSpells)
                    {
                        LocalPlayer.PressAbility(AbilitySlot.Interrupt, true);
                    }
                }
                return;
            }

            Main.DebugOutput            = "Aiming at " + prediction.Target.CharName;
            LocalPlayer.EditAimPosition = true;
            LocalPlayer.Aim(prediction.CastPosition);
        }
Exemple #19
0
 public void EquipSkill(SkillDefinition definition)
 {
     if (!HasSkillActive(definition) && AcquiredSkills.Count < 4 && HasAcquiredSkill(definition))
     {
         ActiveSkills.Add(definition);
         player.PutItemInInventory(mod.ItemType(definition.Item.Name));
     }
     if (HasSkillActive(definition))
     {
         ActiveSkills.Remove(definition);
         foreach (var item in player.inventory)
         {
             if (item == null)
             {
                 continue;
             }
             if (item.type == mod.ItemType(definition.Item.Name))
             {
                 item.TurnToAir();
             }
         }
     }
 }
Exemple #20
0
        public static void DoSwap()
        {
            try
            {
                A_Collection.Me.SkillBuilds.Is_SwapingBuild = true;

                int BuildId = A_Collection.Me.SkillBuilds.SelectedSkillBuild;

                var Build =
                    A_Collection.Me.SkillBuilds.Builds.FirstOrDefault(
                        x => x.Value == A_Collection.Me.HeroGlobals.HeroID && x.Key.Id == BuildId);

                // bool SkillsRemoved = false;

                if (Build.Key != null)
                {
                    //-- check if one skill is on cooldown

                    Dictionary <int, int> _ActiveSkills;
                    lock (A_Collection.Me.HeroDetails.ActiveSkills)
                        _ActiveSkills = A_Collection.Me.HeroDetails.ActiveSkills;


                    foreach (var _using in _ActiveSkills)
                    {
                        if (A_Tools.Skills.Skills.S_Global.isOnCooldown(_using.Key))
                        {
                            MessageBox.Show("One or more skills are on cooldown. Cannot swap Build now");
                            A_Collection.Me.SkillBuilds.Is_SwapingBuild = false;
                            return;
                        }
                    }

                    //

                    //-- check if in Town

                    if (!A_Collection.Me.HeroStates.isInTown)
                    {
                        MessageBox.Show("You can change Builds only while in Town");
                        A_Collection.Me.SkillBuilds.Is_SwapingBuild = false;
                        return;
                    }

                    //

                    //-- Swap Actives

                    var Actives = Build.Key.ActiveSkills.Where(x => x.PowerSno != 0).ToList();

                    for (int i = 0; i < Actives.Count; i++)
                    {
                        var activeSkill = Actives[i];

                        Dictionary <int, int> ActiveSkills;
                        lock (A_Collection.Me.HeroDetails.ActiveSkills)
                            ActiveSkills = A_Collection.Me.HeroDetails.ActiveSkills;

                        if (ActiveSkills.FirstOrDefault(x => x.Key == activeSkill.PowerSno && x.Value == activeSkill.Rune).Key != 0)
                        {
                            continue;
                        }

                        Action_SelectActiveSlot(i);

                        while (!A_Tools.T_D3UI.UIElement.isVisible(A_Enums.UIElements.SkillPanel_Active_PageNext) && isSkillsWindowVisible())
                        {
                            Thread.Sleep(10);
                        }

                        while (!ActivePage_ContainsPower(activeSkill.PowerSno) && isSkillsWindowVisible())
                        {
                            Action_NextPage();
                        }

                        while (!isActivePowerAssigned(activeSkill.PowerSno) && isSkillsWindowVisible())
                        {
                            if (isActiveSelectionDisabled())
                            {
                                Action_RemoveSkillsFromHotbar(i + 1);
                                Action_SelectActiveSlot(i);

                                while (!A_Tools.T_D3UI.UIElement.isVisible(A_Enums.UIElements.SkillPanel_Active_PageNext) && isSkillsWindowVisible())
                                {
                                    Thread.Sleep(10);
                                }

                                while (!ActivePage_ContainsPower(activeSkill.PowerSno) && isSkillsWindowVisible())
                                {
                                    Action_NextPage();
                                }
                            }

                            Action_SelectActivePower(activeSkill.PowerSno);
                        }



                        while (!isSkillPanel_MainWindow() && isSkillsWindowVisible())
                        {
                            Action_SelectRune(activeSkill.PowerSno, activeSkill.Rune);
                        }

                        //while (
                        //    !isActiveRuneAssigned(
                        //        A_Collection.Presets.SkillPowers.AllSkillPowers.First(
                        //            x => x.PowerSNO == activeSkill.PowerSno)
                        //            .Runes.First(x => x.RuneIndex == activeSkill.Rune)
                        //            .Name) && isSkillsWindowVisible())
                        //{
                        //    Action_SelectRune(activeSkill.PowerSno, activeSkill.Rune);
                        //}
                        //Action_AcceptActiveSkill();
                    }

                    //

                    //-- Swap Passives

                    OpenSkillsWindow();


                    while (true)
                    {
                        List <int> PassiveSkills =
                            A_Collection.Me.HeroGlobals.LocalPlayerData.GetPassivePowerSnoIds().ToList();

                        if (PassiveSkills[0] == Build.Key.PassiveSkills[0].PowerSno &&
                            PassiveSkills[1] == Build.Key.PassiveSkills[1].PowerSno &&
                            PassiveSkills[2] == Build.Key.PassiveSkills[2].PowerSno &&
                            PassiveSkills[3] == Build.Key.PassiveSkills[3].PowerSno)
                        {
                            break;
                        }

                        for (int i = 0; i < Build.Key.PassiveSkills.Count; i++)
                        {
                            var passiveSkill = Build.Key.PassiveSkills[i];


                            if (PassiveSkills.Contains(passiveSkill.PowerSno))
                            {
                                continue;
                            }

                            while (!isSkillPanel_PassiveSelection() && isSkillsWindowVisible())
                            {
                                Action_SelectPassiveSlot(i);
                            }

                            while (!isSkillPanel_MainWindow() && isSkillsWindowVisible())
                            {
                                Action_SelectPassivePower(passiveSkill.PowerSno);
                            }
                        }
                    }

                    //

                    CloseSkillsWindow();

                    int _x = A_Collection.D3Client.Window.D3ClientRect.Width / 2;
                    int _y = A_Collection.D3Client.Window.D3ClientRect.Height / 2;

                    Cursor.Position = new Point((int)_x, (int)_y);
                }

                A_Collection.Me.SkillBuilds.Is_SwapingBuild = false;
            }
            catch (Exception)
            {
                A_Collection.Me.SkillBuilds.Is_SwapingBuild = false;
            }
        }
Exemple #21
0
 public Fury() : base("Fury", 16, new damage(5, 7), 5, 3, 16)
 {
     PassiveSkills.Add(new Recharge(true));
     PassiveSkills.Add(new DisableRecharge());
     ActiveSkills.Add(new AttackBaff());
 }
Exemple #22
0
 public void AssignActiveSkill(ActiveSkills active)
 {
     activeSkills = active;
 }
Exemple #23
0
 public Hydra() : base("Hydra", 80, new damage(7, 14), 15, 12, 7)
 {
     PassiveSkills.Add(new Recharge(true));
     ActiveSkills.Add(new InitiativeBaff());
 }
 void Awake()
 {
     instance = this;
 }