Skip to content

Entity Looting System #77

Description

@FirebrickRed

Summary

Allow players to loot dead entities for items and gold. Works for all entity types (NPCs, monsters, etc.) with investigation checks and DM-configurable loot tables.

Phase: 2 - Interaction
Systems: Entity System, Interaction, Looting

Prerequisites

Goals

  • /entity loot <entity> - Attempt to loot entity
  • Optional investigation check (DM configurable)
  • Loot from inventory OR loot_table in YAML
  • Works for ALL entities (not just monsters)
  • DM can disable looting per entity
  • Auto-loot on entity death (optional)

Use Cases

Scenario 1: Monster Loot

# Kobold dies, drops items from loot_table
id: kobold
loot_table:
  - item: dagger
    chance: 0.8
  - item: gold_piece
    min: 1
    max: 5
    chance: 1.0

Scenario 2: NPC Body Looting

# Guard has items in inventory - players can loot if dead
id: town_guard
inventory:
  - longsword
  - chainmail
  - note_from_captain  # Secret note!
  
looting:
  requires_investigation: true
  dc: 12
  # Players must roll investigation to find the note

Scenario 3: Investigation Check

Player: /entity loot town_guard
> Roll Investigation: [Rolling...]
> You rolled 15 (DC 12) - Success!
> You find: Longsword, Chainmail, Note from Captain

YAML Configuration

id: mysterious_merchant
name: "Hooded Merchant"

# What they carry
inventory:
  - healing_potion
  - mysterious_key

# Loot settings
looting:
  enabled: true
  requires_investigation: true
  dc: 15
  hidden_items:  # Only found with high rolls
    - item: mysterious_key
      dc: 18

Commands

# Attempt to loot
/entity loot town_guard
> Investigation check required (DC 12)
> You rolled 9 - Failure. You find nothing of value.

# DM can bypass checks
/dmentity loot town_guard --force
> Looted: Longsword, Chainmail, Note from Captain

Auto-Loot on Death

# Config option: auto_loot_on_death
# If true, loot automatically drops when entity dies
# If false, players must use /entity loot command

Next Steps

After completing this issue, tackle:

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestnpc/entityFor issues pertaining to npc's or monsters and is referred to as entities in the mod pack

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions