Script Function: Q4P7
From Ultima Online: The Second Age
function int Q4P7(list Q57R) { int Q5T8 = numInList(Q57R); if (hasObjVar(this, "findScript")) { int Q5VU = Q5T8; Q5T8 = 0x00; string Q5OM = getObjVar(this, "findScript"); for(int i = 0x00; i < Q5VU; i++) { obj Q57Q = Q57R[0x00]; removeItem(Q57R, 0x00); if (hasScript(Q57Q, Q5OM)) { Q5T8++; append(Q57R, Q57Q); } } } if (hasObjVar(this, "findTemplate")) { Q5VU = Q5T8; Q5T8 = 0x00; int Q5ZB = getObjVar(this, "findTemplate"); for(i = 0x00; i < Q5VU; i++) { Q57Q = Q57R[0x00]; removeItem(Q57R, 0x00); if (getTemplate(Q57Q) == Q5ZB) { Q5T8++; append(Q57R, Q57Q); } } } return (Q5T8); }