So I've got a simple single-stage quest set up to make pickpocketing an item add exp to the lockpicking skill (the pickpocket skill tree is being re-purposed). Using an SM Event Node (Player Add Item with one condition checking to make sure it was added via pickpocketing) to start a quest which runs the following script:
Scriptname AAAThieveryExpFromPickpocket extends Quest
Quest Property ThisQuest Auto
Event OnStoryAddToPlayer(ObjectReference akOwner, ObjectReference akContainer, Location akLocation, Form akItemBase, int aiAcquireType)
if aiAcquireType == 3
Game.AdvanceSkill("Lockpicking", akItemBase.GetGoldValue())
Debug.Notification("You got " + akItemBase.GetGoldValue() + " exp towards Thievery")
ThisQuest.Reset()
endIf
EndEvent
Quest Property ThisQuest Auto
Event OnStoryAddToPlayer(ObjectReference akOwner, ObjectReference akContainer, Location akLocation, Form akItemBase, int aiAcquireType)
if aiAcquireType == 3
Game.AdvanceSkill("Lockpicking", akItemBase.GetGoldValue())
Debug.Notification("You got " + akItemBase.GetGoldValue() + " exp towards Thievery")
ThisQuest.Reset()
endIf
EndEvent
I've used "ThisQuest.Stop()" as well, but the results are identical.
The problem is, it appears NONE of the script actually runs until the pickpocket window is exited, including the exp grant, the debug notice, and (I surmise) the reset/stop.
Any idea why the script won't run with the NPC's inventory open? Is there anything I can do to fix this, or will I have to come up with a messy workaround (ie, making multiple identical quests so if one is running the next will be triggered instead)?