public void OnWndProc(WndEventArgs args) { if (args.Msg == WM_MOUSEDOWN) { if (args.WParam == VK_LBUTTON && Config.Item("placekey").GetValue <KeyBind>().Active) { Vector3?nearestWard = Ward.FindNearestWardSpot(Drawing.ScreenToWorld(Game.CursorPos.X, Game.CursorPos.Y)); if (nearestWard != null) { InventorySlot wardSpellSlot = Items.GetWardSlot(); if (wardSpellSlot != null) { wardSpellSlot.UseItem((Vector3)nearestWard); } } WardSpot nearestSafeWard = Ward.FindNearestSafeWardSpot(Drawing.ScreenToWorld(Game.CursorPos.X, Game.CursorPos.Y)); if (nearestSafeWard != null) { InventorySlot wardSpellSlot = Items.GetWardSlot(); if (wardSpellSlot != null) { ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, nearestSafeWard.MovePosition); Wardspoting._PutSafeWard = nearestSafeWard; } } } } }
public void OnWndProc(WndEventArgs args) { if (args.Msg == WM_MOUSEDOWN) { if (args.WParam == VK_LBUTTON) { Vector3?nearestWard = Ward.FindNearestWardSpot(Drawing.ScreenToWorld(Game.CursorPos.X, Game.CursorPos.Y)); if (nearestWard != null) { SpellSlot wardSpellSlot = Ward.FindWardSpellSlot(ObjectManager.Player); if (wardSpellSlot != SpellSlot.Unknown) { ObjectManager.Player.Spellbook.CastSpell(wardSpellSlot, (Vector3)nearestWard); } } WardSpot nearestSafeWard = Ward.FindNearestSafeWardSpot(Drawing.ScreenToWorld(Game.CursorPos.X, Game.CursorPos.Y)); if (nearestSafeWard != null) { SpellSlot wardSpellSlot = Ward.FindWardSpellSlot(ObjectManager.Player); if (wardSpellSlot != SpellSlot.Unknown) { ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, nearestSafeWard.MagneticPosition); _PutSafeWard = nearestSafeWard; } } } } }
void Game_OnGameUpdate(EventArgs args) { if (_PutSafeWard != null) { if (Math.Sqrt(Math.Pow(_PutSafeWard.ClickPosition.X - ObjectManager.Player.Position.X, 2) + Math.Pow(_PutSafeWard.ClickPosition.Y - ObjectManager.Player.Position.Y, 2)) <= 650.0) { SpellSlot wardSpellSlot = Ward.FindWardSpellSlot(ObjectManager.Player); if (wardSpellSlot != SpellSlot.Unknown) { ObjectManager.Player.Spellbook.CastSpell(wardSpellSlot, (Vector3)_PutSafeWard.ClickPosition); } _PutSafeWard = null; } } }
void Game_OnGameUpdate(EventArgs args) { InventorySlot wardSpellSlot = null; if (Config.Item("placekey").GetValue <KeyBind>().Active) { wardSpellSlot = Items.GetWardSlot(); } else if (Config.Item("placekeypink").GetValue <KeyBind>().Active) { wardSpellSlot = Ward.GetPinkSlot(); } { 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) { ObjectManager.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 = Items.GetWardSlot(); } else if (Config.Item("placekeypink").GetValue <KeyBind>().Active) { wardSpellSlot = Ward.GetPinkSlot(); } if (wardSpellSlot != null) { Console.WriteLine("putting ward2"); ObjectManager.Player.Spellbook.CastSpell(wardSpellSlot.SpellSlot, (Vector3)Wardspoting._PutSafeWard.ClickPosition); lastuseward = Environment.TickCount; } Wardspoting._PutSafeWard = null; } } }
void Game_OnGameUpdate(EventArgs args) { int time = Environment.TickCount; if (Config.Item("AutoBushEnabled").GetValue <bool>() && Config.Item("AutoBushKey").GetValue <KeyBind>().Active) { foreach (Obj_AI_Hero 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 = Items.GetWardSlot(); } else if (Config.Item("placekeypink").GetValue <KeyBind>().Active) { wardSpellSlot = Ward.GetPinkSlot(); } { 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) { ObjectManager.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 = Items.GetWardSlot(); } else if (Config.Item("placekeypink").GetValue <KeyBind>().Active) { wardSpellSlot = Ward.GetPinkSlot(); } if (wardSpellSlot != null) { Console.WriteLine("putting ward2"); ObjectManager.Player.Spellbook.CastSpell(wardSpellSlot.SpellSlot, Wardspoting._PutSafeWard.ClickPosition); lastuseward = Environment.TickCount; } Wardspoting._PutSafeWard = null; } } }