Element Random GlobalConst Random.Half dq 0.5 Random.Seed dd 12345678h GlobalProc proc Random.Do imul edx,[Random.Seed],8088405h inc edx mov [Random.Seed],edx push -32 fild dword [esp] push 0 push edx fild qword [esp] add esp,12 fscale fstp st1 ret endp Vars Self#.FMin dq ? Self#.FMax dq ? Self#.FRnd dq ? Create fmov_ex Self#.FMin,Self#.prop.Min fmov_ex Self#.FMax,Self#.prop.Max PointWork doRandomize invoke GetTickCount add [Random.Seed],eax call Random.Do EndPoint PointWork doRandom0 call Random.Do fld qword [Self#.FMin] fld qword [Self#.FMax] fsub st0,st1 fld1 faddp st1,st0 fmulp st2,st0 faddp st1,st0 fld [Random.Half] fsubp st1,st0 fst [Self#.FRnd] sub esp,4 fistp dword [esp] fwait pop eax Self#.onRandom eax,data_int EndPoint PointWork doRandom1 call Random.Do fld qword [Self#.FMin] fld qword [Self#.FMax] fsub st0,st1 fmulp st2,st0 faddp st1,st0 fst [Self#.FRnd] Self#.onRandom 1,data_real_st0 EndPoint PointWork doMin \local res ReadReal res,data,data.type,Self#.Min,0 fmov_ex [Self#.FMin],res EndPoint PointWork doMax \local res ReadReal res,data,data.type,Self#.Max,0 fmov_ex [Self#.FMax],res EndPoint PointWork doRandSeed \local res ToInteger res,data,data.type mov_ex [Random.Seed],res EndPoint PointVar Random0,data_int fld [Self#.FRnd] sub esp,4 fistp dword [esp] fwait pop eax result equ eax EndPoint PointVar Random0,data_real_st0 fld [Self#.FRnd] result equ 1 EndPoint PointVar RandSeed,data_int result equ [Random.Seed] EndPoint EndElement