Skip to content

Instantly share code, notes, and snippets.

@Jadd
Created November 13, 2017 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jadd/41b4bc2ace3d8b97fc7deaa126bf3a26 to your computer and use it in GitHub Desktop.
Save Jadd/41b4bc2ace3d8b97fc7deaa126bf3a26 to your computer and use it in GitHub Desktop.
Albion max view detection vector bypass.
using Afterglow.Internal.Client.Objects;
using Albion.Common.Photon;
using UnityEngine;
namespace Afterglow.Internal.Client.Detection {
public class MaxViewDetection : PacketHandler {
protected override void OnPacketEvent(PacketInfo packet) {
if (packet.Type != PacketType.OperationRequest)
return;
if (packet.Opcode != OperationCodes.Move)
return;
var movement = (acc) packet.Data;
var movementPosition = new Vector2(movement.ayo[0], movement.ayo[1]);
var movementClick = new Vector2(movement.ayq[0], movement.ayq[1]);
// The distance does not indicate that we can see further than 10 units, so we're safe!
if (Vector2.Distance(movementPosition, movementClick) <= 10f)
return;
// Limit the destination to 9-10 units; remove the interaction target.
movementClick = Vector2.MoveTowards(movementPosition, movementClick, Random.Range(9f, 10f));
movement.ayq[0] = movementClick.x;
movement.ayq[1] = movementClick.y;
movement.ays = 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment