> For the complete documentation index, see [llms.txt](https://chaoss-organization.gitbook.io/chaosdungeon/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chaoss-organization.gitbook.io/chaosdungeon/zhu-yao-mo-kuai-jie-shao/fu-ben-jiao-ben-zong-lan.md).

# 副本脚本总览

副本脚本是通过编辑脚本相关的组件实现想要的效果.

如果用过MythicMobs,BetonQuest的话,会更加容易上手此功能

脚本编写起来并不复杂,效果却十分强大.

脚本有目前几个重要组件:

1. 触发器 tirgger  (触发单条脚本的触发器)
2. 条件 condition (触发脚本的条件)
3. 事件 event  (脚本触发后的执行效果)
4. 变量 variable (用于脚本内部的相关变量输出)

这几个脚本组件在后续会有详细说明.&#x20;

目前先简单介绍一下脚本的编写实现方式和用法.

玩家进入副本后. 会根据预先设置的脚本监听玩家行为.

当玩家触发预设的触发器后.判断条件是否为真.并执行预设事件.

一个脚本的用例:

```yaml
trigger[onDunStart] event[TeamMessage:这是第一条消息,TeamMessage:这是第二条消息] d[2] once
# 开始副本时 触发此脚本 , 无条件判断 , 事件可设置多个,使用 英文逗号 分隔
```

上面这个用例的意思是在 副本开始时,发送两条队内消息.&#x20;

`d[2]` 和 `once` 是脚本的可设置属性. 后文有详细说明

这里说一下副本脚本本身的写法格式:

* 触发器 (必须)
* 条件 (非必须)
* 事件 (必须)

每个组件之间需要空一格. 并且每个组件的自定义部分都是由中括号括起来.

触发器写法: trigger\[触发器构造]  中括号内是触发器名字

条件写法: condition\[条件构造1,条件构造2]&#x20;

事件写法: event\[事件构造1,事件构造2] 条件和事件可设置多个构造. 用英文逗号分隔

**1. 设置脚本是否可重复使用**

脚本最后加  `once` 表示单次脚本. 整个副本生命周期里仅执行一次

**2. 设置脚本延迟**

`d[20]`

设置此脚本的冷却时间为20刻

单位:(刻) 20刻=1秒

**3. 设置脚本冷却时间**

`cd[60]`

设置此脚本的冷却时间为60刻

单位:(刻) 20刻=1秒

脚本冷却时间为副本所有,如果a玩家触发了此脚本,那么b玩家在脚本冷却时无法触发

如果要设置玩家独立冷却,可使用下面的方法

**4. 设置脚本的玩家独立冷却**

`pcd[10]`

设置此脚本的玩家独立冷却时间为10刻

每个玩家触发这个脚本的cd都是单独的. 不会影响其他玩家.

单位:(刻) 20刻=1秒

(一般有玩家cd就不设置脚本的副本cd,会造成冲突,多次触发)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chaoss-organization.gitbook.io/chaosdungeon/zhu-yao-mo-kuai-jie-shao/fu-ben-jiao-ben-zong-lan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
