First of all, there are actually two separate scripting systems:
*
Behaviour scripts: these are generally scripts attached to items/characters, and use an imperative programming language.
*
Osiris (aka "Story"): these are generally global scripts that use a declarative programming language (a bit like Prolog). The documentation for this scripting system is still very much incomplete though. On the other hand, while this language evolved quite a bit since DOS EE, the
old video tutorials are still relevant and would teach you a good basis. We will make new tutorials about the state of the language in DOS2 (don't know about videos though), but if you want a head start, that's definitely a good place and it won't be time wasted.
That said, making every NPC drop everything they had when they die (in addition to whatever is defined as their regular "treasure") should be fairly easy from Osiris once you know the language:
* you can detect when a character is dying (event CharacterDying)
* you can iterate over its inventory (InventoryLaunchIterator)
* you can drop items from its inventory (ItemDrop)
I say "should", because I'm not certain when the regular inventory gets replaced by the treasure table (and maybe it happens before the CharacterDying event, although I would assume not).
I haven't documented any of the above events/calls yet at
https://docs.larian.game/Category:Osiris_APIs, so at least I have good next candidates to add

(there are 879 Osiris APIs in total, so it will take quite a while to document them all — although some are probably no longer functional and merely leftovers; Osiris was first used in the original Divine Divinity!)
In any case, I will start today on a general Osiris overview that explains the basics of the language.