public static UOItem FindType(string objectName, Graphic graphic, UOColor color, Serial container) { UOItem foundItem; if (container != 0) { UOObject obj = World.GetObject(container); if (obj.Serial.IsValid) { if (obj is UOItem) { foundItem = ((UOItem)obj).AllItems.FindType(graphic, color); } else { foundItem = ((UOCharacter)obj).Layers.FindType(graphic, color); } } else { ScriptErrorException.Throw("Invalid container serial."); foundItem = new UOItem(Serial.Invalid); } } else { foundItem = World.Ground.FindType(graphic, color); } Aliases.SetObject(objectName, foundItem); return(foundItem); }
public static void UseType(Graphic graphic, UOColor color) { UOItem item = World.Player.Layers.FindType(graphic, color); if (item.Serial.IsValid) { UO.UseObject(item); } else { ScriptErrorException.Throw("Type not found."); } }
public static IRequestResult WaitTargetType(Graphic graphic, UOColor color) { UOItem item = World.Player.Layers.FindType(graphic, color); if (item.Serial.IsValid) { return(WaitTargetObject(item)); } else { ScriptErrorException.Throw("Type not found."); return(UIManager.FailedResult); } }