コード例 #1
0
ファイル: Program.cs プロジェクト: dendimonster/EnsageSharp-1
        private static void Game_OnUpdate(EventArgs args)
        {
            #region Init

            var me = ObjectMgr.LocalHero;
            if (!_loaded)
            {
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Invoker)
                {
                    return;
                }
                _loaded = true;
                _combo = 0;


                var q = me.Spellbook.SpellQ;
                var w = me.Spellbook.SpellW;
                var e = me.Spellbook.SpellE;

                var ss = me.FindSpell("invoker_sun_strike");
                var coldsnap = me.FindSpell("invoker_cold_snap");
                var ghostwalk = me.FindSpell("invoker_ghost_walk");
                var icewall = me.FindSpell("invoker_ice_wall");
                var tornado = me.FindSpell("invoker_tornado");
                var blast = me.FindSpell("invoker_deafening_blast");
                var forgeSpirit = me.FindSpell("invoker_forge_spirit");
                var emp = me.FindSpell("invoker_emp");
                var alacrity = me.FindSpell("invoker_alacrity");
                var meteor = me.FindSpell("invoker_chaos_meteor");

                SpellInfo.Add(ss.Name, new SpellStruct(e, e, e));
                SpellInfo.Add(coldsnap.Name, new SpellStruct(q, q, q));
                SpellInfo.Add(ghostwalk.Name, new SpellStruct(q, q, w));
                SpellInfo.Add(icewall.Name, new SpellStruct(q, q, e));
                SpellInfo.Add(tornado.Name, new SpellStruct(w, w, q));
                SpellInfo.Add(blast.Name, new SpellStruct(q, w, e));
                SpellInfo.Add(forgeSpirit.Name, new SpellStruct(e, e, q));
                SpellInfo.Add(emp.Name, new SpellStruct(w, w, w));
                SpellInfo.Add(alacrity.Name, new SpellStruct(w, w, e));
                SpellInfo.Add(meteor.Name, new SpellStruct(e, e, w));

                Combos[_maxCombo] = new ComboStruct(new[] {ss, meteor, blast, coldsnap, forgeSpirit}, 5, true);
                Combos[_maxCombo] =
                    new ComboStruct(new[] {tornado, ss, meteor, blast, tornado, coldsnap, alacrity, forgeSpirit},5);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, ss, meteor, blast, tornado, coldsnap},5);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, meteor, blast, coldsnap},5);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, meteor, blast},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, blast},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, icewall},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, ss, icewall},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, blast, coldsnap},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, coldsnap},3);
                Combos[_maxCombo] = new ComboStruct(new[] {coldsnap, alacrity, forgeSpirit},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, meteor,blast,ss,icewall},5);

                Game.PrintMessage(
                    "<font face='Comic Sans MS, cursive'><font color='#00aaff'>" + Menu.DisplayName + " By Jumpering" +
                    " loaded!</font> <font color='#aa0000'>v"  + Ver, MessageType.LogMessage);
                PrintSuccess(string.Format("> {1} Loaded v{0}", Ver, Menu.DisplayName));
                /*PrintInfo("===============Combo selection===============");
                for (var i = 0; i < _maxCombo; i++)
                    PrintInfo(string.Format("Init new combo--> {0}", Combos[i]));
                PrintInfo("============================================");*/
            }

            if (!Game.IsInGame || me == null)
            {
                _loaded = false;
                PrintInfo("> Invorker Annihilation unLoaded");
                return;
            }

            if (Game.IsPaused)
            {
                return;
            }
            //PrintInfo(me.NetworkActivity.ToString());
            if (Utils.SleepCheck("act") && !_inAction && Menu.Item("smartIsActive").GetValue<bool>())
            {
                Ability spell = null;
                switch (Menu.Item("OnMoving").GetValue<StringList>().SelectedIndex)
                {
                    case (int) SmartSphereEnum.Quas:
                        spell = me.Spellbook.SpellQ;
                        break;
                    case (int) SmartSphereEnum.Wex:
                        spell = me.Spellbook.SpellW;
                        break;
                }
                if (me.NetworkActivity == NetworkActivity.Move && me.NetworkActivity != _lastAct && !me.IsInvisible())
                {
                    if (spell != null && spell.CanBeCasted())
                    {
                        spell.UseAbility();
                        spell.UseAbility();
                        spell.UseAbility();
                    }
                }
                _lastAct = me.NetworkActivity;
            }

            #endregion
            
            #region Get needed spells

            if (_startInitSpell && Utils.SleepCheck("GettingNeededSpells"))
            {
                _startInitSpell = false;
                InvokeNeededSpells(me);
            }

            #endregion

            #region Starting Combo

            if (!_inAction)
            {
                _globalTarget = null;
                return;
            }
            if (_globalTarget == null || !_globalTarget.IsValid)
            {
                _globalTarget = ClosestToMouse(me);
            }
            if (_globalTarget == null || !_globalTarget.IsValid || !_globalTarget.IsAlive || !me.CanCast()) return;

            ComboInAction(me, _globalTarget);
            /*
            var target = ClosestToMouse(me);
            if (_ssprediction || _showsSsDamage || _sunstrikekill)
            {
                _globalTarget = target;
            }
            else
            {
                if (_predictionEffect != null)
                {
                    _predictionEffect.Dispose();
                    _predictionEffect = null;
                }
            }
            if (_inAction && target != null && target.IsAlive)
                ComboInAction(me, target);
            */
            #endregion
        }
