I'm working on a mod that adds a custom dragonborn follower (a little cliché, I'll admit), and I'm having an issue that I haven't been able to find a solution to so far. I've searched on Google, around the Nexus forums, on the CC website, but I've had no luck.
A little background: There are several shouts that you can add to an NPC, and the NPC will be able to use them no problem. This includes just under half of the vanilla shouts. However, one shout that NPCs don't use right out of the box is Dragonrend, and I'd like my follower to be able to use it. So, I put together a quest that gets the nearest dragon as an alias, and using a combat override package with the "Shout" template, passing the dragon alias as the target, I was successfully able to make the follower use Dragonrend on dragons.
Now, here's the issue:
The Shout package force-equips the Dragonrend shout in the follower's shout/power slot. After the package is over, the NPC doesn't go back to the usual behavior where they automatically equip shouts from their available spells. Instead, the follower will use other shouts (like Fire Breath), but won't equip them. Dragonrend stays in the equipped shout slot, and this causes issues, since I use GetEquippedShout to determine what voice lines should play when the follower shouts (same as how it's done in vanilla). In effect, this means my follower will say "Joor Zah Frul" when using Fire Breath.
I haven't been able to figure out how or why this happens, but I have figured out that giving the NPC an item (using the AddItem console command) will make them re-check their inventory (similar to when you trade items with your follower, and the decide whether they should use the new gear you gave them). So I tried implementing this in Papyrus, adding a fragment at the end of my dragonrend package to give them a temporary item, just to get them to recheck their inventory and realize that they've got the wrong shout equipped. But it seems that the AddItem() Papyrus function doesn't cause NPCs to recheck their inventory.
Which leads me to my question: Is there a way to make NPCs recheck their inventory & equip the proper equipment by using a Papyrus function? Am I missing something, or doing something wrong? Or, alternatively, is there another way to make an NPC use dragonrend (or any other shouts they don't normally use) that avoids this issue entirely?