Script Function: Q64F
From Ultima Online: The Second Age
function obj Q64F(obj user, obj owner, int Q63R) { list goldOwnerList; list goldQuantityList; getObjListVar(goldOwnerList, this, <span style="color:#800000">"goldOwnerList"</span>); getObjListVar(goldQuantityList, this, <span style="color:#800000">"goldQuantityList"</span>); obj Q5BT = NULL(); for(int i = 0x00; 0x01; i++) { if (i >= numInList(goldOwnerList)) { return (Q5BT); } obj Q4FL = goldOwnerList[i]; if (owner == Q4FL) { int Q5EB = goldQuantityList[i]; if (Q5EB > Q63R) { setItem(goldQuantityList, Q5EB - Q63R, i); Q5EB = Q63R; } else { removeItem(goldOwnerList, i); removeItem(goldQuantityList, i); } obj gold = containsObjType(this, 0x0EED); if (gold != NULL()) { int Q63T = getQuantity(gold); if (Q5EB > Q63T) { debugMessage(<span style="color:#800000">"Tried to transfer "</span> + Q5EB + <span style="color:#800000">" gold from vendor with only "</span> + Q63T + <span style="color:#800000">" gold."</span>); Q5EB = Q63T; clearList(goldOwnerList); clearList(goldQuantityList); } Q5BT = createNoResObjectIn(0x0EED, getBackpack(user)); transferGeneric(Q5BT, gold, Q5EB); break; } } } setObjVar(this, <span style="color:#800000">"goldOwnerList"</span>, goldOwnerList); setObjVar(this, <span style="color:#800000">"goldQuantityList"</span>, goldQuantityList); return (Q5BT); }