Skip to content

MythicMobs 集成

EmakiAttribute 与 MythicMobs 深度集成,提供属性伤害技能机制、属性条件判断和怪物属性配置。

MythicMobs 为软依赖,未安装时相关功能静默跳过。

技能机制:emaki_damage

注册名:emaki_damage(别名:emakiattribute_damageattribute_damage

在 MythicMobs 技能中使用属性伤害系统对目标造成伤害。

参数类型默认值说明
damagedoubleskill power基础伤害值。
damage_typestring伤害类型 ID(如 physicalspell)。
allow_criticalbooleantrue是否允许暴击判定。
allow_target_dodgebooleanfalse是否允许目标闪避。
calculate_target_defensebooleantrue是否计算目标防御。
trigger_mythic_on_damagedbooleanfalse是否触发 MythicMobs 的 on_damaged 事件。

使用示例

yaml
# 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_idstring临时属性效果 ID。相同 ID 重复施加时按叠加模式处理。
attributestring属性 ID。
valuedouble0临时属性数值。
durationint持续时间(tick),必须大于 0。
stack_modestring属性默认叠加模式 REPLACE / STACK。留空则使用属性定义的 temporary_stack_mode
setbooleanfalsetrue 时使用覆盖式赋值(SET)而非叠加式(ADD)。

emaki_attribute_remove

注册名:emaki_attribute_remove(别名:emakiattribute_remove

移除目标身上指定 effect_id 的临时属性。

参数类型说明
effect_idstring要移除的临时属性效果 ID。

emaki_attribute_add_tag

注册名:emaki_attribute_add_tag(别名:emakiattribute_add_tag

给目标添加所有带指定标签的临时属性。会遍历所有 tags 含该标签的属性,为每个属性生成一条临时属性(效果 ID 为 前缀:属性id,互不覆盖)。

参数类型默认值说明
tagstring属性标签(如 DEBUFF),不区分大小写。
valuedouble0统一施加给每个属性的数值。
durationint持续时间(tick),必须大于 0。
effect_prefixstringtag:<tag>生成效果 ID 的前缀。
stack_modestring各属性默认叠加模式 REPLACE / STACK。留空则各属性使用自身的 temporary_stack_mode

emaki_attribute_clear_tag

注册名:emaki_attribute_clear_tag(别名:emakiattribute_clear_tag

清除目标身上所有「属性带指定标签」的临时属性。

参数类型说明
tagstring属性标签,不区分大小写。

使用示例

yaml
# 命中目标附加 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_attributeattribute_valueattribute_resource

检查实体的属性值或资源值。

参数类型说明
attributestring属性 ID(检查属性值时使用)。
resourcestring资源 ID(检查资源值时使用)。仅对玩家生效。
fieldstring资源字段:current(别名 current_valuevalue)、max(别名 current_max)、default(别名 default_max)、bonus(别名 bonus_max)、percent。默认 current
operatorstring比较运算符。
valuedouble比较值。
value_2doublebetween 运算符时的第二个值。

运算符

运算符别名说明
>gt大于。
>=gte大于等于(默认值)。
<lt小于。
<=lte小于等于。
!=<>ne不等于。
between在 value 和 value_2 之间(含端点,自动按大小排序)。

不填 operator 或填写无法识别的运算符时,都按 >= 处理。没有独立的等于运算符。

使用示例

yaml
# 当目标生命低于 30% 时触发
Conditions:
  - emaki_attribute{resource=health;field=percent;operator=<;value=30} true

怪物属性配置

在 MythicMobs 怪物配置文件中,通过 EmakiAttribute 节为怪物设置属性:

yaml
# 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 节并同步属性。
MythicPostReloadedEventMythicMobs 重载后自动 resync 所有活跃的 MythicMobs 怪物。