daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Aug 13th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. JSAPI_FUNC(me_castXY)
  2. {
  3.     if(!WaitForGameReady())
  4.         THROW_WARNING(cx, "Game not ready");
  5.        
  6.     if(argc < 3)
  7.         THROW_ERROR(cx, "Not enough parameters were passed to castXY!");
  8.        
  9.     *rval = JSVAL_FALSE;
  10.  
  11.     DWORD dwX = JSVAL_TO_INT(argv[1]);
  12.     DWORD dwY = JSVAL_TO_INT(argv[2]);
  13.    
  14.     BYTE aPacket[5] = { NULL };
  15.     aPacket[0] = JSVAL_TO_INT(argv[0]) == 0 ? 0x0c : 0x05; 
  16.     *(DWORD*)&aPacket[1] = dwX;
  17.     *(DWORD*)&aPacket[3] = dwY;
  18.     D2NET_SendPacket(5, 1, aPacket);
  19.  
  20.     *rval = JSVAL_TRUE;
  21.    
  22.     return JS_TRUE;
  23. }
RAW Paste Data
Top