FYI, I've made some minor changes to the anti-pickpocket script:
IF
PickPocketFailed([PC])
Allegiance(Myself,NEUTRAL)
General(Myself,HUMANOID)
!StateCheck(Myself,CD_STATE_NOTVALID)
See(LastTrigger)
!Allegiance(LastTrigger,FAMILIAR)
THEN
RESPONSE #100
StartDialogOverride("RR#PICKP",LastTrigger)
END
IF
PickPocketFailed([FAMILIAR])
Allegiance(Myself,NEUTRAL)
General(Myself,HUMANOID)
!StateCheck(Myself,CD_STATE_NOTVALID)
See(LastTrigger)
THEN
RESPONSE #100
SetInterrupt(FALSE)
FaceObject(LastTrigger)
DisplayStringHead(Myself,@9203) // Get away from me you filthy creature!
SetSequence(SEQ_ATTACK)
ActionOverride(LastTrigger,MakeUnselectable(12))
ActionOverride(LastTrigger,RandomWalkContinuous())
SetInterrupt(TRUE)
END
Basically, I wanted to take into account familiars who can pick pockets and make a special response in that case. So, if a familiar fails a pickpocket check against a non-hostile
NPC it will be reprimanded (via cosmetic swing, no actual damage will be dealt) which will make it run around in panic for a while. Anyway, the in-game results are fairly hilarious.

I've also excluded charbase.cre, RR's creatures and joinable NPCs from having their scripts patched:
// Taimon and Miloch's EXE patch for re-enabling the PickPocketFailed() trigger
COPY "bgmain.exe" "bgmain.exe"
PATCH_IF ((LONG_AT 0x5437B2) == 0xAA5E6C) THEN BEGIN
WRITE_LONG 0x5437B2 0xAA5F22
END ELSE PATCH_PRINT "Target bytes don't match. Aborting..."
BUT_ONLY_IF_IT_CHANGES
COMPILE ~RR/RR_CORE/COMPILE/RR#PICKP.BAF~ // compile the new anti-pickpocketing script
COMPILE ~RR/RR_CORE/COMPILE/RR#PICKP.D~ // RR's new pickpocket related dialogue
// Extend creature scripts
COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~ // parse through all creatures in the game
PATCH_IF (%SOURCE_SIZE% > 0x2d3) THEN BEGIN // file size sanity check (filters out 0 byte files i.e. ALLOW_MISSING)
READ_ASCII 0x248 "ovrscript"
READ_BYTE 0x270 "allegiance"
READ_BYTE 0x271 "general"
READ_ASCII 0x280 "deathvar"
PATCH_IF (%allegiance% = "128" AND %general% = "1") BEGIN // only patch non-hostile humanoid creatures
PATCH_IF ("%SOURCE_RES%" STRING_CONTAINS_REGEXP ~RR#~ = 1) BEGIN // don't patch files prefixed with the designated strings (i.e. skip RR's own creatures)
PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~charbase~ = 0) AND (NOT FILE_CONTAINS_EVALUATED (~pdialog.2da~ ~%deathvar%~)) BEGIN // exclude CHARBASE.CRE and joinable NPCs
PATCH_IF NOT FILE_EXISTS_IN_GAME ~%ovrscript%.bcs~ THEN BEGIN // if the override script doesn't exist
WRITE_ASCII 0x248 ~RR#PICKP~ #8 // assign RR#PICKP.BCS as the new override script
END ELSE
INNER_ACTION BEGIN
ACTION_IF FILE_EXISTS_IN_GAME ~%ovrscript%.bcs~ AND (NOT FILE_CONTAINS_EVALUATED (~%ovrscript%.bcs~ ~RR#PICKP~)) AND ("%ovrscript%" STRING_CONTAINS_REGEXP ~RR#~ = 1) BEGIN
EXTEND_TOP ~%ovrscript%.bcs~ ~RR/RR_CORE/COMPILE/RR#PICKP.BAF~ // otherwise just extend the script unless it was already done
END // ends ACTION_IF check which prevents extending the same script multiple times
END // ends inner action
END // ends charbase and joinable NPC check
END // ends prefix check
END // ends allegiance and general check
END // end file size sanity check
BUT_ONLY_IF_IT_CHANGES
Edited by aVENGER, 31 May 2009 - 03:56 AM.