“Skill and Battle Directives in Combat”的版本间的差异

来自部落与弯刀Wiki

第739行: 第739行:
  
 
In the skill configuration table, skill directive strings are separated with ”\n” , a line breaker. Every directive consists of: delay time*[conditional expression(optional)]#directive content. Please refer to the following format:
 
In the skill configuration table, skill directive strings are separated with ”\n” , a line breaker. Every directive consists of: delay time*[conditional expression(optional)]#directive content. Please refer to the following format:
  0*条件表达式1#技能命令1
+
  0*conditional expression 1#skill directive 1
  0.2#技能命令2
+
  0.2#skill directive 2
 
  ……
 
  ……
 
当条件表达式不为空时,根据条件表达式判定结果执行。
 
当条件表达式不为空时,根据条件表达式判定结果执行。
  
 
条件语句中可以使用一些内置命令来实现一些例如重复之类的特殊效果,例如
 
条件语句中可以使用一些内置命令来实现一些例如重复之类的特殊效果,例如
  <nowiki>*</nowiki>REPEAT_START:9
+
  *REPEAT_START:9
  语句1
+
  Statement 1
  语句2
+
  Statement 1
  [@0.01*[%rpt_index%]@]#技能命令
+
  [@0.01*[%rpt_index%]@]#skill directive
 
  ...
 
  ...
  语句N
+
  Statement N
  <nowiki>*</nowiki>REPEAT_END
+
  *REPEAT_END
 
表示将REPEAT_START行与REPEAT_END之间的所有行重复9遍,期间可以通过[%rpt_index%]来查询当前语句处于第几次循环
 
表示将REPEAT_START行与REPEAT_END之间的所有行重复9遍,期间可以通过[%rpt_index%]来查询当前语句处于第几次循环
 
  <nowiki>*</nowiki>SELECT_UNITS:[目标筛选条件表达式](注意,次数查询cast_info中的target为当前单位)
 
  <nowiki>*</nowiki>SELECT_UNITS:[目标筛选条件表达式](注意,次数查询cast_info中的target为当前单位)

2020年9月22日 (二) 00:48的版本

Please pay special attention: when editing scripts, you must use half-size punctuations!!! Meanwhile, in scenarios and all configuration tables, please avoid using strings that contain special characters. Otherwise, there might be errors when scripts are injected.

Script Directives in Battles

We use an independent event operating system to realize specific scenario events or complex battle mechanics in battles. The way this system function resembles that of the scenario executor in common scenario events. The difference is that the system will not pause the game by force unless players call PAUSE/RESUME directives manually.

You can open the Console in battles and use “bs@” followed by script directives to debug. For example, you can enter “bs@KILL_ALL*1” to eliminate all enemies.

List of Script Directives in Battles

Directive Instruction
(null) Character Text Box

Function: show a paragraph with a character painting and typewriter effect.

Format: *Character ID(@position of character painting)# paragraph 1# paragraph 2# paragraph 3#...#paragraph N

NOTHING Empty Directive

Function: an empty directive. Nothing happens.

Format: NOTHING*1.

EVENT Jump To

Function: jump to and execute another scenario event ID.

Format: EVENT*EVENT ID#ID of the user who runs the client (0 means executing everything)#index value of the subcommand line of the target event (starting from 0.)

SELECT Dialogue Option

Function: based on the text box, after the dialogue, is printed, an option box pops up, let the player choose an option, and returns the result (the according [%result_code%] of the resulting directive in the event.)

Format: SELECT*character ID#dialogue content#1:option 1*condition group 1;2:option 2*condition group 2;…:N: option N*condition group N (only when a set of conditions are met or the group is empty will the option shows up; otherwise, it will be hidden.)

SCREEN Fullscreen Subtitle

Function: show a subtitle in full screen (default background colour is black; transparency is adjustable.)

Format: SCREEN*subtitle#resource name of background image#transparency (optional; default: 1).

SHAKE_SCREEN Screen Shake

Function: execute a screen shake effect.

Format: SHAKE_SCREEN*Time(second)#intensity (e.g., SHAKE_SCREEN*0.3#3)

DELAY Delay

Function: delay the current situation for a while (counts by seconds in the real world; the player cannot perform any action during the delay.)

Format: DELAY*waiting time (second)

PAUSE Pause Current Game

Function: pause the current battle scene.

Format: PAUSE*.

RESUME Continue Current Game

Function: continue the current battle scene.

Format: RESUME*.

SET_WEATHER Set Weather

Function: set and replace the current weather in the game.

Format: SET_WEATHER*weather effect directive.

Please refer to Format of Weather Effect Info.

BB Character Icon Pop-up

Function: a character text box pops up at the specific position, without disturbing the current game. The player does not need to perform actions. The text box will disappear in a while.

Format: BB*character ID#dialogue content#extra existing time (counts by second; based on the original current time of the dialogue, which is measured by the length of text).

B_TALK Unit Chat Bubble

Function: units on the battlefield can have chat bubbles over their heads, which show their words.

Format: B_TALK*object ID#random paragraph 1#random paragraph 2#random paragraph 3#...#random paragraph N.

ENEMY_REINF Enemy Reinforcement

Function: all enemies send reinforcement according to a specific unit list.

Format: ENEMY_REINF*minion list.

Please refer to the format of Minion List.

