Script Function: Q4DY
From Ultima Online: The Second Age
function int Q4DY(int metal, int Q55Z, int Q5VT, int Q5VN) { int Q5NY = Q5VT; while(Q5NY < 0x3D) { int Q4HG = getArrayIntElem(0x00, 0x03, Q5NY); if (Q4HG > Q5VN) { int Q4NT = numInList(Q5NZ); int Q4NV = Q4DY(metal, Q55Z, Q5NY + 0x01, Q5VN + 0x01); int Q5C8 = numInList(Q5NZ) - Q4NT; if (Q5C8 > 0x01) { truncateList(Q5NZ, Q4NT); append(Q5NZ, Q5NY); } Q5NY = Q4NV; } else { if ((Q4HG < Q5VN) || (getArrayIntElem(0x00, 0x01, Q5NY) == 0x36)) { break; } if (Q4A1(Q5NY, metal, Q55Z)) { append(Q5NZ, Q5NY); } Q5NY++; } } return (Q5NY); }