public List <FoundItem> FindItem() { int itemcnt = ScanItems(true); List <FoundItem> items = new List <FoundItem>(); for (int i = 0; i < itemcnt; i++) { FoundItem item = GetItem(i); if (item != null) { items.Add(item); } } return(items); }
/// <summary> /// Returns list of FoundItem matching Type or ID /// </summary> /// <param name="TypeOrID"></param> /// <param name="VisibleOnly">Search for visible items only</param> /// <returns>Returns list of FoundItem matching Type or ID</returns> public List <FoundItem> FindItem(int TypeOrID, bool VisibleOnly = true, int containerID = 0) { int itemcnt = ScanItems(VisibleOnly); List <FoundItem> items = new List <FoundItem>(); for (int i = 0; i < itemcnt; i++) { FoundItem item = GetItem(i); if (item != null) { if (TypeOrID == 0 || item.Type == TypeOrID || item.ID == TypeOrID && (containerID == 0 || item.ContID == containerID)) { items.Add(item); } } } return(items); }
public FoundItem GetItem(int index) { UODLL.SetTop(UOHandle, 0); UODLL.PushStrVal(UOHandle, "Call"); UODLL.PushStrVal(UOHandle, "GetItem"); UODLL.PushInteger(UOHandle, index); if (UODLL.Execute(UOHandle) != 0) { return(null); } FoundItem item = new FoundItem(); item.ID = UODLL.GetInteger(UOHandle, 1); item.Type = UODLL.GetInteger(UOHandle, 2); item.Kind = UODLL.GetInteger(UOHandle, 3); item.ContID = UODLL.GetInteger(UOHandle, 4); item.X = UODLL.GetInteger(UOHandle, 5); item.Y = UODLL.GetInteger(UOHandle, 6); item.Z = UODLL.GetInteger(UOHandle, 7); item.Stack = UODLL.GetInteger(UOHandle, 8); item.Rep = UODLL.GetInteger(UOHandle, 9); item.Col = UODLL.GetInteger(UOHandle, 10); return(item); }
public FoundItem GetItem(int index) { UODLL.SetTop(UOHandle, 0); UODLL.PushStrVal(UOHandle, "Call"); UODLL.PushStrVal(UOHandle, "GetItem"); UODLL.PushInteger(UOHandle, index); if (UODLL.Execute(UOHandle) != 0) return null; FoundItem item = new FoundItem(); item.ID = UODLL.GetInteger(UOHandle, 1); item.Type = UODLL.GetInteger(UOHandle, 2); item.Kind = UODLL.GetInteger(UOHandle, 3); item.ContID = UODLL.GetInteger(UOHandle, 4); item.X = UODLL.GetInteger(UOHandle, 5); item.Y = UODLL.GetInteger(UOHandle, 6); item.Z = UODLL.GetInteger(UOHandle, 7); item.Stack = UODLL.GetInteger(UOHandle, 8); item.Rep = UODLL.GetInteger(UOHandle, 9); item.Col = UODLL.GetInteger(UOHandle, 10); return item; }
public void UseObject(FoundItem tinker) { UseObject(tinker.ID); }
public static int DistFromPlayer(UO uO, FoundItem mob) { return(Get2DDistance(uO.CharPosX, uO.CharPosY, mob.X, mob.Y)); }