Skip to content

Prevent looting NPCs by player

Engine restrictions

It's only available for Gothic 2 Addon (G2A)!

This hook is triggered whenever the player tries to loot an NPCs while they are unconscious or dead. It extends the default looting system by allowing custom script conditions to determine whether looting is allowed.

To control looting behavior, define the following Daedalus function: zDExt_Npc_CanPlayerPlunder defined in Scripts/Content directory.

  • self - player
  • other - NPC to loot
Example usage
func int zDExt_Npc_CanPlayerPlunder()
{
    if (!Hlp_IsValidNpc(self) || !Hlp_IsValidNpc(other))
    { 
        return FALSE;
    };

    if (Hlp_GetInstanceID(other) == NONE_100_Xardas)
    {
        AI_PlayAni(self, "T_DONTKNOW");
        return FALSE;
    };

    return TRUE;
};