package client; import server.Randomizer; import tools.data.MaplePacketLittleEndianWriter; public class PlayerRandomStream { private transient long seed1, seed2, seed3; public PlayerRandomStream() { final int v4 = 5; this.CRand32__Seed(Randomizer.nextLong(), 1170746341 * v4 - 755606699, 1170746341 * v4 - 755606699); } public final void CRand32__Seed(final long s1, final long s2, final long s3) { seed1 = s1 | 0x100000; seed2 = s2 | 0x1000; seed3 = s3 | 0x10; } public final long CRand32__Random() { long v8 = ((this.seed1 & 0xFFFFFFFE) << 12) ^ ((this.seed1 & 0x7FFC0 ^ (this.seed1 >> 13)) >> 6); long v9 = 16 * (this.seed2 & 0xFFFFFFF8) ^ (((this.seed2 >> 2) ^ this.seed2 & 0x3F800000) >> 23); long v10 = ((this.seed3 & 0xFFFFFFF0) << 17) ^ (((this.seed3 >> 3) ^ this.seed3 & 0x1FFFFF00) >> 8); return (v8 ^ v9 ^ v10) & 0xffffffffL; // to be confirmed, I am not experienced in converting signed > unsigned } public final void connectData(final MaplePacketLittleEndianWriter mplew) { long v5 = CRand32__Random(); long s2 = CRand32__Random(); long v6 = CRand32__Random(); CRand32__Seed(v5, s2, v6); mplew.writeInt((int) v5); mplew.writeInt((int) s2); mplew.writeInt((int) v6); } }