I've downloaded the mod Art of the Catch and I was wondering how I could change the scripts in order to spawn three new category of items:
any ingredient (dragon bones) any non-enchanted craftable item (iron helmet) any enchanted craftable item (ring with magic enchantment that is vanilla or added by a mod)
Looking at the source code, I found this:
function SelectFish()
Form fish_base = fish_detected.GetBaseObject()
if fish_base == CritterPondFish01
PlayerRef.AddItem(CritterPondFish01Ingredient, 1, true)
_AC_CaughtFish01.Show()
elseif fish_base == CritterPondFish02
PlayerRef.AddItem(CritterPondFish02Ingredient, 1, true)
_AC_CaughtFish02.Show()
elseif fish_base == CritterPondFish03
PlayerRef.AddItem(CritterPondFish03Ingredient, 1, true)
_AC_CaughtFish03.Show()
elseif fish_base == CritterPondFish04
PlayerRef.AddItem(CritterPondFish04Ingredient, 1, true)
_AC_CaughtFish04.Show()
elseif fish_base == CritterPondFish05
PlayerRef.AddItem(CritterPondFish05Ingredient, 1, true)
_AC_CaughtFish05.Show()
elseif fish_base == CritterSalmon01 || fish_base == CritterSalmon02 || _AC_FishWaterfallTypes.HasForm(fish_base)
PlayerRef.AddItem(FoodSalmon, 1, true)
_AC_CaughtFishSalmon.Show()
endif
endFunction
It was inside _ac_beginfishing.psc with other functions. I am pretty sure I just need to modify the function, but I am not sure if we can use a general class of items as a variable, and I am even less sure about adding items with enchantments, because from what I know there's no variable that points to a list of items.
Anyway, how would you change the scripts so that it spawns random items? The way I would do is generate a random number and use it to select an item in a list, but I am not familiar with the scripting language, so I am not exactly sure how I could do that or even if it's possible.