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 AddObject(string name, Serial value) { if (Helper.CheckName(ref name, false)) { Aliases.SetObject(name, value); } else { ScriptErrorException.Throw("Invalid object name."); } }
public static void AddObject(string name) { if (Helper.CheckName(ref name, false)) { UO.Print("Select {0}:", name); Serial serial = UIManager.TargetObject(); if (serial.IsValid) { Aliases.SetObject(name, serial); } else { ScriptErrorException.Throw("Invalid object serial."); } } else { ScriptErrorException.Throw("Invalid object name."); } }