FRIEND_REINF Ally Reinforcement

Function: all allies send reinforcement according to a specific unit configuration list.

Format: FRIEND _REINF*minion list

Please refer to the format of Minion List.

CMD_RETREAT Retreat Order

Function: order all allies to retreat.

Format: CMD_RETREAT*0 (0: All allies; 1: All enemies).

BATTLE_OVER End Battle by Force

Function: end the current battle instantly.

Format: BATTLE_OVER*code (0: Victory; 1: Loss).

KILL_ALL Eliminate All Targets

Function: deals massive damage to all units of one side to kill them within a second.

Format: KILL_ALL*0 (0: Ally; 1: Enemy).

UNDEAD_PLAYER Player Will Not Die

Function: buff the character controlled by the player so that it will not die.

Format: UNDEAD_PLAYER*1.

UNDEAD_ALL All Units Will Not Die

Function: buff all units on the battlefield so that they will not die.

Format: UNDEAD_ALL*0 (0: Ally; 1: All units).

EXEC_SKILL Unit Uses Ability

Function: command-specific units on the battlefield to use skills.

Format: EXEC_SKILL*caster ID#skill ID, skill level (set 1 by default by)#x, y of target’s coordinate#x, y of the coordinate parameter 1.

Caster ID is the identification ID of the target and can have the following unique values:

· PLAYER: player GM_A: the pre-set object of the attacking side GM_B: the pre-set object of the defending side.

· THIS: directive giver (usually goes back to the emitter itself).

· EMITTER=ID: a dungeon emitter of a specific ID, which can be “THIS” to represent the current dungeon emitter.

· RND_FRIEND_UNIT: random ally units RND_ENEMY_UNIT: random enemy units.

When a caster is a pre-set object, coordinate parameter 1 represents its initial coordinate.

DUNGEON_SPAWN Refresh Dungeon Unit

Function: refresh units that have been defined on the battlefield.

Format: DUNGEON_SPAWN*control ID#value of ignoring status (unit will be refreshed even they are defeated; 0: Yes by default; 1: No).

SET_DUNGEON_TS Set Dungeon Emitter Status

Function: set the status of a specific emitter in a dungeon.

Format: SET_DUNGEON_TS*control ID#status (0: Enabled; -1: Disabled).

DUNGEON_OVER End Dungeon Fight

Function: end this dungeon fight and execute relative actions.

Format: DUNGEON_OVER*result value (0: exit; 1: victory; 2: loss).

SET_AREA Set Obstacle Area Status

Function: enable or disable a specific obstacle area.

Format: SET_AREA*control ID#status (0: Enabled; -1: Disabled).

SET_WIDGET Set Decoration Status

Function: enable or disable a specific map decoration.

Format: SET_WIDGET*control ID#status (0: Normal; -1: Hidden).

SET_TP Set Dungeon Teleporter Status

Function: set the status of a dungeon teleporter and its relevant model.

Format:  SET_TP*control ID#status (0: Enabled; -1: Disabled).

SET_EMITTER Set Emitter Status

Function: set the status of a specific emitter.

Format: SET_EMITTER*control ID#status (0: Enabled; -1: Disabled).

SET_PLAYER_MODEL Set Player Model

Function: set the model of the character controlled by the player.

Format: SET_PLAYER_MODE*unit model description info.

SET_PLAYER_SKILL Set Player’s Current Skills

Function: set the current skills of the player’s character.

Format: SET_PLAYER_SKILL*skill ID 1, level| skill ID 1, level| …| skill ID N, level (4 skills at most).

SKILL_CMD Execute Skill Directive

Function: execute skill directives.

Format: SKILL_CMD*content of the skill directive.

SET_DG_INTVAR Set Custom Int Field in Battles

Function: set a custom int field in battles

Format: SET_DG_INTVAR*field ID#set value#mode setting (1: Addition Mode, adds set value based on the original value; other numbers: Direct Mode)#monitor info (optional; you can view the variable info on the monitor panel).

SET_CAMERA Set Camera Mode

Function: set the camera mode in battles.

Format: SET_CAMERA*camera mode#parameter.


Currently, available camera modes and meanings of the parameters are:

· 0: follows the player’s character. No parameter (default)..

· 1: follows a specific target. The parameter is the object ID of the target unit.

· 2: coordinate on the battlefield. The parameter is X and Y.

ATTACK Compulsory Attack

Function: command a unit to attack another unit.

Format: ATTACK*attacker object ID#target object ID.

CMD_QUEUE Unit Control Directive Sequence

Function: give an array of directives to one unit. The unit will execute the directives according to their sequence.

Format: CMD_QUEUE*target object ID#event IDs in the commanding script (fill the content of command sequence into this event to execute).


The command sequence (the time parameter stands for the time before the next directive is executed) can be:

Directive type 1 [,time parameter]:directive parameter.

Directive type 2 [,time parameter]:directive parameter.

...

Currently, available sequence directive types are:

· skill_cmd: execute skill directives: the parameter is a line of skill directives.

· use_skill: use abilities: ability ID, ability level#target unit object parameter#target position parameter.

· event: execute battle events: event ID in battles#execution condition (optional).

· move_to: move to the target position: target coordinate parameter#speed parameter (in this directive, time parameter is invalidated. Only when the target has reached the current position will the next directive be executed).

· set_dir: set unit’s direction: direction is the parameter.