コード例 #2
0
        private static void Game_OnUpdate(EventArgs args)
        {
            #region Init

            var me = ObjectMgr.LocalHero;
            if (!_loaded)
            {
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Invoker)
                {
                    return;
                }
                _loaded = true;
                _combo  = 0;


                var q = me.Spellbook.SpellQ;
                var w = me.Spellbook.SpellW;
                var e = me.Spellbook.SpellE;

                var ss          = me.FindSpell("invoker_sun_strike");
                var coldsnap    = me.FindSpell("invoker_cold_snap");
                var ghostwalk   = me.FindSpell("invoker_ghost_walk");
                var icewall     = me.FindSpell("invoker_ice_wall");
                var tornado     = me.FindSpell("invoker_tornado");
                var blast       = me.FindSpell("invoker_deafening_blast");
                var forgeSpirit = me.FindSpell("invoker_forge_spirit");
                var emp         = me.FindSpell("invoker_emp");
                var alacrity    = me.FindSpell("invoker_alacrity");
                var meteor      = me.FindSpell("invoker_chaos_meteor");

                SpellInfo.Add(ss.Name, new SpellStruct(e, e, e));
                SpellInfo.Add(coldsnap.Name, new SpellStruct(q, q, q));
                SpellInfo.Add(ghostwalk.Name, new SpellStruct(q, q, w));
                SpellInfo.Add(icewall.Name, new SpellStruct(q, q, e));
                SpellInfo.Add(tornado.Name, new SpellStruct(w, w, q));
                SpellInfo.Add(blast.Name, new SpellStruct(q, w, e));
                SpellInfo.Add(forgeSpirit.Name, new SpellStruct(e, e, q));
                SpellInfo.Add(emp.Name, new SpellStruct(w, w, w));
                SpellInfo.Add(alacrity.Name, new SpellStruct(w, w, e));
                SpellInfo.Add(meteor.Name, new SpellStruct(e, e, w));

                Combos[_maxCombo] = new ComboStruct(new[] { ss, meteor, blast, coldsnap, forgeSpirit }, 5, true);
                Combos[_maxCombo] =
                    new ComboStruct(new[] { tornado, ss, meteor, blast, tornado, coldsnap, alacrity, forgeSpirit }, 5);
                Combos[_maxCombo] = new ComboStruct(new[] { tornado, emp, ss, meteor, blast, tornado, coldsnap }, 5);
                Combos[_maxCombo] = new ComboStruct(new[] { tornado, emp, meteor, blast, coldsnap }, 5);
                Combos[_maxCombo] = new ComboStruct(new[] { tornado, meteor, blast }, 3);
                Combos[_maxCombo] = new ComboStruct(new[] { tornado, emp, blast }, 3);
                Combos[_maxCombo] = new ComboStruct(new[] { tornado, emp, icewall }, 3);
                Combos[_maxCombo] = new ComboStruct(new[] { tornado, ss, icewall }, 3);
                Combos[_maxCombo] = new ComboStruct(new[] { tornado, blast, coldsnap }, 3);
                Combos[_maxCombo] = new ComboStruct(new[] { tornado, emp, coldsnap }, 3);
                Combos[_maxCombo] = new ComboStruct(new[] { coldsnap, alacrity, forgeSpirit }, 3);
                Combos[_maxCombo] = new ComboStruct(new[] { tornado, emp, meteor, blast, ss, icewall }, 5);

                Game.PrintMessage(
                    "<font face='Comic Sans MS, cursive'><font color='#00aaff'>" + Menu.DisplayName + " By Jumpering" +
                    " loaded!</font> <font color='#aa0000'>v" + Ver, MessageType.LogMessage);
                PrintSuccess(string.Format("> {1} Loaded v{0}", Ver, Menu.DisplayName));

                /*PrintInfo("===============Combo selection===============");
                 * for (var i = 0; i < _maxCombo; i++)
                 *  PrintInfo(string.Format("Init new combo--> {0}", Combos[i]));
                 * PrintInfo("============================================");*/
            }

            if (!Game.IsInGame || me == null)
            {
                _loaded = false;
                PrintInfo("> Invorker Annihilation unLoaded");
                return;
            }

            if (Game.IsPaused)
            {
                return;
            }
            //PrintInfo(me.NetworkActivity.ToString());
            if (Utils.SleepCheck("act") && !_inAction && Menu.Item("smartIsActive").GetValue <bool>())
            {
                Ability spell = null;
                switch (Menu.Item("OnMoving").GetValue <StringList>().SelectedIndex)
                {
                case (int)SmartSphereEnum.Quas:
                    spell = me.Spellbook.SpellQ;
                    break;

                case (int)SmartSphereEnum.Wex:
                    spell = me.Spellbook.SpellW;
                    break;
                }
                if (me.NetworkActivity == NetworkActivity.Move && me.NetworkActivity != _lastAct && !me.IsInvisible())
                {
                    if (spell != null && spell.CanBeCasted())
                    {
                        spell.UseAbility();
                        spell.UseAbility();
                        spell.UseAbility();
                    }
                }
                _lastAct = me.NetworkActivity;
            }

            #endregion

            #region Get needed spells

            if (_startInitSpell && Utils.SleepCheck("GettingNeededSpells"))
            {
                _startInitSpell = false;
                InvokeNeededSpells(me);
            }

            #endregion

            #region Starting Combo

            if (!_inAction)
            {
                _globalTarget = null;
                return;
            }
            if (_globalTarget == null || !_globalTarget.IsValid)
            {
                _globalTarget = ClosestToMouse(me);
            }
            if (_globalTarget == null || !_globalTarget.IsValid || !_globalTarget.IsAlive || !me.CanCast())
            {
                return;
            }

            ComboInAction(me, _globalTarget);

            /*
             * var target = ClosestToMouse(me);
             * if (_ssprediction || _showsSsDamage || _sunstrikekill)
             * {
             *  _globalTarget = target;
             * }
             * else
             * {
             *  if (_predictionEffect != null)
             *  {
             *      _predictionEffect.Dispose();
             *      _predictionEffect = null;
             *  }
             * }
             * if (_inAction && target != null && target.IsAlive)
             *  ComboInAction(me, target);
             */
            #endregion
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: kobra322/EnsageSharp-1
        private static void Game_OnUpdate(EventArgs args)
        {
            #region Init

            var me = ObjectMgr.LocalHero;
            if (!_loaded)
            {
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Invoker)
                {
                    return;
                }
                _loaded = true;
                _combo  = 0;


                var q = me.Spellbook.SpellQ;
                var w = me.Spellbook.SpellW;
                var e = me.Spellbook.SpellE;

                var ss          = me.FindSpell("invoker_sun_strike");
                var coldsnap    = me.FindSpell("invoker_cold_snap");
                var ghostwalk   = me.FindSpell("invoker_ghost_walk");
                var icewall     = me.FindSpell("invoker_ice_wall");
                var tornado     = me.FindSpell("invoker_tornado");
                var deafblast   = me.FindSpell("invoker_deafening_blast");
                var forge       = me.FindSpell("invoker_forge_spirit");
                var emp         = me.FindSpell("invoker_emp");
                var alacrity    = me.FindSpell("invoker_alacrity");
                var chaosmeteor = me.FindSpell("invoker_chaos_meteor");

                SpellInfo.Add(ss.Name, new SpellStruct(e, e, e));
                SpellInfo.Add(coldsnap.Name, new SpellStruct(q, q, q));
                SpellInfo.Add(ghostwalk.Name, new SpellStruct(q, q, w));
                SpellInfo.Add(icewall.Name, new SpellStruct(q, q, e));
                SpellInfo.Add(tornado.Name, new SpellStruct(w, w, q));
                SpellInfo.Add(deafblast.Name, new SpellStruct(q, w, e));
                SpellInfo.Add(forge.Name, new SpellStruct(e, e, q));
                SpellInfo.Add(emp.Name, new SpellStruct(w, w, w));
                SpellInfo.Add(alacrity.Name, new SpellStruct(w, w, e));
                SpellInfo.Add(chaosmeteor.Name, new SpellStruct(e, e, w));

                /*
                 * Spells[Convert.ToInt32(ss.Name)] = new SpellStruct(e, e, e);
                 * Spells[Convert.ToInt32(coldsnap.Name)] = new SpellStruct( q, q, q);
                 * Spells[Convert.ToInt32(ghostwalk.Name)] = new SpellStruct( );
                 * Spells[Convert.ToInt32(icewall.Name)] = new SpellStruct( );
                 * Spells[Convert.ToInt32(tornado.Name)] = new SpellStruct();
                 * Spells[Convert.ToInt32(deafblast.Name)] = new SpellStruct();
                 * Spells[Convert.ToInt32(forge.Name)] = new SpellStruct();
                 * Spells[Convert.ToInt32(emp.Name)] = new SpellStruct();
                 * Spells[Convert.ToInt32(alacrity.Name)] = new SpellStruct();
                 * Spells[Convert.ToInt32(chaosmeteor.Name)] = new SpellStruct(e, e, w);
                 * */
                //Eul->SS->Met->Bla->Cold

                /*
                 * Tornado > EMP > Meteor > Blast (Requiers Aghanims)
                 * Tornado > Meteor > Blast
                 * Tornado > EMP > Blast
                 * Tornado > EMP > Ica Wall
                 */
                //Combos[0] = new ComboStruct(true, ss, chaosmeteor, deafblast, null, null);
                Combos[0] = new ComboStruct(true, ss, chaosmeteor, deafblast, coldsnap, forge);
                Combos[1] = new ComboStruct(tornado, emp, chaosmeteor, deafblast, coldsnap);
                Combos[2] = new ComboStruct(tornado, chaosmeteor, deafblast, null, null);
                Combos[3] = new ComboStruct(tornado, emp, deafblast, null, null);
                Combos[4] = new ComboStruct(tornado, emp, icewall, null, null);
                PrintSuccess(string.Format("> Invorker Loaded v{0}", Ver));
                PrintInfo("===============Combo selection===============");
                PrintInfo(string.Format("Init new combo--> {0}", Combos[0]));
                PrintInfo(string.Format("Init new combo--> {0}", Combos[1]));
                PrintInfo(string.Format("Init new combo--> {0}", Combos[2]));
                PrintInfo(string.Format("Init new combo--> {0}", Combos[3]));
                PrintInfo(string.Format("Init new combo--> {0}", Combos[4]));
                PrintInfo("============================================");
            }

            if (!Game.IsInGame || me == null)
            {
                _loaded = false;
                PrintInfo("> Invorker unLoaded");
                return;
            }

            if (Game.IsPaused)
            {
                return;
            }
            //PrintInfo(me.NetworkActivity.ToString());
            if (Utils.SleepCheck("act") && !_inAction && SmartSphere)
            {
                var quas  = me.Spellbook.SpellQ;
                var wex   = me.Spellbook.SpellW;
                var exort = me.Spellbook.SpellE;
                if (wex != null && wex.CanBeCasted())
                {
                    //if (me.NetworkActivity == NetworkActivity.Attack2 && me.NetworkActivity != LastAct)

                    if ((me.NetworkActivity == NetworkActivity.Attack || me.NetworkActivity == NetworkActivity.Attack2) &&
                        me.NetworkActivity != LastAct)
                    {
                        //exort.UseAbility();
                        //exort.UseAbility();
                        //exort.UseAbility();
                        //Utils.Sleep(me.AttackSpeedValue+2000, "act");
                    }
                    //else if ((me.NetworkActivity == NetworkActivity.Move && me.NetworkActivity != LastAct))
                    else if (me.NetworkActivity == NetworkActivity.Move && me.NetworkActivity != LastAct)
                    {
                        wex.UseAbility();
                        wex.UseAbility();
                        wex.UseAbility();
                    }
                    else if (me.NetworkActivity == NetworkActivity.Idle && me.NetworkActivity != LastAct)
                    {
                        /*quas.UseAbility();
                         * quas.UseAbility();
                         * quas.UseAbility();
                         * Utils.Sleep(150, "act");*/
                    }
                    LastAct = me.NetworkActivity;
                }
            }

            #endregion

            #region Get needed spells

            if (_startInitSpell && Utils.SleepCheck("GettingNeededSpells"))
            {
                _startInitSpell = false;
                SpellStruct s;
                var         spell1  = _spellForCast = Combos[_combo].GetComboAbilities()[0];
                var         spell2  = _spellForCast = Combos[_combo].GetComboAbilities()[1];
                var         active1 = me.Spellbook.Spell4;
                var         active2 = me.Spellbook.Spell5;
                if (Equals(spell1, active1) || Equals(spell1, active2))
                {
                }
                else
                {
                    if (SpellInfo.TryGetValue(spell1.Name, out s))
                    {
                        var invoke = me.FindSpell("invoker_invoke");
                        if (invoke.CanBeCasted())
                        {
                            var spells = s.GetNeededAbilities();
                            if (spells[0] != null)
                            {
                                spells[0].UseAbility();
                            }
                            if (spells[1] != null)
                            {
                                spells[1].UseAbility();
                            }
                            if (spells[2] != null)
                            {
                                spells[2].UseAbility();
                            }
                            invoke.UseAbility();
                            Utils.Sleep(Game.Ping + 25, "GettingNeededSpells");
                        }
                    }
                    else
                    {
                        try
                        {
                            PrintError("couldnt find data for spell: " + _spellForCast.Name);
                        }
                        catch (Exception)
                        {
                            PrintError("couldnt find data for spell: ERROR");
                        }
                    }
                }
                if (Equals(spell2, active1) || Equals(spell2, active2))
                {
                }
                else
                {
                    if (SpellInfo.TryGetValue(spell2.Name, out s))
                    {
                        var invoke = me.FindSpell("invoker_invoke");
                        if (invoke.CanBeCasted())
                        {
                            var spells = s.GetNeededAbilities();
                            if (spells[0] != null)
                            {
                                spells[0].UseAbility();
                            }
                            if (spells[1] != null)
                            {
                                spells[1].UseAbility();
                            }
                            if (spells[2] != null)
                            {
                                spells[2].UseAbility();
                            }
                            invoke.UseAbility();
                            Utils.Sleep(Game.Ping + 25, "GettingNeededSpells");
                        }
                    }
                    else
                    {
                        try
                        {
                            PrintError("couldnt find data for spell: " + _spellForCast.Name);
                        }
                        catch (Exception)
                        {
                            PrintError("couldnt find data for spell: ERROR");
                        }
                    }
                }
            }

            #endregion

            #region Starting Combo

            var target = ClosestToMouse(me);
            if (_inAction && target != null && target.IsAlive)
            {
                ComboInAction(me, target);
            }

            #endregion
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: MikeTeok/EnsageSharp-1
        private static void Game_OnUpdate(EventArgs args)
        {
            #region Init

            var me = ObjectMgr.LocalHero;
            if (!_loaded)
            {
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Invoker)
                {
                    return;
                }
                _loaded = true;
                _combo = 0;

                var q = me.Spellbook.SpellQ;
                var w = me.Spellbook.SpellW;
                var e = me.Spellbook.SpellE;

                var ss = me.FindSpell("invoker_sun_strike");
                var coldsnap = me.FindSpell("invoker_cold_snap");
                var ghostwalk = me.FindSpell("invoker_ghost_walk");
                var icewall = me.FindSpell("invoker_ice_wall");
                var tornado = me.FindSpell("invoker_tornado");
                var deafblast = me.FindSpell("invoker_deafening_blast");
                var forge = me.FindSpell("invoker_forge_spirit");
                var emp = me.FindSpell("invoker_emp");
                var alacrity = me.FindSpell("invoker_alacrity");
                var chaosmeteor = me.FindSpell("invoker_chaos_meteor");

                SpellInfo.Add(ss.Name, new SpellStruct(e, e, e));
                SpellInfo.Add(coldsnap.Name, new SpellStruct(q, q, q));
                SpellInfo.Add(ghostwalk.Name, new SpellStruct(q, q, w));
                SpellInfo.Add(icewall.Name, new SpellStruct(q, q, e));
                SpellInfo.Add(tornado.Name, new SpellStruct(w, w, q));
                SpellInfo.Add(deafblast.Name, new SpellStruct(q, w, e));
                SpellInfo.Add(forge.Name, new SpellStruct(e, e, q));
                SpellInfo.Add(emp.Name, new SpellStruct(w, w, w));
                SpellInfo.Add(alacrity.Name, new SpellStruct(w, w, e));
                SpellInfo.Add(chaosmeteor.Name, new SpellStruct(e, e, w));

                /*
                Spells[Convert.ToInt32(ss.Name)] = new SpellStruct(e, e, e);
                Spells[Convert.ToInt32(coldsnap.Name)] = new SpellStruct( q, q, q);
                Spells[Convert.ToInt32(ghostwalk.Name)] = new SpellStruct( );
                Spells[Convert.ToInt32(icewall.Name)] = new SpellStruct( );
                Spells[Convert.ToInt32(tornado.Name)] = new SpellStruct();
                Spells[Convert.ToInt32(deafblast.Name)] = new SpellStruct();
                Spells[Convert.ToInt32(forge.Name)] = new SpellStruct();
                Spells[Convert.ToInt32(emp.Name)] = new SpellStruct();
                Spells[Convert.ToInt32(alacrity.Name)] = new SpellStruct();
                Spells[Convert.ToInt32(chaosmeteor.Name)] = new SpellStruct(e, e, w);
                 * */
                //Eul->SS->Met->Bla->Cold
                /*
                Tornado > EMP > Meteor > Blast (Requiers Aghanims)
                Tornado > Meteor > Blast
                Tornado > EMP > Blast
                Tornado > EMP > Ica Wall
                 */
                //Combos[0] = new ComboStruct(true, ss, chaosmeteor, deafblast, null, null);
                Combos[0] = new ComboStruct(true, ss, chaosmeteor, deafblast, coldsnap, forge);
                Combos[1] = new ComboStruct(tornado, emp, chaosmeteor, deafblast, coldsnap);
                Combos[2] = new ComboStruct(tornado, chaosmeteor, deafblast, null, null);
                Combos[3] = new ComboStruct(tornado, emp, deafblast, null, null);
                Combos[4] = new ComboStruct(tornado, emp, icewall, null, null);
                Combos[5] = new ComboStruct(tornado, ss, icewall, null, null);
                PrintSuccess(string.Format("> Invorker Loaded v{0}", Ver));
                PrintInfo("===============Combo selection===============");
                PrintInfo(string.Format("Init new combo--> {0}", Combos[0]));
                PrintInfo(string.Format("Init new combo--> {0}", Combos[1]));
                PrintInfo(string.Format("Init new combo--> {0}", Combos[2]));
                PrintInfo(string.Format("Init new combo--> {0}", Combos[3]));
                PrintInfo(string.Format("Init new combo--> {0}", Combos[4]));
                PrintInfo(string.Format("Init new combo--> {0}", Combos[5]));
                PrintInfo("============================================");

            }

            if (!Game.IsInGame || me == null)
            {
                _loaded = false;
                PrintInfo("> Invorker unLoaded");
                return;
            }

            if (Game.IsPaused)
            {
                return;
            }
            //PrintInfo(me.NetworkActivity.ToString());
            if (Utils.SleepCheck("act") && !_inAction && _smartSphere)
            {
                var quas = me.Spellbook.SpellQ;
                var wex = me.Spellbook.SpellW;
                var exort = me.Spellbook.SpellE;
                //if (me.NetworkActivity == NetworkActivity.Attack2 && me.NetworkActivity != LastAct)

                if ((me.NetworkActivity == NetworkActivity.Attack || me.NetworkActivity == NetworkActivity.Attack2) &&
                    me.NetworkActivity != _lastAct)
                {
                    //exort.UseAbility();
                    //exort.UseAbility();
                    //exort.UseAbility();
                    //Utils.Sleep(me.AttackSpeedValue+2000, "act");
                }
                //else if ((me.NetworkActivity == NetworkActivity.Move && me.NetworkActivity != LastAct))
                else if (me.NetworkActivity == NetworkActivity.Move && me.NetworkActivity != _lastAct && !me.IsInvisible())
                {
                    if (wex != null && wex.Level > quas.Level && wex.CanBeCasted())
                    {
                        wex.UseAbility();
                        wex.UseAbility();
                        wex.UseAbility();
                    }
                    else if (quas!=null && quas.CanBeCasted())
                    {
                        quas.UseAbility();
                        quas.UseAbility();
                        quas.UseAbility();
                    }
                }
                else if (me.NetworkActivity == NetworkActivity.Idle && me.NetworkActivity != _lastAct)
                {
                    /*quas.UseAbility();
                quas.UseAbility();
                quas.UseAbility();
                Utils.Sleep(150, "act");*/
                }
                _lastAct = me.NetworkActivity;
            }

            #endregion

            #region Get needed spells

            if (_startInitSpell && Utils.SleepCheck("GettingNeededSpells"))
            {
                _startInitSpell = false;
                SpellStruct s;
                var spell1 = _spellForCast = Combos[_combo].GetComboAbilities()[0];
                var spell2 = _spellForCast = Combos[_combo].GetComboAbilities()[1];
                var active1 = me.Spellbook.Spell4;
                var active2 = me.Spellbook.Spell5;
                if (Equals(spell1, active1) || Equals(spell1, active2))
                {

                }
                else
                {
                    if (SpellInfo.TryGetValue(spell1.Name, out s))
                    {
                        var invoke = me.FindSpell("invoker_invoke");
                        if (invoke.CanBeCasted())
                        {
                            var spells = s.GetNeededAbilities();
                            if (spells[0] != null) spells[0].UseAbility();
                            if (spells[1] != null) spells[1].UseAbility();
                            if (spells[2] != null) spells[2].UseAbility();
                            invoke.UseAbility();
                            Utils.Sleep(Game.Ping + 25, "GettingNeededSpells");
                        }
                    }
                    else
                        try
                        {
                            PrintError("couldnt find data for spell: " + _spellForCast.Name);
                        }
                        catch (Exception)
                        {
                            PrintError("couldnt find data for spell: ERROR");
                        }
                }
                if (Equals(spell2, active1) || Equals(spell2, active2))
                {

                }
                else
                {
                    if (SpellInfo.TryGetValue(spell2.Name, out s))
                    {
                        var invoke = me.FindSpell("invoker_invoke");
                        if (invoke.CanBeCasted())
                        {
                            var spells = s.GetNeededAbilities();
                            if (spells[0] != null) spells[0].UseAbility();
                            if (spells[1] != null) spells[1].UseAbility();
                            if (spells[2] != null) spells[2].UseAbility();
                            invoke.UseAbility();
                            Utils.Sleep(Game.Ping + 25, "GettingNeededSpells");
                        }
                    }
                    else
                        try
                        {
                            PrintError("couldnt find data for spell: " + _spellForCast.Name);
                        }
                        catch (Exception)
                        {
                            PrintError("couldnt find data for spell: ERROR");
                        }
                }
            }

            #endregion

            #region Starting Combo

            var target = ClosestToMouse(me);
            if (_inAction && target != null && target.IsAlive)
                ComboInAction(me, target);

            #endregion
        }
