private void OnDraw(EventArgs args) { if (Config.Item("drawplaces").GetValue <Circle>().Active) { Ward.DrawWardSpots(); Ward.DrawSafeWardSpots(); } }
public override bool Equals(object obj) { Ward wardItem = obj as Ward; return(wardItem.NetworkId == this.NetworkId); }
void Game_OnGameUpdate(EventArgs args) { int time = Environment.TickCount; if (Config.Item("AutoBushEnabled").GetValue <bool>() && Config.Item("AutoBushKey").GetValue <KeyBind>().Active) { foreach (AIHeroClient enemy in Helper.EnemyInfo.Where(x => x.Player.IsValid && !x.Player.IsVisible && !x.Player.IsDead && x.Player.Distance(ObjectManager.Player.ServerPosition) < 1000 && time - x.LastSeen < 2500).Select(x => x.Player)) { var bestWardPos = GetWardPos(enemy.ServerPosition); // var bestWardPos = GetWardPos(enemy.ServerPosition, 165, 2); if (bestWardPos != enemy.ServerPosition && bestWardPos != Vector3.Zero && bestWardPos.Distance(ObjectManager.Player.ServerPosition) <= 600) { int timedif = Environment.TickCount - _lastTimeWarded; if (timedif > 1250 && !(timedif < 2500 && GetNearObject("SightWard", bestWardPos, 200) != null)) //no near wards { var wardSlot = GetWardSlot(); if (wardSlot != null && wardSlot.Id != ItemId.Unknown) { ObjectManager.Player.Spellbook.CastSpell(wardSlot.SpellSlot, bestWardPos); _lastTimeWarded = Environment.TickCount; } } } } } InventorySlot wardSpellSlot = null; if (Config.Item("placekey").GetValue <KeyBind>().Active) { wardSpellSlot = Ward.GetWardSlot(); } else if (Config.Item("placekeyconWard").GetValue <KeyBind>().Active) { wardSpellSlot = Ward.GetConWardSlot(); } { if (wardSpellSlot == null || lastuseward + 1000 > Environment.TickCount) { return; } Vector3?nearestWard = Ward.FindNearestWardSpot(Drawing.ScreenToWorld(Game.CursorPos.X, Game.CursorPos.Y)); if (nearestWard != null) { if (wardSpellSlot != null) { Console.WriteLine("putting ward"); ObjectManager.Player.Spellbook.CastSpell(wardSpellSlot.SpellSlot, (Vector3)nearestWard); lastuseward = Environment.TickCount; } } WardSpot nearestSafeWard = Ward.FindNearestSafeWardSpot(Drawing.ScreenToWorld(Game.CursorPos.X, Game.CursorPos.Y)); if (nearestSafeWard != null) { if (wardSpellSlot != null) { EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, nearestSafeWard.MovePosition); Wardspoting._PutSafeWard = nearestSafeWard; } } } if (Wardspoting._PutSafeWard != null && lastuseward + 1000 < Environment.TickCount) { wardSpellSlot = Items.GetWardSlot(); if (Math.Sqrt(Math.Pow(Wardspoting._PutSafeWard.ClickPosition.X - ObjectManager.Player.Position.X, 2) + Math.Pow(Wardspoting._PutSafeWard.ClickPosition.Y - ObjectManager.Player.Position.Y, 2)) <= 640.0) { if (Config.Item("placekey").GetValue <KeyBind>().Active) { wardSpellSlot = Ward.GetWardSlot(); } else if (Config.Item("placekeyconWard").GetValue <KeyBind>().Active) { wardSpellSlot = Ward.GetConWardSlot(); } if (wardSpellSlot != null) { Console.WriteLine("putting ward2"); ObjectManager.Player.Spellbook.CastSpell(wardSpellSlot.SpellSlot, Wardspoting._PutSafeWard.ClickPosition); lastuseward = Environment.TickCount; } Wardspoting._PutSafeWard = null; } } }