D&D 5e 工具包:玩家与 DM 的 AI 助手 - Openclaw Skills

作者:互联网

2026-03-26

AI教程

什么是 D&D 5e 工具包?

D&D 5e 工具包是一个专门的设计套件,旨在通过自动化简化桌面角色扮演游戏的管理。通过与官方 D&D 5e SRD API 集成,此技能可即时访问数千个数据点,包括法术、怪物属性块和装备。无论您是需要快速进行遭遇战的地下城主,还是计算复杂掷骰的玩家,Openclaw Skills 库中的这一补充都能确保重点保持在叙事而非规则书上。

该工具弥补了手动纸笔记录与数字自动化之间的差距。它允许用户通过简单的 CLI 命令或基于代理的提示查询复杂的游戏数据,使其成为虚拟和实体桌面会议的必备伴侣。它旨在轻量、快速且可扩展,适用于任何基于 D20 的战役。

下载入口:https://github.com/openclaw/skills/tree/main/skills/capt-marbles/dnd

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install dnd

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 dnd。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

D&D 5e 工具包 应用场景

  • 在高风险战斗中掷出带有修正值的复杂骰子组合。
  • 在游戏过程中查询特定的法术细节,如施法时间、射程和成分。
  • 根据特定的挑战等级 (CR) 生成平衡的战斗遭遇,以挑战玩家。
  • 为自发的角色扮演互动生成具有独特特征和职业的随机 NPC。
  • 访问详细的怪物属性块,用于战术规划和 DM 准备。
D&D 5e 工具包 工作原理
  1. 用户或代理使用特定的子命令(如 roll、spell 或 monster)执行 dnd.py 脚本。
  2. 该技能与官方 D&D 5e SRD API 交互,以获取经过验证的、实时的法术和生物游戏数据。
  3. 对于角色或 NPC 创建等生成任务,逻辑会处理内部模板以随机化属性和特征。
  4. 该技能返回格式化的、人类可读的终端输出或用于程序化用途的结构化 JSON 响应。
  5. 用户可以使用 --search 等标志来完善搜索,以在 SRD 数据库中查找部分匹配项。

D&D 5e 工具包 配置指南

要开始使用此工具包,请确保您的系统中安装了 Python 3。由于它使用公共 SRD API,因此不需要外部 API 密钥。

# 克隆包含该技能的存储库
# 进入技能目录
cd dnd-toolkit

# 运行帮助命令以查看可用功能
python3 dnd.py --help

D&D 5e 工具包 数据架构与分类体系

该技能通过查询 SRD API 并格式化响应来动态组织数据。您可以通过附加 --json 标志来查看任何命令的结构。

组件 数据类型 描述
掷骰子 对象 包含单次掷骰、修正值和总和。
法术数据 Markdown 完整的 SRD 描述,包括等级、学派和成分。
怪物属性 表格 AC、HP、速度、能力值和动作列表。
角色 JSON/文本 随机的种族、职业和能力值数组。
遭遇 列表 根据特定 CR 缩放的怪物集合。
name: dnd
description: D&D 5e toolkit for players and DMs. Roll dice, look up spells and monsters, generate characters, create encounters, and spawn NPCs. Uses the official D&D 5e SRD API.
version: 1.0.0
author: captmarbles

D&D 5e Toolkit

Your complete Dungeons & Dragons 5th Edition assistant! Look up spells, monsters, roll dice, generate characters, encounters, and NPCs.

Features

?? Dice Roller - Roll any dice with modifiers
? Spell Lookup - Search the entire SRD spell list
?? Monster Stats - Get full stat blocks for any creature
?? Character Generator - Random characters with stats
??? Encounter Builder - Generate balanced encounters by CR
?? NPC Generator - Create random NPCs with personality

Usage

All commands use the dnd.py script.

Roll Dice

# Roll 2d6 with +3 modifier
python3 dnd.py roll 2d6+3

# Roll d20
python3 dnd.py roll 1d20

# Roll with negative modifier
python3 dnd.py roll 1d20-2

# Roll multiple dice
python3 dnd.py roll 8d6

Output:

?? Rolling 2d6+3
   Rolls: [4 + 5] +3
   Total: 12

Look Up Spells

# Search for a spell
python3 dnd.py spell --search fireball

# Direct lookup
python3 dnd.py spell fire-bolt

# List all spells
python3 dnd.py spell --list

Output:

? Fireball
   Level: 3 Evocation
   Casting Time: 1 action
   Range: 150 feet
   Components: V, S, M
   Duration: Instantaneous
   
   A bright streak flashes from your pointing finger to a point 
   you choose within range and then blossoms with a low roar into 
   an explosion of flame...

Look Up Monsters

# Search for a monster
python3 dnd.py monster --search dragon

# Direct lookup
python3 dnd.py monster ancient-red-dragon

# List all monsters
python3 dnd.py monster --list

Output:

?? Adult Red Dragon
   Huge Dragon, chaotic evil
   CR 17 (18,000 XP)
   
   AC: 19
   HP: 256 (19d12+133)
   Speed: walk 40 ft., climb 40 ft., fly 80 ft.
   
   STR 27 | DEX 10 | CON 25
   INT 16 | WIS 13 | CHA 21
   
   Special Abilities:
   ? Legendary Resistance (3/Day): If the dragon fails a saving throw...
   
   Actions:
   ? Multiattack: The dragon can use its Frightful Presence...

Generate Random Character

# Generate character with rolled stats
python3 dnd.py character

Output:

??  Elara
   Race: Elf
   Class: Wizard
   
   Stats:
   STR: 10 (+0)
   DEX: 15 (+2)
   CON: 12 (+1)
   INT: 16 (+3)
   WIS: 13 (+1)
   CHA: 8 (-1)

Generate Random Encounter

# Generate encounter with challenge rating
python3 dnd.py encounter --cr 5

# Random CR
python3 dnd.py encounter

Output:

?? Random Encounter (CR ~5)

   2x Troll (CR 5)
      AC 15, HP 84
   1x Ogre (CR 2)
      AC 11, HP 59

Generate Random NPC

python3 dnd.py npc

Output:

?? Finn Shadowend
   Race: Halfling
   Occupation: Merchant
   Trait: Curious

Example Prompts for Clawdbot

  • "Roll 2d20 with advantage" (I'll roll twice!)
  • "Look up the Fireball spell"
  • "Show me stats for a Beholder"
  • "Generate a random character"
  • "Create an encounter for level 5 party"
  • "Give me an NPC for my tavern scene"

JSON Output

Add --json to any command for structured output:

python3 dnd.py roll 2d6 --json
python3 dnd.py spell --search fireball --json
python3 dnd.py character --json

API Source

Uses the official D&D 5e API which includes all System Reference Document (SRD) content.

Tips

  • Spell names use lowercase with hyphens: fireball, magic-missile, cure-wounds
  • Monster names same format: ancient-red-dragon, goblin, beholder
  • Search if unsure of exact name: --search dragon will show all dragons
  • Dice format is flexible: 1d20, 2d6+5, 3d8-2, 100d100

Future Ideas

  • Initiative tracker
  • Treasure generator
  • Quest/plot hook generator
  • Random dungeon generator
  • Party manager
  • Campaign notes

Enjoy your adventure! ?????