コード例 #5
0
        private static void Game_OnUpdate(EventArgs args)
        {
            #region Init

            var me = ObjectMgr.LocalHero;
            if (!_loaded)
            {
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Invoker)
                {
                    return;
                }
                _loaded = true;
                _combo = 0;

                var q = me.Spellbook.SpellQ;
                var w = me.Spellbook.SpellW;
                var e = me.Spellbook.SpellE;

                var ss = me.FindSpell("invoker_sun_strike");
                var coldsnap = me.FindSpell("invoker_cold_snap");
                var ghostwalk = me.FindSpell("invoker_ghost_walk");
                var icewall = me.FindSpell("invoker_ice_wall");
                var tornado = me.FindSpell("invoker_tornado");
                var blast = me.FindSpell("invoker_deafening_blast");
                var forge = me.FindSpell("invoker_forge_spirit");
                var emp = me.FindSpell("invoker_emp");
                var alacrity = me.FindSpell("invoker_alacrity");
                var meteor = me.FindSpell("invoker_chaos_meteor");

                SpellInfo.Add(ss.Name, new SpellStruct(e, e, e));
                SpellInfo.Add(coldsnap.Name, new SpellStruct(q, q, q));
                SpellInfo.Add(ghostwalk.Name, new SpellStruct(q, q, w));
                SpellInfo.Add(icewall.Name, new SpellStruct(q, q, e));
                SpellInfo.Add(tornado.Name, new SpellStruct(w, w, q));
                SpellInfo.Add(blast.Name, new SpellStruct(q, w, e));
                SpellInfo.Add(forge.Name, new SpellStruct(e, e, q));
                SpellInfo.Add(emp.Name, new SpellStruct(w, w, w));
                SpellInfo.Add(alacrity.Name, new SpellStruct(w, w, e));
                SpellInfo.Add(meteor.Name, new SpellStruct(e, e, w));

                Combos[0] = new ComboStruct(true, ss, meteor, blast, coldsnap, forge);
                Combos[1] = new ComboStruct(tornado, emp, meteor, blast, coldsnap);
                Combos[2] = new ComboStruct(tornado, meteor, blast, null, null);
                Combos[3] = new ComboStruct(tornado, emp, blast, null, null);
                Combos[4] = new ComboStruct(tornado, emp, icewall, null, null);
                Combos[5] = new ComboStruct(tornado, ss, icewall, null, null);

                PrintSuccess(string.Format("> Invorker Loaded v{0}", Ver));
                PrintInfo("===============Combo selection===============");
                for (var i = 0; i <= 5; i++)
                    PrintInfo(string.Format("Init new combo--> {0}", Combos[i]));
                PrintInfo("============================================");

            }

            if (!Game.IsInGame || me == null)
            {
                _loaded = false;
                PrintInfo("> Invorker unLoaded");
                return;
            }

            if (Game.IsPaused)
            {
                return;
            }
            //PrintInfo(me.NetworkActivity.ToString());
            if (Utils.SleepCheck("act") && !_inAction && _smartSphere)
            {
                var quas = me.Spellbook.SpellQ;
                var wex = me.Spellbook.SpellW;
                //if (me.NetworkActivity == NetworkActivity.Attack2 && me.NetworkActivity != LastAct)

                if ((me.NetworkActivity == NetworkActivity.Attack || me.NetworkActivity == NetworkActivity.Attack2) &&
                    me.NetworkActivity != _lastAct)
                {
                    //exort.UseAbility();
                    //exort.UseAbility();
                    //exort.UseAbility();
                    //Utils.Sleep(me.AttackSpeedValue+2000, "act");
                }
                //else if ((me.NetworkActivity == NetworkActivity.Move && me.NetworkActivity != LastAct))
                else if (me.NetworkActivity == NetworkActivity.Move && me.NetworkActivity != _lastAct && !me.IsInvisible())
                {
                    if (wex != null && wex.Level > quas.Level && wex.CanBeCasted())
                    {
                        wex.UseAbility();
                        wex.UseAbility();
                        wex.UseAbility();
                    }
                    else if (quas!=null && quas.CanBeCasted())
                    {
                        quas.UseAbility();
                        quas.UseAbility();
                        quas.UseAbility();
                    }
                }
                else if (me.NetworkActivity == NetworkActivity.Idle && me.NetworkActivity != _lastAct)
                {
                    /*quas.UseAbility();
                quas.UseAbility();
                quas.UseAbility();
                Utils.Sleep(150, "act");*/
                }
                _lastAct = me.NetworkActivity;
            }

            #endregion

            #region Get needed spells

            if (_startInitSpell && Utils.SleepCheck("GettingNeededSpells"))
            {
                _startInitSpell = false;
                InvokeNeededSpells(me);
            }

            #endregion

            #region Starting Combo

            var target = ClosestToMouse(me);
            if (_inAction && target != null && target.IsAlive)
                ComboInAction(me, target);

            #endregion
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: JumpAttacker/EnsageSharp
        private static void Main()
        {
            Events.OnLoad += (sender, args) =>
            {
                _myHero = ObjectManager.LocalHero;
                if (_myHero.ClassID != ClassID.CDOTA_Unit_Hero_Invoker)
                {
                    return;
                }
                MyPlayer = ObjectManager.LocalPlayer;
                _stage = 0;
                _combo = 0;
                var spells = _myHero.Spellbook;

                var q = spells.SpellQ;
                var w = spells.SpellW;
                var e = spells.SpellE;

                var ss = Abilities.FindAbility("invoker_sun_strike");
                var coldsnap = Abilities.FindAbility("invoker_cold_snap");
                var ghostwalk = Abilities.FindAbility("invoker_ghost_walk");
                var icewall = Abilities.FindAbility("invoker_ice_wall");
                var tornado = Abilities.FindAbility("invoker_tornado");
                var blast = Abilities.FindAbility("invoker_deafening_blast");

                var forgeSpirit = spells.Spells.FirstOrDefault(x=>x.Name=="invoker_forge_spirit");
                if (forgeSpirit == null)
                {
                    Print("oops, something went wrong. Please reload the script.");
                    return;
                }
                var emp = Abilities.FindAbility("invoker_emp");
                var alacrity = Abilities.FindAbility("invoker_alacrity");
                var meteor = Abilities.FindAbility("invoker_chaos_meteor");

                var list = new List<string>()
                {
                    ss.StoredName(),
                    coldsnap.StoredName(),
                    ghostwalk.StoredName(),
                    icewall.StoredName(),
                    tornado.StoredName(),
                    blast.StoredName(),
                    forgeSpirit.StoredName(),
                    emp.StoredName(),
                    alacrity.StoredName(),
                    meteor.StoredName()
                };
                var dict = new Dictionary<string, bool>
                {
                    { list[0],false},
                    { list[1],false},
                    { list[2],false},
                    { list[3],false},
                    { list[4],false},
                    { list[5],false},
                    { list[6],true},
                    { list[7],false},
                    { list[8],true},
                    { list[9],false},
                };
                Menu.Item("quickCast.Abilities").SetValue(new PriorityChanger(list,new AbilityToggler(dict),"kek"));
                SpellInfo.Add("nothing", new SpellStruct());
                SpellInfo.Add(ss.Name, new SpellStruct(e, e, e));
                SpellInfo.Add(coldsnap.Name, new SpellStruct(q, q, q));
                SpellInfo.Add(ghostwalk.Name, new SpellStruct(q, q, w));
                SpellInfo.Add(icewall.Name, new SpellStruct(q, q, e));
                SpellInfo.Add(tornado.Name, new SpellStruct(w, w, q));
                SpellInfo.Add(blast.Name, new SpellStruct(q, w, e));
                SpellInfo.Add(forgeSpirit.Name, new SpellStruct(e, e, q));
                SpellInfo.Add(emp.Name, new SpellStruct(w, w, w));
                SpellInfo.Add(alacrity.Name, new SpellStruct(w, w, e));
                SpellInfo.Add(meteor.Name, new SpellStruct(e, e, w));

                Combos[_maxCombo] = new ComboStruct(new[] {ss, meteor, blast, coldsnap, forgeSpirit}, 5, true);
                Combos[_maxCombo] =
                    new ComboStruct(new[] {tornado, ss, meteor, blast, tornado, coldsnap, alacrity, forgeSpirit},5);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, ss, meteor, blast, tornado, coldsnap},5);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, meteor, blast, coldsnap},5);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, meteor, blast},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, blast},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, icewall},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, ss, icewall},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, blast, coldsnap},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, coldsnap},3);
                Combos[_maxCombo] = new ComboStruct(new[] {coldsnap, alacrity, forgeSpirit},3);
                Combos[_maxCombo] = new ComboStruct(new[] {tornado, emp, meteor,blast,ss,icewall},5);
                Combos[_maxCombo] = new ComboStruct(new[] {ss, ss, ss, ss, ss, ss, ss, ss}, 3, false, true);

                Game.PrintMessage(
                    "<font face='Comic Sans MS, cursive'><font color='#00aaff'>" + Menu.DisplayName + " By Jumpering" +
                    " loaded!</font> <font color='#aa0000'>v"  + Ver, MessageType.LogMessage);
                PrintSuccess(string.Format("> {1} Loaded v{0}", Ver, Menu.DisplayName));

                Game.OnUpdate += Game_OnUpdate;
                Drawing.OnDraw += Drawing_OnDraw;
                Game.OnWndProc += Game_OnWndProc;
                Player.OnExecuteOrder += Player_OnExecuteAction;
                Orbwalking.Load();
            };
            Events.OnClose += (sender, args) =>
            {
                Game.OnUpdate -= Game_OnUpdate;
                Drawing.OnDraw -= Drawing_OnDraw;
                Game.OnWndProc -= Game_OnWndProc;
                Player.OnExecuteOrder -= Player_OnExecuteAction;
                SpellInfo.Clear();
                _maxCombo = 0;
                PrintSuccess(string.Format("> {1} Unloaded v{0}", Ver, Menu.DisplayName));
            };

            Menu.AddItem(new MenuItem("Hotkey", "Combo Key").SetValue(new KeyBind('G', KeyBindType.Press)));
            Menu.AddItem(
                new MenuItem("Hotkey.Ghost", " Quick cast ghost walk").SetValue(new KeyBind('H', KeyBindType.Press)));
            var sunStrikeSettings=new Menu("Sun Strike Settings","ssSettings",false,"invoker_sun_strike",true);

            /*sunStrikeSettings.AddItem(
                new MenuItem("hotkey", "Hotkey").SetValue(new KeyBind('T', KeyBindType.Press))
                    .SetTooltip("press hotkey for auto SunStrike"));
            sunStrikeSettings.AddItem(new MenuItem("ssShift", "Use Shift With Hotkey").SetValue(true));*/

            sunStrikeSettings.AddItem(new MenuItem("autoSs.Enable", "Enable auto ss [ctrl+T]").SetValue(false));
            sunStrikeSettings.AddItem(new MenuItem("ssDamageontop", "Show Damage on Top Panel").SetValue(false));
            sunStrikeSettings.AddItem(new MenuItem("ssDamageonhero", "Show Damage on Hero").SetValue(false));
            sunStrikeSettings.AddItem(new MenuItem("ssPrediction", "Show Prediction").SetValue(false));
            var ssonstun=new Menu("Sun Strike on stunned Enemy","ssSettingsOnStun");
            ssonstun.AddItem(new MenuItem("ssAutoInStunned", "Use SunStike on stun").SetValue(true));
            ssonstun.AddItem(new MenuItem("ssAutoInStunned.UseSelectedRange", "Use selected range for auto SunStike").SetValue(false));
            ssonstun.AddItem(new MenuItem("ssAutoInStunned.Range", "Range for auto SunStike").SetValue(new Slider(2500,0,10000)));
            ssonstun.AddItem(new MenuItem("ssAutoInStunned.CheckForAnyEnemyInRange", "Dont use SunStike if SunStike cant deal full damage").SetValue(true));
            ssonstun.AddItem(new MenuItem("ssAutoInStunned.KillSteal", "Use SunStike Only for Steal").SetValue(false));
            ssonstun.AddItem(new MenuItem("ssAutoInStunned.FindBestPosition", "Find Best Position for SunStike").SetValue(true).SetTooltip("can eat ur fps"));
            ssonstun.AddItem(new MenuItem("ssAutoInStunned.Accuracy", "Accuracy for finding best position for SunStike").SetValue(new Slider(5,1,50)));

            var combo = new Menu("Combos", "combos");
            combo.AddItem(
                new MenuItem("hotkeyPrev", "Previous Combo").SetValue(new KeyBind(0x6B, KeyBindType.Press))
                    .SetTooltip("default hotkey is numpad [+]"));
            combo.AddItem(
                new MenuItem("hotkeyNext", "Next Combo").SetValue(new KeyBind(0x6D, KeyBindType.Press))
                    .SetTooltip("default hotkey is numpad [-]"));
            combo.AddItem(new MenuItem("ShowComboMenu", "Show Combo Menu").SetValue(true));
            combo.AddItem(new MenuItem("ComboSwitcher", "Auto Switch combo").SetValue(false));
            //combo.AddItem(new MenuItem("ShowCurrentCombo", "Show Current Combo").SetValue(true));

            var showComboMenuPos = new Menu("Combo menu position", "ShowComboMenuPos");
            showComboMenuPos.AddItem(
                new MenuItem("MenuPosX", "Pos X").SetValue(new Slider(100, 0, 3000)));
            showComboMenuPos.AddItem(
                new MenuItem("MenuPosY", "Pos Y").SetValue(new Slider(100, 0, 3000)));

            /*var showCurrentCombo = new Menu("Current Combo position", "showCurrentCombo");
            showCurrentCombo.AddItem(
                new MenuItem("MenuPosX", "Extra Pos X").SetValue(new Slider(0, -2500, 2500)));
            showCurrentCombo.AddItem(
                new MenuItem("MenuPosY", "Extra Pos Y").SetValue(new Slider(0, -2500, 2500)));
            */
            var smart = new Menu("Smart Sphere", "Smart");

            /*var onmov = new Dictionary<string, bool>()
            {
                {"invoker_exort",false},
                {"invoker_wex",false},
                {"invoker_quas",true}
            };
            var onatt = new Dictionary<string, bool>()
            {
                {"invoker_exort",false},
                {"invoker_wex",false},
                {"invoker_quas",true}
            };*/
            smart.AddItem(new MenuItem("smartIsActive", "Is Active").SetValue(true));
            smart.AddItem(new MenuItem("OnMoving", "On moving").SetValue(new StringList(new[] {"quas", "wex"})));
            smart.AddItem(
                new MenuItem("OnAttacking", "On attacking").SetValue(new StringList(new[] {"quas", "wex", "exort"}, 2)));

            //om.ValueChanged += OnMoveChange;
            //ot.ValueChanged += OnAttackChange;

            var items = new Dictionary<string, bool>()
            {
                {"item_blink",true},
                {"item_refresher",true},
                {"item_orchid",true},
                {"item_sheepstick",true},
                {"item_bloodthorn",true},
                {"item_urn_of_shadows",true}
            };
            var settings = new Menu("Settings", "Settings");
            settings.AddItem(new MenuItem("items", "Items:").SetValue(new AbilityToggler(items)));
            //settings.AddItem(new MenuItem("moving", "Move To Enemy").SetValue(false).SetTooltip("while combing"));

            var aInvis = new Menu("Auto Invis", "Auto Invis");
            aInvis.AddItem(new MenuItem("AutoInvis", "Enable").SetValue(false));
            aInvis.AddItem(new MenuItem("AutoInvis_enemy_check", "Check for any enemy in range").SetValue(true).SetTooltip("in 1000 range"));
            aInvis.AddItem(new MenuItem("MinHealth_for_invis", "Min Health").SetValue(new Slider(15,0,100)));

            var quickCast = new Menu("Quick Cast", "quickCast");
            quickCast.AddItem(
                new MenuItem("quickCast.Key", "Key").SetValue(new KeyBind(0, KeyBindType.Press)));
            quickCast.AddItem(new MenuItem("quickCast.Abilities", "Abilities:").SetValue(new PriorityChanger()));
            quickCast.AddItem(new MenuItem("quickCast.UseAlacrityOnlyOnForge", "Use alacrity only on forge spirit").SetValue(false));

            var orbmenu = new Menu("Orbwalking", "Orbwalking");
            orbmenu.AddItem(new MenuItem("orbwalk.Enable", "Enable Orbwalking").SetValue(true).SetTooltip("or just auto attacking"));
            orbmenu.AddItem(new MenuItem("orbwalk.minDistance", "Min distance").SetValue(new Slider(100, 0, 700)));
            orbmenu.AddItem(new MenuItem("orbwalkType", "OrbWalking: chase enemy").SetValue(true).SetTooltip("or your mouse"));
            combo.AddSubMenu(showComboMenuPos);
            //combo.AddSubMenu(showCurrentCombo);
            Menu.AddSubMenu(settings);
            settings.AddSubMenu(orbmenu);
            Menu.AddSubMenu(quickCast);
            Menu.AddSubMenu(aInvis);
            Menu.AddSubMenu(smart);
            Menu.AddSubMenu(sunStrikeSettings);
            sunStrikeSettings.AddSubMenu(ssonstun);
            Menu.AddSubMenu(combo);
            Menu.AddToMainMenu();
        }