IF
CharacterLootedCharacterCorpse(_Player,CHARACTERGUID_YourCharacter_GUID)
THEN
// Prevent corpse "inventory" from opening
DB_CustomUseItemResponse(_Player,CHARACTERGUID_YourCharacter_GUID,0);
IF
CharacterLootedCharacterCorpse(_Player,CHARACTERGUID_YourCharacter_GUID)
AND
CharacterIsDead(CHARACTERGUID_YourCharacter_GUID,1)
AND
// Not already in a dialog
IsSpeakerReserved(CHARACTERGUID_YourCharacter_GUID,0)
AND
StartDialog_Internal_NoDeadCheck("YourDialogName",CHARACTERGUID_YourCharacter_GUID,1,_Player,NULL_00000000-0000-0000-0000-000000000000,NULL_00000000-0000-0000-0000-000000000000,NULL_00000000-0000-0000-0000-000000000000,NULL_00000000-0000-0000-0000-000000000000,1)
THEN
// Dialog successfully started -> set same flags that are set when starting a dialog normally
Proc_DialogFlagSetup("YourDialogName",_Player,CHARACTERGUID_YourCharacter_GUID);
CharacterMakeStoryNpc(_Player,1);
DB_HasMetCharactersToCheck(_Speaker1,CHARACTERGUID_YourCharacter_GUID);