public static List <string> Combine(Arg lastArg) { List <string> result = new List <string>(); string item1ID = lastArg.OptionalEntityArgs.Dequeue().Remove(0, 1); string item2ID = lastArg.OptionalEntityArgs.Dequeue().Remove(0, 1); Item item1 = EntityLibrary.GetEntityByID(item1ID) as Item; Item item2 = EntityLibrary.GetEntityByID(item2ID) as Item; if (item1 == null) { item1 = EntityLibrary.GetEntityByName(item1ID) as Item; } if (item2 == null) { item2 = EntityLibrary.GetEntityByName(item2ID) as Item; } if (item1 == null || item2 == null) { result.Add("one or both items not found"); return(result); } if (item1.CombinabelWithIDs.Contains(item2.ID) && item2.CombinabelWithIDs.Contains(item1.ID) && item1.CombinableToID == item2.CombinableToID) { Item newItem = EntityLibrary.GetEntityByID(item1.CombinableToID) as Item; CharacterData.RemoveFromInventory(item1); CharacterData.RemoveFromInventory(item2); CharacterData.AddToInventory(newItem); result.AddRange(new string[] { "removed: " + item1.Name, "removed: " + item2.Name, "added: " + newItem.Name }); } else { throw new CombiningMismatchException("[Combination failed]", item1ID, item2ID); } return(result); }