跳到主要内容

创建能力

webapp_banner.jpg

EliteMobs 脚本系统

以下页面介绍如何创建精英脚本!

这是一个高级功能,需要对 EliteMobs 有一定的深入了解。

注意:精英脚本可以作为能力文件添加,也可以添加到自定义Boss文件中! 如果用作能力文件,您可以像往常一样使用自定义Boss的 powers 配置设置将它们作为普通能力添加到Boss中。

添加 EliteScript

要开始向Boss添加 EliteScript,请在Boss文件中添加以下条目:

eliteScript:

注意:以下内容对大小写和空格极其敏感!请确保您的空格、换行和整体格式与示例匹配!

现在您已经声明了脚本的开始,可以添加您的特定脚本了。在本例中,我们将创建一个名为 Example 的脚本:

eliteScript:
Example:

EliteScripts 有 5 个不同的部分:Events(事件)、Conditions(条件)、Zones(区域)、Actions(动作)和 Cooldowns(冷却)。只有 Actions 是必需的。

让我们看一个简单的例子:

eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: PUSH
Target:
targetType: SELF
vValue: 0,0.5,0
Cooldowns:
local: 60
global: 20

这个脚本使精英在被玩家击中时被向上推,并且在3秒内不会再次执行(由于我们在Cooldowns部分设置的设置,将在1秒内阻止其他能力触发)。

现在您知道了脚本结构的一般格式,是时候了解每个部分可以做什么了!


Events(事件)

Events

点击上面的链接了解如何使用事件!

Targets(目标)

Targets

点击上面的链接了解如何使用目标!

Actions(动作)

Actions

点击上面的链接了解如何使用动作!

Zones(区域)

Zones

点击上面的链接了解如何使用区域!

Conditions(条件)

Conditions

点击上面的链接了解如何使用条件!

Cooldowns(冷却)

Cooldowns

点击上面的链接了解如何使用冷却!


添加多个 EliteScripts

您可以在一个事件上执行多个动作,但如果您想在同一个Boss上使用多个脚本怎么办?这就像创建一个新的脚本条目一样简单!让我们扩展前面的例子并添加另一个脚本:

eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: PUSH
Target:
targetType: SELF
vValue: 0,0.5,0
Cooldowns:
local: 60
global: 20
Example2:
Events:
- PlayerDamagedByEliteMobEvent
Actions:
- action: SET_ON_FIRE
Target:
targetType: DIRECT_TARGET
Cooldowns:
local: 200
global: 60

在这个例子中,我们添加了一个名为 Example2 的第二个脚本。Example2 会将被Boss伤害的玩家点燃,这是因为 targetType 被设置为 DIRECT_TARGET
此脚本的冷却时间设置为 200 刻,这意味着Boss每10秒只能点燃玩家一次。

制作独立能力

独立能力几乎完全由精英脚本组成。只有两个字段是可选的。不要忘记,要使独立能力正常工作,它们必须放在 ~plugins/EliteMobs/powers 文件夹中。
独立能力示例:

isEnabled: true
powerType: UNIQUE
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Actions:
- action: PUSH
Target:
targetType: SELF
vValue: 0,.3,0
Cooldowns:
local: 60
global: 20

isEnabled

与插件中的其他地方一样,设置能力是否启用。

powerType

能力类型设置能力的分配方式。值为:

  • UNIQUE:该能力仅应用于在能力部分设置了该能力的自定义Boss。
  • DEFENSIVE / MISCELLANEOUS / OFFENSIVE:任何精英都能够获得这些能力,它们将计入特定的能力子集。
  • MAJOR_ZOMBIEMAJOR_SKELETONMAJOR_BLAZEMAJOR_ENDERMANMAJOR_GHAST:只有适当实体类型的精英才能自然生成这些能力,它们将计入主要能力。

effect

Sets the visual effect or material used by the power. This is used by some hardcoded powers to define their visual particle or material trail.

KeyValuesDefault
effectStringnone

powerCooldown

Sets the cooldown, in ticks, for the individual power. This controls how often this specific power can trigger.

KeyValuesDefault
powerCooldownInteger0

globalCooldown

Sets the global cooldown, in ticks, shared across all powers. After this power triggers, no other power can trigger until the global cooldown expires.

KeyValuesDefault
globalCooldownInteger0