· keep_act: keep performing one action: action ID (default action when empty)#loop times (loop endlessly when <=0; 1 by default)#time per action (default action when <=0; 0 by default).

Please note: in this directive, the time parameter is invalidated before the action loop is over. When in an endless loop, you need to give a new directive to the unit to end the old action.

When the coordinate has 2 parameters, the directive shows the X and Y of the target on the map; when there are 3 parameters, the third stands for the type of the position (0: map coordinate; 1: battlefield coordinate).

SET_POLICY Set Unit Battle Tactic

Function: set the current battle tactic for a unit.

Format: SET_POLICY*target object ID#main tactic type#parameter 1#position parameter#unit filter tag (validated when the target object ID is empty)#target ID (used for target-oriented tactic like Follow).


Currently, available main tactic types are:

· 0: Attack (the parameter is the radius of awakening, which becomes endless long when the parameter is lower than 0).

· 1: Defend (the parameter is the radius of defending).

· 2: Follow (the parameter is the radius of following).

· 3: Occupy.

SET_UNIT_TIMER Set Unit Timer

Function: set a timer on a unit, which will trigger and complete a specific event.

Format: SET_UNIT_TIMER*target object ID#timer ID#time parameter (disabled when <=0; a timer only works when the unit has an “on timer” trigger event).

FINISH_CAST Use Channeling Skill Instantly

Function: stop channeling and use the skill instantly (works only when the target is channeling their skill.)

Field 1, value 1|Field 2, value 2|…

REPLACE_SKILLS Replace Unit Skill

Function: replace the current skill of a unit.

Format: REPLACE_SKILLS*target object ID#skill ID 1, level| skill ID 2, level|…|skill ID N, level (4 skills at most; a skill is removed when its level is 0.)

REPLACE_DGSKILL Replace Unit Dungeon Skill

Function: replace the current dungeon skill of a unit.

Format: REPLACE_DGSKILL*target object ID#dungeon skill ID, level (empty skill ID or null means the dungeon skill is disabled).

BATTLE_MSG Battlefield Message

Function: broadcast a battlefield message.

Format: BATTLE_MSG*message type (0: Normal; 1: Warning).

SET_BATTLE_CHECKER Set Battle Checker Status

Function: set the status of Battle Checker.

Format: SET_BATTLE_CHECKER*status (0: Disabled; 1: Enabled).

SHOW_BATTLEOVER_BTN Show End-Battle Button

Function: show the button for the player to end battles manually.

Format: SHOW_BATTLEOVER_BTN*1.

SHOW_DEBUG_INFO Show Debug Info

Function: show debug info.

Format: SHOW_DEBUG_INFO*status value (0: Disabled; 1: Show buff info of player’s character).

OPENSTORE Open Trade Panel

Function: open the trade panel between the player’s character and a specific merchant.

Format: OPENSTORE*merchant ID.

RESET_STORE Refresh Merchant’s Items

Function: refresh a merchant’s item based on the configuration.

Format: RESET_STORE*merchant ID.

SET_TIMER Set Global Timer

Function: set a timer to delay the execution of some scripts.

Format: SET_TIMER*timer ID#time parameter (second; function is disabled when the parameter <= 0)#ID of event that will be executed when the timing ends#monitor field info (optional; allows you to view the remaining time on the variable monitor UI).

AREA_SPAWN Generate Unit in Area

Function: generate units in batch in a specific area.

Format: AREA_SPAWN*target area control ID#hero list#unit list (same format as the ENEMY_REINF directive)#faction index#default tactic (format: tactic code:tactic parameter; same as the SET_POLICY directive)#refreshed unit tag (optional)#extra unit attribute list (optional).

GETITEMS Player Gets Items or Resources

Function: player’s character gains a list of items (please note: money, EXP, and resources in the game can all be gained this way, as long as you have the correct mapping IDs).

Format: GETITEMS*item list info.

REMOVE_ITEMS Remove Items or Resources

Function: remove a certain number of items from the player’s inventory.

Format: REMOVE_ITEMS*item list.

LOOT Execute Drop Check

Function: execute a check according to the loot list (please refer to the format of Item Dropping Info).

Format: LOOT*Loot list.

ADD_EXP Hero Gains EXP

Function: a specific hero gains EXP.

Format: ADD_EXP*EXP#target hero ID(optional; player’s character by default).

SETSKILL Manage Hero Skill

Function: manage the skills of a hero. You can add, replace, or remove the skills of the hero.

Format: SETSKILL*Character ID (optional; player’s character by default)#skill list that needs to be added (format: skill ID 1, level| skill ID 2, level|…)#skill list that needs to be removed (optional; use “|” to separate skills).

CALL_LUAFUNC Execute LUA Function

Function: execute specific functions in the currently loaded LUA script.

Format: CALL_LUAFUNC*function name in the script.

ADD_INTER_OBJECT Add Interactive Object in Battles

Function: add an interactive object on the current battlefield.

Format: ADD_INTER_OBJECT*Interactive Instruction Info#location coordinate#normal model ID (defined in the D World Map Unit Model Table)#visible but noninteractive model ID#particle effect info (visible under normal status; format file name of particle effect: path: Asset\BuildSource\map_res\Particles\), offset X, offset Y)#initial status (0: Normal; 1: Visible but non-interactive; 2: Hidden)#control ID (used to control navigation)#built-in item info list (can be empty)#IDs of events triggered during interaction (optional)#behaviours after the interaction (optional; set default by 0). (0: remove from the scene;1: hide “waiting to auto-refresh” or refresh manually; 2: visible but non-interactive, waiting to be refreshed; 3: do not perform the action and handle this in the script)#auto refreshment time (optional; validated only when this parameter is not 0; set default by 0; manually refresh when >= 0)# event ID after refreshment (the ID of the event-triggered after refreshment).

REMOVE_INTER_OBJECT Remove Interactive Object in Battles

Function: remove an interactive object based on its ID.

Format: REMOVE_INTER_OBJECT#control ID (“THIS” can be used to refer to the object itself in an interactive script event).

SET_INTER_OBJECT Change Status of Interactive Object

Function: change the status of an interactive object based on its ID.

Format: SET_INTER_OBJECT#control ID (“THIS” can be used to refer to the object itself in an interactive script event)#new status value (0: Normal; 1: Visible but non-interactive 2: Hidden).

TELEPORT Teleport to Other Instance Maps

Function: teleport all allies to the target instance map.

Format: TELEPORT*map ID (needs to be defined in “F副本地图信息表”); X coordinate, Y coordinate.

REMOTE_EVENT Remote Execution Request

Function: Send a request to all clients to execute an event.

Format: REMOTE_EVENT*event ID.



Value Query in Battles

Query Directive Explanation
[%result_code%] Results of different event scripts in battles (e.g., the result of an option box).
[%bs_time%] How long the current battle has been going on (integer).
[%rnd:A,B%] Return a different random number each time (A<= this number <= B.)
[%last_rnd%] Return the result of the last [%rnd:A,B%] query.
[%const_rnd%] Return a random number (0~100)that stays the same during the execution period.
[%last_rnd_pos_x%] Return the X value of the last random position.
[%last_rnd_pos_y%] Return the Y value of the last random position.
[%last_rnd_pos%] Return the coordinate of the last random position.
[%last_skill%] The ID of the last skill used by the current queried source object.
[%this_type%] Type of the executor of the current directive (0: Hero; 1: Minion).
[%aim_type%] Type of the current queried target object (0: Hero; 1: Minion).
[%this_level%] Level of the executor of the current directive.
[%aim_level%] Level of the current queried target object.
[%this_hp_pct%] HP percentage of the executor of the current directive.
[%aim_hp_pct%] HP percentage of the current queried target object.
[%this_mp_pct%] MP percentage of the executor of the current directive.
[%aim_mp_pct%] MP percentage of the current queried target object.
[%friends_num%] The number of ally units left.
[%enemy_num%] The number of enemy units left.
[%hit_enemy%] Check if the current hit target is an enemy of the caster (1: Enemy; 0: Not Enemy.)
[%battle_res%] Current battle result.
[%skill_lv:SKILL_ID%] Level of a specific skill ID of the current source object; returns 0 if the level is 0.
[%base_atk%] A basic physical attack based on the current skill level.
[%base_magic_atk%] A basic magic attack based on the current skill level.
[%standard_magic_atk%] An overall magic attack based on the current skill level.
[%this_buff:BUFF_ID%] Number of stacks of source object’s current BUFF_ID.
[%aim_buff:BUFF_ID%] The current number of stacks of target object’s specific BUFF_ID.
[%stat:STAT_FIELD%] The current value of a specific field attribute of a source object.
[%aim_stat:STAT_FIELD%] The current value of a specific field attribute of a target object.
[%this_weapon%] Weapon type of the queried source object.
[%aim_weapon%] Weapon type of the queried target object.
[%charge_val%] Value of charging of this damage(0~100).
[%cmd_argval%] The parameter of the current command line.
[%cmd_argval_next%] Return the parameter of the current command line, and the parameter increases by 1 instantly.
[%rpt_index%] INDEX value of the loop where the current command line is located.
[%find_tag:TAGINFO%] Execute target unit searching once. TAGINFO is the target unit info (format: please refer to the instruction on Skill Object Format). When a proper target is found, returns 1, otherwise, 0.
[%add_find_tag:TAGINFO%] Add the target unit to the unit list that has been searched. Always returns 1. TAGINFO is the same as the explanation above.
[%rm_find_tag:TAGINFO%] Remove the target unit from the unit list that has been searched. Always returns 1. TAGINFO is the same as the explanation above.
[%reset_find_list%] Reset the current search list. It always returns 1.
[%rnd_enum:PROB_A,RES_A:PROB_B,RES_B:PROB_C,RES_C[:...]%] Randomly enumerate values, and return the RES value of one of the enumerated ones according to their probability distribution.

E.g.,

[%rnd_enum:25,1:40,2:35,3%] means that is a 25% chance to return “1”, 40% for “2”, and 35% for “3”.

[%dg_sp_state:ID%] Return the current status of the refreshed units whose Control ID is the ID field in the directive on the current battlefield (0:Not refreshed; 1: Refreshed; -1: Defeated).
[%dg_unitnum:TAG%] Return the number of refreshed units that have not been defeated and have the “TAG” tag on the current battlefield.
[%fd_sum%] Value of the defeated ally counter of the current source object.
[%ed_sum%] Value of the defeated enemy counter of the current source object.
[%fd_mod:MOD_VAL%] Value of defeated-ally counter of source object divided by MOD_VAL, and take the remainder.
[%ed_mod:MOD_VAL%] Value of defeated enemy -counter of source object divided by MOD_VAL, and take the remainder.
[%dg_int_val:KEY%] Return the value in a custom dungeon int field of a specific KEY.
[%emitter_pos:ID,MIN-MAX%] Return the emitter’s central position of a specific ID and a random position between its centre MIN and MAX. Record them in last_rnd_pos.
[%unit_timer:UNIT_ID,TIMER_ID%] Return the remaining time of the timer (whose ID is “TIMER_ID”) on a unit with a specific UNIT_ID.
[%this_intvar:ID%] Return the custom int value of the current directive executor (skill directive set_unit_intvar setting).
[%aim_intvar:ID%] Return the custom int value of the current queried target object (skill directive set_unit_intvar setting).
[%defeat_hit%] Check if the current directive is executed in a kill-unit directive and if the target unit has been killed (0: No; 1: Yes). Please note this only works in the hit directive.
[%eft_count:TAG%] Number of special effect units with a specific TAG

Please note: this only counts the special effect units created by the caster.

[%this_id%] The unit ID of the current queried object.
[%aim_id%] The unit ID of the current queried target object.
[%hit_dmg_val%] Actual damage or healing amount to a target unit in the current casting.

Please: this only works in the hit directive.

[%stealth_hit%] Check if the current skill or damage comes into effect when the caster is invisible (0: No; 1: Yes).
[%hit_count%] Times of the current skill is actually hitting units.
Following directives need client higher than 0.7.4.2 to be executed.
[%this_skills%] Return the skill list of the current source object.
[%aim_skills%] Return the skill list of the current target object.
Following directives need client higher than 0.8.0.1 to be executed
[%this_userid%] Return the client ID of the current source object.
[%aim_userid%] Return the client ID of the current target object.
[%player_money%] Player’s money in the game.
[%item_number:物品key%] Return the number of a specific item or resource in the player’s bag.

Format of Damage Expression

All kinds of damages from attacks, skills, special effects, and directives towards units are settled through a unified port. The primary parameter injected into the port is a data structure, which can be decided by damage expressions in various scripts. The common format of damage expressions is:

key1:value1;key2:value2;...;keyN:valueN

Damage expressions can be put into some data lists (e.g., the status value of the BUFF list), or into a value calculation expression (the [&expression&] format);

Currently supported damage expression key-value is:

  • type: damage type: 0: melee attack 1: ranged attack 2: skill damage 3: healing 4: MP regen
  • dmg: physical damage value. The value is the damage expression.
  • t_dmg: true damage value (all healing effects are counted as this type of value). The value is the damage expression.
  • hit: hit parameter (-1000~1000). When an attack cannot be evaded, the value is -1000.
  • blk: block parameter (-1000~1000). When an attack cannot be blocked, the value is -1000.
  • cri: critical rate parameter (-1000~1000). When an attack cannot deal critical damage, the value is -1000.
  • act: play unit action when they are hit. 0: No; 1: Yes
  • eft ID: special effect ID (when the unit is hit).
  • trig: trigger damage effect (e.g., damage reflection).
  • attack_type: decide the type of weapon attacks that caused the damage.
  • buff: Gain buffs when receiving damage, Format: BuffID,[time],[overlay]. The two parameters are optional, meaning time and the number of stacks.


Damage expressions only support standard mathematic expressions, containing the following math symbols: +-*/^%(). Certain pre-defined fields can be used, and all pre-defined fields should follow the format of [%cmd%]. Currently, we support the following pre-defined fields:

  • [%rnd:min_val,max_val%]: a random integer (min_val<= this integer<= max_val).
  • [%field%]: field stands for a random value defined in a character attribute field.


Skill Directive Editing

Skill directives are the essential elements used to realize different skill effects in battles. On the battlefield, when units cast abilities, their skill directives will be put into an execution queue, carried out one by one according to their execution environment.

In the skill configuration table, skill directive strings are separated with ”\n” , a line breaker. Every directive consists of: delay time*[conditional expression(optional)]#directive content. Please refer to the following format:

0*conditional expression 1#skill directive 1
0.2#skill directive 2
……

当条件表达式不为空时,根据条件表达式判定结果执行。

条件语句中可以使用一些内置命令来实现一些例如重复之类的特殊效果,例如

*REPEAT_START:9
Statement 1
Statement 1
[@0.01*[%rpt_index%]@]#skill directive
...
Statement N
*REPEAT_END

表示将REPEAT_START行与REPEAT_END之间的所有行重复9遍,期间可以通过[%rpt_index%]来查询当前语句处于第几次循环

*SELECT_UNITS:[目标筛选条件表达式](注意,次数查询cast_info中的target为当前单位)
语句1
语句2
...
语句N
*SELECT_END

表示对SELECT_UNITS行与SELECT_END之间所有的命令行,对SELECT_UNITS:后所有满足指定条件表达式的对象使用,并以该对象作为caster对象

其中,嵌入到[@...@]中的语句为保留两位小数的结果运算取值,此类查询仅在技能命令中有效。

目前支持的技能命令有:

技能指令 说明
stop_act 立即停止当前所有技能动作并按照之前指令行动


stop_act#1
add_eft 向战场中添加一个预定义的特效体


add_eft#特效体ID#初始位置#运动参数#修改伤检对象(可选,为空时为默认)#附带伤害表达式(可选,为空时按照特效表中定义的伤害表达式计算,格式见6.4节)#目标参数(见7.4节说明)#特效体TAG(用于replace_eft指令查询)

初始位置格式为:位置类型,偏移x,偏移y,偏移z(偏移量为相对于初始方向的偏移)

支持的位置类型有:

  • cast_pos:技能施放动作的预设位置
  • tag_pos:技能施放目标单位或者目标坐标的位置
  • hit_pos:技能命中目标单位当前的位置
  • unit_pos:技能施放单位当前的位置
  • start_pos:技能释放时的开始位置
  • rnd_pos:技能释放单位周围一个任意的位置
  • dim_pos:通过set_dimpos命令定义的预设位置
  • reinf_pos:施法者阵营方的增援位置
  • emitter_pos=EMITTER_ID:ID为EMITTER_ID的发射器发射点位置
  • unit_round=DIR:LEN:距离施法者正方向偏移DIR角度,距离为LEN的位置
  • rnd_round=RAD[-MIN_RAD]:施法者半径RAD范围内的随机位置,可选参数MIN_RAD表示随机范围距中心的最小距离,默认为0
  • eft_pos=TAG:返回查询到的第一个指定特效体TAG的特效体位置,如不存在则返回caster的当前位置 注意:仅支持查询由caster本单位创建的特效体
  • ……

运动参数格式为:运动类型:运动参数(形如:参数1,参数2,参数3.....)

支持的运动类型有:

  • 0:不运动 无参数
  • 1:运动至技能目标点 偏移x,偏移y,偏移z
  • 2:运动至技能目标单位 无参数(当目标参数不为空时使用目标参数指定的目标,否则按照技能释放目标)
  • 3:向指定方向运动 偏移角度,移动距离(最大不超过战场宽度)
  • 4:向指定方向往返运动 偏移角度,移动距离(最大不超过战场宽度)
  • 5:跟随目标运动 跟随类型(0固定相对位置,1发射点位置),偏移x,偏移y,偏移z,持续时间(-1为永久)
  • 6:运动至dim_pos 偏移x,偏移y,偏移z


dmg_check 进行伤害判定


dmg_check#判断类型#伤害值表达式#目标对象参数#判断参数表(“,”分隔)#是否过滤掉重复检定对象(可选,默认关闭)

支持的判断类型有:

  • 0:单体判断(目标对象参数为目标单位见下一小节,为空表示技能目标)
  • 1:半径范围判断 目标对象参数为目标类型(0:敌方 1:我方 2:双方) 参数表中参数1为参考位置类型(见add_eft命令的位置类型) 参数2,3,4,5分别为偏移坐标的x,y,z及半径
  • 2:多边形范围判断 目标对象参数同上 参数表中参数1同上 参数2为旋转角度 参数3为多边形顶点数,参数4以后为以参考点坐标为(0,0)的多边形坐标信息


add_buff 对目标施加BUFF
add_buff#buff ID#BUFF目标参数#持续时间(如不指定则采用BUFF默认持续时间)#叠加层数(默认为1)#上限层数(默认为配置表中的数值,只有大于0时生效)


可支持的内置目标参数有:

  • caster:技能释放者
  • target:目标单位(指向性技能的目标或技能命中的目标)
  • roleid,ROLEID:查询单位绑定人物ID为ROLEID的一个目标对象
  • buffgiver,BUFFID:查询当前caster身上一个ID为BUFFID的BUFF给与者
  • find_tag_res:查询指定目标的结果单位(必须先执行一次[%find_tag:TAGINFO%]查询才可调用)
  • tag_next_fu,距离D:当前命中目标的下一个小于距离D的友方单位
  • caster_next_fu,距离D:施法者的下一个小于距离D的友方目标
  • caster_next_eu,距离D:施法者的下一个小于距离D的敌方目标


remove_buff 移除目标的BUFF
remove_buff#移除目标(同上)#移除方式#参数1,参数2,参数3...

目前支持的移除方式如下

  • 0:全部移除
  • 1:移除指定BUFF 参数1为BUFF ID,参数2为移除层数(默认-1为全部移除)
  • 2:移除有害BUFF 参数1为移除数量(默认-1全部移除),参数2为BUFF子类型(默认-1不限)
  • 3:移除有益BUFF 参数1为移除数量(默认-1全部移除),参数2为BUFF子类型(默认-1不限)


dart_move 突进类移动
dart_move#动作ID#移动类型#速度参数#冲撞质量#绑定特效#运动结束承接技能,技能等级(默认1级)[可为空],时间偏移(秒,在运动结束前开始执行承接技能向前的时间偏移量>=0)[可为空]#操作对象(可选,默认为caster)#修正目标位置(可选,参数格式见节2)#是否强制(默认0  为1时强制移动)

移动类型分为:

  • 0:匀速运动
  • 1:跳跃
  • 2:击退运动
  • 3:击飞运动 (当为击飞运动时,速度参数为击飞的滞空时间)

速度参数为角色移动时的水平速度(当速度小于等于0时为闪现至目标)

冲撞质量在匀速运动时表示刚体质量,0为无视碰撞 (当为跳跃运动时该参数代表跳跃高度)——由于不使用物理引擎了,目前暂时无用了,参数还必须要填写。

绑定特效为运动时附加在单位上的特效ID

运动结束承接技能为执行运动结束后立即执行的技能ID


stop_dartmove 停止当前突进运动
stop_dartmove#1


explode 在目标位置进行一次爆破物理效果
explode#初始位置(见 技能位置查询参数格式说明)#爆破半径#力度参数


add_force 对目标单位进行一次击退效果
add_force#力度参数#目标单位(可省略,默认target)


play_sound 播放一个指定音效
play_sound#音效ID#音效位置(同第一节解释)


unit_sound_dic 单位根据模型配置播放指定音效字典中的字段对应音效
unit_sound_dic#音效字典KEY值#单位目标参数


cast_sound 播放一个指定音效(在施法者处)
cast_sound#音效ID


chain_eft_to 播放一个链式特效
chain_eft_to#释放单位#目标单位#特效预制体#传播速度(-1为瞬间)#维持时间#命中目标的伤害值表达式

释放目标的参数见 技能 指令目标参数说明

taunt 嘲讽效果,让目标立即攻击释放者
taunt#释放者#目标单位


use_skill 立即触发一个不需要吟唱时间的单体目标技能(可以是当前施法者没有的技能)
use_skill#技能ID,技能等级(默认1级)#释放者#目标单位#目标位置参数


set_cmd_val 操作当前命令行参数
set_cmd_val#操作方式#操作值D

操作方式:0:设置为值D  1:增加值D 2:减少值D


注意:与其他缓冲后依次执行的指令不同,该指令不会进入执行队列,将立即执行生效。这是为了在一些需要在执行语句上下文中使用临时变量进行信息中继所设计的结构。


set_dimpos 设置预设位置参数
set_dimpos#操作方式#操作参数[#偏移参数(仅在查询单位位置时生效)]

操作方式:

  • 0:我方增援出兵位置 操作参数分别为 x,y,z的偏移
  • 1:查询目标单位位置 操作参数为查询指令(见第4小节)
  • 2:查询技能参数位置 操作参数为查询指令(见第2小节位置信息)


play_sk_act 播放一个已定义的技能动作
play_sk_act#目标单位#技能动作ID名称#播放速度系数(默认1)#是否停止移动(默认否)


summon_unit 召唤一个单位
summon_unit#召唤方式#对象参数[,血量百分比(可选参数,默认为100)]#初始位置参数#持续时间#附加状态表#附加特效参数#单位阵营参考目标参数(可选参数,默认为caster)#替换角色技能(可选参数,为空为不替换)#默认策略参数

召唤方式:0:对象的镜像  1:通过人物ID召唤  2:通过小兵ID召唤

对象参数: 当召唤方式为0时表示对象单位(参考本章4节);当召唤方式为1时表示人物模版ID,等级;当召唤方式为2时表示兵种单位ID

初始位置参数见本章2节

持续时间小于等于0时表示本次战斗永久持续,大于0时表示持续秒数

附加状态为该单位的附加属性表,如: s_生命,-[&[%s_生命%]*0.5&]|s_攻击,-[&[%s_攻击%]*0.5&]   表示召唤出的单位生命与攻击力均为原单位的一半

附加特效参数:默认为0 当为1时显示半透明影子效果

单位阵营参考目标参数:以指定的目标当前的阵营作为召唤单位当前的阵营,默认为施法者所在的阵营

替换角色技能参数:格式为普通角色技能表信息,如: 技能1,1|技能2,1|... 如果需要复制角色技能,可使用[%this_skills%]或[%aim_skills%]来复制施法者或者目标的技能

默认策略参数:格式为:策略类型,策略参数(默认为“0,0“,支持的策略类型参考SET_POLICY指令,但是不支持攻略地点类型3。例如:参数“2,500”,表示在半径500范围内进行跟随)

set_unitpos 强制改变目标单位的当前位置
set_unitpos#操作对象(同4节)#位置信息(同2节)


set_active 设置目标单位的激活状态
set_active#操作对象参数(同4节)#是否激活(1是0否),是否隐藏(1是0否,仅在非激活时有效)


kill_unit 目标立即被击倒(无视无敌属性)
kill_unit#操作对象参数(同4节)


down_unit 目标主动倒下
down_unit#操作对象参数(同4节)


b_talk 在目标头上弹出一个对话气泡
b_talk#操作对象#对话内容#持续时间(秒数,可省略)


yell 目标呼喊出几个字(多为技能)
yell#操作对象#喊话内容


warning_area 播放一个圆形战场警告区域
warning_area#目标位置信息#半径#持续时间(秒)


timeline 播放一个TimeLine技能对象
播放Timeline动作并执行对应的技能指令文件(.txt)
timeline#指定的TimeLine ID


timeline_anim 播放一个TimeLine技能的动作部分
只播放Timeline动作,不执行对应的技能指令文件(.txt)
timeline_anim#指定的TimeLine ID


block_act 设置当前施法者的动作锁定状态
block_act#状态类型(见下表)#是否可打断该状态(0否1是)#锁定时间(单位:秒 Timeline里编辑时可不指定该时间,以再度调用 block_act#0#0#0的时间差为准)

可用的锁定状态

  • 0:不锁定
  • 1:锁定攻击及移动
  • 2:仅锁定攻击


