Based on dfusion code, with lots of safety checks added. Supports two
swap modes: transient and permanent; the former does a minimal change
and is intended for managing companion inventory. The permanent one
performs all known actions necessary to turn it into the real adventurer.
Note: the transient mode is a hack and may cause the game to crash
if not reverted while within range of the real adventurer unit.