Advertisement
Baoulettes

AutoSS.cpp

Nov 27th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. void RefreshAutoSS(DWORD * pSocket, WORD itemID)
  2. {
  3.     //file << "<<<< Entered RequestAutoSS: pSocket: " << hex << pSocket
  4.     //  << " itemID: " << itemID << ".\n";
  5.     //file.flush();
  6.     //if the item passed is a valid ID
  7.     if( itemID != 0 )
  8.     {
  9.         if (pSocket != NULL)
  10.         {
  11.             DWORD * pUser = GetUser(pSocket);
  12.  
  13.             if(pUser != NULL)
  14.             {
  15.                 if( !bPrivateStore && !bActiveRequest && bIsAlive )
  16.                 {
  17.                     DWORD * pUserInventory = GetUserInventory(pUser);
  18.  
  19.                     //ExUser * tempExUser = GetExUser(pUser);
  20.  
  21.                     //Find the item in the player's inventory
  22.                     DWORD * pItem = CInventory::FindFirstItemByClassID(pUserInventory, itemID);
  23.  
  24.                     if(pItem != NULL)
  25.                     {
  26.                         //Use the requested item so their SS is charged
  27.                         CCreature::UseItem(pUser, pItem);
  28.                     }
  29.                 }
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement