跳至主要内容

精英腳本區域

區域是由形状定義的位置,可以被腳本編寫者用作目標來執行任何類型的動作。

每個腳本只能設定一個區域。

To target zones, the target type ZONE_FULL or ZONE_BORDER can be used.

Zones themselves also use Script Targets to define were the zone will appear.

shape

設定區域的形状。有效形状:

Shape TypeDetailsAnimatableBorder
CYLINDER圓柱形
SPHERE球形
DOME穹頂形(半球)
CUBOID長方體形
STATIC_RAY兩點之間的固定線
ROTATING_RAY兩點之間的旋轉線
TRANSLATING_RAY從兩個起始點移動到兩個終點的線
CONE圓錐形

可動畫

帶動畫的區域在腳本首次被調用時開始區域動畫。

This means that if an action has a wait time, when the action starts the zone has already been moving around while the action was waiting.

Zones are always animated on every tick. This means that if you use the SPAWN_PARTICLES action, you can set it to run every tick as the zone will be moving every tick. If you run every second, you will see the particles jumping around as the zone kept moving even on ticks where particles were not spawned.

If you want to make a rotating zone action but want to wait for a set amount of ticks before starting the action, make that a different script and call that script through RUN_SCRIPT. Make sure the RUN_SCRIPT has the wait time you want.

區域在動畫完成後會停留在最終位置。

All animatable zones are set to not track on the script targets since the extra movement would make things too hard to understand for scripters and players. This means that these zones will not follow bosses or players around and will always move relative to their initial spawn points.


邊界

Certain zones can have borders. Borders mean that ZONE_BORDER can be used as the target of the zone. Borders are defined by creating a second, smaller shape inside the first, larger shape. The area between the smaller zone and the larger zone is the border.

範例
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Zone:
shape: CYLINDER
radius: 4
borderRadius: 3
height: 8
Target:
targetType: SELF
Actions:
- action: SPAWN_PARTICLE
particles:
- particle: SMOKE_LARGE
Target:
targetType: ZONE_BORDER
repeatEvery: 5
times: 20

elitescript_zones_border.jpg

This script makes smoke particles that only appear in the zone border for 5 seconds (repeat every 5 x times 20 = 100 ticks).

If you did not use the ZONE_BORDER option but the ZONE_FULL option instead then the entire zone would be covered in smoke particles like this:

elitescript_zones_borderfull.jpg


SPHERE

KeyDetailsMandatory
shapeSets the shape of the zone. Should be SPHERE
targetSets the location for the center of the sphere
filterSets which types of entities get targeted
radiusRadius of the sphere
borderRadiusRadius of the inner sphere
範例
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Zone:
shape: SPHERE
radius: 4
borderRadius: 3
Target:
targetType: SELF
Actions:
- action: SPAWN_PARTICLE
particles:
- particle: CLOUD
Target:
targetType: ZONE_FULL
repeatEvery: 5
times: 20

elitescript_zones_sphere.jpg

此腳本使用雲粒子演示球體的形状。


DOME

KeyDetailsMandatory
shapeSets the shape of the zone. Should be DOME
targetSets the location for the center of the dome
filterSets which types of entities get targeted
radiusRadius of the dome
borderRadiusRadius of the inner dome
範例
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Zone:
shape: DOME
radius: 4
borderRadius: 3
Target:
targetType: SELF
Actions:
- action: SPAWN_PARTICLE
particles:
- particle: CLOUD
Target:
targetType: ZONE_FULL
repeatEvery: 5
times: 20

elitescript_zones_dome.jpg

此腳本使用雲粒子演示穹頂的形状。


CONE

KeyDetailsMandatory
shapeSets the shape of the zone. Should be CONE
targetSets the location for the apex (tip) of the cone
target2Sets the location for the center of the base of the cone
filterSets which types of entities get targeted
radiusRadius of the base of the cone
borderRadiusRadius of the inner cone
範例
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Zone:
shape: CONE
radius: 10
Target:
targetType: SELF
offset: 0,0,0
Target2:
targetType: SELF
offset: 0,10,0
Actions:
- action: SPAWN_PARTICLE
particles:
- particle: CLOUD
Target:
targetType: ZONE_FULL
coverage: 0.8
repeatEvery: 5
times: 20

This script demonstrates the shape of a cone using cloud particles. Keep in mind that this zone is a CONE shape, meaning it is a 3D volume, important to consider if you're aiming to create sweep effects.


CYLINDER

KeyDetailsMandatory
shapeSets the shape of the zone. Should be CYLINDER
targetSets the location for the center of the cylinder
filterSets which types of entities get targeted
radiusRadius of the cylinder
borderRadiusRadius of the inner cylinder
heightHeight of the cylinder
範例
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Zone:
shape: CYLINDER
radius: 4
borderRadius: 3
height: 8
Target:
targetType: SELF
Actions:
- action: SPAWN_PARTICLE
particles:
- particle: CLOUD
Target:
targetType: ZONE_FULL
repeatEvery: 5
times: 20

elitescript_zones_cylinder.jpg

此腳本使用雲粒子演示圓柱的形状。


CUBOID

KeyDetailsMandatory
shapeSets the shape of the zone. Should be CUBOID
targetSets the location for the center of the cuboid
filterSets which types of entities get targeted
xSets the length of the cuboid
ySets the height of the cuboid
zSets the width of the cuboid, defaults to x
xBorderSets the length of the inner cuboid
yBorderSets the height of the inner cuboid
zBorderSets the width of the inner cuboid, defaults to x
範例
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Zone:
shape: CUBOID
x: 4
y: 4
z: 4
xBorder: 3
yBorder: 3
zBorder: 3
Target:
targetType: SELF
Actions:
- action: SPAWN_PARTICLE
particles:
- particle: CLOUD
Target:
targetType: ZONE_FULL
repeatEvery: 5
times: 20

elitescript_zones_cuboid.jpg

此腳本使用雲粒子演示長方體的形状。


STATIC_RAY

KeyDetailsMandatory
shapeSets the shape of the zone. Should be STATIC_RAY
targetSets the location for the first point of the line
target2Sets the location for the last point of the line
filterSets which types of entities get targeted
ignoresSolidBlocksSets if the ray will pass through solid blocks. Defaults to true
pointRadiusSets the thickness of the ray. Default is 0.5 blocks.
範例
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Zone:
shape: STATIC_RAY
Target2:
targetType: DIRECT_TARGET
offset: 0,1,0
Target:
targetType: SELF
offset: 0,1,0
Actions:
- action: SPAWN_PARTICLE
particles:
- particle: CLOUD
Target:
targetType: ZONE_FULL
repeatEvery: 5
times: 20

elitescript_zones_staticray.jpg

此腳本使用雲粒子演示靜態射線的形状。

We have adjusted the height of the zone by using the offset option on both ends of the zone to make the ray appear from the middle of the player and the boss, otherwise the ray would appear at their feet.


ROTATING_RAY

KeyDetailsMandatory
shapeSets the shape of the zone. Should be ROTATING_RAY
filterSets which types of entities get targeted
targetSets the location for the first point of the line
target2Sets the location for the last point of the line
animationDurationSets, in ticks, the amount of time for the rotation
pitchPreRotationApplies an initial rotation to the pitch before the animation
yawPreRotationApplies an initial rotation to the yaw before the animation
pitchRotationSets the pitch rotation for the animation
yawRotationSets the yaw rotation for the animation
ignoresSolidBlocksSets if the ray will pass through solid blocks. Defaults to true
pointRadiusSets the thickness of the ray. Default is 0.5 blocks.
範例
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Zone:
shape: ROTATING_RAY
animationDuration: 100
pitchPrerotation: 0
yawPrerotation: 0
pitchRotation: 0
yawRotation: 360
ignoresSolidBlocks: true
Target:
targetType: SELF
offset: 0,1,0
Target2:
targetType: DIRECT_TARGET
offset: 0,1,0
Actions:
- action: SPAWN_PARTICLE
particles:
- particle: CLOUD
Target:
targetType: ZONE_FULL
repeatEvery: 1
times: 100

elitescript_zones_rotatingray.gif

此腳本展示了使用雲粒子的旋轉射線的效果。

First, it creates a ray from the boss to the player who harmed it, using cloud particles. Then, it adjusts the positions slightly upward by one block using offset.

Next, it spins the ray in a full circle around the player who was targeted. This rotation lasts for 5 seconds (100 ticks) to complete, with the targeted player as the center.


TRANSLATING_RAY

KeyDetailsMandatory
shapeSets the shape of the zone. Should be TRANSLATING_RAY
filterSets which types of entities get targeted
animationDurationSets, in ticks, the amount of time for the translation
targetSets the location for the first point of the line
finalTargetSets the location of the destination for the first point of the line
target2Sets the location for the second point of the line
finalTarget2Sets the location of the destination for the second point of the line
ignoresSolidBlocksSets if the ray will pass through solid blocks. Defaults to true
pointRadiusSets the thickness of the ray. Default is 0.5 blocks.
範例
eliteScript:
Example:
Events:
- EliteMobDamagedByPlayerEvent
Zone:
shape: TRANSLATING_RAY
Target:
targetType: SELF
FinalTarget:
targetType: SELF
offset: 0,10,0
Target2:
targetType: DIRECT_TARGET
FinalTarget2:
targetType: DIRECT_TARGET
offset: 0,10,0
animationDuration: 100
ignoresSolidBlocks: true
Actions:
- action: SPAWN_PARTICLE
particles:
- particle: CLOUD
Target:
targetType: ZONE_FULL
repeatEvery: 1
times: 100

elitescript_zones_translatingray.gif

此腳本展示了使用雲粒子的移動射線的效果。

First, it creates a ray from the boss to the player who harmed it, using cloud particles.

Then, it animates the ray to go upwards 10 blocks from both targets using the offset on the FinalTarget1 and FinalTarget2.

The animation takes 5 seconds (100 ticks) to complete.

We can easily make the ray move sideways by adjusting the Z offset to something like offset: 0,0,10:

elitescript_zones_translatingray2.gif

This behavior might change depending on where you're facing in the game.
If we modify the X offset in the script shown in the GIF image, the ray would appear to move away from us in a straight line from our perspective.


filter

The filter property can be used to only target specific entities inside of the zone. These entities can be:

ValueDetails
PLAYER僅目標區域內的玩家(預設)
ELITE僅目標區域內的精英
LIVING目標區域內的所有生物實體
範例
eliteScript:
FilterExample:
Events:
- PlayerDamagedByEliteMobEvent
Zone:
shape: SPHERE
radius: 12
borderRadius: 11
filter: ELITE
Target:
targetType: SELF
track: false

This example script shows how to use the filter to make the zone only target elites.