internal static void CCast(this Spell spell, AIBaseClient target, HitChance SelectedHitchance) //for Circular spells { if (spell.Type == SkillshotType.Circle || spell.Type == SkillshotType.Cone) // Cone 스킬은 임시로 { if (spell != null && target != null) { var pred = SpellPrediction.GetPrediction(target, spell.Delay, spell.Width / 2, spell.Speed); SharpDX.Vector2 castVec = (pred.UnitPosition.ToVector2() + target.PreviousPosition.ToVector2()) / 2; SharpDX.Vector2 castVec2 = Player.PreviousPosition.ToVector2() + SharpDX.Vector2.Normalize(pred.UnitPosition.ToVector2() - Player.Position.ToVector2()) * (spell.Range); if (target.IsValidTarget(spell.Range)) { if (target.MoveSpeed * (Game.Ping / 2000 + spell.Delay + Player.PreviousPosition.Distance(target.PreviousPosition) / spell.Speed) <= spell.Width * 1 / 2) { spell.Cast(target.PreviousPosition); //Game.Ping/2000 추가함. } else if (pred.Hitchance >= SelectedHitchance && pred.UnitPosition.Distance(target.PreviousPosition) < Math.Max(spell.Width, 300f)) { if (target.MoveSpeed * (Game.Ping / 2000 + spell.Delay + Player.PreviousPosition.Distance(target.PreviousPosition) / spell.Speed) <= spell.Width * 2 / 3 && castVec.Distance(pred.UnitPosition) <= spell.Width * 1 / 2 && castVec.Distance(Player.PreviousPosition) <= spell.Range) { spell.Cast(castVec); } else if (castVec.Distance(pred.UnitPosition) > spell.Width * 1 / 2 && Player.PreviousPosition.Distance(pred.UnitPosition) <= spell.Range) { spell.Cast(pred.UnitPosition); } else { spell.Cast(pred.CastPosition); // <- 별로 좋은 선택은 아니지만.. } } } else if (target.IsValidTarget(spell.Range + spell.Width / 2)) //사거리 밖 대상에 대해서 { if (pred.Hitchance >= SelectedHitchance && Player.PreviousPosition.Distance(pred.UnitPosition) <= spell.Range + spell.Width * 1 / 2 && pred.UnitPosition.Distance(target.PreviousPosition) < Math.Max(spell.Width, 400f)) { if (Player.PreviousPosition.Distance(pred.UnitPosition) <= spell.Range) { if (Player.PreviousPosition.Distance(pred.CastPosition) <= spell.Range) { spell.Cast(pred.CastPosition); } } else if (Player.PreviousPosition.Distance(pred.UnitPosition) <= spell.Range + spell.Width * 1 / 2 && target.MoveSpeed * (Game.Ping / 2000 + spell.Delay + Player.PreviousPosition.Distance(target.PreviousPosition) / spell.Speed) <= spell.Width / 2) { if (Player.Distance(castVec2) <= spell.Range) { spell.Cast(castVec2); } } } } } } }
public void Update() { var gfx = _graphics; gfx.BeginScene(); gfx.ClearScene(_transparent); if (Settings.ShowMenu) { DrawShadowText(gfx, _font, _green, new Point(20f, _window.Height / 2 + 115), "Aimbot Menu"); if (Settings.aimEnabled) { DrawShadowText(gfx, _font, _red, new Point(20f, _window.Height / 2 + 130), "Aimbot ON (F5) : " + Settings.aimEnabled.ToString()); } else { DrawShadowText(gfx, _font, _green, new Point(20f, _window.Height / 2 + 130), "Aimbot OF (F5) : " + Settings.aimEnabled.ToString()); } if (Settings.bDrawFow) { DrawShadowText(gfx, _font, _red, new Point(20f, _window.Height / 2 + 145), "FOV SHOW (F6) : " + Settings.bDrawFow.ToString()); } else { DrawShadowText(gfx, _font, _green, new Point(20f, _window.Height / 2 + 145), "FOV HIDE (F6) : " + Settings.bDrawFow.ToString()); } DrawShadowText(gfx, _font, _green, new Point(20f, _window.Height / 2 + 160), "┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈"); } // Read View Matrix long viewMatrixAddr = Mem.ReadMemory <int>(Mem.ReadMemory <int>(_data.ViewMatrixBase) + 32) + 512; D3DMatrix viewMatrix = Algorithms.ReadViewMatrix(viewMatrixAddr); var AimTargets = new AimTarget[_data.Players.Length]; float fClosestDist = -1; // Draw Player ESP if (Settings.PlayerESP) { for (int i = 0; i < _data.Players.Length; i++) { var player = _data.Players[i]; //if (player.Health <= 0) continue; if (Algorithms.WorldToScreenPlayer(viewMatrix, player.Position, out ShpVector3 playerScreen, out int distance, _window.Width, _window.Height)) { // Too Far not render if (distance > 500) { continue; } float x = playerScreen.X; float y = playerScreen.Y; float h = playerScreen.Z; float w = playerScreen.Z / 2; try { _boxBrush = _randomBrush[player.TeamID % 7]; } catch (IndexOutOfRangeException) { _boxBrush = _green; } //DrawShadowText(gfx,_font, _green, new Point((x - playerScreen.Z / 4) - 3, y - 15), player.Pose.ToString()); // Adjust Box if (player.Pose == 1114636288) { y = playerScreen.Y + playerScreen.Z / 5; h -= playerScreen.Z / 5; } if (player.Pose == 1112014848 || player.Status == 7) { y = playerScreen.Y + playerScreen.Z / 4; h -= playerScreen.Z / 4; } int ScreenCenterX = _window.Width / 2, ScreenCenterY = _window.Height / 2; if (Settings.aimEnabled) { long tmpAddv = Mem.ReadMemory <int>(player.Address + tmpOffset); long bodyAddv = tmpAddv + actorOffset; long boneAddv = Mem.ReadMemory <int>(tmpAddv + boneOffset) + 48; ShpVector3 headPos = Algorithms.GetBoneWorldPosition(bodyAddv, boneAddv + 5 * 48); headPos.Z += 7; var clampPos = headPos - player.Position; bool w2sHead = Algorithms.WorldToScreen3DBox(viewMatrix, new ShpVector3(headPos.X, headPos.Y - (Settings.bPredict * 2), headPos.Z - (Settings.bYAxis * 8)), out ShpVector2 HeadPosition, _window.Width, _window.Height); AimTargets[i] = new AimTarget(); AimTargets[i].Screen2D = HeadPosition; AimTargets[i].uniqueID = player.TeamID; AimTargets[i].CrosshairDistance = ShpVector2.Distance(HeadPosition, new ShpVector2(ScreenCenterX, ScreenCenterY)); if (BestTargetUniqID == -1) { if (Algorithms.isInside(ScreenCenterX, ScreenCenterY, Settings.bFovArray[Settings.bFovInt], AimTargets[i].Screen2D.X, AimTargets[i].Screen2D.Y)) { fClosestDist = AimTargets[i].CrosshairDistance; BestTargetUniqID = AimTargets[i].uniqueID; } } if (MainForm.GetAsyncKeyState(Settings.bAimKeys[Settings.bAimKeyINT])) { if (BestTargetUniqID != -1) { var best = FindAimTargetByUniqueID(AimTargets, BestTargetUniqID); if (best != null) { { var roundPos = new ShpVector2((float)Math.Round(best.Screen2D.X), (float)Math.Round(best.Screen2D.Y)); AimAtPosV2(roundPos.X, roundPos.Y, _window.Width, _window.Height, false); } } } } else { BestTargetUniqID = -1; } } if (Settings.bDrawFow) { gfx.DrawCircle(_red, ScreenCenterX, ScreenCenterY, Settings.bFovArray[Settings.bFovInt], 2); } } } gfx.EndScene(); } }