private static void DrawForEnemyHero() { foreach (var v in Ensage.Common.Objects.Heroes.GetByTeam(MeHero.GetEnemyTeam())) { var pos = GetTopPanelPosition(v) + new Vector2(Menu.Item("BarPosX").GetValue<Slider>().Value, Menu.Item("BarPosY").GetValue<Slider>().Value); var size = GetTopPalenSize(v) + new Vector2(0, Menu.Item("BarSizeY").GetValue<Slider>().Value); const int height = 7; if (Menu.Item("EnemyStatus.Timer.Enable").GetValue<bool>()) { var handle = v.Player.ID; if (SInfo[handle] == null || !SInfo[handle].GetHero().IsValid) { SInfo[handle] = new StatusInfo(v, Game.GameTime); } Drawing.DrawRect(pos + new Vector2(0, size.Y + height*2), new Vector2(size.X, height*2), new Color(0, 0, 0, 100)); Drawing.DrawRect(pos + new Vector2(0, size.Y + height*2), new Vector2(size.X, height*2), new Color(0, 0, 0, 255), true); var text = SInfo[handle].GetTime(); Drawing.DrawText(text, pos + new Vector2(5, size.Y + height*2), Color.White, FontFlags.AntiAlias | FontFlags.DropShadow); } if (Menu.Item("Ultimates.Icon.Enable").GetValue<bool>() || Menu.Item("Ultimates.Text.Enable").GetValue<bool>()) { try { Ability ultimate; if (!UltimateAbilities.TryGetValue(v, out ultimate)) { var ult = v.Spellbook.Spells.First(x => x.AbilityType == AbilityType.Ultimate); if (ult != null) UltimateAbilities.Add(v, ult); } else if (ultimate != null && ultimate.Level > 0) { pos = GetTopPanelPosition(v) + new Vector2(Menu.Item("BarPosX").GetValue<Slider>().Value, Menu.Item("BarPosY").GetValue<Slider>().Value); size = GetTopPalenSize(v) + new Vector2(0, Menu.Item("BarSizeY").GetValue<Slider>().Value); var ultPos = pos + new Vector2(size.X/2 - 5, size.Y + 1); string path; switch (ultimate.AbilityState) { case AbilityState.NotEnoughMana: path = "materials/ensage_ui/other/ulti_nomana.vmat"; break; case AbilityState.OnCooldown: path = "materials/ensage_ui/other/ulti_cooldown.vmat"; break; default: path = "materials/ensage_ui/other/ulti_ready.vmat"; break; } if (Menu.Item("Ultimates.Icon.Enable").GetValue<bool>()) Drawing.DrawRect(ultPos, new Vector2(14, 14), Drawing.GetTexture(path)); if (Menu.Item("Ultimates.Text.Enable").GetValue<bool>()) { } } } catch (Exception) { // ignored } } if (Menu.Item("showMeMore.Enable").GetValue<bool>()) { switch (v.ClassID) { case ClassID.CDOTA_Unit_Hero_Mirana: if (_arrowUnit == null) { _arrowUnit = ObjectMgr.GetEntities<Unit>() .FirstOrDefault(x => x.ClassID == ClassID.CDOTA_BaseNPC && x.DayVision == 650 && x.Team != MeHero.Team); } if (_arrowUnit != null) { if (!_arrowUnit.IsValid) { foreach (var effect in ArrowParticalEffects.Where(effect => effect != null)) { effect.Dispose(); } _letsDraw = true; _arrowUnit = ObjectMgr.GetEntities<Unit>() .FirstOrDefault(x => x.ClassID == ClassID.CDOTA_BaseNPC && x.DayVision == 650 && x.Team != MeHero.Team); break; } if (!InSystem.Contains(_arrowUnit)) { _arrowS = _arrowUnit.Position; InSystem.Add(_arrowUnit); Utils.Sleep(100,"kek"); GenerateSideMessage(v.Name.Replace("npc_dota_hero_", ""), "mirana_arrow"); } else if (_letsDraw && Utils.SleepCheck("kek") && _arrowUnit.IsVisible) { _letsDraw = false; /*PrintInfo(string.Format("{0}{1}{2}/{3}{4}{5}", _arrowS.X, _arrowS.Y, _arrowS.Z, _arrowUnit.Position.X, _arrowUnit.Position.Y, _arrowUnit.Position.Z));*/ var ret = FindRet(_arrowS, _arrowUnit.Position); for (var z = 1; z <= 147; z++) { var p = FindVector(_arrowS, ret, 20*z + 60); ArrowParticalEffects[z] = new ParticleEffect( @"particles\ui_mouseactions\draw_commentator.vpcf", p); ArrowParticalEffects[z].SetControlPoint(1, new Vector3(255, 255, 255)); ArrowParticalEffects[z].SetControlPoint(0, p); } } } break; case ClassID.CDOTA_Unit_Hero_SpiritBreaker: break; case ClassID.CDOTA_Unit_Hero_Windrunner: if (!Prediction.IsTurning(v)) //(Utils.SleepCheck("ArrowWindRun")) { var spell = v.Spellbook.Spell2; if (spell != null && spell.Cooldown != 0) { var cd = Math.Floor(spell.Cooldown * 100); if (cd < 880) { if (!InSystem.Contains(v)) { if (cd > 720) { var eff = new ParticleEffect[148]; for (var z = 1; z <= 140; z++) { var p = new Vector3( v.Position.X + 100 * z * (float)Math.Cos(v.RotationRad), v.Position.Y + 100 * z * (float)Math.Sin(v.RotationRad), 100); eff[z] = new ParticleEffect( @"particles\ui_mouseactions\draw_commentator.vpcf", p); eff[z].SetControlPoint(1, new Vector3(255, 255, 255)); eff[z].SetControlPoint(0, p); } Eff.Add(v, eff); InSystem.Add(v); } } else if (cd < 720 || !v.IsAlive && InSystem.Contains(v)) { InSystem.Remove(v); ParticleEffect[] eff; if (Eff.TryGetValue(v, out eff)) { foreach (var particleEffect in eff.Where(x=>x!=null)) particleEffect.ForceDispose(); Eff.Clear(); } } } } } break; case ClassID.CDOTA_Unit_Hero_Pudge: break; case ClassID.CDOTA_Unit_Hero_Kunkka: break; } } if (Menu.Item("EnemyStatus.Map.Enable").GetValue<bool>()) { if (!v.IsAlive || v.IsVisible) continue; Vector2 newPos; if (!Drawing.WorldToScreen(v.Position, out newPos)) continue; var name = "materials/ensage_ui/heroes_horizontal/" + v.Name.Replace("npc_dota_hero_", "") + ".vmat"; var size2 = new Vector2(50, 50); Drawing.DrawRect(newPos + new Vector2(10, 35), size2 + new Vector2(13, -6), Drawing.GetTexture(name)); } } }
private static void DrawEnemyStatus(Hero v, Vector2 size, Vector2 pos, int height) { if (Menu.Item("EnemyStatus.Timer.Enable").GetValue<bool>()) { var handle = v.Player.ID; if (SInfo[handle] == null || !SInfo[handle].GetHero().IsValid) { SInfo[handle] = new StatusInfo(v, Game.GameTime); } Drawing.DrawRect(pos + new Vector2(0, size.Y + height*2), new Vector2(size.X, height*2), new Color(0, 0, 0, 100)); Drawing.DrawRect(pos + new Vector2(0, size.Y + height*2), new Vector2(size.X, height*2), new Color(0, 0, 0, 255), true); var text = SInfo[handle].GetTime(); Drawing.DrawText(text, pos + new Vector2(5, size.Y + height*2), Color.White, FontFlags.AntiAlias | FontFlags.DropShadow); } }