private static void SearchNewPlayers(Hero me) { for (uint i = 0; i < 10; i++) { try { var v = ObjectMgr.GetPlayerById(i).Hero; if (v == null) { continue; } if (!v.IsValid) { continue; } if (v.Team == me.Team) { continue; } PlayersDictionary.Add(i, v); } catch { // ignored } } }
private static void SelectedHeroTopEnemy(int Index, float Base, int Offset = 0) { if (Variables.EnemyTracker[Index - Offset].EnemyTracker != null) { int BaseX = (int)Base + ((int)Variables.HeroIconWidth * (Index - Offset)); int BaseY = (int)Variables.ToolTipActivationY + 10; int counter = 1; Color itemColor = Color.Green; var Player = ObjectMgr.GetPlayerById((uint)Index); Drawing.DrawText(GlobalClasses.GetHeroNameFromLongHeroName(Player.Hero.Name), new Vector2(BaseX, BaseY), Color.Red, FontFlags.AntiAlias | FontFlags.Outline); foreach (var p in Variables.EnemyTracker) { if (p != null) { if (p.EnemyTracker.Player.Name == Player.Name) { foreach (var item in p.EnemyTracker.Inventory.Items) { itemColor = GlobalClasses.GetCostColor(item); Drawing.DrawText(item.Name.Remove(0, 5), new Vector2(BaseX, BaseY + (counter * 12)), itemColor, FontFlags.AntiAlias | FontFlags.Outline); counter++; itemColor = Color.Green; } } } } } }
private static void Drawing_OnEndScene(EventArgs args) { if (!menuadded) { return; } if (Drawing.Direct3DDevice9 == null || Drawing.Direct3DDevice9.IsDisposed || !Game.IsInGame) { return; } var player = ObjectMgr.LocalPlayer; if (player == null || player.Team == Team.Observer) { return; } if (startw == 0) { _screenSize = new Vector2(Drawing.Width, Drawing.Height); startw = 520f / 1920f * _screenSize.X; spacew = (208f / 1920f) * _screenSize.X; herow = (66f / 1920f) * _screenSize.X; } if (Menu.Item("cs").GetValue <bool>() || Menu.Item("bb").GetValue <bool>()) { for (uint i = 0; i < 10; i++) { Player p = null; try { p = ObjectMgr.GetPlayerById(i); } catch { } if (p == null) { continue; } var initPos = (int)(i >= 5 ? (startw + herow * i) + spacew : (startw + herow * i)); if (Menu.Item("cs").GetValue <bool>()) { var text = string.Format("{0}/{1}", p.LastHitCount, p.DenyCount); DrawShadowText(text, initPos + 10, 35 + 1 - 7 * 5, Color.White, _text); } if (Menu.Item("bb").GetValue <bool>() && p.BuybackCooldownTime > 0) { var text = string.Format("{0:0.}", p.BuybackCooldownTime); DrawFilledBox(initPos + 2, 35 + 1 - 7 * 5 + 22, 35, 15, new Color(0, 0, 0, 150)); DrawShadowText(text, initPos + 5, 35 + 1 - 7 * 5 + 22, Color.White, _text); } } } }
public static void Game_OnUpdate(EventArgs args) { if (loaded) { Game.PrintMessage( "<font face='Tahoma'><font color='#000000'>[--</font> <font color='#33ff66'>MapHack Fixed</font> by <font color='#999999'>NaVi_Slon </font> ensage-forum.ru <font color='#000000'>--]</font></font>", MessageType.LogMessage); loaded = false; } //we only proceed if 1 of the following condition is True //+ Forced refresh hotkey is Active and slept for 50ms //+ Repeat hotkey is Active and SleepCheck is off CD //+ Auto Reload is ON and SleepCheck is off CD if (!((Menu.Item("refresh_hotkey2").GetValue <KeyBind>().Active&& Utils.SleepCheck("GCMH_GameUpdateMinSleeper")) || ((Menu.Item("repeat_hotkey2").GetValue <KeyBind>().Active || Menu.Item("auto_reload").GetValue <bool>()) && Utils.SleepCheck("GCMH_GameUpdateSleeper")))) { return; } //minimap temp fix _minimapHeight = (int)Math.Floor(260.0 * Drawing.Height / 1080); _minimapWidth = (int)Math.Floor(270.0 * Drawing.Height / 1080); _minimapCorner = (int)Math.Floor(11.0 * Drawing.Height / 1080); //backup camera position Game.GetConsoleVar("sv_cheats").SetValue(1); Game.ExecuteCommand("cl_fullupdate"); // string z = Game.GetConsoleVar("dota_camera_get_lookatpos ").GetString(); // Game.ExecuteCommand("dota_camera_set_lookatpos" + z ); //get the game state var me = ObjectMgr.LocalPlayer; _nHeroes = 0; for (uint i = 0; i < 40; ++i) { var player = ObjectMgr.GetPlayerById(i); if (player == null || player.Team == me.Team) { continue; } int playerColor = (player.Team == Team.Radiant ? 0 : 1) * 5 + (int)player.TeamSlot; playerColor = playerColor < 0 ? 11 : playerColor > 10 ? 11 : playerColor; HeroesPlayerPosition[_nHeroes] = playerColor; Heroes[_nHeroes++] = player.Hero; } //sleepers Utils.Sleep(Menu.Item("refresh_rate").GetValue <Slider>().Value, "GCMH_GameUpdateSleeper"); Utils.Sleep(50, "GCMH_GameUpdateMinSleeper"); //sleep at least 50 tick }
private static void Render_HUD(EventArgs args) { for (uint i = 0; i < 10; i++) { var player = ObjectMgr.GetPlayerById(i); if (player == null) { continue; } Hero h = player.Hero; if (h == null) { continue; } var Pos = HUDInfo.GetTopPanelPosition(h); var PosX = (float)HUDInfo.GetTopPanelSizeX(h); var PosY = (float)HUDInfo.GetTopPanelSizeY(h); var PosHealth = new Vector2(h.Health * PosX / h.MaximumHealth, 0); var PosMana = new Vector2(h.Mana * PosX / h.MaximumMana, 0); float BPos = PosY + 1; if (h.Health == 0) { continue; } if (h.Mana == 0) { continue; } //uint HPX = h.Health * 100 / h.MaximumHealth; //string buff = Convert.ToString(HPX); if (Menu.Item("HPBarShow").GetValue <bool>()) { Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosX, 7), new Color(0, 0, 0, 100)); Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosHealth.X, 7), new Color(0, 255, 0, 255)); Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosX, 7), Color.Black, true); BPos += 7; } if (Menu.Item("ManaBarShow").GetValue <bool>()) { Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosX, 7), new Color(0, 0, 0, 100)); Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosMana.X, 7), new Color(0, 122, 204, 255)); Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosX, 7), Color.Black, true); } // Ebala... //Drawing.DrawText(string.Format("({0}% | 999%)", buff), "Arial", Pos + new Vector2(0, PosY + 18), new Vector2(13, 5), Color.White, 0); } }
private static void Overlay1(EventArgs args) { if (!Game.IsInGame) { return; } if (Menu.Item("manabar").GetValue <bool>()) { var player = ObjectMgr.LocalPlayer; if (player == null || player.Team == Team.Observer) { return; } var enemies = ObjectMgr.GetEntities <Hero>() .Where(x => x.IsVisible && x.IsAlive && x.MaximumMana > 0 && !x.IsIllusion && x.Team != player.Team) .ToList(); foreach (var enemy in enemies) { var start = HUDInfo.GetHPbarPosition(enemy) + new Vector2(0, HUDInfo.GetHpBarSizeY(enemy) + 1); var manaperc = enemy.Mana / enemy.MaximumMana; var size = new Vector2(HUDInfo.GetHPBarSizeX(enemy), HUDInfo.GetHpBarSizeY(enemy) * 2 / 5); Drawing.DrawRect(start, size + new Vector2(1, 1), Color.Black); Drawing.DrawRect(start, new Vector2(size.X * manaperc, size.Y), new Color(100, 135, 240, 255)); Drawing.DrawRect(start + new Vector2(-1, -2), size + new Vector2(4, 3), Color.Black, true); } } if (Menu.Item("toppanel").GetValue <bool>()) { for (uint i = 0; i < 10; i++) { var v = ObjectMgr.GetPlayerById(i).Hero; if (v == null || !v.IsAlive) { continue; } var pos = HUDInfo.GetTopPanelPosition(v); var sizeX = (float)HUDInfo.GetTopPanelSizeX(v); var sizeY = (float)HUDInfo.GetTopPanelSizeY(v); var healthDelta = new Vector2(v.Health * sizeX / v.MaximumHealth, 0); var manaDelta = new Vector2(v.Mana * sizeX / v.MaximumMana, 0); const int height = 7; Drawing.DrawRect(pos + new Vector2(0, sizeY + 1), new Vector2(healthDelta.X, height), new Color(0, 255, 0, 100)); Drawing.DrawRect(pos + new Vector2(0, sizeY + 1), new Vector2(sizeX, height), Color.Black, true); Drawing.DrawRect(pos + new Vector2(0, sizeY + height), new Vector2(manaDelta.X, height), new Color(80, 120, 255, 255)); Drawing.DrawRect(pos + new Vector2(0, sizeY + height), new Vector2(sizeX, height), Color.Black, true); } } }
private static void SelectedHeroTopFriendly(int Index, float Base, int Offset = 0) { string PlayerName = GlobalClasses.GetHeroNameFromLongHeroName(ObjectMgr.GetPlayerById((uint)Index).Hero.Name); int counter = 1; int BaseX = (int)Base + ((int)Variables.HeroIconWidth * (Index)); int BaseY = (int)Variables.ToolTipActivationY + 10; Color itemColor = Color.Green; Drawing.DrawText(PlayerName, new Vector2(BaseX, BaseY), Color.Red, FontFlags.AntiAlias | FontFlags.Outline); var p = ObjectMgr.GetPlayerById((uint)Index); foreach (var item in p.Hero.Inventory.Items) { itemColor = GlobalClasses.GetCostColor(item); Drawing.DrawText(item.Name.Remove(0, 5), new Vector2(BaseX, BaseY + (counter * 12)), itemColor, FontFlags.AntiAlias | FontFlags.Outline); counter++; itemColor = Color.Green; } }
public static void Game_OnUpdate(EventArgs args) { //we only proceed if 1 of the following condition is True //+ Forced refresh hotkey is Active and slept for 50ms //+ Repeat hotkey is Active and SleepCheck is off CD //+ Auto Reload is ON and SleepCheck is off CD if (!((Menu.Item("refresh_hotkey2").GetValue <KeyBind>().Active&& Utils.SleepCheck("GCMH_GameUpdateMinSleeper")) || ((Menu.Item("repeat_hotkey2").GetValue <KeyBind>().Active || Menu.Item("auto_reload").GetValue <bool>()) && Utils.SleepCheck("GCMH_GameUpdateSleeper")))) { return; } //minimap temp fix _minimapHeight = (int)Math.Floor(260.0 * Drawing.Height / 1080); _minimapWidth = (int)Math.Floor(270.0 * Drawing.Height / 1080); _minimapCorner = (int)Math.Floor(11.0 * Drawing.Height / 1080); //backup camera position Game.ExecuteCommand("cl_fullupdate"); //get the game state var me = ObjectMgr.LocalPlayer; _nHeroes = 0; for (uint i = 0; i < 40; ++i) { var player = ObjectMgr.GetPlayerById(i); if (player == null || player.Team == me.Team) { continue; } int playerColor = (player.Team == Team.Radiant ? 0 : 1) * 5 + (int)player.TeamSlot; playerColor = playerColor < 0 ? 11 : playerColor > 10 ? 11 : playerColor; HeroesPlayerPosition[_nHeroes] = playerColor; Heroes[_nHeroes++] = player.Hero; } //sleepers Utils.Sleep(Menu.Item("refresh_rate").GetValue <Slider>().Value, "GCMH_GameUpdateSleeper"); Utils.Sleep(50, "GCMH_GameUpdateMinSleeper"); //sleep at least 50 tick }
private static void Game_OnUpdate(EventArgs args) { if (!Utils.SleepCheck(Spellpanel)) { return; } _heroes = new Hero[0]; var me = ObjectMgr.LocalHero; if (!_loaded) { me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null) { return; } _loaded = true; PrintSuccess("> OverlayInformation > SpellPanel loaded! v" + Ver); } if (!Game.IsInGame || me == null) { _loaded = false; PrintInfo("> OverlayInformation > SpellPanel unLoaded"); return; } if (!Game.IsInGame || !_loaded) { return; } _heroes = Enumerable.Range(0, 10) .Select(i => ObjectMgr.GetPlayerById((uint)i).Hero) .Where(v => !Equals(v, me)) .ToArray(); Utils.Sleep(200, Spellpanel); }
private static void Game_OnUpdate(EventArgs args) { if (!_loaded) { _me = ObjectMgr.LocalHero; _player = ObjectMgr.LocalPlayer; if (!Game.IsInGame || _me == null || _me.ClassID != ClassID.CDOTA_Unit_Hero_Techies) { return; } _loaded = true; PrintSuccess("> Techies Annihilation loaded! v 1.4"); } if (!Game.IsInGame || _me == null || _me.ClassID != ClassID.CDOTA_Unit_Hero_Techies) { _loaded = false; PrintInfo("> Techies Annihilation Unloaded!"); PrintSuccess("Stats: "); PrintSuccess(string.Format("Error N {0}: {1}", 1, ErrorLevel[1].ToString())); PrintSuccess(string.Format("Error N {0}: {1}", 2, ErrorLevel[2].ToString())); PrintSuccess(string.Format("Error N {0}: {1}", 3, ErrorLevel[3].ToString())); PrintSuccess(string.Format("Error N {0}: {1}", 4, ErrorLevel[4].ToString())); PrintSuccess(string.Format("Error N {0}(2): {1}", 4, ErrorLevel[7].ToString())); PrintSuccess(string.Format("Error N {0}: {1}", 5, ErrorLevel[5].ToString())); PrintSuccess(string.Format("Error N {0}: {1}", 6, ErrorLevel[6].ToString())); return; } if (Game.IsPaused) { return; } try { if (_player == null || _player.Team == Team.Observer) { return; } #region UpdateInfo var ultimate = _me.Spellbook.Spell6; var suic = _me.Spellbook.Spell3; var bombLevel = (ultimate != null) ? ultimate.Level : 0; var suicideLevel = (suic != null) ? suic.Level : 0; if (LvlSpell3 != suicideLevel) { Debug.Assert(suic != null, "suic != null"); var firstOrDefault = suic.AbilityData.FirstOrDefault(x => x.Name == "damage"); if (firstOrDefault != null) { _currentSuicDamage = firstOrDefault.GetValue(suicideLevel - 1); //PrintError("_currentSuicDamage: " + _currentSuicDamage.ToString(CultureInfo.InvariantCulture)); } LvlSpell3 = suicideLevel; } var agh = _me.FindItem("item_ultimate_scepter"); if (LvlSpell6 != bombLevel || !Equals(_aghStatus, agh)) { Debug.Assert(ultimate != null, "ultimate != null"); var firstOrDefault = ultimate.AbilityData.FirstOrDefault(x => x.Name == "damage"); if (firstOrDefault != null) { _currentBombDamage = firstOrDefault.GetValue(ultimate.Level - 1); _currentBombDamage += agh != null ? 150 : 0; //PrintError("_currentBombDamage: " + _currentBombDamage.ToString(CultureInfo.InvariantCulture)); } LvlSpell6 = bombLevel; _aghStatus = agh; } #endregion var bombs = ObjectMgr.GetEntities <Unit>() .Where( x => x.ClassID == ClassID.CDOTA_NPC_TechiesMines && x.Team == _player.Team); var bombsList = bombs as IList <Unit> ?? bombs.ToList(); var enumerable = bombs as IList <Unit> ?? bombsList.ToList(); //PrintError(Game.IsKeyDown(Key.RightCtrl).ToString()); #region ForceStaffRange if ((Game.IsKeyDown(0x11) || AutoForceStaff) && ShowForceStaffRange) { if (_forceStaffRange == null) { _forceStaffRange = _me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); _forceStaffRange.SetControlPoint(1, new Vector3(800, 0, 0)); } } else { if (_forceStaffRange != null) { _forceStaffRange.Dispose(); _forceStaffRange = null; } } #endregion foreach (var s in enumerable) { //add effect HandleEffect(s, s.Spellbook.Spell1 != null); //Init bomb damage if (!s.Spellbook.Spell1.CanBeCasted()) { continue; } float dmg; if (!BombDamage.TryGetValue(s, out dmg)) { //PrintError("_currentBombDamage: "+_currentBombDamage.ToString()); BombDamage.Add(s, _currentBombDamage); } } var enemies = ObjectMgr.GetEntities <Hero>() .Where( x => x.Team != ObjectMgr.LocalPlayer.Team && !x.IsIllusion) .ToList(); var abilSuic = _me.Spellbook.Spell3; var forcestaff = _me.Inventory.Items.FirstOrDefault(x => x.ClassID == ClassID.CDOTA_Item_ForceStaff); for (uint i = 0; i < 10; i++) { try { var v = ObjectMgr.GetPlayerById(i).Hero; if (v == null || v.Team == _me.Team || Equals(v, _me)) { continue; } if (!AutoDetonate) { continue; } if (!DetonateOnAegisAndWk) { var aegis = v.FindItem("item_aegis"); if (v.ClassID == ClassID.CDOTA_Unit_Hero_SkeletonKing) { var reinc = v.Spellbook.Spell4; if (reinc != null && (int)reinc.Cooldown == 0) { continue; } } if (aegis != null) { continue; } } var needToCastnew = new Dictionary <int, Ability>(); var inputDmg = 0f; if (GlobalHealthAfterMines.ContainsKey(v)) { GlobalHealthAfterMines.Remove(v); } var extraBombs = 0; if (v.ClassID == ClassID.CDOTA_Unit_Hero_TemplarAssassin) { var refrection = v.Spellbook.Spell1; if (refrection != null && refrection.Cooldown > 0) { extraBombs = (int)(2 + refrection.Level); //PrintError("its templar: +" + extraBombs); } } foreach (var b in bombsList) { float dmg; if (!(v.Distance2D(b) <= 425) || !BombDamage.TryGetValue(b, out dmg) || !v.IsAlive || !b.Spellbook.Spell1.CanBeCasted() || !b.IsAlive) { continue; } try { if (extraBombs > 0) { extraBombs--; } else { inputDmg += v.DamageTaken(dmg, DamageType.Magical, _me, false); } } catch { //PrintError("ErrorLevel 2"); ErrorLevel[2]++; } needToCastnew.Add(needToCastnew.Count + 1, b.Spellbook.Spell1); //PrintError("NEED: "+needToCastnew.Count); var finalHealth = v.Health - inputDmg; //PrintError(string.Format("{2}: inputDmg: {0} finalHealth: {1} (dmg: {3})", inputDmg, finalHealth, v.Name, dmg)); if (GlobalHealthAfterMines.ContainsKey(v)) { GlobalHealthAfterMines.Remove(v); } GlobalHealthAfterMines.Add(v, finalHealth); if (!(finalHealth <= 0)) { continue; } foreach ( var ability in needToCastnew.Where(ability => Utils.SleepCheck(ability.Value.Handle.ToString()))) { try { ability.Value.UseAbility(); } catch { ErrorLevel[1]++; //PrintError("ErrorLevel 1"); } Utils.Sleep(250, ability.Value.Handle.ToString()); } break; } } catch (Exception) { // ignored } } foreach (var v in enemies.Where(v => _me.IsAlive || v.IsAlive)) { if ((Game.IsKeyDown(0x11) || AutoForceStaff) && forcestaff != null && forcestaff.CanBeCasted() && CheckForceStaff(v) && _me.Distance2D(v) <= 800 /* && v.Modifiers.All(x => x.Name != "modifier_item_sphere_target")*/) { if (Utils.SleepCheck("force")) { forcestaff.UseAbility(v); Utils.Sleep(250, "force"); } } if (!(_me.Distance2D(v) <= 120) || abilSuic == null || !abilSuic.CanBeCasted() || !AutoSuicide) { continue; } if (CanKillSuic(v)) { abilSuic.UseAbility(v); } } } catch { // ignored } }
private static void Drawing_OnDraw(EventArgs args) { var me = ObjectMgr.LocalHero; if (!_loaded) { me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null) { return; } _loaded = true; PrintSuccess("> OverlayInformation > SpellPanel loaded! v" + Ver); } if (!Game.IsInGame || me == null) { _loaded = false; PrintInfo("> OverlayInformation > SpellPanel unLoaded"); return; } if (!Game.IsInGame || !_loaded) { return; } uint i; for (i = 0; i < 10; i++) { try { var v = ObjectMgr.GetPlayerById(i).Hero; if (Equals(v, me)) { continue; } Vector2 screenPos; #region GettingSPells var spells = new Ability[7]; spells[1] = v.Spellbook.Spell1; spells[2] = v.Spellbook.Spell2; spells[3] = v.Spellbook.Spell3; spells[4] = v.Spellbook.Spell4; spells[5] = v.Spellbook.Spell5; spells[6] = v.Spellbook.Spell6; #endregion if (!Drawing.WorldToScreen(v.Position, out screenPos)) { continue; } var start = screenPos + new Vector2(-65, 20); for (var g = 1; g <= 6; g++) { if (spells[g] == null) { continue; } /*try * * { * PrintError(String.Format("Spell # {0}:{1}", g, spells[g].ManaCost)); * } * catch (Exception e) * { * PrintInfo(e.ToString()); * }*/ var cd = spells[g].Cooldown; Drawing.DrawRect(start + new Vector2(g * 20 - 5, 0), new Vector2(20, (int)cd == 0 ? 6 : 20), new ColorBGRA(0, 0, 0, 100), true); //PrintError(String.Format("Spell # {0}:{1}", g, spells[g].AbilityState)); if (spells[g].ManaCost > v.Mana)//spells[g].AbilityState == AbilityState.NotEnoughMana) { Drawing.DrawRect(start + new Vector2(g * 20 - 5, 0), new Vector2(20, (int)cd == 0 ? 6 : 20), new ColorBGRA(0, 0, 150, 150)); } if (cd > 0) { var text = string.Format("{0:0.#}", cd); var textSize = Drawing.MeasureText(text, "Arial", new Vector2(10, 200), FontFlags.None); var textPos = (start + new Vector2(g * 20 - 5, 0) + new Vector2(10 - textSize.X / 2, -textSize.Y / 2 + 12)); Drawing.DrawText(text, textPos, new Vector2(10, 150), Color.White, FontFlags.AntiAlias | FontFlags.DropShadow); } if (spells[g].Level == 0) { continue; } for (var lvl = 1; lvl <= spells[g].Level; lvl++) { Drawing.DrawRect(start + new Vector2(g * 20 - 5 + 3 * lvl, 2), new Vector2(2, 2), new ColorBGRA(255, 255, 0, 255), true); } } } catch { // ignored } } }
private static void Game_OnUpdate(EventArgs args) { var me = ObjectMgr.LocalHero; if (!_loaded) { if (!Game.IsInGame || me == null) { return; } _loaded = true; PrintSuccess(string.Format("> AutoDisable Loaded v{0}", Ver)); Game.PrintMessage( "<font face='Comic Sans MS, cursive'><font color='#00aaff'>" + Menu.DisplayName + " By Jumpering" + " loaded!</font> <font color='#aa0000'>v" + Ver, MessageType.LogMessage); PreLoadItems.Clear(); PreLoadSpell.Clear(); for (var asd = 0; asd < 10; asd++) { Create[asd] = false; FirstTimeItem[asd] = true; FirstTimeSpell[asd] = true; } } if (!Game.IsInGame || me == null) { _loaded = false; PrintInfo("> AutoDisable unLoaded"); return; } #region Dodge by mod if (Utils.SleepCheck("item_manta")) { var dodgeByManta = me.FindItem("item_manta"); var mod = me.Modifiers.FirstOrDefault( x => x.Name == "modifier_orchid_malevolence_debuff" || x.Name == "modifier_lina_laguna_blade" || x.Name == "modifier_pudge_meat_hook" || x.Name == "modifier_skywrath_mage_ancient_seal" || x.Name == "modifier_lion_finger_of_death"); if (dodgeByManta != null && dodgeByManta.CanBeCasted() && mod != null) { dodgeByManta.UseAbility(); Utils.Sleep(250, "item_manta"); return; } } #endregion uint i; var isInvis = me.IsInvisible(); var isChannel = me.IsChanneling(); var items = me.Inventory.Items.Where(x => x.CanBeCasted()).ToList(); var spells = me.Spellbook.Spells.Where(x => SpellList.Contains(x.Name)).ToList(); var newItems = false; //Game.PrintMessage(me.Spellbook.Spell4.Name,MessageType.ChatMessage); foreach (var item in items.Where(item => !PreLoadItems.ContainsKey(item.Name) && ItemList.Contains(item.Name))) { PreLoadItems.Add(item.Name, true); //Game.PrintMessage("[AutoDisable] [ITEM] " + item.Name + " added to menu", MessageType.LogMessage); newItems = true; } var newSpells = false; foreach (var spell in spells.Where(item => !PreLoadSpell.ContainsKey(item.Name))) { PreLoadSpell.Add(spell.Name, true); //Game.PrintMessage("[AutoDisable] [SPELL] " + spell.Name + " added to menu ", MessageType.LogMessage); newSpells = true; } spells = spells.Where(x => x.CanBeCasted()).ToList(); /* * if (newSpells) * { * * AbilityMenu.AddItem( * new MenuItem("SelectedSpells" + me.Name, "Abilities:").SetValue(new AbilityToggler(PreLoadSpell))); * } * if (newItems) * { * ItemMenu.AddItem( * new MenuItem("SelectedItems" + me.Name, "Items:").SetValue(new AbilityToggler(PreLoadItems))); * } */ /*foreach (var ability in spells.Where(item => PreLoadSpell.ContainsKey(item.Name))) * { * Game.PrintMessage( * ExtraSubMenu[i, 1].Item("SelectedSpells" + _me.Name).GetValue<AbilityToggler>().IsEnabled(ability.Name).ToString(), * MessageType.ChatMessage); * }*/ for (i = 0; i < 10; i++) { try { var v = ObjectMgr.GetPlayerById(i).Hero; if (v == null || v.Team == me.Team || Equals(v, me) || !Utils.SleepCheck(v.GetHashCode().ToString())) { continue; } var isInvul = v.IsInvul(); var magicImmnune = v.IsMagicImmune(); //var LinkProt = v.li(); var isStun = v.IsStunned(); var isHex = v.IsHexed(); var isSilence = v.IsSilenced(); var isDisarm = v.IsDisarmed(); /*try * { * Game.PrintMessage("[AutoDisable] " + Menu.Item("ActiveSpell" + i).GetValue<bool>(), MessageType.LogMessage); * } * catch (Exception) * { * } */ if (!Create[i]) { ExtraSubMenu[i, 0] = new Menu("", i.ToString(), false, v.Name); ExtraSubMenu[i, 0].AddItem(new MenuItem("ActiveItem" + i, "Active For This Hero").SetValue(true)); ItemMenu.AddSubMenu(ExtraSubMenu[i, 0]); ExtraSubMenu[i, 1] = new Menu("", i.ToString(), false, v.Name); ExtraSubMenu[i, 1].AddItem(new MenuItem("ActiveSpell" + i, "Active For This Hero").SetValue(true)); AbilityMenu.AddSubMenu(ExtraSubMenu[i, 1]); Create[i] = true; } if (PreLoadItems.Count > 0 && FirstTimeItem[i]) { FirstTimeItem[i] = false; ExtraSubMenu[i, 0].AddItem( new MenuItem("SelectedItems" + me.Name + v.Name, "Items:").SetValue( new AbilityToggler(PreLoadItems))); } if (PreLoadSpell.Count > 0 && FirstTimeSpell[i]) { FirstTimeSpell[i] = false; ExtraSubMenu[i, 1].AddItem( new MenuItem("SelectedSpells" + me.Name + v.Name, "Abilities:").SetValue( new AbilityToggler(PreLoadSpell))); } if (newSpells) { var preLoadSpell2 = PreLoadSpell.ToDictionary(b => b.Key, b => b.Value); ExtraSubMenu[i, 1].Item("SelectedSpells" + me.Name + v.Name) .SetValue((new AbilityToggler(preLoadSpell2))); } if (newItems) { var preLoadItems2 = PreLoadItems.ToDictionary(b => b.Key, b => b.Value); ExtraSubMenu[i, 0].Item("SelectedItems" + me.Name + v.Name) .SetValue((new AbilityToggler(preLoadItems2))); } /*Game.PrintMessage( * "SelectedSpells" + me.Name + v.Name + " : " + * ExtraSubMenu[i, 1].Item("SelectedSpells" + me.Name + v.Name) * .GetValue<AbilityToggler>() * .IsEnabled("lion_voodoo"), MessageType.ChatMessage);*/ if (!v.IsAlive || !v.IsVisible) { continue; } if ((isInvis && !me.IsVisibleToEnemies) || isChannel) { continue; } var blink = v.FindItem("item_blink"); var forcestaff = v.FindItem("item_force_staff"); var dpActivated = v.Modifiers.Any( x => x.Name == "modifier_slark_dark_pact" || x.Name == "modifier_slark_dark_pact_pulses"); var enumerable = items as IList <Item> ?? items.ToList(); var distance = me.Distance2D(v); //var angle = string spellString; var angle = (float)(Math.Max( Math.Abs(v.RotationRad - Utils.DegreeToRadian(v.FindAngleBetween(me.Position))) - 0.20, 0)); if (!enumerable.Any() || !(isInvul || magicImmnune || isInvis || isChannel || dpActivated)) { if ((blink != null && blink.Cooldown > 11) || forcestaff != null && forcestaff.Cooldown > 18.6) { UseDisableStageOne(v, enumerable, null, false, true, me, i); } else if (Menu.Item("onlyoninitiators").GetValue <StringList>().SelectedIndex == (int)DisableType.All) { UseDisableStageOne(v, enumerable, null, false, false, me, i); } else if (Initiators.TryGetValue(v.ClassID, out spellString)) { var initSpell = v.FindSpell(spellString); if (initSpell != null && initSpell.Cooldown != 0) { UseDisableStageOne(v, enumerable, null, false, true, me, i); } } } if (isStun || isHex || isSilence || isDisarm) { continue; } var abilities = spells as IList <Ability> ?? spells.ToList(); if (!abilities.Any() && !enumerable.Any()) { continue; } //var /*if (v.ClassID == ClassID.CDOTA_Unit_Hero_Clinkz) * { * PrintError(String.Format("{0}", angle)); * }*/ if (angle == 0 && distance < 1500) { var r = CheckForFirstSpell(v); var r2 = CheckForSecondSpell(v); //PrintError("kek"); var mustHave = false; //PrintError("kek2"); var s = CheckForModifier(v, ref mustHave); //PrintError("kek3"); var act = (CheckForNetworkAct(v) == v.NetworkActivity); //PrintError("kek4"); //PrintError(String.Format("{0} must have: {1}", v.Name, mustHave)); var modifier = s != "" && v.Modifiers.FirstOrDefault(x => x.Name == s) != null; //if (r != null) PrintInfo(String.Format("r:{0}", r.IsInAbilityPhase)); //if (r2 != null) PrintInfo(String.Format("r2:{0} ", r2.Name)); if ((r != null && r.IsInAbilityPhase) || (r2 != null && r2.IsInAbilityPhase) || mustHave && modifier && act || !mustHave && act) { CounterSpellAndItems(v, enumerable, abilities, me, i); } } if ((blink != null && blink.Cooldown > 11) || forcestaff != null && forcestaff.Cooldown > 18.6) { UseDisableStageOne(v, enumerable, abilities, true, true, me, i); } else if (Menu.Item("onlyoninitiators").GetValue <StringList>().SelectedIndex == (int)DisableType.All && distance <= 1200) { UseDisableStageOne(v, enumerable, abilities, true, false, me, i); } if (Initiators.TryGetValue(v.ClassID, out spellString) && distance < 1000) { var initSpell = v.FindSpell(spellString); if (initSpell != null && initSpell.Cooldown != 0) { UseDisableStageOne(v, enumerable, abilities, true, true, me, i); } } } catch (Exception) { // ignored } } }
private static void Game_OnUpdate(EventArgs args) { if (!_loaded) { _me = ObjectMgr.LocalHero; _player = ObjectMgr.LocalPlayer; if (!Game.IsInGame || _me == null) { return; } _loaded = true; PrintSuccess(string.Format("> AutoDisable Loaded v{0}", Ver)); } if (!Game.IsInGame || _me == null) { _loaded = false; PrintInfo("> AutoDisable unLoaded"); return; } uint i; for (i = 0; i < 10; i++) { try { var v = ObjectMgr.GetPlayerById(i).Hero; if (v == null || v.Team == _me.Team || Equals(v, _me) || !v.IsAlive || !v.IsVisible || !Utils.SleepCheck(v.GetHashCode().ToString())) { continue; } var isInvul = v.IsInvul(); var magicImmnune = v.IsMagicImmune(); //var LinkProt = v.LinkProtection(); var isStun = v.IsStunned(); var isHex = v.IsHexed(); var isSilence = v.IsSilenced(); var isDisarm = v.IsDisarmed(); var isInvis = _me.IsInvisible(); var isChannel = _me.IsChanneling(); var items = _me.Inventory.Items.Where(x => x.CanBeCasted()); var spells = _me.Spellbook.Spells.Where(x => x.CanBeCasted()); var blink = v.FindItem("item_blink"); var forcestaff = v.FindItem("item_force_staff"); var dpActivated = v.Modifiers.Any( x => x.Name == "modifier_slark_dark_pact" || x.Name == "modifier_slark_dark_pact_pulses"); var enumerable = items as IList <Item> ?? items.ToList(); var distance = _me.Distance2D(v); //var angle = string spellString; var angle = (float)(Math.Max( Math.Abs(v.RotationRad - Utils.DegreeToRadian(v.FindAngleBetween(_me.Position))) - 0.20, 0)); if (!enumerable.Any() || (isInvul || magicImmnune || isInvis || isChannel || dpActivated)) { if ((blink != null && blink.Cooldown > 11) || forcestaff != null && forcestaff.Cooldown > 18.6) { UseDisableStageOne(v, enumerable, null, false); } else if (_activated) { UseDisableStageOne(v, enumerable, null, false); } else if (Initiators.TryGetValue(v.ClassID, out spellString)) { var initSpell = v.FindSpell(spellString); if (initSpell != null && initSpell.Cooldown != 0) { UseDisableStageOne(v, enumerable, null, false); } } } if (isStun || isHex || isSilence || isDisarm) { continue; } var abilities = spells as IList <Ability> ?? spells.ToList(); if (!abilities.Any() && !enumerable.Any()) { continue; } //var /*if (v.ClassID == ClassID.CDOTA_Unit_Hero_Clinkz) * { * PrintError(String.Format("{0}", angle)); * }*/ if (angle == 0 && distance < 1500) { var r = CheckForFirstSpell(v); var r2 = CheckForSecondSpell(v); //PrintError("kek"); var mustHave = false; //PrintError("kek2"); var s = CheckForModifier(v, ref mustHave); //PrintError("kek3"); var act = (CheckForNetworkAct(v) == v.NetworkActivity); //PrintError("kek4"); //PrintError(String.Format("{0} must have: {1}", v.Name, mustHave)); var modifier = s != "" && v.Modifiers.FirstOrDefault(x => x.Name == s) != null; //if (r != null) PrintInfo(String.Format("r:{0}", r.IsInAbilityPhase)); //if (r2 != null) PrintInfo(String.Format("r2:{0} ", r2.Name)); if ((r != null && r.IsInAbilityPhase) || (r2 != null && r2.IsInAbilityPhase) || mustHave && modifier && act || !mustHave && act) { UsaSafeItems(v, enumerable, abilities); } } if ((blink != null && blink.Cooldown > 11) || forcestaff != null && forcestaff.Cooldown > 18.6) { UseDisableStageOne(v, enumerable, abilities, true); } else if (_activated) { UseDisableStageOne(v, enumerable, abilities, true); } else if (Initiators.TryGetValue(v.ClassID, out spellString)) { var initSpell = v.FindSpell(spellString); if (initSpell != null && initSpell.Cooldown != 0) { UseDisableStageOne(v, enumerable, abilities, true); } } } catch (Exception) { // ignored } } }
private static void Drawing_OnDraw(EventArgs args) { var me = ObjectMgr.LocalHero; if (!_loaded) { if (!Game.IsInGame || me == null) { return; } _loaded = true; PrintSuccess("> ShowEnemyItems loaded!"); Game.PrintMessage( "<font face='Comic Sans MS, cursive'><font color='#00aaff'>" + "ShowEnemyItems loaded!</font>", MessageType.LogMessage); } if (!Game.IsInGame || me == null) { _loaded = false; PrintInfo("> ShowEnemyItems unLoaded"); return; } if (!Menu.Item("show").GetValue <bool>()) { return; } var percent = HUDInfo.RatioPercentage(); for (uint i = 0; i < 10; i++) { #region Init Hero v; try { v = ObjectMgr.GetPlayerById(i).Hero; } catch { continue; } if (v == null) { continue; } if (!v.IsValid) { continue; } #endregion Vector2 pos; if (v.IsVisible && v.IsAlive && Drawing.WorldToScreen(v.Position, out pos)) { if (Menu.Item("checkforteam").GetValue <bool>()) { if (v.Team == me.Team) { continue; } } var invetory = v.Inventory.Items; var iPos = HUDInfo.GetHPbarPosition(v); var iSize = new Vector2(HUDInfo.GetHPBarSizeX(v), HUDInfo.GetHpBarSizeY(v)); float yPos = 0; float count = 0; var n = 0; var botrange = iSize.X / 4; var coef = Menu.Item("sizer").GetValue <Slider>().Value; Drawing.DrawRect(iPos + new Vector2(0, -iSize.Y - iSize.X / 3), new Vector2(iSize.X / 2 * coef, (float)(iSize.Y * 3.5) * coef), GetTexture("materials/ensage_ui/heroes_horizontal/" + v.Name.Replace("npc_dota_hero_", "") + ".vmat")); #region Items foreach (var item in invetory) { n++; var itemname = string.Format("materials/ensage_ui/items/{0}.vmat", item.Name.Replace("item_", "")); if (item is Bottle) { var bottletype = item as Bottle; if (bottletype.StoredRune != RuneType.None) { itemname = string.Format("materials/ensage_ui/items/{0}.vmat", item.Name.Replace("item_", "") + "_" + bottletype.StoredRune); //Game.PrintMessage(itemname, MessageType.LogMessage); } } Drawing.DrawRect(iPos + new Vector2(count, botrange + yPos), new Vector2(iSize.X / 3 * coef, (float)(iSize.Y * 2.5) * coef), GetTexture(itemname)); if (item.AbilityState == AbilityState.OnCooldown) { Drawing.DrawRect(iPos + new Vector2(count, botrange + yPos), new Vector2((iSize.X / 4) * coef, item.Cooldown / item.CooldownLength * ((float)(iSize.Y * 2.5) * coef)), new Color(255, 255, 255, Menu.Item("slider").GetValue <Slider>().Value)); } if (item.AbilityState == AbilityState.NotEnoughMana) { Drawing.DrawRect(iPos + new Vector2(count, botrange + yPos), new Vector2((iSize.X / 5) * coef, (float)(iSize.Y * 2.5) * coef), new Color(0, 0, 200, Menu.Item("slider").GetValue <Slider>().Value)); } count += iSize.X / 4 * coef; if (n != 3) { continue; } count = 0; yPos = (int)((iSize.Y * 2.5) * coef); } #endregion #region Spells //Game.PrintMessage(percent.ToString(),MessageType.ChatMessage); var start = new Vector2(iPos.X, iPos.Y + 120 * percent) + new Vector2(0, yPos); var g = -1; var distBetweenSpells = Menu.Item("distBetweenSpells").GetValue <Slider>().Value; var DistBwtweenLvls = Menu.Item("DistBwtweenLvls").GetValue <Slider>().Value; var SizeSpell = Menu.Item("SizeSpell").GetValue <Slider>().Value; var size = distBetweenSpells; //(iSize.X / 3); var sizey = 9; foreach (var spell in v.Spellbook.Spells.Where(x => x.AbilityType != AbilityType.Attribute)) { g++; var cd = spell.Cooldown; Drawing.DrawRect(start + new Vector2((g * size), 0), new Vector2(size, spell.AbilityState != AbilityState.OnCooldown ? sizey : 22), new ColorBGRA(0, 0, 0, 100)); Drawing.DrawRect(start + new Vector2((g * size), 0), new Vector2(size, spell.AbilityState != AbilityState.OnCooldown ? sizey : 22), new ColorBGRA(255, 255, 255, 100), true); if (spell.AbilityState == AbilityState.NotEnoughMana) { Drawing.DrawRect(start + new Vector2((g * size), 0), new Vector2(size, spell.AbilityState != AbilityState.OnCooldown ? sizey : 22), new ColorBGRA(0, 0, 150, 150)); } if (spell.AbilityState == AbilityState.OnCooldown) { var text = string.Format("{0:0.#}", cd); var textSize = Drawing.MeasureText(text, "Arial", new Vector2(10, 200), FontFlags.None); var textPos = (start + new Vector2(g * size, 0) + new Vector2(10 - textSize.X / 2, -textSize.Y / 2 + 12)); Drawing.DrawText(text, textPos, /*new Vector2(10, 150),*/ Color.White, FontFlags.AntiAlias | FontFlags.DropShadow); } if (spell.Level == 0) { continue; } for (var lvl = 1; lvl <= spell.Level; lvl++) { Drawing.DrawRect(start + new Vector2((g * (size) + (/*4+*/ DistBwtweenLvls) * lvl), sizey - 6), new Vector2(SizeSpell, sizey - 6), new ColorBGRA(255, 255, 0, 255)); } } #endregion } } }
private static void DrawItems(Hero me, Vector2 pos, Vector2 size, float percent) { uint i = 0; for (uint num = 0; num < 10; num++) { try { if (Heroes[num] == null || !Heroes[num].IsValid) { Heroes[num] = ObjectMgr.GetPlayerById(num).Hero; } } catch { continue; } if (Heroes[num] == null || !Heroes[num].IsValid || Heroes[num].Team == me.Team) { continue; } Drawing.DrawRect(pos + new Vector2(10, size.Y / 7 + 10 + i * (size.Y / 10 + 5) * percent), new Vector2(size.X / 7, size.Y / 8), Drawing.GetTexture("materials/ensage_ui/heroes_horizontal/" + Heroes[num].Name.Substring("npc_dota_hero_".Length) + ".vmat")); Drawing.DrawRect(pos + new Vector2(10, size.Y / 7 + 10 + i * (size.Y / 10 + 5) * percent), new Vector2(size.X / 7, size.Y / 8), new Color(0, 0, 0, 255), true); for (var i2 = 1; i2 <= 6; i2++) { try { string texturename; var item = Heroes[num].Inventory.GetItem((ItemSlot)i2 - 1); if (item == null) { texturename = "materials/ensage_ui/items/emptyitembg.vmat"; } else if (item.IsRecipe) { texturename = "materials/ensage_ui/items/recipe.vmat"; } else { texturename = string.Format("materials/ensage_ui/items/{0}.vmat", item.Name.Replace("item_", "")); } if (item is Bottle) { var bottletype = item as Bottle; if (bottletype.StoredRune != RuneType.None) { texturename = string.Format("materials/ensage_ui/items/{0}.vmat", item.Name.Replace("item_", "") + "_" + bottletype.StoredRune); } } if (item == null) { continue; } var itemStartPos = pos + new Vector2((size.X / 7) + (size.X / 9) * i2, size.Y / 7 + 10 + i * (size.Y / 10 + 5) * percent); Drawing.DrawRect( itemStartPos, new Vector2(size.X / 7, size.Y / 8), Drawing.GetTexture(texturename)); if (item.AbilityState == AbilityState.NotEnoughMana) { Drawing.DrawRect(itemStartPos, new Vector2(size.X / 9, size.Y / 8), new Color(0, 0, 255, 75)); } if (item.AbilityState == AbilityState.OnCooldown) { if (Menu.Item("showRect").GetValue <bool>()) { Drawing.DrawRect(itemStartPos, new Vector2(size.X / 9, item.Cooldown / item.CooldownLength * (size.Y / 8)), new Color(255, 255, 255, Menu.Item("trans").GetValue <Slider>().Value)); } if (Menu.Item("showNumber").GetValue <bool>()) { Drawing.DrawText(((int)item.Cooldown).ToString(CultureInfo.InvariantCulture), itemStartPos, new Vector2(Menu.Item("fontSize").GetValue <Slider>().Value *percent), Color.Gold, FontFlags.AntiAlias | FontFlags.DropShadow); } } } catch (Exception) { /*Drawing.DrawRect(_startPos + new Vector2(25 * Con * i2, 18 * Con * (i + 1)), new Vector2(32 * Con, 18 * Con), * Drawing.GetTexture("materials/ensage_ui/items/emptyitembg.vmat"));*/ } } i++; } }
public static void start(bool topmenu) { me = ObjectMgr.LocalHero; if (me == null && !Game.IsInGame) { return; } GetHPbarSize(); ScaleX = (float)Drawing.Width / 1400; ScaleY = (float)Drawing.Height / 900; heroes = ObjectMgr.GetEntities <Hero>().Where(x => x.IsAlive && !x.IsIllusion && x.IsVisible && x.IsValid).ToList(); try { try { for (uint t = 0; t < 10; t++) { player = ObjectMgr.GetPlayerById(t); if (player != null && player.Team != me.Team) { Hero x = player.Hero; if (x != null && x.IsValid && x.Health != 0) { if (topmenu) { TOP_HEALTH_BAR_POS = new Vector2(HUDInfo.GetTopPanelPosition(x).X, (float)HUDInfo.GetTopPanelSizeY(x) + (1 * ScaleY)); TOP_HEALTH_BAR_SIZE = new Vector2(((float)HUDInfo.GetTopPanelSizeX(x) / (x.MaximumHealth / (float)x.Health)) - (2 * ScaleX), boxSizeY - (13 * ScaleY)); TOP_MANA_BAR_POS = new Vector2(HUDInfo.GetTopPanelPosition(x).X, (float)HUDInfo.GetTopPanelSizeY(x) + 6); TOP_MANA_BAR_SIZE = new Vector2(((float)HUDInfo.GetTopPanelSizeX(x) / (x.MaximumMana / x.Mana)) - (2 * ScaleX), boxSizeY - (13 * ScaleY)); TOP_BAR_FULLSIZE = new Vector2((float)HUDInfo.GetTopPanelSizeX(x) - (2 * ScaleX), boxSizeY - (13 * ScaleY)); TOP_ULT_BAR_POS = new Vector2(HUDInfo.GetTopPanelPosition(x).X, (float)HUDInfo.GetTopPanelSizeY(x) + (12 * ScaleY)); TOP_ULT_BAR_SIZE = new Vector2(((float)HUDInfo.GetTopPanelSizeX(x) / (x.Spellbook.SpellR.CooldownLength / x.Spellbook.SpellR.Cooldown)) - (2 * ScaleX), boxSizeY - (13 * ScaleY)); if (MouseOnSpot(TOP_HEALTH_BAR_POS, new Vector2((float)HUDInfo.GetTopPanelSizeX(x), 100 * ScaleY))) { Drawing.DrawText("HP: " + (int)x.Health + " / MANA: " + (int)x.Mana + " / ULT: " + (int)x.Spellbook.SpellR.Cooldown, TOP_HEALTH_BAR_POS + new Vector2(-5 * ScaleX, 17 * ScaleY), new Vector2(18 * ScaleX, 15 * ScaleY), Color.White, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive); } Drawing.DrawRect(TOP_HEALTH_BAR_POS, TOP_HEALTH_BAR_SIZE, Color.Green, false); Drawing.DrawRect(TOP_HEALTH_BAR_POS, TOP_BAR_FULLSIZE, Color.Black, true); Drawing.DrawRect(TOP_MANA_BAR_POS, TOP_MANA_BAR_SIZE, new Color(0x00, 0x80, 0xF8, 0xFF), false); Drawing.DrawRect(TOP_MANA_BAR_POS, TOP_BAR_FULLSIZE, Color.Black, true); if (TOP_ULT_BAR_SIZE.X > 0) { Drawing.DrawRect(TOP_ULT_BAR_POS, TOP_ULT_BAR_SIZE, Color.Gold, false); Drawing.DrawRect(TOP_ULT_BAR_POS, TOP_BAR_FULLSIZE, Color.Black, true); } } } } } foreach (Hero x in heroes) { if (x == null) { continue; } if (x == me) { continue; } Herospells = x.Spellbook.Spells; DangerItems = x.Inventory.Items; i = 0; i2 = 0; i3 = 0; if (x.Mana > 0 && x.Team != me.Team && !x.UnitState.HasFlag(UnitState.NoHealthbar)) { Drawing.DrawRect(new Vector2((float)(HUDInfo.GetHPbarPosition(x).X - (0.5 * ScaleX)), HUDInfo.GetHPbarPosition(x).Y + (9 * ScaleY)), new Vector2((boxSizeX * 6) + (2 * ScaleX), boxSizeY - (13 * ScaleY)), new Color(0x00, 0x80, 0xF8, 0x32), false); Drawing.DrawRect(new Vector2((float)(HUDInfo.GetHPbarPosition(x).X - (0.5 * ScaleX)), HUDInfo.GetHPbarPosition(x).Y + (9 * ScaleY)), new Vector2((boxSizeX * 6) + (2 * ScaleX), boxSizeY - (13 * ScaleY)), Color.Black, true); Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + (1 * ScaleX), HUDInfo.GetHPbarPosition(x).Y + (10 * ScaleY)), new Vector2(((boxSizeX * 6) / (x.MaximumMana / x.Mana)) - (1 * ScaleX), boxSizeY - (15 * ScaleY)), new Color(0x00, 0x80, 0xF8, 0xFF), false); } foreach (Ability y in Herospells) { if (y != null && !y.Name.Contains("empty") && (x.Name.Contains("rubick") ? !y.Name.Contains("hidden") : true) && !x.UnitState.HasFlag(UnitState.NoHealthbar)) { if (y.AbilitySlot == AbilitySlot.Slot_1ULL || y.AbilitySlot == AbilitySlot.Slot_2 || y.AbilitySlot == AbilitySlot.Slot_3 || y.AbilitySlot == AbilitySlot.Slot_4 || y.AbilitySlot == AbilitySlot.Slot_5 || y.AbilitySlot == AbilitySlot.Slot_6) { Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Drawing.GetTexture("materials/ensage_ui/spellicons/" + y.Name + ".vmat")); Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Color.Black, true); if (y.Cooldown > 0 || (y.ManaCost > x.Mana && y.ManaCost > 0)) { Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX, boxSizeY), new Color(0x5F, 0x00, 0xCE, 0x9E), false); Drawing.DrawText((int)(y.Cooldown == 0 ? (y.ManaCost - x.Mana) : y.Cooldown) + "", new Vector2((float)(HUDInfo.GetHPbarPosition(x).X + (0.8 + (i * 20) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y - (17 * ScaleY)), new Vector2(10 * ScaleX, 20 * ScaleY), y.Cooldown == 0 ? Color.LightSkyBlue : Color.White, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive); } if (y.Level <= 0) { Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX, boxSizeY), new Color(0x5F, 0x00, 0x00, 0x9E), false); } else { Drawing.DrawRect(new Vector2((HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX - ((y.Level < 10 ? 8 : 5) * ScaleX), boxSizeY - (9 * ScaleY)), Color.Black, false); Drawing.DrawText((int)y.Level + "", new Vector2((float)(HUDInfo.GetHPbarPosition(x).X + (((y.Level < 10 ? 0.8 : 0) + (i * 20)) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(10 * ScaleX, 20 * ScaleY), Color.YellowGreen, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive); } i += 1 * ScaleX; } else { if (y.Cooldown != 0 || y.ManaCost > x.Mana) { Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i2 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (50 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Drawing.GetTexture("materials/ensage_ui/spellicons/" + y.Name + ".vmat")); Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i2 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (50 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Color.Black, true); if (y.Cooldown > 0 || (y.ManaCost > x.Mana && y.ManaCost > 0)) { Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i2 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (50 * ScaleY)), new Vector2(boxSizeX, boxSizeY), new Color(0x5F, 0x00, 0xCE, 0x9E), false); Drawing.DrawText((int)(y.Cooldown == 0 ? (y.ManaCost - x.Mana) : y.Cooldown) + "", new Vector2((float)(HUDInfo.GetHPbarPosition(x).X + ((0.8 + (i2 * 20)) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y - (42 * ScaleY)), new Vector2(10 * ScaleX, 20 * ScaleY), y.Cooldown == 0 ? Color.LightSkyBlue : Color.White, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive); } i2 += 1 * ScaleX; } } } } foreach (Item z in DangerItems) { if (z != null && !x.UnitState.HasFlag(UnitState.NoHealthbar) && (z.Name == "item_gem" || z.Name == "item_dust" || z.Name == "item_sphere" || z.Name == "item_blink" || z.Name == "item_ward_observer" || z.Name == "item_ward_sentry" || z.Name == "item_black_king_bar" || z.Name == "item_ward_dispenser" || z.Name == "item_sheepstick" || z.Name == "item_blade_mail" || z.Name == "item_rapier" || z.Name == "item_cyclone" || z.Name == "item_shadow_amulet" || z.Name == "item_invis_sword" || z.Name == "item_silver_edge" || z.Name == "item_glimmer_cape" || z.Name == "item_lotus_orb" || z.Name == "item_orchid" || z.Name.Contains("item_dagon") || z.Name == "item_manta" || z.Name == "item_aegis" || z.Name == "item_cheese")) { Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i3 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y + (15 * ScaleY)), new Vector2(boxSizeX + (6 * ScaleX), boxSizeY), Drawing.GetTexture("materials/ensage_ui/items/" + z.Name.Remove(0, 5))); Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i3 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y + (15 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Color.Black, true); if (z.Cooldown > 0 || (z.ManaCost > x.Mana && z.ManaCost > 0)) { Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i3 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y + (15 * ScaleY)), new Vector2(boxSizeX, boxSizeY), new Color(0x5F, 0x00, 0xCE, 0x9E), false); Drawing.DrawText((int)(z.Cooldown == 0 ? (z.ManaCost - x.Mana) : z.Cooldown) + "", new Vector2((float)(HUDInfo.GetHPbarPosition(x).X + ((1.2 + (i3 * 20)) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y + (23 * ScaleY)), new Vector2(10 * ScaleX, 20 * ScaleY), z.Cooldown == 0 ? Color.LightSkyBlue : Color.White, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive); } i3 += 1 * ScaleX; } } } } catch (EntityNotFoundException) { } } catch (NullReferenceException) { } }
private static void Drawing_OnEndScene(EventArgs args) { if (Drawing.Direct3DDevice9 == null || Drawing.Direct3DDevice9.IsDisposed || !Game.IsInGame || !_loaded) { return; } var player = ObjectMgr.LocalPlayer; if (player == null || player.Team == Team.Observer) { return; } /*var screenX = Drawing.Width / (float)1600 * (float)0.8; * Drawing.DrawRect(new Vector2(10, 200), new Vector2((float)15 * screenX, (float)15 * screenX), Drawing.GetTexture(@"vgui\hud\minimap_creep.vmat")); * Drawing.DrawRect(new Vector2(10, 300), new Vector2((float)15 * screenX, (float)15 * screenX), Drawing.GetTexture(@"vgui\hud\minimap_glow.vmat")); * vgui\dashboard\dash_button_back * root\materials\vgui\hud\heroportraits\portraitbackground_techies.vmat_c * */ try { if (!IsClose) { DrawFilledBox(10, 200, 200, ExtraMenu ? 400 : 270, new ColorBGRA(0, 0, 0, 100)); DrawLine(10, 250, 200, 250, 1, Color.Black); DrawShadowText("Damage Helper", 20, 210, Color.White, _fontSize1); var enemies = ObjectMgr.GetEntities <Hero>() .Where( x => x.Team != player.Team && !x.IsIllusion && x.ClassID != ClassID.CDOTA_Unit_Hero_Meepo) .ToList(); var counter = 0; DrawFilledBox(20, 380, 120, 50, CheckMouse(20, 380, 120, 50) ? new ColorBGRA(255, 255, 0, 100) : new ColorBGRA(100, 255, 0, 100)); DrawShadowText("Open / Hide", 30, 390, Color.White, _fontSize1); DrawFilledBox(145, 380, 55, 50, CheckMouse(145, 380, 55, 50) ? new ColorBGRA(255, 255, 0, 100) : WithAll ? new ColorBGRA(100, 255, 0, 100) : new ColorBGRA(255, 0, 0, 100)); DrawShadowText(WithAll ? "AllHero" : "WithVis", 150, 390, Color.White, _fontSize2); DrawFilledBox(20, 435, 180, 25, CheckMouse(20, 435, 180, 25) ? new ColorBGRA(255, 255, 0, 100) : ExtraMenu ? new ColorBGRA(100, 255, 0, 100) : new ColorBGRA(255, 0, 0, 100)); if (!ExtraMenu) { DrawLine(90, 440, 100, 450, 3, Color.Black); DrawLine(100, 450, 110, 440, 3, Color.Black); } else { DrawLine(100, 440, 90, 450, 3, Color.Black); DrawLine(110, 450, 100, 440, 3, Color.Black); DrawShadowText("Auto detonate", 20, 470, Color.White, _fontSize2); DrawShadowText("Auto suicide", 20, 490, Color.White, _fontSize2); DrawShadowText("Legit mode", 20, 510, Color.White, _fontSize2); DrawShadowText("Auto Force Staff", 20, 530, Color.White, _fontSize2); DrawShadowText("Show Force Staff Range", 20, 550, Color.White, _fontSize2); DrawShadowText("Detonate Aegis or Wk", 20, 570, Color.White, _fontSize2); DrawButton(180, 470, 15, 15, 2, ref AutoDetonate, true); DrawButton(180, 490, 15, 15, 2, ref AutoSuicide, true); DrawButton(180, 510, 15, 15, 2, ref LegitMode, false); DrawButton(180, 530, 15, 15, 2, ref AutoForceStaff, true); DrawButton(180, 550, 15, 15, 2, ref ShowForceStaffRange, true); DrawButton(180, 570, 15, 15, 2, ref DetonateOnAegisAndWk, true); } //DrawShadowText(WithAll ? "AllHero" : "WithVis", 150, 390, Color.White, _fontSize2); var dummy = false; if (!WithAll) { foreach (var v in enemies) { DrawShadowText( string.Format(" {0}: {3} | {1}/{2}", GetNameOfHero(v), Math.Abs(_currentBombDamage) <= 0 ? 0 : GetCount(v, v.Health, _currentBombDamage), Math.Abs(_currentBombDamage) <= 0 ? 0 : GetCount(v, v.MaximumHealth, _currentBombDamage), CanKillSuic(v, ref dummy)), 10, 250 + 25 * counter++, Color.YellowGreen, _fontSize2); } } else { for (uint i = 0; i < 10; i++) { try { var v = ObjectMgr.GetPlayerById(i).Hero; if (v != null && v.Team != _me.Team && !Equals(v, _me)) { DrawShadowText( string.Format(" {0}: {3} | {1}/{2}", GetNameOfHero(v), Math.Abs(_currentBombDamage) <= 0 ? 0 : GetCount(v, v.Health, _currentBombDamage), Math.Abs(_currentBombDamage) <= 0 ? 0 : GetCount(v, v.MaximumHealth, _currentBombDamage), CanKillSuic(v, ref dummy)), 10, 250 + 25 * counter++, Color.YellowGreen, _fontSize2); } } catch (Exception) //not all 10 players in a game! { ErrorLevel[6]++; //PrintError("ErrorLevel 6 "); // ignored } } } } else { DrawFilledBox(20, 380, 50, 50, CheckMouse(20, 380, 50, 50) ? new ColorBGRA(255, 255, 0, 100) : new ColorBGRA(0, 0, 0, 100)); } } catch { // ignored } }