An example fix was posted in the other thread pertaining to this issue here
https://postpacific.mmorpg-game.onli...=1502&start=90 . Basically, the npcs are checking for the castle owner and/or pledge members of the castle owner in the TALKED event handler, and it also needs to be done in in the MENU_SELECTED event handler. Different fixes are required for npcs not dealing with castle owners.
If you discover what causes the crash, please pass it on. I've tried a handful of different handlers and I've yet to find one that crashes.