camera_shake 镜头抖动
camera_shake#时长(秒)#幅度


rotate 控制角色进行旋转
rotate#目标单位参数#起始偏转角度(相对于当前方向)#共计旋转角度数(负数为反转)#持续时间(秒)


replace_eft 查找并用指定的特效体在当前位置替换目标特效体
replace_eft#指定的特效体TAG#匹配数量(≤0时为匹配全部,>0为匹配生成时间最早的有限几个)#用于替换的特效体ID(可为空表示直接停止目标特效)#初始位置(默认空或hit_pos表达式(同add_eft)#运动参数(可选,同add_eft)#修改伤检对象(可选,为空时为默认)#附带伤害表达式(可选,同add_eft)#目标参数(同add_eft)#特效体TAG(用于replace_eft指令查询)#原特效体创建者的对象参数(可选,用于查询时筛选,默认为所有人)


hitstop 角色顿帧
hitstop#操作对象#曲线起点降速幅度(倍率)#曲线终点降速幅度(倍率)#时长(秒)

(结束后角色动作速度恢复为1倍)

global_hitstop 全局顿帧
global_hitstop#曲线起点降速幅度(倍率)#曲线终点降速幅度(倍率)#时长(秒)

(结束后全局速度恢复为1倍)


set_skill_cd 更改施法者的指定技能CD
set_skill_cd#技能ID表(为空或者为ALL表示单位的所有技能,多个技能ID以”|”分隔)#操作方式(0:减少 1:直接赋新值)#操作值(单位:秒)


get_items 战斗中立即获得道具或资源(增加的道具只对主角自己使用时有效)
get_items#道具列表(道具表格式同剧情指令中的GETITEMS指令)#获得道具的对象目标参数


set_unit_intvar 为此单位设置一个自定义的整形变量值
set_unit_intvar#变量ID#操作方式(0:±改变 1:直接赋值)#操作值#操作对象目标参数(可选,默认为施法者)


call_battle_event 执行一个指定的战斗事件
call_battle_event#事件ID#执行者的目标参数(可选,事件脚本中THIS对象的默认值)


change_skill 替换施法者单位的当前技能列表
change_skill#技能列表信息


revert_skill 还原施法者的当前技能列表
revert_skill#1


change_dungeon_skill 替换施法者的地城技能
change_dungeon_skill#技能ID,等级


revert_dungeon_skill 还原施法者的地城技能
revert_dungeon_skill#1


replace_tag_skill 将一个单位的指定技能暂时替换为其他技能
replace_tag_skill#原技能ID#替换为新的技能ID,等级(如需还原该技能则为空)#替换时长(≤0时为永久,>0为持续指定秒数)#对象单位目标参数


change_mp 改变一个单位当前的MP值
change_mp#对象单位目标参数#改变值(可以是公式)#是否播放数字特效(0:否 1:是)#播放受击特效ID(可选,为空不播放)



战斗中的特殊对象ID

战斗指令中经常需要进行一些目标单位的查询,通常是通过角色ID来查找,但是可以通过以下内置ID返回特定的查询对象:

特殊内置ID 说明
PLAYER 玩家单位
GM_A A方的固定内置单位(用于实现一些无特定施法者的技能指令)
GM_B B方的固定内置单位(用于实现一些无特定施法者的技能指令)
THIS 当前执行指令单位自身(一般用于单位挂载脚本中)
RND_ENEMY_UNIT 随机的敌方小兵单位(非当前PLAYER一方)
RND_FRIEND_UNIT 随机的友方小兵单位(非当前PLAYER一方)
EMITTER={EMITER_ID} 指定ID为EMITER_ID的发射器单位


单位对象附加触发脚本编辑说明

通过在地城单位对象中的触发命令中定义,可对该单位附加若干触发器脚本。角色表中角色也可以通过在TAG中指定attached_script字段为一个脚本事件ID来给该角色附加触发脚本。定义格式为:

[CMD_BEGIN]#触发类型1#触发条件(可选)#触发参数(可选)
命令行1
命令行2
...
命令行N
[CMD_END]
[CMD_BEGIN]#触发类型2#触发条件(可选)#触发参数(可选)
命令行1
命令行2
...
命令行N
[CMD_END]
...


每个对象可挂载多个地城对象触发器,当前已支持的触发类型有:

  • on_spawn:当刷新出时
  • enter_combat:进入战斗
  • get_hurt:单位受到伤害
  • dead:单位死亡时
  • on_timer:当单位身上的计时器(战斗指令SET_UNIT_TIMER设置)到时时触发
  • on_skill:该单位开始释放技能时触发 触发参数位技能ID
  • hp_pct:单位血线第一次少于目标百分比时触发 触发参数位目标血线的百分比
  • interactive:具有战斗内可交互对象的单位在进行交互行为时触发


以下为一段示例附加脚本:

[CMD_BEGIN]#enter_combat#
B_TALK*THIS#关门,放狗!
[CMD_END]
[CMD_BEGIN]#get_hurt#[%this_hp_pct%][<=]5&[%dg_int_val:测试计数器1%][<=]0
SET_DG_INTVAR*测试计数器1#1#1
SKILL_CMD*THIS#THIS#0#add_buff#中立#caster B_TALK*THIS#别打了!别打了!我认输,什么都给你!
CMD_RETREAT*1
[CMD_END]