MythicMobs 集成
EmakiAttribute 与 MythicMobs 深度集成,提供属性伤害技能机制、属性条件判断和怪物属性配置。
MythicMobs 为软依赖,未安装时相关功能静默跳过。
技能机制:emaki_damage
注册名:emaki_damage(别名:emakiattribute_damage、attribute_damage)
在 MythicMobs 技能中使用属性伤害系统对目标造成伤害。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
damage | double | skill power | 基础伤害值。 |
damage_type | string | — | 伤害类型 ID(如 physical、spell)。 |
allow_critical | boolean | true | 是否允许暴击判定。 |
allow_target_dodge | boolean | false | 是否允许目标闪避。 |
calculate_target_defense | boolean | true | 是否计算目标防御。 |
trigger_mythic_on_damaged | boolean | false | 是否触发 MythicMobs 的 on_damaged 事件。 |
使用示例
# MythicMobs 技能配置
FireBlast:
Skills:
- emaki_damage{damage=50;damage_type=spell;allow_critical=true} @target技能机制:临时属性
以下机制作用于技能目标(@target、@self 等),对玩家和怪物均生效。临时属性到期后自动移除;不持久化,服务器重启即失效。
emaki_attribute_add
注册名:emaki_attribute_add(别名:emakiattribute_add)
给目标添加一个临时属性。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
effect_id | string | — | 临时属性效果 ID。相同 ID 重复施加时按叠加模式处理。 |
attribute | string | — | 属性 ID。 |
value | double | 0 | 临时属性数值。 |
duration | int | — | 持续时间(tick),必须大于 0。 |
stack_mode | string | 属性默认 | 叠加模式 REPLACE / STACK。留空则使用属性定义的 temporary_stack_mode。 |
set | boolean | false | 为 true 时使用覆盖式赋值(SET)而非叠加式(ADD)。 |
emaki_attribute_remove
注册名:emaki_attribute_remove(别名:emakiattribute_remove)
移除目标身上指定 effect_id 的临时属性。
| 参数 | 类型 | 说明 |
|---|---|---|
effect_id | string | 要移除的临时属性效果 ID。 |
emaki_attribute_add_tag
注册名:emaki_attribute_add_tag(别名:emakiattribute_add_tag)
给目标添加所有带指定标签的临时属性。会遍历所有 tags 含该标签的属性,为每个属性生成一条临时属性(效果 ID 为 前缀:属性id,互不覆盖)。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
tag | string | — | 属性标签(如 DEBUFF),不区分大小写。 |
value | double | 0 | 统一施加给每个属性的数值。 |
duration | int | — | 持续时间(tick),必须大于 0。 |
effect_prefix | string | tag:<tag> | 生成效果 ID 的前缀。 |
stack_mode | string | 各属性默认 | 叠加模式 REPLACE / STACK。留空则各属性使用自身的 temporary_stack_mode。 |
emaki_attribute_clear_tag
注册名:emaki_attribute_clear_tag(别名:emakiattribute_clear_tag)
清除目标身上所有「属性带指定标签」的临时属性。
| 参数 | 类型 | 说明 |
|---|---|---|
tag | string | 属性标签,不区分大小写。 |
使用示例
# 命中目标附加 5 秒减速 debuff,并统一施加所有 DEBUFF 标签属性
CurseStrike:
Skills:
- emaki_attribute_add{effect_id=curse_slow;attribute=movement_speed;value=-2;duration=100} @target
- emaki_attribute_add_tag{tag=DEBUFF;value=-10;duration=100;stack_mode=STACK} @target
# 净化:清除目标所有 DEBUFF 临时属性
Purify:
Skills:
- emaki_attribute_clear_tag{tag=DEBUFF} @target条件:emaki_attribute
注册名:emaki_attribute(别名:emakiattribute_attribute、attribute_value、attribute_resource)
检查实体的属性值或资源值。
| 参数 | 类型 | 说明 |
|---|---|---|
attribute | string | 属性 ID(检查属性值时使用)。 |
resource | string | 资源 ID(检查资源值时使用)。仅对玩家生效。 |
field | string | 资源字段:current(别名 current_value、value)、max(别名 current_max)、default(别名 default_max)、bonus(别名 bonus_max)、percent。默认 current。 |
operator | string | 比较运算符。 |
value | double | 比较值。 |
value_2 | double | between 运算符时的第二个值。 |
运算符
| 运算符 | 别名 | 说明 |
|---|---|---|
> | gt | 大于。 |
>= | gte | 大于等于(默认值)。 |
< | lt | 小于。 |
<= | lte | 小于等于。 |
!= | <>、ne | 不等于。 |
between | — | 在 value 和 value_2 之间(含端点,自动按大小排序)。 |
不填
operator或填写无法识别的运算符时,都按>=处理。没有独立的等于运算符。
使用示例
# 当目标生命低于 30% 时触发
Conditions:
- emaki_attribute{resource=health;field=percent;operator=<;value=30} true怪物属性配置
在 MythicMobs 怪物配置文件中,通过 EmakiAttribute 节为怪物设置属性:
# MythicMobs 怪物配置
FireDragon:
Type: ENDER_DRAGON
Health: 500
EmakiAttribute:
- "physical_attack: 100"
- "physical_defense: 50"
- "spell_attack: 80"
- "health: 500"每一行必须加引号
EmakiAttribute 是字符串列表。写成 - physical_attack: 100(不加引号)时,YAML 会把它解析成映射而不是字符串,该节会被整段跳过,怪物拿不到任何属性,且不会有任何报错或警告。
判断方式:进战斗后开 /ea debug on,看攻击者快照里有没有你配的属性 ID。只有 default_profile 的默认项说明这一节没被读到。
- 属性值支持数学表达式(通过 ExpressionEngine 解析)。
- 怪物生成时自动同步属性。
- MythicMobs 重载后自动 resync 所有活跃怪物。
生命周期同步
| 事件 | 行为 |
|---|---|
MythicMobSpawnEvent | 怪物生成时读取 EmakiAttribute 节并同步属性。 |
MythicPostReloadedEvent | MythicMobs 重载后自动 resync 所有活跃的 MythicMobs 怪物。 |