Beispiel #1
0
 internal static void OnRightClickUnit(IntPtr parPlayerPtr, int parAutoLoot)
 {
     if (OnRightClickUnitFunction == null)
     {
         OnRightClickUnitFunction = Memory.Reader.RegisterDelegate <OnRightClickUnitDelegate>((IntPtr)Constants.Offsets.Functions.OnRightClickUnit);
     }
     OnRightClickUnitFunction(parPlayerPtr, parAutoLoot);
 }
 internal static void Apply()
 {
     if (_OnRightClickUnitHook == null)
     {
         byte[] old = Memory.Reader.ReadBytes((IntPtr)0x60BEA0, 8);
         _OnRightClickUnitDelegate = Memory.Reader.RegisterDelegate <OnRightClickUnitDelegate>((IntPtr)0x60BEA0);
         _OnRightClickUnitHook     = Memory.Reader.Detours.CreateAndApply(_OnRightClickUnitDelegate, new OnRightClickUnitDelegate(OnRightClickUnitHookFunc), "OnRightClickUnitHook");
         byte[] custom       = Memory.Reader.ReadBytes((IntPtr)0x60BEA0, 8);
         Hack   autolootUnit = new Hack((IntPtr)0x60BEA0, custom, old, "OnRightClickUnit");
         AntiWarden.HookWardenMemScan.AddHack(autolootUnit);
     }
     _OnRightClickUnitHook.Apply();
 }
        internal static void OnRightClickUnit(IntPtr parPlayerPtr, int parAutoLoot)
        {
            if (!ObjectManager.Instance.IsIngame)
            {
                return;
            }
            if (OnRightClickUnitFunction == null)
            {
                OnRightClickUnitFunction =
                    Memory.Reader.RegisterDelegate <OnRightClickUnitDelegate>(funcs.OnRightClickUnit);
            }

            MainThread.Instance.Invoke(() => OnRightClickUnitFunction(parPlayerPtr, parAutoLoot));
        }