shepher

SendRemoveMob

Mar 13th, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. /* .cpp */
  2. void SendRemoveParty(int clientid, int mobId)
  3. {
  4.  int removeparty_addr = 0x00442410;
  5.  _asm
  6.  {
  7.   PUSH mobId
  8.   PUSH clientid
  9.   CALL removeparty_addr
  10.   ADD ESP,0x04
  11.  }
  12. }
  13.  
  14. void SendRemoveMob(int clientid)
  15. {
  16.  pCL_P1h pRemMob;
  17.     pRemMob.Header.Size = sizeof(pCL_P1h);
  18.  pRemMob.Header.PacketId = 0x165;
  19.  char tmp[1024];
  20.  for(int i = 0; i < 12; i++)
  21.  {
  22.   int masterIndex = clientid * 0x410;
  23.   int memberId = *(WORD*)(masterIndex + 0x015C6D86 + (i * 2));
  24.   if(*(DWORD*)(memberId * 0xC4C + 0x07B318E0) == 0x00)
  25.   {
  26.    if(memberId != 0x0)
  27.    {
  28.     pRemMob.dat1 = DELETE_UNSPAWN;
  29.     pRemMob.Header.ClientId = memberId;
  30.     AddMessage((BYTE*)&pRemMob ,clientid);
  31.     SendRemoveParty(clientid, memberId);
  32.                                 return;
  33.    }
  34.   }
  35.  }
  36. }
  37. /* .h */
  38. struct pCL_P1h
  39.  
  40. {
  41.  
  42.     PacketHeader Header;
  43.  
  44.     int dat1;
  45.  
  46. };
  47.  
  48. void SendRemoveMob(int clientid);
  49. void SendRemoveParty(int clientid, int mobId);
  50.  
  51. #define DELETE_NORMAL 0 // Somente desaparece
  52. #define DELETE_DEAD 1 // Animacao da morte do spawn
  53. #define DELETE_DISCONNECT 2 // Efeito de quando o personagem sai do jogo
  54. #define DELETE_UNSPAWN 3 // Efeito quando os monstros ancts somem
Advertisement
Add Comment
Please, Sign In to add comment