| 1914 | } |
| 1915 | |
| 1916 | int RndTypeItems(int itype, int imid) |
| 1917 | { |
| 1918 | int i, ri; |
| 1919 | BOOL okflag; |
| 1920 | int ril[512]; |
| 1921 | |
| 1922 | ri = 0; |
| 1923 | for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) { |
| 1924 | okflag = TRUE; |
| 1925 | if (!AllItemsList[i].iRnd) |
| 1926 | okflag = FALSE; |
| 1927 | if (currlevel << 1 < AllItemsList[i].iMinMLvl) |
| 1928 | okflag = FALSE; |
| 1929 | if (AllItemsList[i].itype != itype) |
| 1930 | okflag = FALSE; |
| 1931 | if (imid != -1 && AllItemsList[i].iMiscId != imid) |
| 1932 | okflag = FALSE; |
| 1933 | if (okflag) { |
| 1934 | ril[ri] = i; |
| 1935 | ri++; |
| 1936 | } |
| 1937 | } |
| 1938 | |
| 1939 | return ril[random_(27, ri)]; |
| 1940 | } |
| 1941 | |
| 1942 | int CheckUnique(int i, int lvl, int uper, BOOL recreate) |
| 1943 | { |
no test coverage detected