Пример #1
0
 internal static void UseItemAtPos(IntPtr ptr, Location parPos)
 {
     if (CastAtPosFunction == null)
     {
         CastAtPosFunction = Memory.Reader.RegisterDelegate <CastAtPosDelegate>(funcs.CastAtPos);
     }
     if (!ObjectManager.Instance.IsIngame)
     {
         return;
     }
     MainThread.Instance.Invoke(() =>
     {
         Memory.Reader.Write((IntPtr)0xCECAC0, 64);
         UseItem(ptr);
         var pos = parPos.ToStruct;
         CastAtPosFunction(ref pos);
     });
 }
Пример #2
0
 internal static void CastAtPos(string parSpell, Location parPos, int parRank = -1)
 {
     if (CastAtPosFunction == null)
     {
         CastAtPosFunction = Memory.Reader.RegisterDelegate <CastAtPosDelegate>(funcs.CastAtPos);
     }
     if (!ObjectManager.Instance.IsIngame)
     {
         return;
     }
     MainThread.Instance.Invoke(() =>
     {
         Memory.Reader.Write((IntPtr)0xCECAC0, 0);
         Spell.Instance.Cast(parSpell, parRank);
         var pos = parPos.ToStruct;
         CastAtPosFunction(ref pos);
     });
 }