KidaCoding

Untitled

Mar 9th, 2025
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.64 KB | Source Code | 0 0
  1. بدل دول بلي عندك
  2.  
  3.  public static unsafe void Interaction(this ServerSockets.Packet stream, InteractQuery* pQuery, bool AutoAttack)
  4.         {
  5.             stream.ReadUnsafe(pQuery, sizeof(InteractQuery));
  6.             if (pQuery->AtkType == AttackID.Magic && AutoAttack == false)
  7.             {
  8.                 DecodeMagicAttack(pQuery);
  9.             }
  10.         }
  11.  
  12.         public static unsafe ServerSockets.Packet InteractionCreate(this ServerSockets.Packet stream, InteractQuery* pQuery)
  13.         {
  14.             stream.InitWriter();
  15.  
  16.             stream.WriteUnsafe(pQuery, sizeof(InteractQuery));
  17.             stream.Finalize(GamePackets.Attack);
  18.  
  19.             return stream;
  20.         }
  21.         private static unsafe void DecodeMagicAttack(InteractQuery* pQuery)
  22.         {
  23.             int magicType, magicLevel;
  24.             BitUnfold32(pQuery->Damage, out magicType, out magicLevel);
  25.  
  26.             magicType = (ushort)(ExchangeShortBits(((ushort)magicType ^ (uint)pQuery->UID ^ 0x915d), 16 - 3) + 0x14be);
  27.             magicLevel = (ushort)(((byte)magicLevel) ^ 0x21);
  28.  
  29.             pQuery->Damage = BitFold32(magicType, magicLevel);
  30.             pQuery->OpponentUID = (uint)((ExchangeLongBits((uint)pQuery->OpponentUID, 13) ^ (uint)pQuery->UID ^ 0x5f2d2463) + 0x8b90b51a);
  31.             pQuery->X = (ushort)(ExchangeShortBits(((ushort)pQuery->X ^ (uint)pQuery->UID ^ 0x2ed6), 16 - 1) + 0xdd12);
  32.             pQuery->Y = (ushort)(ExchangeShortBits(((ushort)pQuery->Y ^ (uint)pQuery->UID ^ 0xb99b), 16 - 5) + 0x76de);
  33.         }
  34.  
  35. ولول جالك ايرور ف  كود شبه ده
  36. خليه كده
  37.  
  38.    stream.Interaction(&Attack, user.OnAutoAttack);
Advertisement
Add Comment
Please, Sign In to add comment