/// <summary> /// Gets the object used for i18n token replacements /// </summary> /// <param name="questId">The quest ID - used to get the quest type</param> /// <returns> /// A generic object in the following format: /// - person - the npc name (translated) /// - otherPerson - a second npc name (translated) /// - englishPerson - untranslated npc name (used for quest keys) /// - itemName - the translated item name you will need to get for the quest - empty string if nothing /// - cropStart - the first 4 characters of the crop name - empty string if not a crop /// - id - the id of the item you need to get - 0 if nothing /// - article - "a" or "an" - currently only used for English replacements /// - number - random number between 2 and 10; used to determine how many of an item you need to get /// - reward - the money reward for a quest - between 300 and 3000 /// </returns> private static object GetTokenObject(int questId) { ReplacementObject replacements = new ReplacementObject(); string itemName = ""; string cropStart = ""; string article = ""; int id = 0; QuestItemTypes questType = QuestIdToQuestTypeMap[questId]; switch (questType) { case QuestItemTypes.Static: switch (questId) { case 3: itemName = ItemList.GetItemName((int)ObjectIndexes.Beet); break; case 6: itemName = ItemList.GetItemName(ParsnipCropId); id = ParsnipCropId; break; case 22: itemName = ItemList.GetItemName((int)ObjectIndexes.LargemouthBass); break; default: Globals.ConsoleError($"In the static quest type for unexpected quest: {questId}"); break; } break; case QuestItemTypes.Crop: itemName = replacements.Crop.DisplayName; cropStart = Globals.GetStringStart(itemName, 4); id = replacements.Crop.Id; break; case QuestItemTypes.Dish: itemName = replacements.Dish.DisplayName; id = replacements.Crop.Id; break; case QuestItemTypes.Fish: itemName = replacements.Fish.DisplayName; id = replacements.Fish.Id; break; case QuestItemTypes.Item: itemName = replacements.Item.DisplayName; id = replacements.Item.Id; break; default: break; } article = Globals.GetArticle(itemName); return(new { person = Globals.GetTranslation($"{replacements.Person}-name"), otherPerson = Globals.GetTranslation($"{replacements.OtherPerson}-name"), englishPerson = replacements.Person, item = itemName, cropStart, id, a = article, number = replacements.Number, reward = replacements.Reward }); }