导图社区 魔兽争霸地图编辑器_Api列表_cj全
魔兽争霸地图编辑器的api列表,包括:数据类型、常量、函数、游戏对象、Ul、系统、本地化。
编辑于2022-09-24 22:55:11 四川省api
数据类型
cj
integer 整数
real 真值型
string 字符串
<">boolean 布尔型
handle 句柄
code 代码
ability 技能
aidifficulty 对战AI难度
alliancetype 盟友类型
blendmode 合成算法
boolexpr 布尔表达式
buff 缓冲
button 对话按钮
camerafield 镜头区域
camerasetup 镜头物体
conditionfunc 条件函数
defeatcondition 失败条件
destructable 可破坏的
dialog 对话
dialogevent 对话事件
effect 特效
effecttype 特效类型
event 事件
eventid 事件代码
igamestate 游戏状态(I)
整数类型游戏状态
fgamestate 游戏状态(f)
浮点数类型游戏状态
filterfunc 过滤函数
fogmodifier 可见修改器
fogstate 可见状态
force 玩家组
gamecache 游戏缓存
gamedifficulty 游戏难度
gameevent 游戏事件
gamespeed 游戏速度
gamestate 游戏状态
gametype 游戏类型
group 单位组
item 物品
itempool 物品池
itemtype 物品类
leaderboard 排行榜
limitop 比较算符
location 点
mapcontrol 玩家控制者
mapdensity 地图密度
mapflag 地图标记
mapsetting 地图设置
mapvisibility 地图可见性
multiboard 多面板
multiboarditem 多面板项目
placement 起始位置分布
player 玩家
playercolor 玩家颜色
playerevent 玩家事件
playergameresult 玩家游戏结果
playerscore 玩家得分
playerslotstate 玩家槽状态
playerstate 玩家属性
playerunitevent 玩家单位事件
quest 任务
questitem 任务要求
race 种族
racepreference 种族优选
raritycontrol 动画珍品
rect 地区
region 地区
sound 声音
startlocprio 起始位置优先权
terraindeformation 地形变形
texmapflags 地图涂层标志
texttag 漂浮文字
timer 计时器
timerdialog 计时器窗口
trackable 可跟踪
trigger 触发器
triggeraction 触发器动作
triggercondition 触发器条件
unit 单位
unitevent 单位事件
unitpool 单位池
unitstate 单位属性
unittype 单位类型
version 版本
volumegroup 音量频道
weathereffect 气候效果
widget 有生命的对象
widgetevent 容器事件
bj
常量
cj
限制事件常量(即比较运算符)
基础
用来对事件的触发条件进行限制
分类
//< constant limitop LESS_THAN = ConvertLimitOp(0) //<= constant limitop LESS_THAN_OR_EQUAL = ConvertLimitOp(1) //== constant limitop EQUAL = ConvertLimitOp(2) //>= constant limitop GREATER_THAN_OR_EQUAL = ConvertLimitOp(3) //> constant limitop GREATER_THAN = ConvertLimitOp(4) //~= constant limitop NOT_EQUAL = ConvertLimitOp(5)
示例
类型
bool
// false constant boolean FALSE = false // true constant boolean TRUE = true
最大值
数组最大值
// 数组最大值--重制版 //早期版本为8192 constant integer JASS_MAX_ARRAY_SIZE = 32768
bj
函数
当前无法正常运行的函数
cj
// Not currently working correctly... constant native AbilityId takes string abilityIdString returns integer constant native AbilityId2String takes integer abilityId returns string
转换函数
cj
// 转换种族 constant native ConvertRace takes integer i returns race // 转换联盟类型 constant native ConvertAllianceType takes integer i returns alliancetype // 转换种族 constant native ConvertRacePref takes integer i returns racepreference // 转换I游戏状态 constant native ConvertIGameState takes integer i returns igamestate // 转换F游戏状态 constant native ConvertFGameState takes integer i returns fgamestate // 玩家状态转换 constant native ConvertPlayerState takes integer i returns playerstate // 转换玩家得分 constant native ConvertPlayerScore takes integer i returns playerscore // 转换玩家游戏结果 constant native ConvertPlayerGameResult takes integer i returns playergameresult // 转换单位状态 constant native ConvertUnitState takes integer i returns unitstate // 转换AI难度 constant native ConvertAIDifficulty takes integer i returns aidifficulty // 转换游戏事件 constant native ConvertGameEvent takes integer i returns gameevent // 转换玩家事件 constant native ConvertPlayerEvent takes integer i returns playerevent // 转换玩家单位事件 constant native ConvertPlayerUnitEvent takes integer i returns playerunitevent // 转换组件事件 constant native ConvertWidgetEvent takes integer i returns widgetevent // 转换对话框事件 constant native ConvertDialogEvent takes integer i returns dialogevent // 转换单位事件 constant native ConvertUnitEvent takes integer i returns unitevent // 转换限制操作 constant native ConvertLimitOp takes integer i returns limitop // 转换单位类型 constant native ConvertUnitType takes integer i returns unittype // 转换游戏速度 constant native ConvertGameSpeed takes integer i returns gamespeed // 转换位置 constant native ConvertPlacement takes integer i returns placement // 转换起始位置优先 constant native ConvertStartLocPrio takes integer i returns startlocprio // 游戏难度 constant native ConvertGameDifficulty takes integer i returns gamedifficulty // 游戏类型 constant native ConvertGameType takes integer i returns gametype // 地图标记 constant native ConvertMapFlag takes integer i returns mapflag // 地图可见性 constant native ConvertMapVisibility takes integer i returns mapvisibility // 地图设置 constant native ConvertMapSetting takes integer i returns mapsetting // 地图密度 constant native ConvertMapDensity takes integer i returns mapdensity // 地图控制器 constant native ConvertMapControl takes integer i returns mapcontrol // 玩家颜色 constant native ConvertPlayerColor takes integer i returns playercolor // 玩家位置状态 constant native ConvertPlayerSlotState takes integer i returns playerslotstate // 音量组 constant native ConvertVolumeGroup takes integer i returns volumegroup // 照相机领域 constant native ConvertCameraField takes integer i returns camerafield // 混合模式 constant native ConvertBlendMode takes integer i returns blendmode // 罕见的控制 constant native ConvertRarityControl takes integer i returns raritycontrol // 纹理贴图标志 constant native ConvertTexMapFlags takes integer i returns texmapflags // 迷雾状态 constant native ConvertFogState takes integer i returns fogstate // 特效类型 constant native ConvertEffectType takes integer i returns effecttype // 版本 constant native ConvertVersion takes integer i returns version // 物品类型 constant native ConvertItemType takes integer i returns itemtype // 攻击类型 constant native ConvertAttackType takes integer i returns attacktype // 伤害类型 constant native ConvertDamageType takes integer i returns damagetype // 武器类型 constant native ConvertWeaponType takes integer i returns weapontype // 声音类型 constant native ConvertSoundType takes integer i returns soundtype // 路径类型 constant native ConvertPathingType takes integer i returns pathingtype // 鼠标按钮类型 constant native ConvertMouseButtonType takes integer i returns mousebuttontype // 动画类型 constant native ConvertAnimType takes integer i returns animtype // 子动画类型 constant native ConvertSubAnimType takes integer i returns subanimtype // 原点框架类型 constant native ConvertOriginFrameType takes integer i returns originframetype // frame点类型 constant native ConvertFramePointType takes integer i returns framepointtype // 文本对齐类型 constant native ConvertTextAlignType takes integer i returns textaligntype // 框架事件类型 constant native ConvertFrameEventType takes integer i returns frameeventtype // 按键类型 constant native ConvertOsKeyType takes integer i returns oskeytype // 技能整数字段 constant native ConvertAbilityIntegerField takes integer i returns abilityintegerfield // 技能实数字段 constant native ConvertAbilityRealField takes integer i returns abilityrealfield // 技能布尔字段 constant native ConvertAbilityBooleanField takes integer i returns abilitybooleanfield // 技能字符串字段 constant native ConvertAbilityStringField takes integer i returns abilitystringfield // 技能整数等级字段 constant native ConvertAbilityIntegerLevelField takes integer i returns abilityintegerlevelfield // 技能实数等级字段 constant native ConvertAbilityRealLevelField takes integer i returns abilityreallevelfield // 技能布尔等级字段 constant native ConvertAbilityBooleanLevelField takes integer i returns abilitybooleanlevelfield // 技能字符串等级字段 constant native ConvertAbilityStringLevelField takes integer i returns abilitystringlevelfield constant native ConvertAbilityIntegerLevelArrayField takes integer i returns abilityintegerlevelarrayfield constant native ConvertAbilityRealLevelArrayField takes integer i returns abilityreallevelarrayfield constant native ConvertAbilityBooleanLevelArrayField takes integer i returns abilitybooleanlevelarrayfield constant native ConvertAbilityStringLevelArrayField takes integer i returns abilitystringlevelarrayfield constant native ConvertUnitIntegerField takes integer i returns unitintegerfield constant native ConvertUnitRealField takes integer i returns unitrealfield constant native ConvertUnitBooleanField takes integer i returns unitbooleanfield constant native ConvertUnitStringField takes integer i returns unitstringfield constant native ConvertUnitWeaponIntegerField takes integer i returns unitweaponintegerfield constant native ConvertUnitWeaponRealField takes integer i returns unitweaponrealfield constant native ConvertUnitWeaponBooleanField takes integer i returns unitweaponbooleanfield constant native ConvertUnitWeaponStringField takes integer i returns unitweaponstringfield constant native ConvertItemIntegerField takes integer i returns itemintegerfield constant native ConvertItemRealField takes integer i returns itemrealfield constant native ConvertItemBooleanField takes integer i returns itembooleanfield constant native ConvertItemStringField takes integer i returns itemstringfield constant native ConvertMoveType takes integer i returns movetype constant native ConvertTargetFlag takes integer i returns targetflag constant native ConvertArmorType takes integer i returns armortype constant native ConvertHeroAttribute takes integer i returns heroattribute constant native ConvertDefenseType takes integer i returns defensetype constant native ConvertRegenType takes integer i returns regentype constant native ConvertUnitCategory takes integer i returns unitcategory // 路径标志 constant native ConvertPathingFlag takes integer i returns pathingflag
// 命令id constant native OrderId takes string orderIdString returns integer // 命令id转字符串 constant native OrderId2String takes integer orderId returns string // 单位id constant native UnitId takes string unitIdString returns integer // 单位id转字符串 constant native UnitId2String takes integer unitId returns string
字符串工具
cj
// 获取句柄id tips:一般用于hashtable key // @param h 任意handle子类型, 常用于hashtable key native GetHandleId takes handle h returns integer // 截取字符串 [R] // @param source "hello world" // @param start 开始位置,下标为0 // @param end 结束位置,需要的字符串长度 native SubString takes string source, integer start, integer end returns string // 字串符长度 native StringLength takes string s returns integer // 将字串符转换为大小写字母 native StringCase takes string source, boolean upper returns string // 转换字符串为哈希码 native StringHash takes string s returns integer
布尔表达式api
基础
// Boolean Expr API ( for compositing trigger conditions and unit filter funcs...) //Boolean Expr API(用于合成触发条件和单元过滤函数...) //
条件
// and native And takes boolexpr operandA, boolexpr operandB returns boolexpr // or native Or takes boolexpr operandA, boolexpr operandB returns boolexpr // not native Not takes boolexpr operand returns boolexpr // 限制条件为 native Condition takes code func returns conditionfunc // 销毁条件 native DestroyCondition takes conditionfunc c returns nothing
过滤器
// 过滤 native Filter takes code func returns filterfunc // 销毁过滤 native DestroyFilter takes filterfunc f returns nothing // 销毁条件表达式 native DestroyBoolExpr takes boolexpr e returns nothing
自动化测试
// 设置自动化测试类型--重制版 native AutomationSetTestType takes string testType returns nothing // 自动化测试开始--重制版 native AutomationTestStart takes string testName returns nothing //自动化测试结束--重制版 native AutomationTestEnd takes nothing returns nothing // 自动化测试完成--重制版 native AutomationTestingFinished takes nothing returns nothing
函数工具
// 运行函数 [R] native ExecuteFunc takes string funcName returns nothing
// 异步执行函数 native DzExecuteFunc takes string funcName returns nothing
数学
基础
// 转换 度 到 弧度 native Deg2Rad takes real degrees returns real // 转换 弧度 到 度 native Rad2Deg takes real radians returns real // 正弦(弧度) [R] native Sin takes real radians returns real // 余弦(弧度) [R] native Cos takes real radians returns real // 正切(弧度) [R] native Tan takes real radians returns real // Expect values between -1 and 1...returns 0 for invalid input // 反正弦(弧度) [R] native Asin takes real y returns real // 反余弦(弧度) [R] native Acos takes real x returns real // 反正切(弧度) [R] native Atan takes real x returns real // Returns 0 if x and y are both 0 // 反正切(Y:X)(弧度) [R] native Atan2 takes real y, real x returns real // Returns 0 if x <= 0 // 平方根 native SquareRoot takes real x returns real // computes x to the y power // y == 0.0 => 1 // x ==0.0 and y < 0 => 0 // // 求幂 native Pow takes real x, real power returns real // 四舍五入 constant native MathRound takes real r returns integer
随机
随机种子
// 设置随机种子 native SetRandomSeed takes integer seed returns nothing
随机数
// 随机整数 native GetRandomInt takes integer lowBound, integer highBound returns integer // 随机实数 native GetRandomReal takes real lowBound, real highBound returns real
随机对象
//// Choose any random unit/item. (NP means Neutral Passive) //一个等级 ${Level} 的随机中立单位类型 native ChooseRandomCreep takes integer level returns integer //随机中立被动建筑类型 native ChooseRandomNPBuilding takes nothing returns integer //随机物品 //该功能为ROC版函数,使用旧版等级作为参照对象. -1表示任何等级. native ChooseRandomItem takes integer level returns integer //随机类型物品 native ChooseRandomItemEx takes itemtype whichType, integer level returns integer
位运算
// 按位或--重制版 native BlzBitOr takes integer x, integer y returns integer // 按位与--重制版 native BlzBitAnd takes integer x, integer y returns integer // 按位异或--重制版 native BlzBitXor takes integer x, integer y returns integer
类型转换
// 转换整数变量为实数 native I2R takes integer i returns real // 转换实数为整数 native R2I takes real r returns integer // 将整数转换为字符串 native I2S takes integer i returns string // 将实数转换为字符串 native R2S takes real r returns string // 将实数转换为格式化字符串 //@param precision 保留小数位数 native R2SW takes real r, integer width, integer precision returns string // 转换字串符为整数 native S2I takes string s returns integer // 转换字符串为实数 native S2R takes string s returns real
//转换 Frame 为 整数--转换 ${Frame} 为 整数 function DzF2I takes integer i returns integer return i endfunction //转换 整数 为 Frame function DzI2F takes integer i returns integer return i endfunction //转换 按键 为 整数 function DzK2I takes integer i returns integer return i endfunction //转换 整数 为 按键 function DzI2K takes integer i returns integer return i endfunction
内存
// 设置内存数值--设置内存数据 ${地址} = ${数值} native DzSetMemory takes integer address, real value returns nothing //设置内存数值-- "设置内存数据 ${地址} = ${数值}" native DzSetMemory takes integer frame,real r returns nothing
作弊码
//输入作弊码: ${String}--作弊码只在单机有效 native Cheat takes string cheatStr returns nothing // 无法胜利--玩家开启作弊模式: 无法胜利 [R] native IsNoVictoryCheat takes nothing returns boolean // 无法失败--玩家开启作弊模式: 无法失败 [R] native IsNoDefeatCheat takes nothing returns boolean
文件加载
// 预读文件--可以事先载入文件并调入到游戏内存,以加快游戏的速度 //可以创建一个马甲单位,给他添加技能等,从而实现预加载的功能 native Preload takes string filename returns nothing // 开始预读--开始预载, 超时设置 ${Time} 秒--将文件调入到游戏内存中 native PreloadEnd takes real timeout returns nothing // 预加载开始 native PreloadStart takes nothing returns nothing // 预加载刷新 native PreloadRefresh takes nothing returns nothing // 预加载结束 native PreloadEndEx takes nothing returns nothing //预加载清除 native PreloadGenClear takes nothing returns nothing //预加载清除开始 native PreloadGenStart takes nothing returns nothing //预加载清除结束 native PreloadGenEnd takes string filename returns nothing // 批量预载--预载所有在 ${文件} 中列出的文件 native Preloader takes string filename returns nothing
数据同步
重制版
// 注册玩家同步事件--重制版 native BlzTriggerRegisterPlayerSyncEvent takes trigger whichTrigger, player whichPlayer, string prefix, boolean fromServer returns event
回调参数获取
// 获取同步的前缀--重制版 native BlzGetTriggerSyncPrefix takes nothing returns string // 获取同步的数据--重制版 native BlzGetTriggerSyncData takes nothing returns string
相关函数
// 同步数据--重制版 native BlzSendSyncData takes string prefix, string data returns boolean
老版本
// 数据同步--标签为 ${prefix} 的数据被同步 | 是否来自平台:${server} native DzTriggerRegisterSyncData takes trigger trig, string prefix, boolean server returns nothing // 同步游戏数据--同步 标签:${prefix} 发送数据:${data} native DzSyncData takes string prefix, string data returns nothing // 事件响应 - 获取同步的数据--响应 [同步] - 同步消息事件 native DzGetTriggerSyncData takes nothing returns string // 事件响应 - 获取同步数据的玩家--响应 [同步] - 同步消息事件 native DzGetTriggerSyncPlayer takes nothing returns player
服务器
请求服务器数据
重制版(DzApi中有同名函数)
// 获取拓展数据整型数据--重制版 native RequestExtraIntegerData takes integer dataType, player whichPlayer, string param1, string param2, boolean param3, integer param4, integer param5, integer param6 returns integer // 获取布尔数据--重制版 native RequestExtraBooleanData takes integer dataType, player whichPlayer, string param1, string param2, boolean param3, integer param4, integer param5, integer param6 returns boolean // 获取字符串数据--重制版 native RequestExtraStringData takes integer dataType, player whichPlayer, string param1, string param2, boolean param3, integer param4, integer param5, integer param6 returns string // 获取实数数据--重制版 native RequestExtraRealData takes integer dataType, player whichPlayer, string param1, string param2, boolean param3, integer param4, integer param5, integer param6 returns real
服务器存档
普通存档
基础
DZApi
// DzAPI-保存服务器存档--"DzAPI: ",~玩家,"保存存档[",~存档名称,"][",~存档内容,"]"," 最大长度64位 native DzAPI_Map_SaveServerValue takes player whichPlayer, string key, string value returns boolean // 获取服务器存储的数据 native DzAPI_Map_GetServerValue takes player whichPlayer, string key returns string //清理服务器数据--"服务器数据:清理",~whichPlayer,"数据,名称: ",~key // "清理封装的接口记得在前面加对应的B、I、R、S" function DzAPI_Map_FlushStoredMission takes player whichPlayer, string key returns nothing call DzAPI_Map_SaveServerValue(whichPlayer,key,null) set key=null set whichPlayer=null endfunction
封装
整数
//服务器存储整数(区分大小写)--这是经过封装的接口,实际Key会在原Key前面加”I”,与普通存档共用KEY function DzAPI_Map_StoreIntegerEX takes player whichPlayer, string key, integer value returns nothing set key="I"+key call RequestExtraBooleanData(39, whichPlayer, key, I2S(value), false, 0, 0, 0) set key=null set whichPlayer=null endfunction //获取服务器存储的整数(区分大小写)--这是经过封装的接口,实际Key会在原Key前面加”I”,用于作者之家设置的防刷分存档,与普通存档共用KEY function DzAPI_Map_GetStoredIntegerEX takes player whichPlayer, string key returns integer local integer value set key="I"+key set value=S2I(RequestExtraStringData(38, whichPlayer, key, null, false, 0, 0, 0)) set key=null set whichPlayer=null return value endfunction
//服务器存储整数--这是经过封装的接口,实际Key会在原Key前面加”I,(如您的key是AA,实际key为IAA。【IAA用于作者之家填写,在编辑器上获取和读都填写AA就可以了】) function DzAPI_Map_StoreInteger takes player whichPlayer, string key, integer value returns nothing set key="I"+key call DzAPI_Map_SaveServerValue(whichPlayer,key,I2S(value)) set key=null set whichPlayer=null endfunction //获取服务器存储的整数--这是经过封装的接口,实际Key会在原Key前面加”I” function DzAPI_Map_GetStoredInteger takes player whichPlayer, string key returns integer local integer value set key="I"+key set value=S2I(DzAPI_Map_GetServerValue(whichPlayer,key)) set key=null set whichPlayer=null return value endfunction
实数
//服务器存储实数 //服务器存档:存储 ",~whichPlayer," 数据,名称:",~key,",值:",~value," 最大长度63位 //这是经过封装的接口,实际Key会在原Key前面加”R,(如您的key是AA,实际key为RAA。【RAA用于作者之家填写,在编辑器上获取和读都填写AA就可以了】 function DzAPI_Map_StoreReal takes player whichPlayer, string key, real value returns nothing set key="R"+key call DzAPI_Map_SaveServerValue(whichPlayer,key,R2S(value)) set key=null set whichPlayer=null endfunction //获取服务器存储的实数 //这是经过封装的接口,实际Key会在原Key前面加”R,(如您的key是AA,实际key为RAA。【RAA用于作者之家填写,在编辑器上获取和读都填写AA就可以了】 function DzAPI_Map_GetStoredReal takes player whichPlayer, string key returns real local real value set key="R"+key set value=S2R(DzAPI_Map_GetServerValue(whichPlayer,key)) set key=null set whichPlayer=null return value endfunction
布尔
//服务器存储布尔值--这是经过封装的接口,实际Key会在原Key前面加”B,(如您的key是AA,实际key为BAA。【BAA用于作者之家填写,在编辑器上获取和读都填写AA就可以了】)” function DzAPI_Map_StoreBoolean takes player whichPlayer, string key, boolean value returns nothing set key="B"+key if(value)then call DzAPI_Map_SaveServerValue(whichPlayer,key,"1") else call DzAPI_Map_SaveServerValue(whichPlayer,key,"0") endif set key=null set whichPlayer=null endfunction //获取服务器存储的布尔值 //这是经过封装的接口,实际Key会在原Key前面加”B function DzAPI_Map_GetStoredBoolean takes player whichPlayer, string key returns boolean local boolean value set key="B"+key set key=DzAPI_Map_GetServerValue(whichPlayer,key) if(key=="1")then set value=true else set value=false endif set key=null set whichPlayer=null return value endfunction
字符串
//服务器存储字符串--这是经过封装的接口,实际Key会在原Key前面加”S,(如您的key是AA,实际key为SAA。【SAA用于作者之家填写,在编辑器上获取和读都填写AA就可以了】 function DzAPI_Map_StoreString takes player whichPlayer, string key, string value returns nothing set key="S"+key call DzAPI_Map_SaveServerValue(whichPlayer,key,value) set key=null set whichPlayer=null endfunction //获取服务器存储的字符串 //这是经过封装的接口,实际Key会在原Key前面加”S function DzAPI_Map_GetStoredString takes player whichPlayer, string key returns string return DzAPI_Map_GetServerValue(whichPlayer,"S"+key) endfunction
//服务器存储字符串--这是经过封装的接口,实际Key会在原Key前面加”S,(如您的key是AA,实际key为SAA。【SAA用于作者之家填写,在编辑器上获取和读都填写AA就可以了】 function DzAPI_Map_StoreStringEX takes player whichPlayer, string key, string value returns nothing set key="S"+key call RequestExtraBooleanData(39, whichPlayer,key,value,false,0,0,0) set key=null set whichPlayer=null endfunction //服务器获取字符串--这是经过封装的接口,实际Key会在原Key前面加”S,(如您的key是AA,实际key为SAA。【SAA用于作者之家填写,在编辑器上获取和读都填写AA就可以了】 function DzAPI_Map_GetStoredStringEX takes player whichPlayer, string key returns string return RequestExtraStringData(38, whichPlayer,"S"+key,null,false,0,0,0) endfunction
单位
//获取服务器存储的单位类型--这是经过封装的接口,实际Key会在原Key前面加”I” function DzAPI_Map_GetStoredUnitType takes player whichPlayer, string key returns integer local integer value set key="I"+key set value=S2I(DzAPI_Map_GetServerValue(whichPlayer,key)) set key=null set whichPlayer=null return value endfunction
技能
//获取服务器存储的技能类型--这是经过封装的接口,实际Key会在原Key前面加”I” function DzAPI_Map_GetStoredAbilityId takes player whichPlayer, string key returns integer local integer value set key="I"+key set value=S2I(DzAPI_Map_GetServerValue(whichPlayer,key)) set key=null set whichPlayer=null return value endfunction
天梯
基础
提交数据
//天梯提交字符串数据--"提交 ",~whichPlayer," 天梯项目:",~key," 的值为:",~value native DzAPI_Map_Ladder_SetStat takes player whichPlayer, string key, string value returns nothing
// 天梯设置玩家数据 native DzAPI_Map_Ladder_SetPlayerStat takes player whichPlayer, string key, string value returns nothing
判断
// 判断地图是否在RPG天梯[DzAPI] native DzAPI_Map_IsRPGLadder takes nothing returns boolean
天梯等级
// 获取天梯等级--取值1~25,青铜V是1级 native DzAPI_Map_GetLadderLevel takes player whichPlayer returns integer
天梯排名
// 获取天梯排名--排名>1000的获取值为0 native DzAPI_Map_GetLadderRank takes player whichPlayer returns integer
封装
整数
//天梯提交整数数据--"提交 ",~whichPlayer," 天梯项目:",~key," 的值为:",~value function DzAPI_Map_Ladder_SubmitIntegerData takes player whichPlayer, string key, integer value returns nothing call DzAPI_Map_Ladder_SetStat(whichPlayer,key,I2S(value)) endfunction
单位
//天梯提交单位类型数据 //"提交 ",~whichPlayer," 天梯项目:",~key," 的值为:",~value function DzAPI_Map_Stat_SubmitUnitIdData takes player whichPlayer, string key,integer value returns nothing if(value==0)then //call DzAPI_Map_Ladder_SetStat(whichPlayer,key,"0") else call DzAPI_Map_Ladder_SetStat(whichPlayer,key,I2S(value)) endif endfunction //天梯提交单位类型数据 function DzAPI_Map_Stat_SubmitUnitData takes player whichPlayer, string key,unit value returns nothing call DzAPI_Map_Stat_SubmitUnitIdData(whichPlayer,key,GetUnitTypeId(value)) endfunction
技能
//天梯提交技能数据 function DzAPI_Map_Ladder_SubmitAblityIdData takes player whichPlayer, string key, integer value returns nothing if(value==0)then //call DzAPI_Map_Ladder_SetStat(whichPlayer,key,"0") else call DzAPI_Map_Ladder_SetStat(whichPlayer,key,I2S(value)) endif endfunction
物品
//天梯提交物品数据 function DzAPI_Map_Ladder_SubmitItemIdData takes player whichPlayer, string key, integer value returns nothing local string S if(value==0)then set S="0" else set S=I2S(value) call DzAPI_Map_Ladder_SetStat(whichPlayer,key,S) endif //call DzAPI_Map_Ladder_SetStat(whichPlayer,key,S) set S=null set whichPlayer=null endfunction //天梯提交物品数据--函数重载 function DzAPI_Map_Ladder_SubmitItemData takes player whichPlayer, string key, item value returns nothing call DzAPI_Map_Ladder_SubmitItemIdData(whichPlayer,key,GetItemTypeId(value)) endfunction
布尔
//天梯提交布尔值数据 function DzAPI_Map_Ladder_SubmitBooleanData takes player whichPlayer, string key,boolean value returns nothing if(value)then call DzAPI_Map_Ladder_SetStat(whichPlayer,key,"1") else call DzAPI_Map_Ladder_SetStat(whichPlayer,key,"0") endif endfunction
称号
//天梯提交获得称号 function DzAPI_Map_Ladder_SubmitTitle takes player whichPlayer, string value returns nothing call DzAPI_Map_Ladder_SetStat(whichPlayer,value,"1") endfunction
排名
//天梯提交玩家排名 function DzAPI_Map_Ladder_SubmitPlayerRank takes player whichPlayer, integer value returns nothing call DzAPI_Map_Ladder_SetPlayerStat(whichPlayer,"RankIndex",I2S(value)) endfunction
额外分
//天梯提交玩家额外分 function DzAPI_Map_Ladder_SubmitPlayerExtraExp takes player whichPlayer, integer value returns nothing call DzAPI_Map_Ladder_SetStat(whichPlayer,"ExtraExp",I2S(value)) endfunction
全局服务器存档值
函数
// 获取全局服务器存档值--获取全局存档名称:",~key," 里存储的字符串. native DzAPI_Map_GetMapConfig takes string key returns string
//读取全局存档 //只读的公共存档请使用另一个API读取 function DzAPI_Map_Global_GetStoreString takes string key returns string return RequestExtraStringData(36, GetLocalPlayer(), key, null, false, 0, 0, 0) endfunction //保存全局存档 //保存时受作者之家设定的规则限制 function DzAPI_Map_Global_StoreString takes string key, string value returns nothing call RequestExtraStringData(37, GetLocalPlayer(), key, value, false, 0, 0, 0) endfunction
触发器
//全局存档变化事件 //本局游戏或其他游戏保存的全局存档都会触发这个事件,请使用[同步]分类下的获取同步数据来获得发生变化的全局存档KEY值 function DzAPI_Map_Global_ChangeMsg takes trigger trig returns nothing call DzTriggerRegisterSyncData(trig, "DZGAU", true) endfunction
服务器存档组
//服务器存档组保存--"在服务器存档组:存储 ",~whichPlayer," 数据,名称:",~key,",值:",~value //存储服务器存档组,服务器存档组有100个KEY,每个KEY64个字符串长度,使用前请在作者之家服务器存档组进行设置 native DzAPI_Map_SavePublicArchive takes player whichPlayer, string key, string value returns boolean //读取服务器存档组数据--"在服务器存档组读取 ",~whichPlayer,",名称:",~key," 里的数据" //服务器存档组有100个KEY,每个KEY64个字符长度,可以多张地图读取和保存,使用前先在作者之家服务器存档组设置 native DzAPI_Map_GetPublicArchive takes player whichPlayer, string key returns string
//获取服务器存储的数据(区分大小写) 玩家 ${player} 名称 ${key} //用于作者之家设置的防刷分存档,与普通存档共用KEY function DzAPI_Map_ServerArchive takes player whichPlayer, string key returns string return RequestExtraStringData(38, whichPlayer, key, null, false, 0, 0, 0) endfunction //保存服务器存档(区分大小写) 玩家 ${player} 名称 ${key} 值 ${value} //用于作者之家设置的防刷分存档,与普通存档共用KEY function DzAPI_Map_SaveServerArchive takes player whichPlayer, string key, string value returns nothing call RequestExtraBooleanData(39, whichPlayer, key, value, false, 0, 0, 0) endfunction
自定义排行榜
//获取自定义排行榜玩家排名--"获取玩家 ",~whichPlayer," 自定义排行榜KEY(作者之家填写):",~key," 的排名,【请注意100名以外的玩家获取的值为0!】 //【100名以外的玩家排名为0】该功能适用于作者之家-服务器存档-自定义排行榜 function DzAPI_Map_CommentTotalCount1 takes player whichPlayer, integer id returns integer return RequestExtraIntegerData(52, whichPlayer, null, null, false, id, 0, 0) endfunction
boss
// 触发boss击杀--"设置 ",~whichPlayer," 触发击杀 ",~bosskey native DzAPI_Map_OrpgTrigger takes player whichPlayer, string key returns nothing // 读取服务器Boss掉落装备类型--"获取 ",~whichPlayer," 服务器里 ",~bosskey," 掉落的装备" native DzAPI_Map_GetServerArchiveDrop takes player whichPlayer, string key returns string // 读取服务器玩家装备 native DzAPI_Map_GetServerArchiveEquip takes player whichPlayer, string key returns integer
错误码
//获取玩家服务器错误码 native DzAPI_Map_GetServerValueErrorCode takes player whichPlayer returns integer // 读取玩家服务器存档成功 //如果返回false代表读取失败,反之成功,之后游戏里平台不会再发送“服务器保存失败”的信息,所以希望地图作者在游戏开始给玩家发下信息服务器存档是否正确读取。 function GetPlayerServerValueSuccess takes player whichPlayer returns boolean if(DzAPI_Map_GetServerValueErrorCode(whichPlayer)==0)then return true else return false endif endfunction
平台
房间显示的数据
//设置房间显示的数据--"设置 ",~whichPlayer," 房间的 ",~key," 项目显示 ",~value //为服务器存档显示的数据,这里miao代表秒退次数! native DzAPI_Map_Stat_SetStat takes player whichPlayer, string key, string value returns nothing
公会
// 获取玩家公会名称 native DzAPI_Map_GetGuildName takes player whichPlayer returns string // 获取玩家公会权限--获取公会权限 Member=10 Admin=20 Leader=30 native DzAPI_Map_GetGuildRole takes player whichPlayer returns integer
VIP
// 判断是否是红名vip native DzAPI_Map_IsRedVIP takes player whichPlayer returns boolean // 判断是否是蓝名vip native DzAPI_Map_IsBlueVIP takes player whichPlayer returns boolean
//获取平台vip native DzAPI_Map_GetPlatformVIP takes player whichPlayer returns integer //玩家是否是平台VIP function DzAPI_Map_IsPlatformVIP takes player whichPlayer returns boolean return DzAPI_Map_GetPlatformVIP(whichPlayer) > 0 endfunction
平台活动
// 任务完成--"DzAPI: ",~玩家,"完成任务[",~任务类型,"][",~任务名称,"]" //完成平台活动[RPG大厅限定] native DzAPI_Map_MissionComplete takes player whichPlayer, string key, string value returns nothing // 活动数据 native DzAPI_Map_GetActivityData takes nothing returns string
平台功能设置
//修改平台功能设置--设置 ${player} 的 ${option} 号平台功能为 ${enable} //1号功能为锁定镜头距离,2号功能为显示血、蓝条 /* platformFunction_1=0,platformFunction,1,锁定视距 platformFunction_2=0,platformFunction,2,显血/显蓝 platformFunction_3=0,platformFunction,3,智能施法 */ function DzAPI_Map_EnablePlatformSettings takes player whichPlayer, integer option, boolean enable returns boolean return RequestExtraBooleanData(43, whichPlayer, null, null, enable, option, 0, 0) endfunction
平台统计
//平台统计--平台统计: ",~whichPlayer,",埋点key:",~eventKey,",子key:",~不填,",次数 ",~value //一般用于统计游戏里某些事件的触发次数,可在作者之家查看。【第二个子key是以后备用暂时不要填】 function DzAPI_Map_Statistics takes player whichPlayer, string eventKey, string eventType, integer value returns nothing call RequestExtraBooleanData(34, whichPlayer, eventKey, "", false, value, 0, 0) endfunction
评论
//评论次数--无效果 //获取玩家的评论次数,该功能已失效,始终返回1 function DzAPI_Map_CommentCount takes player whichPlayer returns integer return RequestExtraIntegerData(46, whichPlayer, null, null, false, 0, 0, 0) endfunction //地图评论次数--获取该图总评论次数 function DzAPI_Map_CommentTotalCount takes nothing returns integer return RequestExtraIntegerData(51, null, null, null, false, 0, 0, 0) endfunction
//是否是鉴赏家--评论里的鉴赏家 function DzAPI_Map_IsConnoisseur takes player whichPlayer returns boolean return RequestExtraBooleanData(48, whichPlayer, null, null, false, 0, 0, 0) endfunction
论坛
//获取论坛数据(0=累计获得赞数,1=精华帖数量,2=发表回复次数,3=收到的欢乐数,4=是否发过贴子,5=是否版主,6=主题数量)("“是否发过贴子”和“是否版主”属性,返回为1代表肯定") function DzAPI_Map_GetForumData takes player whichPlayer, integer whichData returns integer return RequestExtraIntegerData(65, whichPlayer, null, null, false, whichData, 0, 0) endfunction
登录方式
//战网账号--玩家登陆的是战网账号 function DzAPI_Map_IsBattleNetAccount takes player whichPlayer returns boolean return RequestExtraBooleanData(49, whichPlayer, null, null, false, 0, 0, 0) endfunction
好友数量
//好友数量--获取玩家平台好友数量 function DzAPI_Map_FriendCount takes player whichPlayer returns integer return RequestExtraIntegerData(47, whichPlayer, null, null, false, 0, 0, 0) endfunction
重制版
//玩家是否购买了重制版 function DzAPI_Map_IsBuyReforged takes player whichPlayer returns boolean return RequestExtraBooleanData(44, whichPlayer, null, null, false, 0, 0, 0) endfunction
商城道具
判断
// 玩家是否拥有该商城道具(平台地图商城)--"获取 ",~whichPlayer," 是否拥有:",~key," 对应的商城道具." //平台地图商城玩家拥有该道具返还true native DzAPI_Map_HasMallItem takes player whichPlayer, string key returns boolean
消耗性商品
局数消耗型
//局数消耗商品调用--"设置该局消耗 ",~whichPlayer," 的商品:",~key," 一个 //"仅对局数消耗型商品有效" native DzAPI_Map_UseConsumablesItem takes player whichPlayer, string key returns nothing
次数消耗型
//获取 玩家 ${player} KEY ${key} 的商品剩余库存次数 //仅对次数消耗型商品有效 function DzAPI_Map_GetMallItemCount takes player whichPlayer, string key returns integer return RequestExtraIntegerData(41, whichPlayer, key, null, false, 0, 0, 0) endfunction //使用 ${player} 名称 ${key} 的商城道具 ${value} 次 //仅对次数消耗型商品有效,只能使用不能恢复,请谨慎使用 function DzAPI_Map_ConsumeMallItem takes player whichPlayer, string key, integer count returns boolean return RequestExtraBooleanData(42, whichPlayer, key, null, false, count, 0, 0) endfunction
界面
函数
//游戏中弹出商城道具购买界面--可以在游戏里打开指定商城道具购买界面(包括下架商品),商品购买之后,请配合实时购买触发功能使用 function DzAPI_Map_OpenMall takes player whichPlayer,string whichkey returns boolean return RequestExtraBooleanData(66, whichPlayer, whichkey, null, false, 0, 0, 0) endfunction
触发器
//注册实时购买商品事件--玩家在游戏中购买商城道具触发,可以配合打开商城界面使用,读取用实时购买玩家和实时购买商品 function DzTriggerRegisterMallItemSyncData takes trigger trig returns nothing call DzTriggerRegisterSyncData(trig, "DZMIA", true) endfunction
回调参数获取
//实时购买商城道具的玩家 function DzGetTriggerMallItemPlayer takes nothing returns player return DzGetTriggerSyncPlayer() endfunction //实时购买的商品 function DzGetTriggerMallItem takes nothing returns string return DzGetTriggerSyncData() endfunction
快速购买
// 游戏内快速购买(游戏内弹出购买窗口)--"向 ",~whichPlayer," 弹出商品 ",~key," 的购买窗口,购买数量 ",~数量," 窗口持续时间 ",~时间," 秒" function DzAPI_Map_QuickBuy takes player whichPlayer, string key, integer count, integer seconds returns boolean return RequestExtraBooleanData(72, whichPlayer, key, null, false, count, seconds, 0) endfunction //取消快速购买--关闭快速购买界面后,玩家之后提交的订单就算购买失败。 function DzAPI_Map_CancelQuickBuy takes player whichPlayer returns boolean return RequestExtraBooleanData(73, whichPlayer, null, null, false, 0, 0, 0) endfunction
宝箱
//宝箱抽取次数 function DzAPI_Map_GetLotteryUsedCount takes player whichPlayer returns integer return RequestExtraIntegerData(68, whichPlayer, null, null, false, 0, 0, 0) endfunction
签到
//签到次数--玩家每天登录游戏后,自动签到。 function DzAPI_Map_ContinuousCount takes player whichPlayer, integer id returns integer return RequestExtraIntegerData(54, whichPlayer, null, null, false, id, 0, 0) endfunction
平台货币
金币
// 玩家在指定地图中消耗的平台金币--~whichPlayer," 地图:",~mapId," 的平台金币消耗" function DzAPI_Map_MapsConsumeGold takes player whichPlayer, integer mapId returns integer return RequestExtraIntegerData(58, whichPlayer, null, null, false, mapId, 0, 0) endfunction
木材
// 玩家在指定地图中消耗的平台木材--~whichPlayer," 地图:",~mapId," 的平台木材消耗" function DzAPI_Map_MapsConsumeLumber takes player whichPlayer, integer mapId returns integer return RequestExtraIntegerData(59, whichPlayer, null, null, false, mapId, 0, 0) endfunction
人民币
// 检测玩家在指定地图消费的人民币是否在(1~199)区间 function DzAPI_Map_MapsConsumeLv1 takes player whichPlayer, integer mapId returns boolean return RequestExtraBooleanData(60, whichPlayer, null, null, false, mapId, 0, 0) endfunction // 检测玩家在指定地图消费的人民币是否在(200~499)区间 function DzAPI_Map_MapsConsumeLv2 takes player whichPlayer, integer mapId returns boolean return RequestExtraBooleanData(61, whichPlayer, null, null, false, mapId, 0, 0) endfunction // 检测玩家在指定地图消费的人民币是否在(500~999)区间 function DzAPI_Map_MapsConsumeLv3 takes player whichPlayer, integer mapId returns boolean return RequestExtraBooleanData(62, whichPlayer, null, null, false, mapId, 0, 0) endfunction // 检测玩家在指定地图消费的人民币是否在(1000+)区间 function DzAPI_Map_MapsConsumeLv4 takes player whichPlayer, integer mapId returns boolean return RequestExtraBooleanData(63, whichPlayer, null, null, false, mapId, 0, 0) endfunction
皮肤
// 检查是否装备着皮肤--检测玩家是否装备着指定平台皮肤道具(1=头像、2=边框、3=称号、4=底纹) //~whichPlayer," 装备了 ",~skinType," 的 ",~id," 道具" function DzAPI_Map_IsPlayerUsingSkin takes player whichPlayer, integer skinType, integer id returns boolean return RequestExtraBooleanData(64,whichPlayer, null, null, false, skinType, id, 0) endfunction
平台结算
提交数据
//[平台结算] 提交数据 function DzAPI_Map_GameResult_CommitData takes player whichPlayer, string key, string value returns nothing call RequestExtraIntegerData(69, whichPlayer, key, value, false, 0, 0, 0) endfunction
称号
//[平台结算] 获得称号 function DzAPI_Map_GameResult_CommitTitle takes player whichPlayer, string value returns nothing call DzAPI_Map_GameResult_CommitData(whichPlayer,value,"1") set whichPlayer=null set value=null endfunction
排名
//[平台结算] 提交排名 function DzAPI_Map_GameResult_CommitPlayerRank takes player whichPlayer, integer value returns nothing call DzAPI_Map_GameResult_CommitData(whichPlayer,"RankIndex",I2S(value)) set whichPlayer=null set value=0 endfunction
游戏模式
//[平台结算] 提交模式 function DzAPI_Map_GameResult_CommitGameMode takes string value returns nothing call DzAPI_Map_GameResult_CommitData(GetLocalPlayer(),"InnerGameMode",value) set value=null endfunction
游戏结果
//[平台结算] 游戏结果 function DzAPI_Map_GameResult_CommitGameResult takes player whichPlayer, integer value returns nothing call DzAPI_Map_GameResult_CommitData(whichPlayer,"GameResult",I2S(value)) set whichPlayer=null endfunction //[平台结算] 游戏结果(不结束游戏) function DzAPI_Map_GameResult_CommitGameResultNoEnd takes player whichPlayer, integer value returns nothing call DzAPI_Map_GameResult_CommitData(whichPlayer,"GameResultNoEnd",I2S(value)) set whichPlayer=null endfunction
地图
模式
// 获取天梯和匹配的模式--返回数值与作者之家设置对应 native DzAPI_Map_GetMatchType takes nothing returns integer // rpg大厅--判断当前地图是否rpg大厅来的--是rpg大厅地图会返回true native DzAPI_Map_IsRPGLobby takes nothing returns boolean
//判断玩家是否是通过匹配模式进入游戏 //具体模式ID使用 获取天梯和匹配的模式 获取 function DzAPI_Map_IsRPGQuickMatch takes nothing returns boolean return RequestExtraBooleanData(40, null, null, null, false, 0, 0, 0) endfunction
地图等级
// 获取玩家地图等级排名--排名>100的获取值为0 native DzAPI_Map_GetMapLevelRank takes player whichPlayer returns integer // 获取地图等级--获取玩家地图等级 //获取玩家地图等级【RPG大厅限定】 native DzAPI_Map_GetMapLevel takes player whichPlayer returns integer
// 指定地图的地图等级--可以在作者之家看到指定地图的id function DzAPI_Map_MapsLevel takes player whichPlayer, integer mapId returns integer return RequestExtraIntegerData(57, whichPlayer, null, null, false, mapId, 0, 0) endfunction
游戏局数
//获取玩家的游戏局数 function DzAPI_Map_PlayedGames takes player whichPlayer returns integer return RequestExtraIntegerData(45, whichPlayer, null, null, false, 0, 0, 0) endfunction
作者
//本图作者 function DzAPI_Map_IsAuthor takes player whichPlayer returns boolean return RequestExtraBooleanData(50, whichPlayer, null, null, false, 0, 0, 0) endfunction
回流
//是否回流/收藏过地图的用户--超过7天未玩地图的用户再次登录被称为地图回流用户,地图回流BUFF会存在7天,7天后消失。平台回流用户的BUFF存在15天,15天后消失。建议设置奖励,鼓励玩家回来玩地图! function DzAPI_Map_Returns takes player whichPlayer, integer label returns boolean return RequestExtraBooleanData(53, whichPlayer, null, null, false, label, 0, 0) endfunction
是否是玩家
//是玩家--用于区别平台AI玩家。现在平台已经添加虚拟电脑玩家,不用再担心匹配没人问题了!如果你的地图有AI,试试在作者之家开启这个功能吧! function DzAPI_Map_IsPlayer takes player whichPlayer returns boolean return RequestExtraBooleanData(55, whichPlayer, null, null, false, 0, 0, 0) endfunction
总游戏时长
// 所有地图的总游戏时长 function DzAPI_Map_MapsTotalPlayed takes player whichPlayer returns integer return RequestExtraIntegerData(56, whichPlayer, null, null, false, 0, 0, 0) endfunction
玩家标记
//玩家标记 label(1=曾经是平台回流用户,2=当前是平台回流用户,4=曾经是地图回流用户,8=当前是地图回流用户,16=地图是否被玩家收藏) function DzAPI_Map_PlayerFlags takes player whichPlayer, integer label returns boolean return RequestExtraBooleanData(53, whichPlayer, null, null, false, label, 0, 0) endfunction
最后游戏时间
// 最后游戏时间--返回最后一次离开游戏的时间戳,推荐用于制作离线奖励 function DzAPI_Map_GetSinceLastPlayedSeconds takes player whichPlayer returns integer return RequestExtraIntegerData(70, whichPlayer, null, null, false, 0, 0, 0) endfunction
电影
电影模式
// 开启/关闭 信箱模式(所有玩家)--使用电影镜头模式,隐藏游戏界面,同时禁用用户输入 [R] native ShowInterface takes boolean flag, real fadeDuration returns nothing
显隐
// 隐藏电影面板 --重制版 native BlzHideCinematicPanels takes boolean enable returns nothing
设置
//设置介绍镜头文本(当玩家处于电影模式并且有人说话时)--什么也不做 native SetIntroShotText takes string introText returns nothing //设置介绍镜头模型(当玩家处于电影模式并且有人说话时)--什么也不做 native SetIntroShotModel takes string introModelPath returns nothing //播放模型电影 native PlayModelCinematic takes string modelName returns nothing //播放电影 native PlayCinematic takes string movieName returns nothing
电影场景
//设置电影场景 native SetCinematicScene takes integer portraitUnitId, playercolor color, string speakerTitle, string text, real sceneDuration, real voiceoverDuration returns nothing //结束电影场景 native EndCinematicScene takes nothing returns nothing
字幕
//${On/Off} 电影字幕显示功能--该功能和'游戏菜单-声音选项'中的字幕选项中有一项为开时即能够显示电影字幕 native ForceCinematicSubtitles takes boolean flag returns nothing
声音
//开启/关闭电影声音--重制版 native SetCinematicAudio takes boolean cinematicAudio returns nothing
触发器
命令事件
cj
重制版
// EVENT_COMMAND_BUTTON_CLICK // 命令事件 --重制版 native TriggerRegisterCommandEvent takes trigger whichTrigger, integer whichAbility, string order returns event //升级命令事件 --重制版 native TriggerRegisterUpgradeCommandEvent takes trigger whichTrigger, integer whichUpgrade returns event
游戏对象
函数
工具
// 物体名称 [C] 查找任何对象(单位、项目、能力)的“名称”字段 constant native GetObjectName takes integer objectId returns string
触发器
TriggerRegister<X>StateEvent
基础
注册状态事件
游戏、玩家和单位状态
分类
游戏
常量
cj
游戏常量(任何地图中都相同的常量)
玩家类型
基础
这是早期的定义,在文件后面有最新的定义
分类
// 中立被动玩家--早期版本值为15 constant integer PLAYER_NEUTRAL_PASSIVE = GetPlayerNeutralPassive() // 中立敌对玩家 --早期版本值为12 constant integer PLAYER_NEUTRAL_AGGRESSIVE = GetPlayerNeutralAggressive()
属性
版本
常量
//版本-混乱之治 constant version VERSION_REIGN_OF_CHAOS = ConvertVersion(0) //版本-冰封王座 constant version VERSION_FROZEN_THRONE = ConvertVersion(1)
函数
// 获取版本 native VersionGet takes nothing returns version // 版本兼容 native VersionCompatible takes version whichVersion returns boolean // 版本支持 native VersionSupported takes version whichVersion returns boolean
游戏状态
常量
//游戏状态-干涉---上帝视角 constant igamestate GAME_STATE_DIVINE_INTERVENTION = ConvertIGameState(0) //游戏状态-断开---失去连接 constant igamestate GAME_STATE_DISCONNECTED = ConvertIGameState(1) //游戏状态-时间---一天中的游戏时间 constant fgamestate GAME_STATE_TIME_OF_DAY = ConvertFGameState(2)
函数
设置状态值
// 为游戏状态设置一个浮点值 native SetFloatGameState takes fgamestate whichFloatGameState, real value returns nothing // 获取游戏状态浮点值 constant native GetFloatGameState takes fgamestate whichFloatGameState returns real // 为游戏状态设置一个整数 native SetIntegerGameState takes igamestate whichIntegerGameState, integer value returns nothing // 获取游戏状态整数 constant native GetIntegerGameState takes igamestate whichIntegerGameState returns integer
游戏时间
时间流速
//暂停遊戲時間流動 native SuspendTimeOfDay takes boolean b returns nothing // 设置昼夜时间流逝速度--设置昼夜时间流逝速度为默认值的 ${Value}倍 [R] //设置100%来恢复正常值. 该值并不影响游戏速度 native SetTimeOfDayScale takes real r returns nothing native GetTimeOfDayScale takes nothing returns real
游戏时间
// 获取创建地图的游戏时间--时间换算为时间戳 native DzAPI_Map_GetGameStartTime takes nothing returns integer
函数
cj
游戏管理
生命周期
// 结束游戏 native EndGame takes boolean doScoreScreen returns nothing // 重启游戏 native RestartGame takes boolean doScoreScreen returns nothing // 重新加载游戏 native ReloadGame takes nothing returns nothing // 加载游戏 native LoadGame takes string saveFileName, boolean doScoreScreen returns nothing
// 暂停/恢复游戏 [R] native PauseGame takes boolean flag returns nothing
保存游戏
// 保存游戏 [R] native SaveGame takes string saveFileName returns nothing // 重命名保存目录 native RenameSaveDirectory takes string sourceDirName, string destDirName returns boolean // 移除保存目录 native RemoveSaveDirectory takes string sourceDirName returns boolean // 复制保存目录 native CopySaveGame takes string sourceSaveName, string destSaveName returns boolean // 游戏进度是存在的 native SaveGameExists takes string saveName returns boolean
录像功能
// 关闭游戏录像功能 [R]--游戏结束时不保存游戏录像 native DoNotSaveReplay takes nothing returns nothing
战役
关卡
// Async only!--注意这个函数是异步的,所以每个玩家都会被发送到他们自己的地图。 // 切换关卡--切换到关卡: ${Filename} (${Show/Skip} 计分屏) [R] native ChangeLevel takes string newLevel, boolean doScoreScreen returns nothing
检查点
// 设置最大检查点保存数量--重制版 native SetMaxCheckpointSaves takes integer maxCheckpointSaves returns nothing // 保存游戏检查点--重制版 native SaveGameCheckpoint takes string saveFileName, boolean showWindow returns nothing
触发器
// 当变量的值满足某个条件时 native TriggerRegisterVariableEvent takes trigger whichTrigger, string varName, limitop opcode, real limitval returns event
// Creates it's own timer and triggers when it expires //创建它自己的计时器并在到期时触发 // 延迟周期性的运行触发器---注意这里不需要timer参数 native TriggerRegisterTimerEvent takes trigger whichTrigger, real timeout, boolean periodic returns event
// Triggers when the timer you tell it about expires //当您告诉它的计时器到期时触发 // 计时器到期事件 native TriggerRegisterTimerExpireEvent takes trigger whichTrigger, timer t returns event
// 游戏状态事件 native TriggerRegisterGameStateEvent takes trigger whichTrigger, gamestate whichState, limitop opcode, real limitval returns event
参数
whichState
//游戏状态-干涉---上帝视角 constant igamestate GAME_STATE_DIVINE_INTERVENTION = ConvertIGameState(0) //游戏状态-断开---失去连接 constant igamestate GAME_STATE_DISCONNECTED = ConvertIGameState(1) //游戏状态-时间---一天中的游戏时间 constant fgamestate GAME_STATE_TIME_OF_DAY = ConvertFGameState(2)
// 游戏事件 native TriggerRegisterGameEvent takes trigger whichTrigger, gameevent whichGameEvent returns event
参数
whichGameEvent
以前版本
//游戏事件-游戏本关结束 constant gameevent EVENT_GAME_END_LEVEL = ConvertGameEvent(1) //游戏事件-游戏超时 constant gameevent EVENT_GAME_TIMER_EXPIRED = ConvertGameEvent(4) //游戏事件-显示技能 constant gameevent EVENT_GAME_SHOW_SKILL = ConvertGameEvent(9) //游戏事件-创建子菜单 constant gameevent EVENT_GAME_BUILD_SUBMENU = ConvertGameEvent(10)
//游戏事件-游戏胜利 constant gameevent EVENT_GAME_VICTORY = ConvertGameEvent(0)
回调参数获取
// EVENT_GAME_VICTORY // 胜利的玩家 constant native GetWinningPlayer takes nothing returns player
//游戏事件-游戏变量达到限制(当变量达到某个值时) constant gameevent EVENT_GAME_VARIABLE_LIMIT = ConvertGameEvent(2)
回调参数获取
//EVENT_GAME_VARIABLE_LIMIT GetTriggeringVariableName
该方法已弃用
//游戏事件-游戏状态限制 constant gameevent EVENT_GAME_STATE_LIMIT = ConvertGameEvent(3)
回调参数获取
// EVENT_GAME_STATE_LIMIT // 获取触发的游戏状态 constant native GetEventGameState takes nothing returns gamestate
区域
//游戏事件-进入区域 constant gameevent EVENT_GAME_ENTER_REGION = ConvertGameEvent(5)
变种触发器
// 单位进入不规则区域(指定条件) [R] native TriggerRegisterEnterRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event
回调参数获取
// EVENT_GAME_ENTER_REGION // 正在进入的单位 constant native GetEnteringUnit takes nothing returns unit
// 触发区域 [R] constant native GetTriggeringRegion takes nothing returns region
//游戏事件-离开区域 constant gameevent EVENT_GAME_LEAVE_REGION = ConvertGameEvent(6)
变种触发器
// 单位离开不规则区域(指定条件) [R] native TriggerRegisterLeaveRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event
回调参数获取
// 正在离开的单位 constant native GetLeavingUnit takes nothing returns unit
// 触发区域 [R] constant native GetTriggeringRegion takes nothing returns region
可追踪物
//游戏事件-可跟踪物体点击 constant gameevent EVENT_GAME_TRACKABLE_HIT = ConvertGameEvent(7)
变种触发器
//游戏事件-鼠标移入可跟踪物体 constant gameevent EVENT_GAME_TRACKABLE_TRACK = ConvertGameEvent(8)
变种触发器
冰封王座扩展事件
//游戏事件 - 游戏读档 constant gameevent EVENT_GAME_LOADED = ConvertGameEvent(256) //游戏事件 - 当自定义UI触发了任意UI事件 constant gameevent EVENT_GAME_CUSTOM_UI_FRAME = ConvertGameEvent(310)
//游戏事件 - 游戏将在不久结束--该事件只出现在Battle.net的自动匹配游戏 constant gameevent EVENT_GAME_TOURNAMENT_FINISH_SOON = ConvertGameEvent(257) //游戏事件 - 游戏将在现在结束--该事件只出现在Battle.net的自动匹配游戏 constant gameevent EVENT_GAME_TOURNAMENT_FINISH_NOW = ConvertGameEvent(258)
回调参数获取
// EVENT_GAME_TOURNAMENT_FINISH_SOON // 比赛剩余时间 constant native GetTournamentFinishSoonTimeRemaining takes nothing returns real // 比赛结束规则 constant native GetTournamentFinishNowRule takes nothing returns integer // 比赛结束玩家 constant native GetTournamentFinishNowPlayer takes nothing returns player // 对战比赛得分 constant native GetTournamentScore takes player whichPlayer returns integer
//游戏事件 - 游戏存档 constant gameevent EVENT_GAME_SAVE = ConvertGameEvent(259)
回调参数获取
// EVENT_GAME_SAVE // 储存游戏文件名 constant native GetSaveBasicFilename takes nothing returns string
子类
战役
属性
战役选择画面
基础
函数
// 队伍战役选择画面 native ForceCampaignSelectScreen takes nothing returns nothing
教程
//清空教程 native SetTutorialCleared takes boolean cleared returns nothing
任务
//设置任务可用性 native SetMissionAvailable takes integer campaignNumber, integer missionNumber, boolean available returns nothing
电影
//设置开头电影可用 native SetOpCinematicAvailable takes integer campaignNumber, boolean available returns nothing //设置结束电影可用 native SetEdCinematicAvailable takes integer campaignNumber, boolean available returns nothing
可用性
//设置战役可用性 native SetCampaignAvailable takes integer campaignNumber, boolean available returns nothing
难度
常量
constant gamedifficulty MAP_DIFFICULTY_EASY = ConvertGameDifficulty(0) constant gamedifficulty MAP_DIFFICULTY_NORMAL = ConvertGameDifficulty(1) constant gamedifficulty MAP_DIFFICULTY_HARD = ConvertGameDifficulty(2) //地图难度-令人发疯的 constant gamedifficulty MAP_DIFFICULTY_INSANE = ConvertGameDifficulty(3)
函数
//获取默认难度 native GetDefaultDifficulty takes nothing returns gamedifficulty //设置默认难度 native SetDefaultDifficulty takes gamedifficulty g returns nothing
按钮
//设置自定义战役按钮是否显示 native SetCustomCampaignButtonVisible takes integer whichButton, boolean visible returns nothing //获取自定义战役按钮是否显示 native GetCustomCampaignButtonVisible takes integer whichButton returns boolean
地图
属性
迷雾
常量
//战争迷雾状态--黑色迷雾 constant fogstate FOG_OF_WAR_MASKED = ConvertFogState(1) //战争迷雾状态--战争迷雾 constant fogstate FOG_OF_WAR_FOGGED = ConvertFogState(2) //战争迷雾状态--没有迷雾 constant fogstate FOG_OF_WAR_VISIBLE = ConvertFogState(4)
函数
迷雾状态
// 设置地图迷雾(矩形区域)--为 ${玩家} 设置 ${FogStateVisible} 在 ${矩形区域} (对盟友 ${共享} 视野) [R] native SetFogStateRect takes player forWhichPlayer, fogstate whichState, rect where, boolean useSharedVision returns nothing // 设置地图迷雾(圆范围)--为 ${玩家} 设置 ${FogStateVisible} 在圆心为(${X},${Y}) 半径为 ${数值} 的范围, (对盟友 ${共享} 视野) [R] native SetFogStateRadius takes player forWhichPlayer, fogstate whichState, real centerx, real centerY, real radius, boolean useSharedVision returns nothing // 设置地图迷雾(圆范围) [R] native SetFogStateRadiusLoc takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision returns nothing
启用状态
// 启用/禁用黑色阴影 [R] native FogMaskEnable takes boolean enable returns nothing // 黑色阴影是否开启 native IsFogMaskEnabled takes nothing returns boolean // ${启用/禁用} 战争迷雾 [R] native FogEnable takes boolean enable returns nothing // 战争迷雾是否开启 native IsFogEnabled takes nothing returns boolean
修正器
// 新建可见度修正器(矩形区域)--新建的 ${玩家} 可见度修正器. 可见度: ${FogStateVisible} 影响区域: ${矩形区域} (对盟友 ${共享} 视野, ${覆盖} 单位视野) [R] native CreateFogModifierRect takes player forWhichPlayer, fogstate whichState, rect where, boolean useSharedVision, boolean afterUnits returns fogmodifier // 新建可见度修正器(圆范围) [R] native CreateFogModifierRadius takes player forWhichPlayer, fogstate whichState, real centerx, real centerY, real radius, boolean useSharedVision, boolean afterUnits returns fogmodifier // 新建可见度修正器(圆范围) [R] native CreateFogModifierRadiusLoc takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision, boolean afterUnits returns fogmodifier // 删除可见度修正器 native DestroyFogModifier takes fogmodifier whichFogModifier returns nothing // 允许可见度修正器 native FogModifierStart takes fogmodifier whichFogModifier returns nothing // 禁止可见度修正器 native FogModifierStop takes fogmodifier whichFogModifier returns nothing
地形迷雾
//设置迷雾 native SetTerrainFog takes real a, real b, real c, real d, real e returns nothing //重置地形迷雾 native ResetTerrainFog takes nothing returns nothing //设置单位在战争迷雾里的显示效果 native SetUnitFog takes real a, real b, real c, real d, real e returns nothing // 设置迷雾--迷雾风格: ${Style}, Z轴开始端: ${Z-Start}, Z轴结束端: ${Z-End}, 密度: ${Density} 颜色:(${Red},${Green},${Blue}) [R] //颜色格式为(红,绿,蓝). 取值范围0.00-1.00. //// Fog styles //WESTRING_FOGSTYLE_LINEAR=0,"直线" //WESTRING_FOGSTYLE_EXP1=1,"指数1" //WESTRING_FOGSTYLE_EXP2=2,"指数2" native SetTerrainFogEx takes integer style, real zstart, real zend, real density, real red, real green, real blue returns nothing
边界染色
// 允许/禁止 边界染色(所有玩家)--禁用边界染色时边界为普通地形,不显示为黑色,但仍是不可通行的 [R] native EnableWorldFogBoundary takes boolean b returns nothing
光照
//修改日夜环境光照效果--Environment\\ DNC native SetDayNightModels takes string terrainDNCFile, string unitDNCFile returns nothing //修改大头像光照--重制版 native SetPortraitLight takes string portraitDNCFile returns nothing
地图范围
// Returns full map bounds, including unplayable borders, in world coordinates //以世界坐标返回完整的地图边界,包括无法播放的边界 // 获取可用地图范围 native GetWorldBounds takes nothing returns rect
天空盒
// 设置天空--设置天空模型为 ${Sky} native SetSkyModel takes string skyModelFile returns nothing
闭塞
// 允许/禁止闭塞(即视野高度遮挡,所有玩家)--${Enable/Disable} 闭塞 [R] native EnableOcclusion takes boolean flag returns nothing
天气效果
// 新建天气效果--给 ${Rect} 添加天气效果: ${Weather Id} [R] native AddWeatherEffect takes rect where, integer effectID returns weathereffect //删除天气效果 native RemoveWeatherEffect takes weathereffect whichEffect returns nothing // 启用/禁用 天气效果 native EnableWeatherEffect takes weathereffect whichEffect, boolean enable returns nothing
参数
effectID
'RAhr',"白杨谷大雨" 'RAlr',"白杨谷小雨" 'MEds',"达拉然之盾" 'FDbh',"地下城蓝雾(厚)" 'FDbl',"地下城蓝雾(薄)" 'FDgh',"地下城绿雾(厚)" 'FDgl',"地下城绿雾(薄)" 'FDrh',"地下城红雾(厚)" 'FDrl',"地下城红雾(薄)" 'FDwh',"地下城白雾(厚)" 'FDwl',"地下城白雾(薄)" 'RLhr',"洛丹伦大雨" 'RLlr',"洛丹伦小雨" 'SNbs',"诺森德的暴风雪" 'SNhs',"诺森德大雪" 'SNls',"诺森德小雪" 'WOcw',"边缘之地大风" 'WOlw',"边缘之地的风" 'LRaa',"日光" 'LRma',"月光" 'WNcw',"大风"
TerrainArt\Weather.slk
悬崖高度
// 地形悬崖高度(指定坐标)--悬崖高度:深水区为0, 浅水区为1, 平原为2, 之后每层+1. [R] native GetTerrainCliffLevel takes real x, real y returns integer
水
// 设置水颜色--颜色格式为(红,绿,蓝). 透明值0为不可见. 颜色值和透明道值取值范围为0-255 [R] native SetWaterBaseColor takes integer red, integer green, integer blue, integer alpha returns nothing // 开启/关闭 水面变形--开启时当发生地形变化时水面高度也会随着变化. 对永久变形无效 native SetWaterDeforms takes boolean val returns nothing
地形高度
// 新建地形变化:弹坑--新建的弹坑变形. 中心坐标:(${X},${Y}) 半径: ${Radius} 深度: ${Depth} 动画/持续时间: ${Duration} 毫秒, 变化类型: ${Type} [R] //深度可取负数. 永久地形变化在保存游戏时不会被记录,(动画时间结束后,非永久地形变化会复位) //由于图形设置,并非每个玩家都可能显示这些转换。因此,读取地形高度等数据可能会导致异步值。 native TerrainDeformCrater takes real x, real y, real radius, real depth, integer duration, boolean permanent returns terraindeformation // 新建地形变化:水波纹--新建的波纹变形,永久持续. 中心坐标:(${X},${Y}) 最终半径: ${Radius} 深度: ${Depth} 持续时间: ${Duration} 毫秒, 变化次数: ${Count} 面波数: ${SpaceWave} 总波数: ${TimeWave} 初始半径率: ${数值} 限制负数: ${limitNeg} [R] native TerrainDeformRipple takes real x, real y, real radius, real depth, integer duration, integer count, real spaceWaves, real timeWaves, real radiusStartPct, boolean limitNeg returns terraindeformation // 新建地形变化:冲击波--新建的冲击波变形. 起始坐标:(${X},${Y}) 波方向:(${X},${Y}) 波距离: ${distance} 波速度: ${speed} 波半径: ${radius} 深度: ${Depth} 变形效果持续时间: ${trailTime} 毫秒, 变化次数: ${Count} [R] //深度可取负数. 方向以(X,Y)坐标形式表示,如(1,1)表示45度 native TerrainDeformWave takes real x, real y, real dirX, real dirY, real distance, real speed, real radius, real depth, integer trailTime, integer count returns terraindeformation // 新建地形变化:随机--新建的随机变形. 中心坐标:(${X},${Y}) 半径: ${Radius} 最小高度变化: ${minDelta} 最大高度变化: ${maxDelta} 持续时间: ${Duration} 毫秒, 变化周期: ${updateInterval} 毫秒 [R] native TerrainDeformRandom takes real x, real y, real radius, real minDelta, real maxDelta, integer duration, integer updateInterval returns terraindeformation // 停止地形变化--停止 ${Terrain Deformation} ,衰退时间: ${Duration} 毫秒 [R] //地形变化会平滑地过渡到无 native TerrainDeformStop takes terraindeformation deformation, integer duration returns nothing // 停止所有地域变形--包括由技能引起的地形变化 native TerrainDeformStopAll takes nothing returns nothing
地形纹理
生命周期
// 新建地面纹理变化--新建的地面纹理变化在点(${X},${Y}),使用图像: ${Type} 颜色值为(${Red},${Green},${Blue}) Alpha值为${Transparency} (${Enable/Disable} 暂停状态, ${Enble/Disable} 跳过出生动画) [R] //颜色值和Alpha值取值范围0-255. 使用'地面纹理变化 - 设置永久渲染状态' 来显示创建的纹理变化. 暂停状态表示动画播放完毕后是否继续保留该纹理变化. 会创建纹理变化 native CreateUbersplat takes real x, real y, string name, integer red, integer green, integer blue, integer alpha, boolean forcePaused, boolean noBirthTime returns ubersplat // 删除地面纹理 native DestroyUbersplat takes ubersplat whichSplat returns nothing
参数
name
//地形纹理名称定义SLK文件路径:Splats\UberSplatData.slk
LAST=最顶端 TEST=测试 LSDS=洛丹伦(夏)泥地小 LSDM=洛丹伦(夏)泥地中 LSDL=洛丹伦(夏)泥地大 HCRT=人类弹坑 UDSU=不死族金矿 DNCS=中立城市小建筑(死亡) HMTP=群体传送 SCTP=回城卷轴 AMRC=召唤护身符 DRKC=黑暗转换 DOSB=兽族小建筑(死亡) DOMB=兽族中建筑(死亡) DOLB=兽族大建筑(死亡) DHSB=人类小建筑(死亡) DHMB=人类中建筑(死亡) DHLB=人类大建筑(死亡) DUSB=不死族小建筑(死亡) DUMB=不死族中建筑(死亡) DULB=不死族大建筑(死亡) DNSB=暗夜精灵小古树(死亡) DNMB=暗夜精灵中古树(死亡) DNSA=暗夜精灵小古迹(死亡) DNMA=暗夜精灵中古迹(死亡) HSMA=人类小建筑 HMED=人类中建筑 HLAR=人类大建筑 OSMA=兽族小建筑 OMED=兽族中建筑 OLAR=兽族大建筑 USMA=不死族建筑 UMED=不死族建筑 ULAR=不死族建筑 ESMA=暗夜精灵小古树 EMDA=暗夜精灵中古树 ESMB=暗夜精灵小建筑 EMDB=暗夜精灵中建筑 HTOW=城镇大厅 HCAS=城堡 NGOL=金矿 THND=雷霆一击 NDGS=恶魔之门 CLTS=荆棘之盾 HFS1=烈焰风暴1 HFS2=烈焰风暴2 USBR=兽族地洞 NLAR=娜迦族大建筑 NMED=娜迦族中建筑 DPSW=黑暗之门(面向西南) DPSE=黑暗之门(面向东南) NVOL=火山 NVCR=火山口
// 重置地面纹理 native ResetUbersplat takes ubersplat whichSplat returns nothing
// 结束地面纹理变化--在动画播放完毕时自动清除该地面纹理变化 native FinishUbersplat takes ubersplat whichSplat returns nothing
显隐
// 显示/隐藏 地面纹理变化[R] native ShowUbersplat takes ubersplat whichSplat, boolean flag returns nothing
设置地形类型
// 改变地形类型(指定坐标)--改变(${X},${Y})处的地形为 ${Terrain Type} ,使用样式: ${Variation} 范围: ${Area} 形状: ${Shape} [R] native SetTerrainType takes real x, real y, integer terrainType, integer variation, integer area, integer shape returns nothing
参数
terrainType
TerrainArt\Terrain.slk
Ldrt=洛丹伦(夏) - 泥地 Ldro=洛丹伦(夏) - 烂泥地 Ldrg=洛丹伦(夏) - 泥草地 Lrok=洛丹伦(夏) - 岩石 Lgrs=洛丹伦(夏) - 草地 Lgrd=洛丹伦(夏) - 黑暗草地 Fdrt=洛丹伦(秋) - 泥地 Fdro=洛丹伦(秋) - 烂泥地 Fdrg=洛丹伦(秋) - 泥草地 Frok=洛丹伦(秋) - 岩石 Fgrs=洛丹伦(秋) - 草地 Fgrd=洛丹伦(秋) - 黑暗草地 Wdrt=洛丹伦(冬) - 泥地 Wdro=洛丹伦(冬) - 烂泥地 Wsng=洛丹伦(冬) - 雪草地 Wrok=洛丹伦(冬) - 岩石 Wgrs=洛丹伦(冬) - 草地 Wsnw=洛丹伦(冬) - 雪地 Bdrt=贫瘠之地 - 泥地 Bdrh=贫瘠之地 - 烂泥地 Bdrr=贫瘠之地 - 鹅卵石 Bdrg=贫瘠之地 - 泥草地 Bdsr=贫瘠之地 - 沙漠 Bdsd=贫瘠之地 - 黑暗沙漠 Bflr=贫瘠之地 - 岩石 Bgrr=贫瘠之地 - 草地 Adrt=白杨谷 - 泥地 Adrd=白杨谷 - 烂泥地 Agrs=白杨谷 - 草地 Arck=白杨谷 - 岩石 Agrd=白杨谷 - 长草 Avin=白杨谷 - 藤蔓 Adrg=白杨谷 - 泥草地 Alvd=白杨谷 - 树叶 Cdrt=费尔伍德 - 泥地 Cdrd=费尔伍德 - 烂泥地 Cpos=费尔伍德 - 毒沼 Crck=费尔伍德 - 岩石 Cvin=费尔伍德 - 藤蔓 Cgrs=费尔伍德 - 草地 Clvg=费尔伍德 - 树叶 Ndrt=诺森德 - 泥地 Ndrd=诺森德 - 暗黑泥地 Nrck=诺森德 - 岩石 Ngrs=诺森德 - 草地 Nice=诺森德 - 冰 Nsnw=诺森德 - 雪地 Nsnr=诺森德 - 雪岩地 Ydrt=城邦 - 泥地 Ydtr=城邦 - 烂泥地 Yblm=城邦 - 黑大理石 Ybtl=城邦 - 砖 Ysqd=城邦 - 方形地砖 Yrtl=城邦 - 圆形地砖 Ygsb=城邦 - 草地 Yhdg=城邦 - 修剪的草地 Ywmb=城邦 - 白大理石 Vdrt=村庄 - 泥地 Vdrr=村庄 - 烂泥地 Vcrp=村庄 - 庄稼 Vcbp=村庄 - 卵石路 Vstp=村庄 - 碎石路 Vgrs=村庄 - 矮草 Vrck=村庄 - 岩石 Vgrt=村庄 - 长草 Qdrt=村庄(秋) - 泥地 Qdrr=村庄(秋) - 烂泥地 Qcrp=村庄(秋) - 庄稼 Qcbp=村庄(秋) - 卵石路 Qstp=村庄(秋) - 碎石路 Qgrs=村庄(秋) - 矮草 Qrck=村庄(秋) - 岩石 Qgrt=村庄(秋) - 长草 Xdrt=达拉然 - 泥地 Xdtr=达拉然 - 烂泥地 Xblm=达拉然 - 黑大理石 Xbtl=达拉然 - 砖块 Xsqd=达拉然 - 方形地砖 Xrtl=达拉然 - 圆形地砖 Xgsb=达拉然 - 草地 Xhdg=达拉然 - 修剪的草地 Xwmb=达拉然 - 白大理石 Ddrt=地下城 - 泥地 Dbrk=地下城 - 砖 Drds=地下城 - 红色石头 Dlvc=地下城 - 熔岩裂缝 Dlav=地下城 - 熔岩 Ddkr=地下城 - 黑暗岩石 Dgrs=地下城 - 灰色石头 Dsqd=地下城 - 方形地砖 Gdrt=地底 - 泥地 Gbrk=地底 - 砖 Grds=地底 - 红色石头 Glvc=地底 - 熔岩裂缝 Glav=地底 - 熔岩 Gdkr=地底 - 黑暗岩石 Ggrs=地底 - 灰色石头 Gsqd=地底 - 方形地砖 Zdrt=沉沦的遗迹 - 泥地 Zdtr=沉沦的遗迹 - 烂泥地 Zdrg=沉沦的遗迹 - 泥草地 Zbks=沉沦的遗迹 - 碎砖 Zsan=沉沦的遗迹 - 沙地 Zbkl=沉沦的遗迹 - 大砖块 Ztil=沉沦的遗迹 - 圆形地砖 Zgrs=沉沦的遗迹 - 草地 Zvin=沉沦的遗迹 - 黑暗草地 Idrt=冰封王座 - 泥地 Idtr=冰封王座 - 烂泥地 Idki=冰封王座 - 黑暗冰 Ibkb=冰封王座 - 黑砖块 Irbk=冰封王座 - 刻字砖块 Itbk=冰封王座 - 砖铺 Iice=冰封王座 - 冰 Ibsq=冰封王座 - 黑方块 Isnw=冰封王座 - 雪地 Odrt=边缘之地 - 泥地 Odtr=边缘之地 - 轻泥地 Osmb=边缘之地 - 烂泥地 Ofst=边缘之地 - 干裂土地 Olgb=边缘之地 - 平石头 Orok=边缘之地 - 岩石 Ofsl=边缘之地 - 轻石头 Oaby=边缘之地 - 深谷 Kdrt=黑色城堡 - 泥地 Kfsl=黑色城堡 - 轻泥地 Kdtr=黑色城堡 - 烂泥地 Kfst=黑色城堡 - 平石头 Ksmb=黑色城堡 - 碎砖 Klgb=黑色城堡 - 大砖块 Ksqt=黑色城堡 - 方形地砖 Kdkt=黑色城堡 - 黑砖块 Jdrt=达拉然遗迹 - 泥地 Jdtr=达拉然遗迹 - 烂泥地 Jblm=达拉然遗迹 - 黑大理石 Jbtl=达拉然遗迹 - 砖块 Jsqd=达拉然遗迹 - 方形地砖 Jrtl=达拉然遗迹 - 圆形地砖 Jgsb=达拉然遗迹 - 草地 Jhdg=达拉然遗迹 - 修剪的草地 Jwmb=达拉然遗迹 - 白大理石 cAc2=白杨谷 - 泥土悬崖 cAc1=白杨谷 - 草地悬崖 cBc2=贫瘠之地 - 沙地悬崖 cBc1=贫瘠之地 - 草地悬崖 cKc1=黑色城堡 - 泥土悬崖 cKc2=黑色城堡 - 砖砌墙壁 cYc2=城邦 - 泥土悬崖 cYc1=城邦 - 方砖墙壁 cXc2=达拉然 - 泥土悬崖 cXc1=达拉然 - 方砖墙壁 cJc2=达拉然遗迹 - 泥土悬崖 cJc1=达拉然遗迹 - 方砖墙壁 cDc2=地下城 - 天然墙壁 cDc1=地下城 - 石砖墙壁 cCc2=费尔伍德 - 泥土悬崖 cCc1=费尔伍德 - 草地悬崖 cIc2=冰封王座 - 石砌墙壁 cIc1=冰封王座 - 雪地悬崖 cFc2=洛丹伦(秋) - 泥土悬崖 cFc1=洛丹伦(秋) - 草地悬崖 cLc2=洛丹伦(夏) - 泥土悬崖 cLc1=洛丹伦(夏) - 草地悬崖 cWc2=洛丹伦(冬) - 草地悬崖 cWc1=洛丹伦(冬) - 雪地悬崖 cNc2=诺森德- 泥土悬崖 cNc1=诺森德- 雪地悬崖 cOc1=边缘之地- 深渊 cOc2=边缘之地- 泥土悬崖 cZc2=沉沦的遗迹 - 泥土悬崖 cZc1=沉沦的遗迹 - 石砌墙壁 cGc2=地底 - 天然墙壁 cGc1=地底 - 砖砌墙壁 cVc2=村庄 - 泥土悬崖 cVc1=村庄 - 厚草地悬崖 cQc2=村庄(秋) - 泥土悬崖 cQc1=村庄(秋) - 厚草地悬崖
shape
圆形=0 方形=1
获取
//获取地形样式 native GetTerrainType takes real x, real y returns integer
返回值
TerrainArt\Terrain.slk
Ldrt=洛丹伦(夏) - 泥地 Ldro=洛丹伦(夏) - 烂泥地 Ldrg=洛丹伦(夏) - 泥草地 Lrok=洛丹伦(夏) - 岩石 Lgrs=洛丹伦(夏) - 草地 Lgrd=洛丹伦(夏) - 黑暗草地 Fdrt=洛丹伦(秋) - 泥地 Fdro=洛丹伦(秋) - 烂泥地 Fdrg=洛丹伦(秋) - 泥草地 Frok=洛丹伦(秋) - 岩石 Fgrs=洛丹伦(秋) - 草地 Fgrd=洛丹伦(秋) - 黑暗草地 Wdrt=洛丹伦(冬) - 泥地 Wdro=洛丹伦(冬) - 烂泥地 Wsng=洛丹伦(冬) - 雪草地 Wrok=洛丹伦(冬) - 岩石 Wgrs=洛丹伦(冬) - 草地 Wsnw=洛丹伦(冬) - 雪地 Bdrt=贫瘠之地 - 泥地 Bdrh=贫瘠之地 - 烂泥地 Bdrr=贫瘠之地 - 鹅卵石 Bdrg=贫瘠之地 - 泥草地 Bdsr=贫瘠之地 - 沙漠 Bdsd=贫瘠之地 - 黑暗沙漠 Bflr=贫瘠之地 - 岩石 Bgrr=贫瘠之地 - 草地 Adrt=白杨谷 - 泥地 Adrd=白杨谷 - 烂泥地 Agrs=白杨谷 - 草地 Arck=白杨谷 - 岩石 Agrd=白杨谷 - 长草 Avin=白杨谷 - 藤蔓 Adrg=白杨谷 - 泥草地 Alvd=白杨谷 - 树叶 Cdrt=费尔伍德 - 泥地 Cdrd=费尔伍德 - 烂泥地 Cpos=费尔伍德 - 毒沼 Crck=费尔伍德 - 岩石 Cvin=费尔伍德 - 藤蔓 Cgrs=费尔伍德 - 草地 Clvg=费尔伍德 - 树叶 Ndrt=诺森德 - 泥地 Ndrd=诺森德 - 暗黑泥地 Nrck=诺森德 - 岩石 Ngrs=诺森德 - 草地 Nice=诺森德 - 冰 Nsnw=诺森德 - 雪地 Nsnr=诺森德 - 雪岩地 Ydrt=城邦 - 泥地 Ydtr=城邦 - 烂泥地 Yblm=城邦 - 黑大理石 Ybtl=城邦 - 砖 Ysqd=城邦 - 方形地砖 Yrtl=城邦 - 圆形地砖 Ygsb=城邦 - 草地 Yhdg=城邦 - 修剪的草地 Ywmb=城邦 - 白大理石 Vdrt=村庄 - 泥地 Vdrr=村庄 - 烂泥地 Vcrp=村庄 - 庄稼 Vcbp=村庄 - 卵石路 Vstp=村庄 - 碎石路 Vgrs=村庄 - 矮草 Vrck=村庄 - 岩石 Vgrt=村庄 - 长草 Qdrt=村庄(秋) - 泥地 Qdrr=村庄(秋) - 烂泥地 Qcrp=村庄(秋) - 庄稼 Qcbp=村庄(秋) - 卵石路 Qstp=村庄(秋) - 碎石路 Qgrs=村庄(秋) - 矮草 Qrck=村庄(秋) - 岩石 Qgrt=村庄(秋) - 长草 Xdrt=达拉然 - 泥地 Xdtr=达拉然 - 烂泥地 Xblm=达拉然 - 黑大理石 Xbtl=达拉然 - 砖块 Xsqd=达拉然 - 方形地砖 Xrtl=达拉然 - 圆形地砖 Xgsb=达拉然 - 草地 Xhdg=达拉然 - 修剪的草地 Xwmb=达拉然 - 白大理石 Ddrt=地下城 - 泥地 Dbrk=地下城 - 砖 Drds=地下城 - 红色石头 Dlvc=地下城 - 熔岩裂缝 Dlav=地下城 - 熔岩 Ddkr=地下城 - 黑暗岩石 Dgrs=地下城 - 灰色石头 Dsqd=地下城 - 方形地砖 Gdrt=地底 - 泥地 Gbrk=地底 - 砖 Grds=地底 - 红色石头 Glvc=地底 - 熔岩裂缝 Glav=地底 - 熔岩 Gdkr=地底 - 黑暗岩石 Ggrs=地底 - 灰色石头 Gsqd=地底 - 方形地砖 Zdrt=沉沦的遗迹 - 泥地 Zdtr=沉沦的遗迹 - 烂泥地 Zdrg=沉沦的遗迹 - 泥草地 Zbks=沉沦的遗迹 - 碎砖 Zsan=沉沦的遗迹 - 沙地 Zbkl=沉沦的遗迹 - 大砖块 Ztil=沉沦的遗迹 - 圆形地砖 Zgrs=沉沦的遗迹 - 草地 Zvin=沉沦的遗迹 - 黑暗草地 Idrt=冰封王座 - 泥地 Idtr=冰封王座 - 烂泥地 Idki=冰封王座 - 黑暗冰 Ibkb=冰封王座 - 黑砖块 Irbk=冰封王座 - 刻字砖块 Itbk=冰封王座 - 砖铺 Iice=冰封王座 - 冰 Ibsq=冰封王座 - 黑方块 Isnw=冰封王座 - 雪地 Odrt=边缘之地 - 泥地 Odtr=边缘之地 - 轻泥地 Osmb=边缘之地 - 烂泥地 Ofst=边缘之地 - 干裂土地 Olgb=边缘之地 - 平石头 Orok=边缘之地 - 岩石 Ofsl=边缘之地 - 轻石头 Oaby=边缘之地 - 深谷 Kdrt=黑色城堡 - 泥地 Kfsl=黑色城堡 - 轻泥地 Kdtr=黑色城堡 - 烂泥地 Kfst=黑色城堡 - 平石头 Ksmb=黑色城堡 - 碎砖 Klgb=黑色城堡 - 大砖块 Ksqt=黑色城堡 - 方形地砖 Kdkt=黑色城堡 - 黑砖块 Jdrt=达拉然遗迹 - 泥地 Jdtr=达拉然遗迹 - 烂泥地 Jblm=达拉然遗迹 - 黑大理石 Jbtl=达拉然遗迹 - 砖块 Jsqd=达拉然遗迹 - 方形地砖 Jrtl=达拉然遗迹 - 圆形地砖 Jgsb=达拉然遗迹 - 草地 Jhdg=达拉然遗迹 - 修剪的草地 Jwmb=达拉然遗迹 - 白大理石 cAc2=白杨谷 - 泥土悬崖 cAc1=白杨谷 - 草地悬崖 cBc2=贫瘠之地 - 沙地悬崖 cBc1=贫瘠之地 - 草地悬崖 cKc1=黑色城堡 - 泥土悬崖 cKc2=黑色城堡 - 砖砌墙壁 cYc2=城邦 - 泥土悬崖 cYc1=城邦 - 方砖墙壁 cXc2=达拉然 - 泥土悬崖 cXc1=达拉然 - 方砖墙壁 cJc2=达拉然遗迹 - 泥土悬崖 cJc1=达拉然遗迹 - 方砖墙壁 cDc2=地下城 - 天然墙壁 cDc1=地下城 - 石砖墙壁 cCc2=费尔伍德 - 泥土悬崖 cCc1=费尔伍德 - 草地悬崖 cIc2=冰封王座 - 石砌墙壁 cIc1=冰封王座 - 雪地悬崖 cFc2=洛丹伦(秋) - 泥土悬崖 cFc1=洛丹伦(秋) - 草地悬崖 cLc2=洛丹伦(夏) - 泥土悬崖 cLc1=洛丹伦(夏) - 草地悬崖 cWc2=洛丹伦(冬) - 草地悬崖 cWc1=洛丹伦(冬) - 雪地悬崖 cNc2=诺森德- 泥土悬崖 cNc1=诺森德- 雪地悬崖 cOc1=边缘之地- 深渊 cOc2=边缘之地- 泥土悬崖 cZc2=沉沦的遗迹 - 泥土悬崖 cZc1=沉沦的遗迹 - 石砌墙壁 cGc2=地底 - 天然墙壁 cGc1=地底 - 砖砌墙壁 cVc2=村庄 - 泥土悬崖 cVc1=村庄 - 厚草地悬崖 cQc2=村庄(秋) - 泥土悬崖 cQc1=村庄(秋) - 厚草地悬崖
// 地形变化(指定坐标)--坐标(${X},${Y})处的地形样式 [R] native GetTerrainVariance takes real x, real y returns integer
渲染状态
// 改变地面纹理着色状态--未发现有任何作用 native SetUbersplatRender takes ubersplat whichSplat, boolean flag returns nothing // 改变地面纹理永久着色状态--要显示地面纹理变化则必须开启该项 native SetUbersplatRenderAlways takes ubersplat whichSplat, boolean flag returns nothing
荒芜地表
生命周期
// 创建/删除荒芜地表(圆范围)(指定坐标)--为 ${Player} 在圆心为(${X},${Y}),半径为 ${R} 的圆范围内 ${Create/Remove} 一块荒芜地表 [R] native SetBlight takes player whichPlayer, real x, real y, real radius, boolean addBlight returns nothing // 创建/删除荒芜地表(矩形区域)--为 ${Player} 在 ${Region} ${Create/Remove} 一块荒芜地表 [R] native SetBlightRect takes player whichPlayer, rect r, boolean addBlight returns nothing // 创建/删除荒芜地表(位置) native SetBlightPoint takes player whichPlayer, real x, real y, boolean addBlight returns nothing // 设置荒芜地表点(圆形) native SetBlightLoc takes player whichPlayer, location whichLocation, real radius, boolean addBlight returns nothing
判断
// 坐标点被荒芜地表覆盖 [R] native IsPointBlighted takes real x, real y returns boolean
地形通行状态
常量
路径类型
基础
受到路径贴图颜色的影响
游戏中的地形也是转换为路径贴图的
分类
//任何单位都能通过的地形 constant pathingtype PATHING_TYPE_ANY = ConvertPathingType(0) //只有步行单位才能通过的地形 constant pathingtype PATHING_TYPE_WALKABILITY = ConvertPathingType(1) //只有飞行单位才能通过的地形 constant pathingtype PATHING_TYPE_FLYABILITY = ConvertPathingType(2) //可以建造建筑的地形 constant pathingtype PATHING_TYPE_BUILDABILITY = ConvertPathingType(3) //采矿和伐木中的农民可以穿过的地形 constant pathingtype PATHING_TYPE_PEONHARVESTPATHING = ConvertPathingType(4) //不死族的腐蚀地表的地形 constant pathingtype PATHING_TYPE_BLIGHTPATHING = ConvertPathingType(5) //允许漂浮水面行走的地形 constant pathingtype PATHING_TYPE_FLOATABILITY = ConvertPathingType(6) //允许两栖行走的地形 constant pathingtype PATHING_TYPE_AMPHIBIOUSPATHING = ConvertPathingType(7)
函数
// 地形通行状态关闭(指定坐标)--坐标(${X},${Y})处的 ${Pathing Type} 通行状态为关闭 [R] //指定类型单位不能通行即通行状态为关闭. 如该点不能造建筑就是'建造'通行状态为关闭. 可使用'环境 - 设置地形通行状态'来改变通行状态 native IsTerrainPathable takes real x, real y, pathingtype t returns boolean // 设置地形通行状态(指定坐标)--例:设置'建造'通行状态为开,则该点可以建造建筑. 一个单元点范围为32x32 [R] native SetTerrainPathable takes real x, real y, pathingtype t, boolean flag returns nothing
地图信息
//设置地图名称--只能在地图脚本的config函数中使用 native SetMapName takes string name returns nothing //设置地图描述--只能在地图脚本的config函数中使用 native SetMapDescription takes string description returns nothing
游戏速度
// 设定游戏速度--只能在地图脚本的config函数中使用 native SetGameSpeed takes gamespeed whichspeed returns nothing // 当前游戏速度 constant native GetGameSpeed takes nothing returns gamespeed
constant gamespeed MAP_SPEED_SLOWEST = ConvertGameSpeed(0) constant gamespeed MAP_SPEED_SLOW = ConvertGameSpeed(1) constant gamespeed MAP_SPEED_NORMAL = ConvertGameSpeed(2) constant gamespeed MAP_SPEED_FAST = ConvertGameSpeed(3) constant gamespeed MAP_SPEED_FASTEST = ConvertGameSpeed(4)
游戏难度
// 设置游戏难度 [R]--只能在地图脚本的config函数中使用 native SetGameDifficulty takes gamedifficulty whichdifficulty returns nothing // 难度等级 constant native GetGameDifficulty takes nothing returns gamedifficulty
constant gamedifficulty MAP_DIFFICULTY_EASY = ConvertGameDifficulty(0) constant gamedifficulty MAP_DIFFICULTY_NORMAL = ConvertGameDifficulty(1) constant gamedifficulty MAP_DIFFICULTY_HARD = ConvertGameDifficulty(2) //地图难度-令人发疯的 constant gamedifficulty MAP_DIFFICULTY_INSANE = ConvertGameDifficulty(3)
游戏类型
//设置支持的游戏类型--只能在地图脚本的config函数中使用 native SetGameTypeSupported takes gametype whichGameType, boolean value returns nothing // 是否支持游戏类型 native IsGameTypeSupported takes gametype whichGameType returns boolean // 获取当前选择的游戏类型 native GetGameTypeSelected takes nothing returns gametype
//游戏类型-对战 经典的魔兽争霸游戏模式 一座主城 5个农民 constant gametype GAME_TYPE_MELEE = ConvertGameType(1) //游戏类型-自由竞赛 所有东西免费 constant gametype GAME_TYPE_FFA = ConvertGameType(2) //游戏类型-使用地图设置 constant gametype GAME_TYPE_USE_MAP_SETTINGS = ConvertGameType(4) //游戏类型-官方地图 constant gametype GAME_TYPE_BLIZ = ConvertGameType(8) //游戏类型-1 对 1 constant gametype GAME_TYPE_ONE_ON_ONE = ConvertGameType(16) //游戏类型-2队竞赛 constant gametype GAME_TYPE_TWO_TEAM_PLAY = ConvertGameType(32) //游戏类型-3队竞赛 constant gametype GAME_TYPE_THREE_TEAM_PLAY = ConvertGameType(64) //游戏类型-4队竞赛 constant gametype GAME_TYPE_FOUR_TEAM_PLAY = ConvertGameType(128)
资源密度
//设置资源密度--只能在地图脚本的config函数中使用 native SetResourceDensity takes mapdensity whichdensity returns nothing //设置生物密度--只能在地图脚本的config函数中使用 native SetCreatureDensity takes mapdensity whichdensity returns nothing //资源密度 constant native GetResourceDensity takes nothing returns mapdensity //生物密度 constant native GetCreatureDensity takes nothing returns mapdensity
//修改地图上的资源,生物密度 constant mapdensity MAP_DENSITY_NONE = ConvertMapDensity(0) constant mapdensity MAP_DENSITY_LIGHT = ConvertMapDensity(1) constant mapdensity MAP_DENSITY_MEDIUM = ConvertMapDensity(2) constant mapdensity MAP_DENSITY_HEAVY = ConvertMapDensity(3)
地图标志
// 设置地图标志--只能在地图脚本的config函数中使用 native SetMapFlag takes mapflag whichMapFlag, boolean value returns nothing // 地图标志 native IsMapFlagSet takes mapflag whichMapFlag returns boolean
//地图迷雾-隐藏地形---迷雾会隐藏地形 constant mapflag MAP_FOG_HIDE_TERRAIN = ConvertMapFlag(1) //地图迷雾-地图已探索---可探索迷雾 到过的地方会解开迷雾 constant mapflag MAP_FOG_MAP_EXPLORED = ConvertMapFlag(2) //地图迷雾-总是可见---没有迷雾 constant mapflag MAP_FOG_ALWAYS_VISIBLE = ConvertMapFlag(4) //地图-使用障碍 constant mapflag MAP_USE_HANDICAPS = ConvertMapFlag(8) //地图-允许有观察者 constant mapflag MAP_OBSERVERS = ConvertMapFlag(16) //地图-玩家死亡后进入观战位 constant mapflag MAP_OBSERVERS_ON_DEATH = ConvertMapFlag(32) //地图-固定颜色 constant mapflag MAP_FIXED_COLORS = ConvertMapFlag(128) //地图-锁定资源交易---禁止资源交易 constant mapflag MAP_LOCK_RESOURCE_TRADING = ConvertMapFlag(256) //地图-容许联盟资源交易---启用资源交易 constant mapflag MAP_RESOURCE_TRADING_ALLIES_ONLY = ConvertMapFlag(512) //地图-锁定改变联盟---禁止玩家改变联盟 constant mapflag MAP_LOCK_ALLIANCE_CHANGES = ConvertMapFlag(1024) //地图-隐藏改变联盟---允许玩家改变联盟 constant mapflag MAP_ALLIANCE_CHANGES_HIDDEN = ConvertMapFlag(2048) //地图---容许作弊码 constant mapflag MAP_CHEATS = ConvertMapFlag(4096) //地图-隐藏作弊码---禁止使用作弊码 constant mapflag MAP_CHEATS_HIDDEN = ConvertMapFlag(8192) //地图-锁定游戏速度---禁止改变游戏速度 constant mapflag MAP_LOCK_SPEED = ConvertMapFlag(8192 * 2) //锁定随机种子 constant mapflag MAP_LOCK_RANDOM_SEED = ConvertMapFlag(8192 * 4) //共享所有单位的高级控制权(可建造等) constant mapflag MAP_SHARED_ADVANCED_CONTROL = ConvertMapFlag(8192 * 8) //随机英雄 constant mapflag MAP_RANDOM_HERO = ConvertMapFlag(8192 * 16) //随机种族 constant mapflag MAP_RANDOM_RACES = ConvertMapFlag(8192 * 32) //可重载地图 constant mapflag MAP_RELOADED = ConvertMapFlag(8192 * 64)
队伍
//设置有多少个队伍,不知道为什么这里传入的是玩家数量,而不是队伍数量--只能在地图脚本的config函数中使用 native SetTeams takes integer teamcount returns nothing // 队伍数量--由于前面传入的是玩家数量,所以这里返回的也是玩家数量(包含电脑) native GetTeams takes nothing returns integer // 设置玩家队伍--只能在地图脚本的config函数中使用 native SetPlayerTeam takes player whichPlayer, integer whichTeam returns nothing // 玩家在的队伍 native GetPlayerTeam takes player whichPlayer returns integer
玩家
玩家数量
//设置玩家数量--只能在地图脚本的config函数中使用 native SetPlayers takes integer playercount returns nothing // 玩家数量 native GetPlayers takes nothing returns integer
出生点放置类型
//设置玩家出生点类型(固定,在队伍玩家中随机选择等)--只能在地图脚本的config函数中使用 native SetGamePlacement takes placement whichPlacementType returns nothing constant native GetGamePlacement takes nothing returns placement
//玩家出生点 在所有插槽中随机 constant placement MAP_PLACEMENT_RANDOM = ConvertPlacement(0) // random among all slots //玩家出生点 固定位置 constant placement MAP_PLACEMENT_FIXED = ConvertPlacement(1) // player 0 in start loc 0... //地图-使用地图设置的玩家放置---当只有一个真人玩家的时候,会使用此设置 constant placement MAP_PLACEMENT_USE_MAP_SETTINGS = ConvertPlacement(2) // whatever was specified by the script //玩家出生点 随机选择一个队友的出生点---当有两个及以上的真人玩家时,使用此设置 constant placement MAP_PLACEMENT_TEAMS_TOGETHER = ConvertPlacement(3) // random with allies next to each other
选择
// 启用选择--重制版 native BlzEnableSelections takes boolean enableSelection, boolean enableSelectionCircle returns nothing // 选择被允许--重制版 native BlzIsSelectionEnabled takes nothing returns boolean // 选择框被启用--重制版 native BlzIsSelectionCircleEnabled takes nothing returns boolean
目标提示器
// 启用目标提示器--脚下的选择圈--重制版 native BlzEnableTargetIndicator takes boolean enable returns nothing // 闪动指示器被启用--重制版 native BlzIsTargetIndicatorEnabled takes nothing returns boolean
相机
玩家相机
属性
变换
位置
获取/设置
//设置镜头位置 native SetCameraPosition takes real x, real y returns nothing
// 当前摄象机的位置的 X 坐标--注意:该函数对各玩家返回值不同,请确定你知道自己在做什么,否则很容易引起掉线 constant native GetCameraEyePositionX takes nothing returns real // 当前摄象机的位置的 Y 坐标 constant native GetCameraEyePositionY takes nothing returns real // 当前摄象机的位置的 Z 坐标 constant native GetCameraEyePositionZ takes nothing returns real // 当前照相机的位置 constant native GetCameraEyePositionLoc takes nothing returns location
动画
// 平移镜头 native PanCameraTo takes real x, real y returns nothing // 平移镜头(所有玩家)(限时)--平移玩家镜头到(${X},${Y}),动画时间 ${Time} 秒 [R] native PanCameraToTimed takes real x, real y, real duration returns nothing // 平移镜头(包含z轴) native PanCameraToWithZ takes real x, real y, real zOffsetDest returns nothing // 指定高度平移镜头(所有玩家)(限时) [R] native PanCameraToTimedWithZ takes real x, real y, real zOffsetDest, real duration returns nothing
空格转向点
// 设置空格键转向点(所有玩家)--按下空格键时镜头转向的位置 [R] native SetCameraQuickPosition takes real x, real y returns nothing
旋转
// 指定点旋转镜头(所有玩家)(弧度)(限时)--以(${X},${Y})为中心,旋转弧度为${Rad}, 持续: ${Time} 秒 [R] native SetCameraRotateMode takes real x, real y, real radiansToSweep, real duration returns nothing
镜头变换速度
//数值越大,镜头转换越平滑 native CameraSetSmoothingFactor takes real factor returns nothing
停止
// 停止播放镜头(所有玩家)--比如在平移镜头的过程中可用该动作来中断平移 [R] native StopCamera takes nothing returns nothing
重置
// 重置游戏镜头(所有玩家)--重置玩家镜头为游戏默认状态,动画时间 ${Time} 秒 [R] native ResetToGameCamera takes real duration returns nothing
镜头目标
位置
获取
// 当前摄象机的目标的 X 坐标 constant native GetCameraTargetPositionX takes nothing returns real // 当前摄象机的目标的 Y 坐标 constant native GetCameraTargetPositionY takes nothing returns real // 当前摄象机的目标的 Z 坐标 constant native GetCameraTargetPositionZ takes nothing returns real // 当前摄象机的目标 constant native GetCameraTargetPositionLoc takes nothing returns location
设置
镜头范围
// 设置可用镜头区域(所有玩家)--设置玩家可用镜头区域: 左下角(${X},${Y}), 左上角(${X},${Y}), 右上角(${X},${Y}), 右下角(${X},${Y}) [R] //该动作同样会影响小地图的显示. 但小地图的图片是无法改变的. 实际可用区域要大于可用镜头区域 native SetCameraBounds takes real x1, real y1, real x2, real y2, real x3, real y3, real x4, real y4 returns nothing // These return values for the local players camera only... //这些返回值仅适用于本地玩家相机 //获取相机边界 constant native GetCameraBoundMinX takes nothing returns real constant native GetCameraBoundMinY takes nothing returns real constant native GetCameraBoundMaxX takes nothing returns real constant native GetCameraBoundMaxY takes nothing returns real
//获取镜头范围 native GetCameraMargin takes integer whichMargin returns real
参数
whichMargin
constant integer CAMERA_MARGIN_LEFT = 0 constant integer CAMERA_MARGIN_RIGHT = 1 constant integer CAMERA_MARGIN_TOP = 2 constant integer CAMERA_MARGIN_BOTTOM = 3
镜头跟随模式
// 锁定镜头到单位(所有玩家,镜头会自动跟随单位移动)--锁定玩家镜头到 ${单位}, 偏移坐标(${X}, ${Y}) ,使用 ${Rotation Source} [R] //偏移坐标(X,Y)以单位脚底为原点坐标 native SetCameraTargetController takes unit whichUnit, real xoffset, real yoffset, boolean inheritOrientation returns nothing // 锁定镜头到单位(固定镜头源,镜头位置固定不动,同时朝向目标单位,可模拟星球表面的视角)(所有玩家)--锁定玩家镜头到 ${单位}, 偏移坐标(${X}, ${Y}) [R] native SetCameraOrientController takes unit whichUnit, real xoffset, real yoffset returns nothing
焦距
//相机设置焦距--重制版 native CameraSetFocalDistance takes real distance returns nothing
景深
//相机设置景深比例--重制版 native CameraSetDepthOfFieldScale takes real scale returns nothing
过滤贴图
函数
生命周期
//设置相机过滤贴图--会显示在UI下面,比如血条 native SetCineFilterTexture takes string filename returns nothing
显隐
//显示filter native DisplayCineFilter takes boolean flag returns nothing //是否显示 native IsCineFilterDisplayed takes nothing returns boolean
混合模式
//设置过滤贴图混合模式 native SetCineFilterBlendMode takes blendmode whichMode returns nothing
//混合模式--无混合 constant blendmode BLEND_MODE_NONE = ConvertBlendMode(0) //混合模式-- constant blendmode BLEND_MODE_DONT_CARE = ConvertBlendMode(0) //关键的alpha混合 constant blendmode BLEND_MODE_KEYALPHA = ConvertBlendMode(1) //普通混合 constant blendmode BLEND_MODE_BLEND = ConvertBlendMode(2) //添加 constant blendmode BLEND_MODE_ADDITIVE = ConvertBlendMode(3) //调制 constant blendmode BLEND_MODE_MODULATE = ConvertBlendMode(4) //两倍调制 constant blendmode BLEND_MODE_MODULATE_2X = ConvertBlendMode(5)
UVWarp模式
//设置镜头过滤贴图的flag native SetCineFilterTexMapFlags takes texmapflags whichFlags returns nothing
//无标志 constant texmapflags TEXMAP_FLAG_NONE = ConvertTexMapFlags(0) //水平重复 constant texmapflags TEXMAP_FLAG_WRAP_U = ConvertTexMapFlags(1) //v向重复 constant texmapflags TEXMAP_FLAG_WRAP_V = ConvertTexMapFlags(2) //uv向重复 constant texmapflags TEXMAP_FLAG_WRAP_UV = ConvertTexMapFlags(3)
开始/结束UV
//设置动画的开始UV--uv原点(0,0)在图像左上角,将参数指定的UV范围内的图像贴到相机视角相同大小的矩形模型上 native SetCineFilterStartUV takes real minu, real minv, real maxu, real maxv returns nothing ////设置动画的结束UV--uv原点(0,0)在图像左上角,将参数指定的UV范围内的图像贴到相机视角相同大小的矩形模型上 native SetCineFilterEndUV takes real minu, real minv, real maxu, real maxv returns nothing
颜色
//设置开始颜色--如果使用图像,则把颜色设为255即可 native SetCineFilterStartColor takes integer red, integer green, integer blue, integer alpha returns nothing //设置结束颜色--如果使用图像,则把颜色设为255即可 native SetCineFilterEndColor takes integer red, integer green, integer blue, integer alpha returns nothing
动画时间
//设置filter的动画时间 native SetCineFilterDuration takes real duration returns nothing
函数
镜头属性
常量
//镜头视野-镜头到镜头目标的距离 constant camerafield CAMERA_FIELD_TARGET_DISTANCE = ConvertCameraField(0) //镜头视野-镜头区域(观察区域)---FOV constant camerafield CAMERA_FIELD_FIELD_OF_VIEW = ConvertCameraField(3) //近景截断距离(远景剪裁) constant camerafield CAMERA_FIELD_NEARZ = ConvertCameraField(7) //镜头视野-远景截断距离(远景剪裁) constant camerafield CAMERA_FIELD_FARZ = ConvertCameraField(1) //镜头视野-X轴旋转角度(水平角度) constant camerafield CAMERA_FIELD_ANGLE_OF_ATTACK = ConvertCameraField(2) //Y轴旋转角度(滚动) constant camerafield CAMERA_FIELD_ROLL = ConvertCameraField(4) //Z轴旋转角度(旋转) constant camerafield CAMERA_FIELD_ROTATION = ConvertCameraField(5) //Z轴偏移(高度位移) constant camerafield CAMERA_FIELD_ZOFFSET = ConvertCameraField(6) //本地旋转--前后俯仰---ue4中的z轴(指向右)旋转 constant camerafield CAMERA_FIELD_LOCAL_PITCH = ConvertCameraField(8) //本地旋转--旋转---ue4中的y轴(指向上)旋转 constant camerafield CAMERA_FIELD_LOCAL_YAW = ConvertCameraField(9) //本地旋转--侧滚---ue4中的x轴(指向前)旋转 constant camerafield CAMERA_FIELD_LOCAL_ROLL = ConvertCameraField(10)
函数
// 设置镜头属性(所有玩家)(限时)--设置玩家的镜头属性 ${Field} 为 ${数值},持续 ${Time} 秒 [R] native SetCameraField takes camerafield whichField, real value, real duration returns nothing // 当前摄象机的属性 constant native GetCameraField takes camerafield whichField returns real //调整(加/减,使用相对值)镜头属性(所有玩家)(限时) native AdjustCameraField takes camerafield whichField, real offset, real duration returns nothing
电影镜头文件
// 播放电影镜头(所有玩家)--对所有玩家播放电影镜头: ${Camera File} [R] //在'Objects\\CinematicCameras'目录下有一些电影镜头,可用Mpq工具来查询 native SetCinematicCamera takes string cameraModelFile returns nothing
镜头配置文件
生命周期
//创建一个镜头配置文件 native CreateCameraSetup takes nothing returns camerasetup
属性设置
//给配置文件中设置镜头属性 native CameraSetupSetField takes camerasetup whichSetup, camerafield whichField, real value, real duration returns nothing // 获取镜头属性(指定配置文件) [R] native CameraSetupGetField takes camerasetup whichSetup, camerafield whichField returns real
目标
目标距离
//设置与目标的距离 native CameraSetupSetDestPosition takes camerasetup whichSetup, real x, real y, real duration returns nothing
目标位置
//设置摄象机的目标 native CameraSetupGetDestPositionLoc takes camerasetup whichSetup returns location //获取摄象机的目标x native CameraSetupGetDestPositionX takes camerasetup whichSetup returns real //获取摄象机的目标y native CameraSetupGetDestPositionY takes camerasetup whichSetup returns real
应用配置文件
//给所有玩家应用指定的摄像机配置文件 native CameraSetupApply takes camerasetup whichSetup, boolean doPan, boolean panTimed returns nothing native CameraSetupApplyWithZ takes camerasetup whichSetup, real zDestOffset returns nothing // 应用镜头配置(所有玩家)(指定动画时间) [R] native CameraSetupApplyForceDuration takes camerasetup whichSetup, boolean doPan, real forceDuration returns nothing // 应用镜头配置,包含目标的z轴偏移(所有玩家)(指定动画时间) native CameraSetupApplyForceDurationWithZ takes camerasetup whichSetup, real zDestOffset, real forceDuration returns nothing
配置文件名称
//设置配置文件名称--重制版 native BlzCameraSetupSetLabel takes camerasetup whichSetup, string label returns nothing //获取配置文件名称--重制版 native BlzCameraSetupGetLabel takes camerasetup whichSetup returns string
平滑持续时间
// 设置镜头平滑持续时间--重制版 native BlzCameraSetupApplyForceDurationSmooth takes camerasetup whichSetup, boolean doPan, real forcedDuration, real easeInDuration, real easeOutDuration, real smoothFactor returns nothing
摇晃镜头
摇晃目标
//摇晃玩家的镜头目标, 摇晃幅度: ${Magnitude} 速率: ${Velocity} //使用'镜头 - 重置镜头'或设置摇晃幅度和速率为0来停止摇晃 native CameraSetTargetNoise takes real mag, real velocity returns nothing // 摇晃镜头目标(所有玩家)--是否只是垂直方向 [R] native CameraSetTargetNoiseEx takes real mag, real velocity, boolean vertOnly returns nothing
摇晃摄像机
// 摇晃玩家的镜头源, 摇晃幅度: ${Magnitude} 速率: ${Velocity} 摇晃方式: ${是否只是垂直方向} [R] native CameraSetSourceNoiseEx takes real mag, real velocity, boolean vertOnly returns nothing //摇晃玩家的摄像机, 摇晃幅度: ${Magnitude} 速率: ${Velocity} native CameraSetSourceNoise takes real mag, real velocity returns nothing
玩家
属性
出生点
//定义玩家的开始点--whichStartLoc为开始点的索引,使用函数将玩家和开始点索引进行绑定--只能在地图脚本的config函数中使用 native DefineStartLocation takes integer whichStartLoc, real x, real y returns nothing //定义指定玩家索引位置的玩家的开始点--使用location--只能在地图脚本的config函数中使用 native DefineStartLocationLoc takes integer whichStartLoc, location whichLocation returns nothing //获取玩家的开始点x constant native GetStartLocationX takes integer whichStartLocation returns real //获取玩家的开始点y constant native GetStartLocationY takes integer whichStartLocation returns real //获取玩家的开始点坐标 constant native GetStartLocationLoc takes integer whichStartLocation returns location // 设置玩家开始点--只能在地图脚本的config函数中使用 native SetPlayerStartLocation takes player whichPlayer, integer startLocIndex returns nothing // 玩家开始点 native GetPlayerStartLocation takes player whichPlayer returns integer // forces player to have the specified start loc and marks the start loc as occupied // which removes it from consideration for subsequently placed players // ( i.e. you can use this to put people in a fixed loc and then // use random placement for any unplaced players etc ) // use random placement for any unplaced players etc ) // 强制固定玩家开始点--不管地图放置类型如何设置--只能在地图脚本的config函数中使用 native ForcePlayerStartLocation takes player whichPlayer, integer startLocIndex returns nothing
同盟
判断
// 玩家是玩家的同盟--包括中立状态. 单向判断玩家A对玩家B联盟不侵犯,即表示玩家A是玩家B的盟友 constant native IsPlayerAlly takes player whichPlayer, player otherPlayer returns boolean // 玩家是玩家的敌人--不包括中立状态. 单向判断玩家A对玩家B敌对侵犯,即表示玩家A是玩家B的盟友 constant native IsPlayerEnemy takes player whichPlayer, player otherPlayer returns boolean
// 玩家与玩家结盟--${Player} 对 ${Player} 是否开启 ${Alliance Type} constant native GetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting returns boolean
联盟优先级
//======注意下面的函数不是设置开始点优先级,而是联盟优先级=========== //设置指定玩家索引的玩家可以与几个玩家联盟,此处会根据参数创建指定数量的开始点插槽,以便使用下面的设置联盟优先级函数来保存优先级设置数据--只能在地图脚本的config函数中使用 native SetStartLocPrioCount takes integer whichStartLoc, integer prioSlotCount returns nothing //设置指定索引的玩家选择开始点的优先级,数据保存在prioSlotindex指向的插槽中,这里的优先级来自于联盟优先权设定--只能在地图脚本的config函数中使用 native SetStartLocPrio takes integer whichStartLoc, integer prioSlotIndex, integer otherStartLocIndex, startlocprio priority returns nothing //获取插槽 native GetStartLocPrioSlot takes integer whichStartLoc, integer prioSlotIndex returns integer //获取插槽中保存的联盟优先级数据 native GetStartLocPrio takes integer whichStartLoc, integer prioSlotIndex returns startlocprio //重制版--设置敌人联盟数量--只能在地图脚本的config函数中使用 native SetEnemyStartLocPrioCount takes integer whichStartLoc, integer prioSlotCount returns nothing //重制版--设置敌人联盟优先权--只能在地图脚本的config函数中使用 native SetEnemyStartLocPrio takes integer whichStartLoc, integer prioSlotIndex, integer otherStartLocIndex, startlocprio priority returns nothing
//联盟优先级--低 constant startlocprio MAP_LOC_PRIO_LOW = ConvertStartLocPrio(0) //联盟优先级--高 constant startlocprio MAP_LOC_PRIO_HIGH = ConvertStartLocPrio(1) //联盟优先级--没有--无法联盟 constant startlocprio MAP_LOC_PRIO_NOT = ConvertStartLocPrio(2)
联盟状态
常量
//将盟友单位视为被动的(例如,他们不会自动攻击他们) constant alliancetype ALLIANCE_PASSIVE = ConvertAllianceType(0) //联盟请求帮助 constant alliancetype ALLIANCE_HELP_REQUEST = ConvertAllianceType(1) //联盟帮助响应 constant alliancetype ALLIANCE_HELP_RESPONSE = ConvertAllianceType(2) //联盟允许共享英雄 EXP constant alliancetype ALLIANCE_SHARED_XP = ConvertAllianceType(3) //使法术的目标行为对其友好,即无法攻击盟友 constant alliancetype ALLIANCE_SHARED_SPELLS = ConvertAllianceType(4) //联盟共享视野 constant alliancetype ALLIANCE_SHARED_VISION = ConvertAllianceType(5) //联盟共享单位控制 constant alliancetype ALLIANCE_SHARED_CONTROL = ConvertAllianceType(6) //联盟共享所有控制权(可以建造等) constant alliancetype ALLIANCE_SHARED_ADVANCED_CONTROL = ConvertAllianceType(7) //联盟可营救 constant alliancetype ALLIANCE_RESCUABLE = ConvertAllianceType(8) //联盟强制共享视野 constant alliancetype ALLIANCE_SHARED_VISION_FORCED = ConvertAllianceType(9)
函数
普通
// 设置联盟状态(指定项目) [R]--只能在地图脚本的config函数中使用 native SetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting, boolean value returns nothing
触发器
// 玩家联盟状态改变(特殊) native TriggerRegisterPlayerAllianceChange takes trigger whichTrigger, player whichPlayer, alliancetype whichAlliance returns event
观战位
// 玩家是裁判或观察者--${Player}是裁判或观察者 [R] constant native IsPlayerObserver takes player whichPlayer returns boolean
可见性
// 坐标可见 constant native IsVisibleToPlayer takes real x, real y, player whichPlayer returns boolean // 点对于玩家可见 constant native IsLocationVisibleToPlayer takes location whichLocation, player whichPlayer returns boolean // 坐标在迷雾中--坐标(${x},${y}) 在 ${玩家} 的迷雾范围内 constant native IsFoggedToPlayer takes real x, real y, player whichPlayer returns boolean // 点被迷雾遮挡 constant native IsLocationFoggedToPlayer takes location whichLocation, player whichPlayer returns boolean // 坐标在黑色阴影中--坐标(${x},${y}) 在 ${玩家} 的黑色阴影内 constant native IsMaskedToPlayer takes real x, real y, player whichPlayer returns boolean // 点被黑色阴影遮挡 constant native IsLocationMaskedToPlayer takes location whichLocation, player whichPlayer returns boolean
种族
// 设置玩家种族--只能在地图脚本的config函数中使用 native SetPlayerRacePreference takes player whichPlayer, racepreference whichRacePreference returns nothing // 设置玩家种族可选--只能在地图脚本的config函数中使用 native SetPlayerRaceSelectable takes player whichPlayer, boolean value returns nothing // 玩家的种族是否被预先设置为指定值 native IsPlayerRacePrefSet takes player whichPlayer, racepreference pref returns boolean
基础
RACE_PREF 是二进制标志位,RACE 是简单的数字,RACE_PREF 概念将取代 RACE 概念
分类
//人族 constant racepreference RACE_PREF_HUMAN = ConvertRacePref(1) //兽族 constant racepreference RACE_PREF_ORC = ConvertRacePref(2) //暗夜精灵族 constant racepreference RACE_PREF_NIGHTELF = ConvertRacePref(4) //不死族 constant racepreference RACE_PREF_UNDEAD = ConvertRacePref(8) //恶魔族 constant racepreference RACE_PREF_DEMON = ConvertRacePref(16) //随机种族--大厅里随机给玩家指定一个种族 constant racepreference RACE_PREF_RANDOM = ConvertRacePref(32) //玩家可自选种族--玩家在大厅里可以自己切换种族 constant racepreference RACE_PREF_USER_SELECTABLE = ConvertRacePref(64)
// 玩家的种族 constant native GetPlayerRace takes player whichPlayer returns race
//人类 constant race RACE_HUMAN = ConvertRace(1) //兽族 constant race RACE_ORC = ConvertRace(2) //不死族 constant race RACE_UNDEAD = ConvertRace(3) //暗夜精灵族 constant race RACE_NIGHTELF = ConvertRace(4) //恶魔 constant race RACE_DEMON = ConvertRace(5) //其他 constant race RACE_OTHER = ConvertRace(7)
id
// 玩家ID - 1 [R] constant native GetPlayerId takes player whichPlayer returns integer
玩家拥有单位
获取
// 单位数量 constant native GetPlayerUnitCount takes player whichPlayer, boolean includeIncomplete returns integer //获取玩家特定单位数 constant native GetPlayerTypedUnitCount takes player whichPlayer, string unitName, boolean includeIncomplete, boolean includeUpgrades returns integer // 获得建筑数量 constant native GetPlayerStructureCount takes player whichPlayer, boolean includeIncomplete returns integer
//获取玩家城镇大厅计数 native BlzGetPlayerTownHallCount takes player whichPlayer returns integer
创建
// 新建不死族金矿--新建 ${玩家} 的不死族金矿在(${X},${Y}),面向角度:${Face} 度 [R] native CreateBlightedGoldmine takes player id, real x, real y, real face returns unit
状态
常量
//玩家状态--游戏结算 constant playerstate PLAYER_STATE_GAME_RESULT = ConvertPlayerState(0) // current resource levels 当前的资源等级 //玩家身上的金币 constant playerstate PLAYER_STATE_RESOURCE_GOLD = ConvertPlayerState(1) //玩家身上的木材 constant playerstate PLAYER_STATE_RESOURCE_LUMBER = ConvertPlayerState(2) //玩家状态-英雄券的数量,凭券可以免费获得一个英雄 constant playerstate PLAYER_STATE_RESOURCE_HERO_TOKENS = ConvertPlayerState(3) //玩家状态-食物容量 constant playerstate PLAYER_STATE_RESOURCE_FOOD_CAP = ConvertPlayerState(4) //玩家状态-食物使用 constant playerstate PLAYER_STATE_RESOURCE_FOOD_USED = ConvertPlayerState(5) //玩家状态-食物最大容量 constant playerstate PLAYER_STATE_FOOD_CAP_CEILING = ConvertPlayerState(6) //玩家状态-赏金,杀死玩家12的任意单位都会获得金钱奖励---bool标志位 constant playerstate PLAYER_STATE_GIVES_BOUNTY = ConvertPlayerState(7) //玩家状态-联盟胜利---bool标志位 constant playerstate PLAYER_STATE_ALLIED_VICTORY = ConvertPlayerState(8) //玩家状态-放置---bool标志位 constant playerstate PLAYER_STATE_PLACED = ConvertPlayerState(9) //玩家状态-死亡后进入观战模式---bool标志位 constant playerstate PLAYER_STATE_OBSERVER_ON_DEATH = ConvertPlayerState(10) //玩家状态-进入观战模式---bool标志位 constant playerstate PLAYER_STATE_OBSERVER = ConvertPlayerState(11) //玩家状态-不可跟随---bool标志位 constant playerstate PLAYER_STATE_UNFOLLOWABLE = ConvertPlayerState(12) // taxation rate for each resource 每种资源的税率 //玩家状态-金钱维修费率 constant playerstate PLAYER_STATE_GOLD_UPKEEP_RATE = ConvertPlayerState(13) //玩家状态-木材维修费率 constant playerstate PLAYER_STATE_LUMBER_UPKEEP_RATE = ConvertPlayerState(14) // cumulative resources collected by the player during the mission 玩家在游戏期间收集的累积资源 //玩家状态-游戏期间已收集的总金钱 constant playerstate PLAYER_STATE_GOLD_GATHERED = ConvertPlayerState(15) //玩家状态-游戏期间已收集的总木材 constant playerstate PLAYER_STATE_LUMBER_GATHERED = ConvertPlayerState(16) //玩家状态-野生生物不睡眠---bool标志位 constant playerstate PLAYER_STATE_NO_CREEP_SLEEP = ConvertPlayerState(25)
函数
普通
// 获得玩家属性 constant native GetPlayerState takes player whichPlayer, playerstate whichPlayerState returns integer // 设置玩家属性 native SetPlayerState takes player whichPlayer, playerstate whichPlayerState, integer value returns nothing
触发器
// 玩家属性事件 native TriggerRegisterPlayerStateEvent takes trigger whichTrigger, player whichPlayer, playerstate whichState, limitop opcode, real limitval returns event
积分
常量
//玩家积分-已训练单位 constant playerscore PLAYER_SCORE_UNITS_TRAINED = ConvertPlayerScore(0) //玩家积分-消灭单位 constant playerscore PLAYER_SCORE_UNITS_KILLED = ConvertPlayerScore(1) //玩家积分-已建造建筑 constant playerscore PLAYER_SCORE_STRUCT_BUILT = ConvertPlayerScore(2) //玩家积分-摧毁建筑 constant playerscore PLAYER_SCORE_STRUCT_RAZED = ConvertPlayerScore(3) //玩家积分-科技百分比 constant playerscore PLAYER_SCORE_TECH_PERCENT = ConvertPlayerScore(4) //玩家积分-最大的人口数量 constant playerscore PLAYER_SCORE_FOOD_MAXPROD = ConvertPlayerScore(5) //玩家积分-最大所使用的人口数量 constant playerscore PLAYER_SCORE_FOOD_MAXUSED = ConvertPlayerScore(6) //玩家积分-杀死英雄得分 constant playerscore PLAYER_SCORE_HEROES_KILLED = ConvertPlayerScore(7) //玩家积分-获得物品 constant playerscore PLAYER_SCORE_ITEMS_GAINED = ConvertPlayerScore(8) //玩家积分-雇佣兵 constant playerscore PLAYER_SCORE_MERCS_HIRED = ConvertPlayerScore(9)
//玩家积分-所采集的金子 (总共) constant playerscore PLAYER_SCORE_GOLD_MINED_TOTAL = ConvertPlayerScore(10) //玩家积分-所采集的金子(带有维修) constant playerscore PLAYER_SCORE_GOLD_MINED_UPKEEP = ConvertPlayerScore(11) //玩家积分-因为维修费而损失的金子 constant playerscore PLAYER_SCORE_GOLD_LOST_UPKEEP = ConvertPlayerScore(12) //玩家积分-由于向其他玩家交税而损失的金子 constant playerscore PLAYER_SCORE_GOLD_LOST_TAX = ConvertPlayerScore(13) //玩家积分-给予盟友的金子 constant playerscore PLAYER_SCORE_GOLD_GIVEN = ConvertPlayerScore(14) //玩家积分-从盟友那里收到的金子 constant playerscore PLAYER_SCORE_GOLD_RECEIVED = ConvertPlayerScore(15)
//玩家积分-采集到的木材 constant playerscore PLAYER_SCORE_LUMBER_TOTAL = ConvertPlayerScore(16) //玩家积分-由于维修费而损失的木材 constant playerscore PLAYER_SCORE_LUMBER_LOST_UPKEEP = ConvertPlayerScore(17) //玩家积分-由于税而损失的木材 constant playerscore PLAYER_SCORE_LUMBER_LOST_TAX = ConvertPlayerScore(18) //玩家积分-给予盟友的木材 constant playerscore PLAYER_SCORE_LUMBER_GIVEN = ConvertPlayerScore(19) //玩家积分-从盟友那里收到的木材 constant playerscore PLAYER_SCORE_LUMBER_RECEIVED = ConvertPlayerScore(20)
//玩家积分-总的单位得分 constant playerscore PLAYER_SCORE_UNIT_TOTAL = ConvertPlayerScore(21) //玩家积分-总的英雄得分 constant playerscore PLAYER_SCORE_HERO_TOTAL = ConvertPlayerScore(22) //玩家积分-总的资源得分 constant playerscore PLAYER_SCORE_RESOURCE_TOTAL = ConvertPlayerScore(23) //玩家积分-总的整体得分 constant playerscore PLAYER_SCORE_TOTAL = ConvertPlayerScore(24)
函数
// 获得玩家得分 constant native GetPlayerScore takes player whichPlayer, playerscore whichPlayerScore returns integer
障碍
生命障碍
//获取玩家的生命障碍 [R] constant native GetPlayerHandicap takes player whichPlayer returns real // 设置玩家的生命障碍--将玩家的基础最大生命值设置为[handicap]% [R] constant native SetPlayerHandicap takes player whichPlayer, real handicap returns nothing
经验障碍
//获取玩家的经验障碍 [R] constant native GetPlayerHandicapXP takes player whichPlayer returns real // 设置经验障碍--将玩家每次获得的经验量变为原来的[handicap]% [R] constant native SetPlayerHandicapXP takes player whichPlayer, real handicap returns nothing
伤害障碍
//获取玩家的伤害障碍 constant native GetPlayerHandicapDamage takes player whichPlayer returns real //设置玩家障碍恢复时间 constant native SetPlayerHandicapReviveTime takes player whichPlayer, real handicap returns nothing
定时
//玩家障碍恢复时间--重制版 constant native GetPlayerHandicapReviveTime takes player whichPlayer returns real //设置玩家伤害障碍--将玩家每次造成的伤害变为原来的[handicap]% constant native SetPlayerHandicapDamage takes player whichPlayer, real handicap returns nothing
科技
//设置玩家的科技等级上限 constant native SetPlayerTechMaxAllowed takes player whichPlayer, integer techid, integer maximum returns nothing //获取玩家的科技上限 constant native GetPlayerTechMaxAllowed takes player whichPlayer, integer techid returns integer // 增加科技等级--增加 ${玩家} 的 ${科技} ${整数} 级 constant native AddPlayerTechResearched takes player whichPlayer, integer techid, integer levels returns nothing // 设置玩家科技等级 constant native SetPlayerTechResearched takes player whichPlayer, integer techid, integer setToLevel returns nothing // 获取玩家科技是否已经研究 constant native GetPlayerTechResearched takes player whichPlayer, integer techid, boolean specificonly returns boolean // 获取玩家科技数量 constant native GetPlayerTechCount takes player whichPlayer, integer techid, boolean specificonly returns integer
// 降低玩家科技--重制版 native BlzDecPlayerTechResearched takes player whichPlayer, integer techid, integer levels returns nothing
所属权
// 设置指定玩家的所有单位的所属权到另一个玩家[玩家id] native SetPlayerUnitsOwner takes player whichPlayer, integer newOwner returns nothing
技能
// 允许/禁用 技能 [R] native SetPlayerAbilityAvailable takes player whichPlayer, integer abilid, boolean avail returns nothing
残废
// 残废(暴露)玩家 native CripplePlayer takes player whichPlayer, force toWhichPlayers, boolean flag returns nothing
数据缓存
// Used to store hero level data for the scorescreen // before units are moved to neutral passive in melee games // 缓存玩家数据--在经典模式游戏中将单位移动到中立被动之前,用于存储记分屏幕的英雄级别数据 native CachePlayerHeroData takes player whichPlayer returns nothing
玩家名字
// 设置玩家名字 native SetPlayerName takes player whichPlayer, string name returns nothing // 玩家名字 native GetPlayerName takes player whichPlayer returns string
玩家控制器
// 设置玩家控制器 native SetPlayerController takes player whichPlayer, mapcontrol controlType returns nothing // 玩家控制者 native GetPlayerController takes player whichPlayer returns mapcontrol
//玩家 constant mapcontrol MAP_CONTROL_USER = ConvertMapControl(0) //电脑 constant mapcontrol MAP_CONTROL_COMPUTER = ConvertMapControl(1) //中立可营救 constant mapcontrol MAP_CONTROL_RESCUABLE = ConvertMapControl(2) //中立 敌对和被动 constant mapcontrol MAP_CONTROL_NEUTRAL = ConvertMapControl(3) //野生动物 constant mapcontrol MAP_CONTROL_CREEP = ConvertMapControl(4) //没有控制 constant mapcontrol MAP_CONTROL_NONE = ConvertMapControl(5)
玩家颜色
// 改变玩家颜色 [R] native SetPlayerColor takes player whichPlayer, playercolor color returns nothing // 玩家的颜色 native GetPlayerColor takes player whichPlayer returns playercolor
// 红方玩家 constant playercolor PLAYER_COLOR_RED = ConvertPlayerColor(0) // 蓝方玩家 constant playercolor PLAYER_COLOR_BLUE = ConvertPlayerColor(1) // 青色方玩家 constant playercolor PLAYER_COLOR_CYAN = ConvertPlayerColor(2) // 紫色方玩家 constant playercolor PLAYER_COLOR_PURPLE = ConvertPlayerColor(3) // 黄色方玩家 constant playercolor PLAYER_COLOR_YELLOW = ConvertPlayerColor(4) // 橙色方玩家 constant playercolor PLAYER_COLOR_ORANGE = ConvertPlayerColor(5) // 绿色方玩家 constant playercolor PLAYER_COLOR_GREEN = ConvertPlayerColor(6) // 粉色方玩家 constant playercolor PLAYER_COLOR_PINK = ConvertPlayerColor(7) // 深灰色方玩家 constant playercolor PLAYER_COLOR_LIGHT_GRAY = ConvertPlayerColor(8) // 深蓝色方玩家 constant playercolor PLAYER_COLOR_LIGHT_BLUE = ConvertPlayerColor(9) // 浅绿色方玩家 constant playercolor PLAYER_COLOR_AQUA = ConvertPlayerColor(10) // 棕色方玩家 constant playercolor PLAYER_COLOR_BROWN = ConvertPlayerColor(11) // 褐红色方玩家 constant playercolor PLAYER_COLOR_MAROON = ConvertPlayerColor(12) // 深蓝色方玩家 constant playercolor PLAYER_COLOR_NAVY = ConvertPlayerColor(13) // 蓝绿色方玩家 constant playercolor PLAYER_COLOR_TURQUOISE = ConvertPlayerColor(14) // 紫罗兰色方玩家 constant playercolor PLAYER_COLOR_VIOLET = ConvertPlayerColor(15) // 小麦色方玩家 constant playercolor PLAYER_COLOR_WHEAT = ConvertPlayerColor(16) // 桃色方玩家 constant playercolor PLAYER_COLOR_PEACH = ConvertPlayerColor(17) // 薄荷色方玩家 constant playercolor PLAYER_COLOR_MINT = ConvertPlayerColor(18) // 淡紫色方玩家 constant playercolor PLAYER_COLOR_LAVENDER = ConvertPlayerColor(19) // 煤焦油色方玩家 constant playercolor PLAYER_COLOR_COAL = ConvertPlayerColor(20) // 雪白方玩家 constant playercolor PLAYER_COLOR_SNOW = ConvertPlayerColor(21) // 祖母绿方玩家 constant playercolor PLAYER_COLOR_EMERALD = ConvertPlayerColor(22) // PEANUT玩家 [PEANUT](微不足道) constant playercolor PLAYER_COLOR_PEANUT = ConvertPlayerColor(23)
玩家槽位
// 玩家插槽状态 native GetPlayerSlotState takes player whichPlayer returns playerslotstate
//没有玩家 constant playerslotstate PLAYER_SLOT_STATE_EMPTY = ConvertPlayerSlotState(0) //正在游戏中 constant playerslotstate PLAYER_SLOT_STATE_PLAYING = ConvertPlayerSlotState(1) //离开状态 constant playerslotstate PLAYER_SLOT_STATE_LEFT = ConvertPlayerSlotState(2)
// 玩家是否可选--大厅使用,表示玩家插槽 native GetPlayerSelectable takes player whichPlayer returns boolean
税率
// 设置 ${Player} 交纳给 ${Player} 的 ${Resource} 所得税为 ${Rate} %--只能在地图脚本的config函数中使用 //缴纳所得税所损失的资源可以通过'玩家得分'的'税务损失的黄金/木材'来获取. 所得税最高为100%. 且玩家1对玩家2和玩家3都交纳80%所得税.则玩家1采集黄金时将给玩家2 8黄金,玩家3 2黄金. native SetPlayerTaxRate takes player sourcePlayer, player otherPlayer, playerstate whichResource, integer rate returns nothing // 玩家税率 [R] native GetPlayerTaxRate takes player sourcePlayer, player otherPlayer, playerstate whichResource returns integer
AI
// 启动对战 AI --为 ${Player} 启用对战AI: ${Script} //AI只能对电脑玩家使用,当运行该动作后,与之匹配的电脑玩家会强制执行该AI脚本 native StartMeleeAI takes player num, string script returns nothing // 启动战役 AI --为 ${Player} 启用战役AI: ${Script} native StartCampaignAI takes player num, string script returns nothing // 发送 AI 命令--对 ${Player} 发送AI命令:(${命令}, ${数据}) //发送的AI命令将被AI脚本所使用 native CommandAI takes player num, integer command, integer data returns nothing // 暂停/恢复 AI脚本运行--设定 ${Player} ${暂停/恢复} 当前AI脚本的运行 [R] //事实上该函数是有问题的,可以这么理解:设玩家当前AI脚本的运行状态R为0,暂停1次则R+1,恢复1次则R-1,仅当R=0时该玩家才会运行AI. 在使用前请先理解这段话的意思 native PauseCompAI takes player p, boolean pause returns nothing // 对战 AI难度--对非AI玩家返回普通难度 native GetAIDifficulty takes player num returns aidifficulty
返回值
//AI难度-新手 constant aidifficulty AI_DIFFICULTY_NEWBIE = ConvertAIDifficulty(0) //AI难度-正常 constant aidifficulty AI_DIFFICULTY_NORMAL = ConvertAIDifficulty(1) //AI难度-令人发疯的 constant aidifficulty AI_DIFFICULTY_INSANE = ConvertAIDifficulty(2)
函数
玩家管理
获取
// 获取最大的玩家数 constant native GetBJMaxPlayers takes nothing returns integer // 玩家中立的受害者 constant native GetBJPlayerNeutralVictim takes nothing returns integer // 获得bj玩家中立额外 constant native GetBJPlayerNeutralExtra takes nothing returns integer // 获得最大玩家插槽 constant native GetBJMaxPlayerSlots takes nothing returns integer // 玩家中立被动 constant native GetPlayerNeutralPassive takes nothing returns integer // 玩家中立敌对 constant native GetPlayerNeutralAggressive takes nothing returns integer
// 玩家 // @param number 下标0 constant native Player takes integer number returns player // 本地玩家 [R] // 通常用于异步判断 constant native GetLocalPlayer takes nothing returns player
控制权
// 启用/禁用玩家控制权(所有玩家) [R] native EnableUserControl takes boolean b returns nothing
踢出
// 踢除玩家--踢除 ${Player} ,玩家的游戏结果为 ${文字} native RemovePlayer takes player whichPlayer, playergameresult gameResult returns nothing
参数
gameResult
constant playergameresult PLAYER_GAME_RESULT_VICTORY = ConvertPlayerGameResult(0) constant playergameresult PLAYER_GAME_RESULT_DEFEAT = ConvertPlayerGameResult(1) //平局 constant playergameresult PLAYER_GAME_RESULT_TIE = ConvertPlayerGameResult(2) //不确定 constant playergameresult PLAYER_GAME_RESULT_NEUTRAL = ConvertPlayerGameResult(3)
选择
// 清除所有选定--清空所有玩家的选择 native ClearSelection takes nothing returns nothing //取消选择/选择单位--所有玩家 native SelectUnit takes unit whichUnit, boolean flag returns nothing
// 允许/禁止框选--${Enable/Disable} 框选功能 (${Enable/Disable} 显示选择框) native EnableDragSelect takes boolean state, boolean ui returns nothing // 允许/禁止预选--${Enable/Disable} 预选功能 (${Enable/Disable} 显示预选圈,生命槽,物体信息) native EnablePreSelect takes boolean state, boolean ui returns nothing // 允许/禁止选择--${Enable/Disable} 选择和取消选择功能 (${Enable/Disable} 显示选择圈) //禁用选择后仍可以通过触发来选择物体. 只有允许选择功能时才会显示选择圈 native EnableSelect takes boolean state, boolean ui returns nothing
// 同步选择--它强制玩家之间的选择同步并暂停线程直到他们同步(或尝试) native SyncSelections takes nothing returns nothing
触发器
通用回调参数获取
// 触发玩家 constant native GetTriggerPlayer takes nothing returns player
函数
// 玩家事件 native TriggerRegisterPlayerEvent takes trigger whichTrigger, player whichPlayer, playerevent whichPlayerEvent returns event
可用事件
老版本
//玩家事件-盟友改变 constant playerevent EVENT_PLAYER_ALLIANCE_CHANGED = ConvertPlayerEvent(12) //玩家事件-离开 constant playerevent EVENT_PLAYER_LEAVE = ConvertPlayerEvent(15) //玩家事件-聊天,当玩家发送聊天信息的时候触发 constant playerevent EVENT_PLAYER_CHAT = ConvertPlayerEvent(16) //玩家事件-结束电影 constant playerevent EVENT_PLAYER_END_CINEMATIC = ConvertPlayerEvent(17)
//玩家某个状态达到限制(金币达到最大值,木头达到最大值等) constant playerevent EVENT_PLAYER_STATE_LIMIT = ConvertPlayerEvent(11)
回调参数获取
// 获取玩家属性 constant native GetEventPlayerState takes nothing returns playerstate
//玩家事件-失败 constant playerevent EVENT_PLAYER_DEFEAT = ConvertPlayerEvent(13) //玩家事件-胜利 constant playerevent EVENT_PLAYER_VICTORY = ConvertPlayerEvent(14)
冰封王座扩展事件
//玩家键盘事件 - 按下Left键 constant playerevent EVENT_PLAYER_ARROW_LEFT_DOWN = ConvertPlayerEvent(261) //玩家键盘事件 - 松开Left键 constant playerevent EVENT_PLAYER_ARROW_LEFT_UP = ConvertPlayerEvent(262) //玩家键盘事件 - 按下Right键 constant playerevent EVENT_PLAYER_ARROW_RIGHT_DOWN = ConvertPlayerEvent(263) //玩家键盘事件 - 松开Right键 constant playerevent EVENT_PLAYER_ARROW_RIGHT_UP = ConvertPlayerEvent(264) //玩家键盘事件 - 按下Down键 constant playerevent EVENT_PLAYER_ARROW_DOWN_DOWN = ConvertPlayerEvent(265) //玩家键盘事件 - 松开Down键 constant playerevent EVENT_PLAYER_ARROW_DOWN_UP = ConvertPlayerEvent(266) //玩家键盘事件 - 按下Up键 constant playerevent EVENT_PLAYER_ARROW_UP_DOWN = ConvertPlayerEvent(267) //玩家键盘事件 - 松开Up键 constant playerevent EVENT_PLAYER_ARROW_UP_UP = ConvertPlayerEvent(268) //玩家键盘事件 - 按下鼠标左键 constant playerevent EVENT_PLAYER_MOUSE_DOWN = ConvertPlayerEvent(305) //玩家键盘事件 - 松开鼠标左键 constant playerevent EVENT_PLAYER_MOUSE_UP = ConvertPlayerEvent(306) //玩家键盘事件 - 移动鼠标 constant playerevent EVENT_PLAYER_MOUSE_MOVE = ConvertPlayerEvent(307) //当玩家接收到同步数据 constant playerevent EVENT_PLAYER_SYNC_DATA = ConvertPlayerEvent(309) //当玩家点击按键(按下和抬起) constant playerevent EVENT_PLAYER_KEY = ConvertPlayerEvent(311) //当玩家按下按键 constant playerevent EVENT_PLAYER_KEY_DOWN = ConvertPlayerEvent(312) //当玩家抬起按键 constant playerevent EVENT_PLAYER_KEY_UP = ConvertPlayerEvent(313)
// 玩家单位事件,某个玩家触发了任意单位的事件 native TriggerRegisterPlayerUnitEvent takes trigger whichTrigger, player whichPlayer, playerunitevent whichPlayerUnitEvent, boolexpr filter returns event
通用回调参数获取
// returns handle to unit which triggered the most recent event when called from // within a trigger action function...returns null handle when used incorrectly //当从触发动作函数中调用时,返回触发最近事件的单元的句柄...当使用不正确时返回空句柄 // 获取触发单位 constant native GetTriggerUnit takes nothing returns unit
可用事件
老版本
检测事件
// 玩家单位事件-单位被发现 constant playerunitevent EVENT_PLAYER_UNIT_DETECTED = ConvertPlayerUnitEvent(22)
回调参数获取
// 检测单位 constant native GetDetectedUnit takes nothing returns unit
隐藏事件
// 玩家单位事件-单位隐藏 constant playerunitevent EVENT_PLAYER_UNIT_HIDDEN = ConvertPlayerUnitEvent(23)
伤害事件
//玩家单位事件 - 单位收到伤害 constant playerunitevent EVENT_PLAYER_UNIT_DAMAGED = ConvertPlayerUnitEvent(308) //玩家单位事件 - 单位造成伤害 constant playerunitevent EVENT_PLAYER_UNIT_DAMAGING = ConvertPlayerUnitEvent(315)
攻击事件
// 玩家单位事件-玩家單位被攻擊 constant playerunitevent EVENT_PLAYER_UNIT_ATTACKED = ConvertPlayerUnitEvent(18)
回调参数获取
// 攻击的单位 constant native GetAttacker takes nothing returns unit
救援事件
// 玩家单位事件-玩家單位被救援 constant playerunitevent EVENT_PLAYER_UNIT_RESCUED = ConvertPlayerUnitEvent(19)
回调参数获取
//救援者 constant native GetRescuer takes nothing returns unit
选择事件
// 玩家单位事件-选择单位 constant playerunitevent EVENT_PLAYER_UNIT_SELECTED = ConvertPlayerUnitEvent(24)
回调参数获取
//已弃用 constant native GetSelectedUnit takes nothing returns unit
// 玩家单位事件 - 取消选择单位 constant playerunitevent EVENT_PLAYER_UNIT_DESELECTED = ConvertPlayerUnitEvent(25)
死亡事件
// 玩家单位事件 - 死亡 constant playerunitevent EVENT_PLAYER_UNIT_DEATH = ConvertPlayerUnitEvent(20)
回调参数获取
// 垂死的单位 constant native GetDyingUnit takes nothing returns unit // 凶手单位 constant native GetKillingUnit takes nothing returns unit
// 玩家单位事件-玩家單位開始腐爛 constant playerunitevent EVENT_PLAYER_UNIT_DECAY = ConvertPlayerUnitEvent(21)
回调参数获取
// 尸体腐烂单位 constant native GetDecayingUnit takes nothing returns unit
英雄事件
//玩家单位事件 - 提升等级 constant playerunitevent EVENT_PLAYER_HERO_LEVEL = ConvertPlayerUnitEvent(41)
回调参数获取
// 获取升级了的单位 constant native GetLevelingUnit takes nothing returns unit
//玩家单位事件 - 学习技能 constant playerunitevent EVENT_PLAYER_HERO_SKILL = ConvertPlayerUnitEvent(42)
回调参数获取
// 学习技能的英雄 constant native GetLearningUnit takes nothing returns unit // 学习技能 [R] constant native GetLearnedSkill takes nothing returns integer // 学习的技能的等级 constant native GetLearnedSkillLevel takes nothing returns integer
//玩家单位事件 - 变得可重生 constant playerunitevent EVENT_PLAYER_HERO_REVIVABLE = ConvertPlayerUnitEvent(43)
回调参数获取
// 可复活的英雄 constant native GetRevivableUnit takes nothing returns unit
//玩家单位事件 - 开始复活英雄 constant playerunitevent EVENT_PLAYER_HERO_REVIVE_START = ConvertPlayerUnitEvent(44) //玩家单位事件 - 取消复活英雄 constant playerunitevent EVENT_PLAYER_HERO_REVIVE_CANCEL = ConvertPlayerUnitEvent(45) //玩家单位事件 - 完成复活英雄 constant playerunitevent EVENT_PLAYER_HERO_REVIVE_FINISH = ConvertPlayerUnitEvent(46)
回调参数获取
// 正在复活的英雄 constant native GetRevivingUnit takes nothing returns unit
建筑
建造
// 玩家单位事件 - 开始建造 constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_START = ConvertPlayerUnitEvent(26)
回调参数获取
// 正在建造的建筑 constant native GetConstructingStructure takes nothing returns unit
// 玩家单位事件 - 取消建造 constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL = ConvertPlayerUnitEvent(27) // 玩家单位事件 - 完成建造 constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_FINISH = ConvertPlayerUnitEvent(28)
回调参数获取
// 取消建造中的建筑 constant native GetCancelledStructure takes nothing returns unit // 已建造的建筑 constant native GetConstructedStructure takes nothing returns unit
升级
// 玩家单位事件 - 开始建筑升级 constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_START = ConvertPlayerUnitEvent(29)
// 玩家单位事件 - 取消建筑升级 constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_CANCEL = ConvertPlayerUnitEvent(30) // 玩家单位事件 - 完成建筑升级 constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_FINISH = ConvertPlayerUnitEvent(31)
科技
//玩家单位事件 - 开始研究科技 constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_START = ConvertPlayerUnitEvent(35) //玩家单位事件 - 取消研究科技 constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_CANCEL = ConvertPlayerUnitEvent(36) //玩家单位事件 - 完成研究科技 constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_FINISH = ConvertPlayerUnitEvent(37)
回调参数获取
// 研究科技单位 constant native GetResearchingUnit takes nothing returns unit // 研究的科技 constant native GetResearched takes nothing returns integer
训练
//玩家单位事件 - 开始训练单位 constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_START = ConvertPlayerUnitEvent(32) //玩家单位事件 - 取消训练单位 constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_CANCEL = ConvertPlayerUnitEvent(33)
回调参数获取
// 训练单位类型 constant native GetTrainedUnitType takes nothing returns integer
//玩家单位事件 - 完成训练单位 constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_FINISH = ConvertPlayerUnitEvent(34)
回调参数获取
// 训练单位类型 constant native GetTrainedUnitType takes nothing returns integer // EVENT_PLAYER_UNIT_TRAIN_FINISH // 训练完成的单位 constant native GetTrainedUnit takes nothing returns unit
物品
// 玩家单位事件 - 出售物品 constant playerunitevent EVENT_PLAYER_UNIT_SELL_ITEM = ConvertPlayerUnitEvent(271)
回调参数获取
// 卖出的物品 constant native GetSoldItem takes nothing returns item
//玩家单位事件 - 丢弃物品 constant playerunitevent EVENT_PLAYER_UNIT_DROP_ITEM = ConvertPlayerUnitEvent(48) //玩家单位事件 - 获得物品 constant playerunitevent EVENT_PLAYER_UNIT_PICKUP_ITEM = ConvertPlayerUnitEvent(49) //玩家单位事件 - 使用物品 constant playerunitevent EVENT_PLAYER_UNIT_USE_ITEM = ConvertPlayerUnitEvent(50)
回调参数获取
// 获取操作物品的单位 constant native GetManipulatingUnit takes nothing returns unit // 被操作的物品 constant native GetManipulatedItem takes nothing returns item
// 玩家单位事件 - 抵押物品 constant playerunitevent EVENT_PLAYER_UNIT_PAWN_ITEM = ConvertPlayerUnitEvent(277)
命令
//玩家单位事件 - 发布无目标指令 constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_ORDER = ConvertPlayerUnitEvent(38)
回调参数获取
// 执行命令的单位 constant native GetOrderedUnit takes nothing returns unit // 命令id constant native GetIssuedOrderId takes nothing returns integer
//玩家单位事件 - 发布指定点目标指令 constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER = ConvertPlayerUnitEvent(39)
回调参数获取
// 命令发布点X坐标 [R] constant native GetOrderPointX takes nothing returns real // 命令发布点Y坐标 [R] constant native GetOrderPointY takes nothing returns real // 命令的位置 constant native GetOrderPointLoc takes nothing returns location
//玩家单位事件 - 发布指定物体目标指令 constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER = ConvertPlayerUnitEvent(40)
回调参数获取
// 目标 constant native GetOrderTarget takes nothing returns widget // 目标可毁坏物 constant native GetOrderTargetDestructable takes nothing returns destructable // 目标物品 constant native GetOrderTargetItem takes nothing returns item // 目标单位 constant native GetOrderTargetUnit takes nothing returns unit
//玩家单位事件 - 发布指定单位目标指令 --为了兼容 constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER = ConvertPlayerUnitEvent(40) // for compat(兼容)
召唤事件
//玩家单位事件 - 被召唤(召唤单位) constant playerunitevent EVENT_PLAYER_UNIT_SUMMON = ConvertPlayerUnitEvent(47)
基础
召唤开始和结束都会触发事件
回调参数获取
// 正在召唤的单位 constant native GetSummoningUnit takes nothing returns unit // 已召唤单位 constant native GetSummonedUnit takes nothing returns unit
装载事件
//玩家单位事件 - 被运输机装载 constant playerunitevent EVENT_PLAYER_UNIT_LOADED = ConvertPlayerUnitEvent(51)
回调参数获取
// 载具单位 constant native GetTransportUnit takes nothing returns unit // 被装载的单位 constant native GetLoadedUnit takes nothing returns unit
技能事件
// 玩家单位事件 - 准备施放技能 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_CHANNEL = ConvertPlayerUnitEvent(272) // 玩家单位事件 - 开始施放技能 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_CAST = ConvertPlayerUnitEvent(273) // 玩家单位事件 - 发动技能效果 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_EFFECT = ConvertPlayerUnitEvent(274) // 玩家单位事件 - 施放技能结束 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_FINISH = ConvertPlayerUnitEvent(275) // 玩家单位事件 - 停止施放技能 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_ENDCAST = ConvertPlayerUnitEvent(276)
回调参数获取
// 释放技能的单位 constant native GetSpellAbilityUnit takes nothing returns unit // 使用的技能id constant native GetSpellAbilityId takes nothing returns integer // 使用的技能 constant native GetSpellAbility takes nothing returns ability // 对其使用技能的目标点 constant native GetSpellTargetLoc takes nothing returns location // 对其使用技能的目标点x constant native GetSpellTargetX takes nothing returns real // 对其使用技能的目标点y constant native GetSpellTargetY takes nothing returns real // 对其使用技能的目标可毁坏物 constant native GetSpellTargetDestructable takes nothing returns destructable // 对其使用技能的目标物品 constant native GetSpellTargetItem takes nothing returns item // 对其使用技能的目标单位 constant native GetSpellTargetUnit takes nothing returns unit
出售事件
//玩家单位事件 - 单位被出售 constant playerunitevent EVENT_PLAYER_UNIT_SELL = ConvertPlayerUnitEvent(269)
基础
出售开始和结束都会触发事件
回调参数获取
// 正在出售的单位 constant native GetSellingUnit takes nothing returns unit // 出售完成的单位 constant native GetSoldUnit takes nothing returns unit // 出售给谁 constant native GetBuyingUnit takes nothing returns unit
所有者事件
// 玩家单位事件 - 单位所有者被改变 constant playerunitevent EVENT_PLAYER_UNIT_CHANGE_OWNER = ConvertPlayerUnitEvent(270)
回调参数获取
// 改变了所有者的单位 constant native GetChangingUnit takes nothing returns unit // 前一个所有者 constant native GetChangingUnitPrevOwner takes nothing returns player
// 玩家输入聊天信息 native TriggerRegisterPlayerChatEvent takes trigger whichTrigger, player whichPlayer, string chatMessageToDetect, boolean exactMatchOnly returns event
参数
boolean exactMatchOnly
true
必须要完全匹配字符串才会触发
false
只需要包含改字符串就会触发
回调参数获取
// returns the actual string they typed in ( same as what you registered for // if you required exact match ) //返回他们输入的实际字符串(如果您需要完全匹配,则与您注册的字符串相同) // 输入的聊天字符 constant native GetEventPlayerChatString takes nothing returns string
// returns the string that you registered for //返回您注册的字符串 // 匹配的聊天字符 constant native GetEventPlayerChatStringMatched takes nothing returns string
widget
基础
继承树
常量
事件
cj
//widget事件 - 死亡 widget是unit的父类 constant widgetevent EVENT_WIDGET_DEATH = ConvertWidgetEvent(89)
属性
生命值
//获取生命值 native GetWidgetLife takes widget whichWidget returns real //设置生命值 native SetWidgetLife takes widget whichWidget, real newLife returns nothing
位置
//获取x坐标 native GetWidgetX takes widget whichWidget returns real //获取y坐标 native GetWidgetY takes widget whichWidget returns real
指示器
// 闪动指示器(单位底部选择圈,对单位)--对 ${单位} 闪动指示器,使用颜色:(${Red}%, ${Green}%, ${Blue}%) Alpha通道值: ${Transparency},颜色值和Alpha通道值取值范围为0-255. [R] native AddIndicator takes widget whichWidget, integer red, integer green, integer blue, integer alpha returns nothing
触发器
cj
// 单位死亡事件 native TriggerRegisterDeathEvent takes trigger whichTrigger, widget whichWidget returns event
回调参数获取
//获取触发了事件的widget constant native GetTriggerWidget takes nothing returns widget
子类
单位
属性
普通单位
状态
属性
生命/魔法
基础
常量
// 单位状态-当前生命值 constant unitstate UNIT_STATE_LIFE = ConvertUnitState(0) // 单位状态-最大生命值 constant unitstate UNIT_STATE_MAX_LIFE = ConvertUnitState(1) // 单位状态-当前法力值 constant unitstate UNIT_STATE_MANA = ConvertUnitState(2) // 单位状态-最大法力值 constant unitstate UNIT_STATE_MAX_MANA = ConvertUnitState(3)
生命回复类型
重制版
constant regentype REGENERATION_TYPE_NONE = ConvertRegenType(0) constant regentype REGENERATION_TYPE_ALWAYS = ConvertRegenType(1) //荒芜地表 constant regentype REGENERATION_TYPE_BLIGHT = ConvertRegenType(2) constant regentype REGENERATION_TYPE_DAY = ConvertRegenType(3) //只在白天回复 constant regentype REGENERATION_TYPE_NIGHT = ConvertRegenType(4)
函数
// 设置单位属性 [R] // @param whichUnitState [UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE, UNIT_STATE_MANA, UNIT_STATE_MAX_MANA] native SetUnitState takes unit whichUnit, unitstate whichUnitState, real newVal returns nothing // 获取单位属性 [R] // @param whichUnitState [UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE, UNIT_STATE_MANA, UNIT_STATE_MAX_MANA] constant native GetUnitState takes unit whichUnit, unitstate whichUnitState returns real
// 获取单位最大生命值--重制版 native BlzGetUnitMaxHP takes unit whichUnit returns integer // 设置最大生命值--重制版 native BlzSetUnitMaxHP takes unit whichUnit, integer hp returns nothing // 获取单位最大魔法值--重制版 native BlzGetUnitMaxMana takes unit whichUnit returns integer // 设置最大法力值--重制版 native BlzSetUnitMaxMana takes unit whichUnit, integer mana returns nothing
无敌
// 设置单位 无敌/可攻击 native SetUnitInvulnerable takes unit whichUnit, boolean flag returns nothing
// 单位是无敌的--重制版 native BlzIsUnitInvulnerable takes unit whichUnit returns boolean
警戒
// 启用单位警戒 [R] //它启用/禁用单元自动返回到其先前位置。 //比如当单位攻击范围内出现敌人后,会自动寻路去攻击敌人,杀死敌人后会返回到出发时的位置 //野生动物默认启用它,如果它们移动得太远,它们总是会返回到它们创建的点——这就是这个功能的意义所在——。 //单位将自动返回原警戒点. 一个很有用的功能就是刷怪进攻时禁用警戒的话,怪就不会想家了 native SetUnitCreepGuard takes unit whichUnit, boolean creepGuard returns nothing
// 忽视指定单位的警戒点--单位将不会自动返回原警戒点. 一个很有用的功能就是刷怪进攻时忽视单位警戒范围的话,怪就不会想家了 native RemoveGuardPosition takes unit hUnit returns nothing // 恢复单位的警戒点--这个动作通过 AI 来恢复特定单位的警戒点 native RecycleGuardPosition takes unit hUnit returns nothing // 忽略所有单位的警戒点--忽视 ${Player} 的所有单位的警戒点 native RemoveAllGuardPositions takes player num returns nothing
尸体
// 暂停尸体腐烂--设置 ${单位} 的尸体腐烂状态: ${Suspend/Resume} [R] //只对已完成死亡动作的尸体有效 native UnitSuspendDecay takes unit whichUnit, boolean suspend returns nothing
// 新建尸体 [R] //新建 ${玩家} 的 ${单位} 的尸体在(${X},${Y}),面向角度:${Face} 度 native CreateCorpse takes player whichPlayer, integer unitid, real x, real y, real face returns unit
营救
// 设置可否营救(对玩家) [R] native SetUnitRescuable takes unit whichUnit, player byWhichPlayer, boolean flag returns nothing // 设置营救单位的营救距离,进入这个距离就会被营救 native SetUnitRescueRange takes unit whichUnit, real range returns nothing
等级
基础
函数
// 单位等级 constant native GetUnitLevel takes unit whichUnit returns integer
选择状态
// ${单位} 被 ${Player} 选择 constant native IsUnitSelected takes unit whichUnit, player whichPlayer returns boolean
// 单位能被选择--重制版 native BlzIsUnitSelectable takes unit whichUnit returns boolean
单位附加参数
基础
函数
基础
// 单位的 附加值 native GetUnitPointValue takes unit whichUnit returns integer // 单位-类型的 附加值 native GetUnitPointValueByType takes integer unitType returns integer //弃用的 native SetUnitPointValueByType takes integer unitType, integer newPointValue returns nothing
// 单位自定义值 native GetUnitUserData takes unit whichUnit returns integer // 设置单位自定义数据 native SetUnitUserData takes unit whichUnit, int
物品栏
函数
// 给予物品 [R] native UnitAddItem takes unit whichUnit, item whichItem returns boolean native UnitAddItemById takes unit whichUnit, integer itemId returns item // 新建物品到指定物品栏 [R] native UnitAddItemToSlotById takes unit whichUnit, integer itemId, integer itemSlot returns boolean native UnitRemoveItem takes unit whichUnit, item whichItem returns nothing native UnitRemoveItemFromSlot takes unit whichUnit, integer itemSlot returns item // 英雄已有物品 native UnitHasItem takes unit whichUnit, item whichItem returns boolean // 获取单位持有物品 native UnitItemInSlot takes unit whichUnit, integer itemSlot returns item //${单位} 的物品栏格数 native UnitInventorySize takes unit whichUnit returns integer // 发布丢弃物品命令(指定坐标) [R] native UnitDropItemPoint takes unit whichUnit, item whichItem, real x, real y returns boolean // 移动物品到指定物品槽 // 只有当单位持有该物品时才有效. 注意: 该函数中物品栏编号从0-5,而不是1-6 [R] native UnitDropItemSlot takes unit whichUnit, item whichItem, integer slot returns boolean //移动物品到某个单位 //命令 ${单位} 把 ${物品} 给 ${单位} native UnitDropItemTarget takes unit whichUnit, item whichItem, widget target returns boolean // 使用物品 native UnitUseItem takes unit whichUnit, item whichItem returns boolean // 使用物品(指定坐标) //命令 ${单位} 使用 ${物品} ,目标坐标:(${X},${Y}) native UnitUseItemPoint takes unit whichUnit, item whichItem, real x, real y returns boolean // 对单位使用物品 native UnitUseItemTarget takes unit whichUnit, item whichItem, widget target returns boolean
所有者
// 改变单位所有者 native SetUnitOwner takes unit whichUnit, player whichPlayer, boolean changeColor returns nothing
// 单位的所有者 constant native GetOwningPlayer takes unit whichUnit returns player
// 单位是否属于某个玩家 constant native IsUnitOwnedByPlayer takes unit whichUnit, player whichPlayer returns boolean
单位id
// 单位的id constant native GetUnitTypeId takes unit whichUnit returns integer
单位类别
基础
常量
老版本
//单位类型-英雄 constant unittype UNIT_TYPE_HERO = ConvertUnitType(0) //单位类型-死亡了的单位 constant unittype UNIT_TYPE_DEAD = ConvertUnitType(1) //单位类型-建筑单位 constant unittype UNIT_TYPE_STRUCTURE = ConvertUnitType(2) //单位类型-飞行单位 constant unittype UNIT_TYPE_FLYING = ConvertUnitType(3) //单位类型-地面单位 constant unittype UNIT_TYPE_GROUND = ConvertUnitType(4) //单位类型-可攻击飞行物的单位 constant unittype UNIT_TYPE_ATTACKS_FLYING = ConvertUnitType(5) //单位类型-可攻击地面物体的单位 constant unittype UNIT_TYPE_ATTACKS_GROUND = ConvertUnitType(6) //单位类型-近战攻击单位 constant unittype UNIT_TYPE_MELEE_ATTACKER = ConvertUnitType(7) //单位类型-远程攻击单位 constant unittype UNIT_TYPE_RANGED_ATTACKER = ConvertUnitType(8) //单位类型-泰坦族---巨人 constant unittype UNIT_TYPE_GIANT = ConvertUnitType(9) //单位类型-被召唤的 constant unittype UNIT_TYPE_SUMMONED = ConvertUnitType(10) //单位类型-被晕眩的 constant unittype UNIT_TYPE_STUNNED = ConvertUnitType(11) //单位类型-附带瘟疫的---可以传染 constant unittype UNIT_TYPE_PLAGUED = ConvertUnitType(12) //单位类型-被束缚的 constant unittype UNIT_TYPE_SNARED = ConvertUnitType(13) //单位类型-不死族 constant unittype UNIT_TYPE_UNDEAD = ConvertUnitType(14) //单位类型-机械的 constant unittype UNIT_TYPE_MECHANICAL = ConvertUnitType(15) //单位类型-农名 constant unittype UNIT_TYPE_PEON = ConvertUnitType(16) //单位类型-民兵 constant unittype UNIT_TYPE_SAPPER = ConvertUnitType(17) //单位类型-城镇大厅类型单位 constant unittype UNIT_TYPE_TOWNHALL = ConvertUnitType(18) //单位类型-古代的 constant unittype UNIT_TYPE_ANCIENT = ConvertUnitType(19) //单位类型-牛头人 constant unittype UNIT_TYPE_TAUREN = ConvertUnitType(20) //单位类型-中毒的 constant unittype UNIT_TYPE_POISONED = ConvertUnitType(21) //单位类型-被变形的---变羊 constant unittype UNIT_TYPE_POLYMORPHED = ConvertUnitType(22) //单位类型-被催眠的---夜晚自动睡眠或者被技能睡眠 constant unittype UNIT_TYPE_SLEEPING = ConvertUnitType(23) //单位类型-有抗性皮肤 constant unittype UNIT_TYPE_RESISTANT = ConvertUnitType(24) //单位类型-处于虚无状态 constant unittype UNIT_TYPE_ETHEREAL = ConvertUnitType(25) //单位类型-魔法免疫 constant unittype UNIT_TYPE_MAGIC_IMMUNE = ConvertUnitType(26)
重制版
constant unitcategory UNIT_CATEGORY_GIANT = ConvertUnitCategory(1) constant unitcategory UNIT_CATEGORY_UNDEAD = ConvertUnitCategory(2) constant unitcategory UNIT_CATEGORY_SUMMONED = ConvertUnitCategory(4) constant unitcategory UNIT_CATEGORY_MECHANICAL = ConvertUnitCategory(8) constant unitcategory UNIT_CATEGORY_PEON = ConvertUnitCategory(16) constant unitcategory UNIT_CATEGORY_SAPPER = ConvertUnitCategory(32) constant unitcategory UNIT_CATEGORY_TOWNHALL = ConvertUnitCategory(64) constant unitcategory UNIT_CATEGORY_ANCIENT = ConvertUnitCategory(128) constant unitcategory UNIT_CATEGORY_NEUTRAL = ConvertUnitCategory(256) constant unitcategory UNIT_CATEGORY_WARD = ConvertUnitCategory(512) constant unitcategory UNIT_CATEGORY_STANDON = ConvertUnitCategory(1024) constant unitcategory UNIT_CATEGORY_TAUREN = ConvertUnitCategory(2048)
函数
// 检查单位的类型 constant native IsUnitType takes unit whichUnit, unittype whichUnitType returns boolean // 单位类型是英雄单位 constant native IsHeroUnitId takes integer unitId returns boolean // 添加类别--为 ${单位} 添加 ${Classification} 类别 [R] //已去除所有无效类别 native UnitAddType takes unit whichUnit, unittype whichUnitType returns boolean // 删除类别 [R] native UnitRemoveType takes unit whichUnit, unittype whichUnitType returns boolean
// 检查单位-类型 分类 constant native IsUnitIdType takes integer unitId, unittype whichUnitType returns boolean
//${单位} 是镜像单位 constant native IsUnitIllusion takes unit whichUnit returns boolean
单位ID
// 替换为另一个单位--替换 ${单位} 的 单位类型为:${type} [BZAPI] //不会替换大头像中的模型 native DzSetUnitID takes unit whichUnit, integer id returns nothing
种族
基础
常量
constant race RACE_HUMAN = ConvertRace(1) constant race RACE_ORC = ConvertRace(2) constant race RACE_UNDEAD = ConvertRace(3) constant race RACE_NIGHTELF = ConvertRace(4) constant race RACE_DEMON = ConvertRace(5) constant race RACE_OTHER = ConvertRace(7)
函数
// 单位的种族 constant native GetUnitRace takes unit whichUnit returns race // 单位种族检查 constant native IsUnitRace takes unit whichUnit, race whichRace returns boolean
人口
基础
函数
// 单位占用人口 constant native GetUnitFoodUsed takes unit whichUnit returns integer // 单位占用人口 constant native GetFoodUsed takes integer unitId returns integer // 单位提供人口数量 constant native GetUnitFoodMade takes unit whichUnit returns integer // 单位-类型 提供的人口 constant native GetFoodMade takes integer unitId returns integer // 允许/禁止 人口占用 [R] native SetUnitUseFood takes unit whichUnit, boolean useFood returns nothing
集结点
函数
// 单位集结点 //如果单位没有设置集结点,则返回null. 设置自己为集结点可取消集结点设置. 会创建点 constant native GetUnitRallyPoint takes unit whichUnit returns location // 获取指定单位设置的目标集结点单位 //如果指定单位没有设置集结点到单位目标,则返回null constant native GetUnitRallyUnit takes unit whichUnit returns unit // 单位集结点 //如果指定单位没有设置集结点到可破坏物上,则返回null constant native GetUnitRallyDestructable takes unit whichUnit returns destructable
同盟
//单位是否是指定玩家的同盟单位--判断指定玩家对指定单位是否是不侵犯状态 //对于中立状态返回true. 单向判断玩家对单位是否为不侵犯状态 constant native IsUnitAlly takes unit whichUnit, player whichPlayer returns boolean
//${单位} 是 ${Player} 的敌对单位 // 对于中立状态返回false. 单向判断玩家对单位是否为敌对侵犯 constant native IsUnitEnemy takes unit whichUnit, player whichPlayer returns boolean
装载状态
// ${单位} 被 ${运输机} 装载中 constant native IsUnitInTransport takes unit whichUnit, unit whichTransport returns boolean //${单位} 被装载中--被飞艇,船等有运输功能的单位装载 constant native IsUnitLoaded takes unit whichUnit returns boolean
共享视野
// 共享视野--设置 ${单位} 的视野对 ${玩家} ${开启/关闭} [R] native UnitShareVision takes unit whichUnit, player whichPlayer, boolean share returns nothing
睡眠状态
基础
函数
// 设置单位夜晚睡眠--只对中立单位有效. 并不影响催眠魔法 native UnitAddSleep takes unit whichUnit, boolean add returns nothing // 允许夜晚睡眠--中立生物才会睡眠 native UnitCanSleep takes unit whichUnit returns boolean // 控制单位睡眠状态(无论何时)--使用该功能前必须用触发为单位添加'一直睡眠'技能 native UnitAddSleepPerm takes unit whichUnit, boolean add returns nothing // 允许控制 ${单位} 的睡眠状态--即该单位拥有'一直睡眠'技能 native UnitCanSleepPerm takes unit whichUnit returns boolean // 单位在睡眠 native UnitIsSleeping takes unit whichUnit returns boolean // 叫醒单位--不影响催眠魔法效果 native UnitWakeUp takes unit whichUnit returns nothing
警报
//单位忽略报警 native UnitIgnoreAlarm takes unit whichUnit, boolean flag returns boolean //单位忽略报警开关 native UnitIgnoreAlarmToggled takes unit whichUnit returns boolean
小地图图标
// 设置单位小地图图标为商店图标 native UnitSetUsesAltIcon takes unit whichUnit, boolean flag returns nothing
队伍辉光
// 显示队伍辉光--重制版 native BlzShowUnitTeamGlow takes unit whichUnit, boolean show returns nothing
经验
//获取升级所需经验--获取单位 ${unit} 的 ${level}级 升级所需经验 native DzGetUnitNeededXP takes unit whichUnit, integer level returns integer
指令
常量
攻击类型
// 正常 constant attacktype ATTACK_TYPE_NORMAL = ConvertAttackType(0) // 普通 constant attacktype ATTACK_TYPE_MELEE = ConvertAttackType(1) // 穿刺 constant attacktype ATTACK_TYPE_PIERCE = ConvertAttackType(2) // 攻城 constant attacktype ATTACK_TYPE_SIEGE = ConvertAttackType(3) // 魔法 constant attacktype ATTACK_TYPE_MAGIC = ConvertAttackType(4) // 混乱 constant attacktype ATTACK_TYPE_CHAOS = ConvertAttackType(5) // 英雄 constant attacktype ATTACK_TYPE_HERO = ConvertAttackType(6)
伤害类型
// 未知 constant damagetype DAMAGE_TYPE_UNKNOWN = ConvertDamageType(0) // 正常 constant damagetype DAMAGE_TYPE_NORMAL = ConvertDamageType(4) // 增强 constant damagetype DAMAGE_TYPE_ENHANCED = ConvertDamageType(5) // 火焰 constant damagetype DAMAGE_TYPE_FIRE = ConvertDamageType(8) // 寒冰 constant damagetype DAMAGE_TYPE_COLD = ConvertDamageType(9) // 闪电 constant damagetype DAMAGE_TYPE_LIGHTNING = ConvertDamageType(10) // 毒 constant damagetype DAMAGE_TYPE_POISON = ConvertDamageType(11) // 瘟疫 constant damagetype DAMAGE_TYPE_DISEASE = ConvertDamageType(12) // 瘟疫 constant damagetype DAMAGE_TYPE_DIVINE = ConvertDamageType(13) // 神圣 constant damagetype DAMAGE_TYPE_MAGIC = ConvertDamageType(14) // 音速 constant damagetype DAMAGE_TYPE_SONIC = ConvertDamageType(15) // 酸性 constant damagetype DAMAGE_TYPE_ACID = ConvertDamageType(16) // 势力 constant damagetype DAMAGE_TYPE_FORCE = ConvertDamageType(17) // 死亡 constant damagetype DAMAGE_TYPE_DEATH = ConvertDamageType(18) // 精神 constant damagetype DAMAGE_TYPE_MIND = ConvertDamageType(19) // 植物 constant damagetype DAMAGE_TYPE_PLANT = ConvertDamageType(20) // 防御 constant damagetype DAMAGE_TYPE_DEFENSIVE = ConvertDamageType(21) // 破坏 constant damagetype DAMAGE_TYPE_DEMOLITION = ConvertDamageType(22) // 慢性毒药 constant damagetype DAMAGE_TYPE_SLOW_POISON = ConvertDamageType(23) // 灵魂锁链 constant damagetype DAMAGE_TYPE_SPIRIT_LINK = ConvertDamageType(24) // 暗影打击 constant damagetype DAMAGE_TYPE_SHADOW_STRIKE = ConvertDamageType(25) // 通用 constant damagetype DAMAGE_TYPE_UNIVERSAL = ConvertDamageType(26)
武器类型声音
// 无 constant weapontype WEAPON_TYPE_WHOKNOWS = ConvertWeaponType(0) //金属类--轻击 constant weapontype WEAPON_TYPE_METAL_LIGHT_CHOP = ConvertWeaponType(1) constant weapontype WEAPON_TYPE_METAL_MEDIUM_CHOP = ConvertWeaponType(2) constant weapontype WEAPON_TYPE_METAL_HEAVY_CHOP = ConvertWeaponType(3) //金属类--切割 constant weapontype WEAPON_TYPE_METAL_LIGHT_SLICE = ConvertWeaponType(4) constant weapontype WEAPON_TYPE_METAL_MEDIUM_SLICE = ConvertWeaponType(5) constant weapontype WEAPON_TYPE_METAL_HEAVY_SLICE = ConvertWeaponType(6) //金属类--猛击 constant weapontype WEAPON_TYPE_METAL_MEDIUM_BASH = ConvertWeaponType(7) constant weapontype WEAPON_TYPE_METAL_HEAVY_BASH = ConvertWeaponType(8) //金属类--穿透 constant weapontype WEAPON_TYPE_METAL_MEDIUM_STAB = ConvertWeaponType(9) constant weapontype WEAPON_TYPE_METAL_HEAVY_STAB = ConvertWeaponType(10) //木头类--切割 constant weapontype WEAPON_TYPE_WOOD_LIGHT_SLICE = ConvertWeaponType(11) constant weapontype WEAPON_TYPE_WOOD_MEDIUM_SLICE = ConvertWeaponType(12) constant weapontype WEAPON_TYPE_WOOD_HEAVY_SLICE = ConvertWeaponType(13) //木头类--猛击 constant weapontype WEAPON_TYPE_WOOD_LIGHT_BASH = ConvertWeaponType(14) constant weapontype WEAPON_TYPE_WOOD_MEDIUM_BASH = ConvertWeaponType(15) constant weapontype WEAPON_TYPE_WOOD_HEAVY_BASH = ConvertWeaponType(16) //木头类--穿透 constant weapontype WEAPON_TYPE_WOOD_LIGHT_STAB = ConvertWeaponType(17) constant weapontype WEAPON_TYPE_WOOD_MEDIUM_STAB = ConvertWeaponType(18) //爪子类--切割 constant weapontype WEAPON_TYPE_CLAW_LIGHT_SLICE = ConvertWeaponType(19) constant weapontype WEAPON_TYPE_CLAW_MEDIUM_SLICE = ConvertWeaponType(20) constant weapontype WEAPON_TYPE_CLAW_HEAVY_SLICE = ConvertWeaponType(21) //斧头类--中击 constant weapontype WEAPON_TYPE_AXE_MEDIUM_CHOP = ConvertWeaponType(22) //石头类--猛击 constant weapontype WEAPON_TYPE_ROCK_HEAVY_BASH = ConvertWeaponType(23)
函数
当前指令
// 单位当前的命令--${单位} 的当前命令ID native GetUnitCurrentOrder takes unit whichUnit returns integer
伤害指令
// 伤害区域 [R] // @param amount 伤害 // @param attack 普通攻击 // @param ranged 远程伤害 // @param attackType 攻击类型 [ATTACK_TYPE_NORMAL,ATTACK_TYPE_MELEE,ATTACK_TYPE_PIERCE,ATTACK_TYPE_SIEGE,ATTACK_TYPE_MAGIC,ATTACK_TYPE_CHAOS,ATTACK_TYPE_HERO] // @param damageType 伤害类型 [DAMAGE_TYPE_UNKNOWN,DAMAGE_TYPE_NORMAL,DAMAGE_TYPE_ENHANCED,DAMAGE_TYPE_FIRE,DAMAGE_TYPE_COLD,DAMAGE_TYPE_LIGHTNING,DAMAGE_TYPE_POISON,DAMAGE_TYPE_DISEASE,DAMAGE_TYPE_DIVINE,DAMAGE_TYPE_MAGIC,DAMAGE_TYPE_SONIC,DAMAGE_TYPE_ACID,DAMAGE_TYPE_FORCE,DAMAGE_TYPE_DEATH,DAMAGE_TYPE_MIND,DAMAGE_TYPE_PLANT,DAMAGE_TYPE_DEFENSIVE,DAMAGE_TYPE_DEMOLITION,DAMAGE_TYPE_SLOW_POISON,DAMAGE_TYPE_SPIRIT_LINK,DAMAGE_TYPE_SHADOW_STRIKE,DAMAGE_TYPE_UNIVERSAL] // @param weaponType 武器类型 [WEAPON_TYPE_WHOKNOWS,WEAPON_TYPE_METAL_LIGHT_CHOP,WEAPON_TYPE_METAL_MEDIUM_CHOP,WEAPON_TYPE_METAL_HEAVY_CHOP,WEAPON_TYPE_METAL_LIGHT_SLICE,WEAPON_TYPE_METAL_MEDIUM_SLICE,WEAPON_TYPE_METAL_HEAVY_SLICE,WEAPON_TYPE_METAL_MEDIUM_BASH,WEAPON_TYPE_METAL_HEAVY_BASH,WEAPON_TYPE_METAL_MEDIUM_STAB,WEAPON_TYPE_METAL_HEAVY_STAB,WEAPON_TYPE_WOOD_LIGHT_SLICE,WEAPON_TYPE_WOOD_MEDIUM_SLICE,WEAPON_TYPE_WOOD_HEAVY_SLICE,WEAPON_TYPE_WOOD_LIGHT_BASH,WEAPON_TYPE_WOOD_MEDIUM_BASH,WEAPON_TYPE_WOOD_HEAVY_BASH,WEAPON_TYPE_WOOD_LIGHT_STAB,WEAPON_TYPE_WOOD_MEDIUM_STAB,WEAPON_TYPE_CLAW_LIGHT_SLICE,WEAPON_TYPE_CLAW_MEDIUM_SLICE,WEAPON_TYPE_CLAW_HEAVY_SLICE,WEAPON_TYPE_AXE_MEDIUM_CHOP,WEAPON_TYPE_ROCK_HEAVY_BASH] native UnitDamagePoint takes unit whichUnit, real delay, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean // 伤害目标 [R] // @param amount 伤害 // @param ranged 远程伤害 // @param ranged 远程伤害 // @param attackType 攻击类型 [ATTACK_TYPE_NORMAL,ATTACK_TYPE_MELEE,ATTACK_TYPE_PIERCE,ATTACK_TYPE_SIEGE,ATTACK_TYPE_MAGIC,ATTACK_TYPE_CHAOS,ATTACK_TYPE_HERO] // @param damageType 伤害类型 [DAMAGE_TYPE_UNKNOWN,DAMAGE_TYPE_NORMAL,DAMAGE_TYPE_ENHANCED,DAMAGE_TYPE_FIRE,DAMAGE_TYPE_COLD,DAMAGE_TYPE_LIGHTNING,DAMAGE_TYPE_POISON,DAMAGE_TYPE_DISEASE,DAMAGE_TYPE_DIVINE,DAMAGE_TYPE_MAGIC,DAMAGE_TYPE_SONIC,DAMAGE_TYPE_ACID,DAMAGE_TYPE_FORCE,DAMAGE_TYPE_DEATH,DAMAGE_TYPE_MIND,DAMAGE_TYPE_PLANT,DAMAGE_TYPE_DEFENSIVE,DAMAGE_TYPE_DEMOLITION,DAMAGE_TYPE_SLOW_POISON,DAMAGE_TYPE_SPIRIT_LINK,DAMAGE_TYPE_SHADOW_STRIKE,DAMAGE_TYPE_UNIVERSAL] // @param weaponType 武器类型 [WEAPON_TYPE_WHOKNOWS,WEAPON_TYPE_METAL_LIGHT_CHOP,WEAPON_TYPE_METAL_MEDIUM_CHOP,WEAPON_TYPE_METAL_HEAVY_CHOP,WEAPON_TYPE_METAL_LIGHT_SLICE,WEAPON_TYPE_METAL_MEDIUM_SLICE,WEAPON_TYPE_METAL_HEAVY_SLICE,WEAPON_TYPE_METAL_MEDIUM_BASH,WEAPON_TYPE_METAL_HEAVY_BASH,WEAPON_TYPE_METAL_MEDIUM_STAB,WEAPON_TYPE_METAL_HEAVY_STAB,WEAPON_TYPE_WOOD_LIGHT_SLICE,WEAPON_TYPE_WOOD_MEDIUM_SLICE,WEAPON_TYPE_WOOD_HEAVY_SLICE,WEAPON_TYPE_WOOD_LIGHT_BASH,WEAPON_TYPE_WOOD_MEDIUM_BASH,WEAPON_TYPE_WOOD_HEAVY_BASH,WEAPON_TYPE_WOOD_LIGHT_STAB,WEAPON_TYPE_WOOD_MEDIUM_STAB,WEAPON_TYPE_CLAW_LIGHT_SLICE,WEAPON_TYPE_CLAW_MEDIUM_SLICE,WEAPON_TYPE_CLAW_HEAVY_SLICE,WEAPON_TYPE_AXE_MEDIUM_CHOP,WEAPON_TYPE_ROCK_HEAVY_BASH] native UnitDamageTarget takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean
发送命令
// 给单位发送命令到 没有目标 native IssueImmediateOrder takes unit whichUnit, string order returns boolean // 发布命令(无目标)(ID) native IssueImmediateOrderById takes unit whichUnit, integer order returns boolean // 发布命令(指定坐标) native IssuePointOrder takes unit whichUnit, string order, real x, real y returns boolean // 给单位发送命令到 点 native IssuePointOrderLoc takes unit whichUnit, string order, location whichLocation returns boolean // 发布命令(指定坐标)(ID) native IssuePointOrderById takes unit whichUnit, integer order, real x, real y returns boolean // 发布命令(指定点)(ID) native IssuePointOrderByIdLoc takes unit whichUnit, integer order, location whichLocation returns boolean // 给单位发送命令到 单位 native IssueTargetOrder takes unit whichUnit, string order, widget targetWidget returns boolean // 发布命令(指定单位)(ID) native IssueTargetOrderById takes unit whichUnit, integer order, widget targetWidget returns boolean
间接指令
/* ==间接命令== 参数: 1. 命令发布者 2. 字符串命令 3. 目标1(widget类型,生命体,单位/物品/可破坏物) 4. 目标2(同样widget类型) 使用方式:发现似乎只有在进行物品的丢弃/转交/出售(卖)的时候才会有间接目标存在, 1.比如命令A将攻击之爪交给B,B是转交命令的直接目标,而攻击之爪就是间接目标,作为转交物的存在。 2.在魔兽中,物品的丢弃/转交/出售(卖)都被视作物品持有者丢弃物品,其字符串命令为"dropitem",数字命令为852001。 3.经过测试:instantTargetWidget是间接目标,即要转交的物品。 */ // 发布间接命令(指定坐标) native IssueInstantPointOrder takes unit whichUnit, string order, real x, real y, widget instantTargetWidget returns boolean // 发布间接命令(指定点)(ID) native IssueInstantPointOrderById takes unit whichUnit, integer order, real x, real y, widget instantTargetWidget returns boolean // 发布间接命令(指定单位) native IssueInstantTargetOrder takes unit whichUnit, string order, widget targetWidget, widget instantTargetWidget returns boolean // 发布间接命令(指定单位)(ID) native IssueInstantTargetOrderById takes unit whichUnit, integer order, widget targetWidget, widget instantTargetWidget returns boolean
建造
// 发布建造命令(指定坐标)--whichPeon(哪个农民) [R] native IssueBuildOrder takes unit whichPeon, string unitToBuild, real x, real y returns boolean // 发布建造命令(指定坐标) [R] native IssueBuildOrderById takes unit whichPeon, integer unitId, real x, real y returns boolean
中介指令
// 发布中介即时命令(无目标)--使 ${玩家} 对 ${单位} 发布 ${Order} 命令 //可以用来对非本玩家单位发布命令 native IssueNeutralImmediateOrder takes player forWhichPlayer, unit neutralStructure, string unitToBuild returns boolean // 发布中介命令(无目标)(ID)--使 ${玩家} 对 ${单位} 发布 ${Order} 命令 native IssueNeutralImmediateOrderById takes player forWhichPlayer,unit neutralStructure, integer unitId returns boolean // 发布中介命令(指定坐标) native IssueNeutralPointOrder takes player forWhichPlayer,unit neutralStructure, string unitToBuild, real x, real y returns boolean // 发布中介命令(指定坐标)(ID) native IssueNeutralPointOrderById takes player forWhichPlayer,unit neutralStructure, integer unitId, real x, real y returns boolean // 发布中介命令(指定单位) native IssueNeutralTargetOrder takes player forWhichPlayer,unit neutralStructure, string unitToBuild, widget target returns boolean // 发布中介命令(指定单位)(ID) native IssueNeutralTargetOrderById takes player forWhichPlayer,unit neutralStructure, integer unitId, widget target returns boolean
工具
逻辑判断
// ${单位} 与 ${单位}相同 --用来判断两个单位是否相等。 constant native IsUnit takes unit whichUnit, unit whichSpecifiedUnit returns boolean
距离判断
// 判断单位是否在指定单位范围内 // ${单位} 在距离 ${指定单位} ${范围} 范围内 [R] constant native IsUnitInRange takes unit whichUnit, unit otherUnit, real distance returns boolean // 在指定坐标范围内--${单位} 在距离坐标(${X},${Y}) ${范围} 范围内 [R] constant native IsUnitInRangeXY takes unit whichUnit, real x, real y, real distance returns boolean // 在指定点范围内 [R] constant native IsUnitInRangeLoc takes unit whichUnit, location whichLocation, real distance returns boolean
文本
名称
基础
函数
// 单位名字 constant native GetUnitName takes unit whichUnit returns string
// 设置单位名字--重制版 native BlzSetUnitName takes unit whichUnit, string name returns nothing
技能
属性
永久性
// 设置技能永久性 [R] //如触发添加给单位的技能就是非永久性的,非永久性技能在变身并回复之后会丢失掉. 这类情况就需要设置技能永久性 native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean
函数
添加/删除
// 添加技能 [R] --添加成功返回true native UnitAddAbility takes unit whichUnit, integer abilityId returns boolean // 删除技能 [R] native UnitRemoveAbility takes unit whichUnit, integer abilityId returns boolean
CD
// 重设单位技能cd //如果要重置单一技能的CD,可以通过删除技能+添加技能+设置技能等级来完成 native UnitResetCooldown takes unit whichUnit returns nothing
// 设置技能冷却时间--重制版 native BlzSetUnitAbilityCooldown takes unit whichUnit, integer abilId, integer level, real cooldown returns nothing // 获取单位技能的冷却时间--重制版 native BlzGetUnitAbilityCooldown takes unit whichUnit, integer abilId, integer level returns real // 单位技能的剩余冷却时间--重制版 native BlzGetUnitAbilityCooldownRemaining takes unit whichUnit, integer abilId returns real // 重设技能冷却--重制版 native BlzEndUnitAbilityCooldown takes unit whichUnit, integer abilCode returns nothing //设置技能进入冷却--重制版 native BlzStartUnitAbilityCooldown takes unit whichUnit, integer abilCode, real cooldown returns nothing
隐藏/禁用
// 隐藏技能--重制版 native BlzUnitHideAbility takes unit whichUnit, integer abilId, boolean flag returns nothing // 禁用技能--重制版 native BlzUnitDisableAbility takes unit whichUnit, integer abilId, boolean flag, boolean hideUI returns nothing
魔法消耗
// 单位技能魔法消耗--重制版 native BlzGetUnitAbilityManaCost takes unit whichUnit, integer abilId, integer level returns integer // 设置单位技能法力消耗--重制版 native BlzSetUnitAbilityManaCost takes unit whichUnit, integer abilId, integer level, integer manaCost returns nothing
获取
//获取单位技能--重制版 native BlzGetUnitAbility takes unit whichUnit, integer abilId returns ability // 获取单位第N个技能--重制版 native BlzGetUnitAbilityByIndex takes unit whichUnit, integer index returns ability
其他
// 未用完的技能点数 native GetHeroSkillPoints takes unit whichHero returns integer // 修改剩余技能点 [R] native UnitModifySkillPoints takes unit whichHero, integer skillPointDelta returns boolean
// 英雄学习技能 //命令 ${Hero} 学习技能 ${Skill} //只有当英雄有剩余技能点时有效 native SelectHeroSkill takes unit whichHero, integer abilcode returns nothing // 单位技能等级 [R] native GetUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer // 降低技能等级 [R] //改变死亡单位的光环技能会导致魔兽崩溃 native DecUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer // 提升技能等级 [R] //改变死亡单位的光环技能会导致魔兽崩溃 native IncUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer // 设置技能等级 [R] //改变死亡单位的光环技能会导致魔兽崩溃 native SetUnitAbilityLevel takes unit whichUnit, integer abilcode, integer level returns integer
魔法效果
// 删除魔法效果(指定极性)--删除 ${单位} 的附带Buff,(${包含/不包含} 正面Buff, ${包含/不包含} 负面Buff) [R] native UnitRemoveBuffs takes unit whichUnit, boolean removePositive, boolean removeNegative returns nothing // 删除魔法效果(详细类别)--删除 ${单位} 的附带Buff, //(${包含/不包含} 正面Buff //${包含/不包含} 负面Buff$ //{包含/不包含} 魔法Buff //${包含/不包含} 物理Buff //${包含/不包含} 生命周期 //${包含/不包含} 光环效果 //${包含/不包含} 不可驱散Buff [R] native UnitRemoveBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns nothing // 拥有Buff [R] native UnitHasBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns boolean // 拥有Buff数量 [R] native UnitCountBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns integer
移动
移动类型
基础
常量
重制版
//未知 constant movetype MOVE_TYPE_UNKNOWN = ConvertMoveType(0) //不行 constant movetype MOVE_TYPE_FOOT = ConvertMoveType(1) //飞行 constant movetype MOVE_TYPE_FLY = ConvertMoveType(2) //骑马 constant movetype MOVE_TYPE_HORSE = ConvertMoveType(4) //浮空(陆地上) constant movetype MOVE_TYPE_HOVER = ConvertMoveType(8) //漂浮(上面上) constant movetype MOVE_TYPE_FLOAT = ConvertMoveType(16) //两栖 constant movetype MOVE_TYPE_AMPHIBIOUS = ConvertMoveType(32) //无法建造 constant movetype MOVE_TYPE_UNBUILDABLE = ConvertMoveType(64)
飞行高度
基础
函数
//设定单位飞行高度 native SetUnitFlyHeight takes unit whichUnit, real newHeight, real rate returns nothing // 飞行高度 (当前) native GetUnitFlyHeight takes unit whichUnit returns real // 飞行高度 (默认) native GetUnitDefaultFlyHeight takes unit whichUnit returns real
移动速度
基础
函数
// 设置单位移动速度 native SetUnitMoveSpeed takes unit whichUnit, real newSpeed returns nothing // 单位移动速度 (当前) constant native GetUnitMoveSpeed takes unit whichUnit returns real // 单位移动速度 (默认) constant native GetUnitDefaultMoveSpeed takes unit whichUnit returns real
转身速度
基础
函数
//设定单位转向速度 native SetUnitTurnSpeed takes unit whichUnit, real newTurnSpeed returns nothing // 转向速度 (当前) native GetUnitTurnSpeed takes unit whichUnit returns real // 转向速度 (默认) native GetUnitDefaultTurnSpeed takes unit whichUnit returns real
路径
放置不允许
基础
重制版
//不能行走 constant pathingflag PATHING_FLAG_UNWALKABLE = ConvertPathingFlag(2) //不能飞行 constant pathingflag PATHING_FLAG_UNFLYABLE = ConvertPathingFlag(4) //不能建造 constant pathingflag PATHING_FLAG_UNBUILDABLE = ConvertPathingFlag(8) //采矿和伐木中的农民不能穿过的地形 constant pathingflag PATHING_FLAG_UNPEONHARVEST = ConvertPathingFlag(16) //荒芜地表 constant pathingflag PATHING_FLAG_BLIGHTED = ConvertPathingFlag(32) //不能漂浮 constant pathingflag PATHING_FLAG_UNFLOATABLE = ConvertPathingFlag(64) //两栖不能通过 constant pathingflag PATHING_FLAG_UNAMPHIBIOUS = ConvertPathingFlag(128) //不能放置物品 constant pathingflag PATHING_FLAG_UNITEMPLACABLE = ConvertPathingFlag(256)
这里的值是反的,因为是给"放置不允许属性"用的
碰撞体积
// 碰撞体积--重制版 native BlzGetUnitCollisionSize takes unit whichUnit returns real
碰撞通道
//打开/关闭其他单位对当前单位的碰撞通道--并不是禁用当前单位的碰撞盒 //关闭碰撞的单位无视障碍物,但其他单位仍视其为障碍物 native SetUnitPathing takes unit whichUnit, boolean flag returns nothing
显示
变换
位置
老版本
// 设置X坐标 [R] native SetUnitX takes unit whichUnit, real newX returns nothing // 设置Y坐标 [R] native SetUnitY takes unit whichUnit, real newY returns nothing // 移动单位(立即)(指定坐标) [R] native SetUnitPosition takes unit whichUnit, real newX, real newY returns nothing // 移动单位 (立刻) native SetUnitPositionLoc takes unit whichUnit, location whichLocation returns nothing // 单位所在X轴坐标 [R] constant native GetUnitX takes unit whichUnit returns real // 单位所在Y轴坐标 [R] constant native GetUnitY takes unit whichUnit returns real // 单位的位置 constant native GetUnitLoc takes unit whichUnit returns location
// 设置单位位置-本地调用 native DzSetUnitPosition takes unit whichUnit, real x, real y returns nothing
重制版
// 获取本地单位Z坐标--重制版 native BlzGetLocalUnitZ takes unit whichUnit returns real
// Add this function to follow the style of GetUnitX and GetUnitY, it has the same result as BlzGetLocalUnitZ--加入这个函数跟GetUnitX和GetUnitY的风格一样,结果和BlzGetLocalUnitZ一样 // 获取单位Z坐标--重制版 native BlzGetUnitZ takes unit whichUnit returns real
旋转
// 单位面向角度 constant native GetUnitFacing takes unit whichUnit returns real // 设置单位面向角度 [R]--注意是角度 //面向角度采用角度制,0度为正东方向,90度为正北方向。速度等于单位的转身速度。 native SetUnitFacing takes unit whichUnit, real facingAngle returns nothing // 设置单位面对角度在指定时间内完成转向--注意是角度 //面向角度采用角度制,0度为正东方向,90度为正北方向。不能超过单位的转身速度。 native SetUnitFacingTimed takes unit whichUnit, real facingAngle, real duration returns nothing
//设置单位朝向--重制版 native BlzSetUnitFacingEx takes unit whichUnit, real facingAngle returns nothing
缩放
// 改变单位尺寸(按倍数) [R] native SetUnitScale takes unit whichUnit, real scaleX, real scaleY, real scaleZ returns nothing
可见性
// 显示/隐藏 [R] native ShowUnit takes unit whichUnit, boolean show returns nothing // 是隐藏单位 constant native IsUnitHidden takes unit whichUnit returns boolean
// ${单位} 对 ${Player} 可见 constant native IsUnitVisible takes unit whichUnit, player whichPlayer returns boolean
// ${单位} 处在 ${玩家} 的真实视野范围内 //用来判断单位在这个玩家反隐形范围内,注:不包含该玩家同盟的反隐范围 constant native IsUnitDetected takes unit whichUnit, player whichPlayer returns boolean // ${单位} 对 ${Player} 不可见 constant native IsUnitInvisible takes unit whichUnit, player whichPlayer returns boolean
//单位在迷雾中--黑色阴影内的单位不算处在迷雾中,只计算地形迷雾 // ${单位} 在 ${Player} 的迷雾范围内 constant native IsUnitFogged takes unit whichUnit, player whichPlayer returns boolean // 单位在黑色阴影中---用来制作类似于剑灵躲在石头后的机制 //${单位} 在 ${Player} 的黑色阴影内 constant native IsUnitMasked takes unit whichUnit, player whichPlayer returns boolean
颜色值
基础
函数
// 改变单位颜色--使用玩家颜色 native SetUnitColor takes unit whichUnit, playercolor whichColor returns nothing // 改变单位的顶点颜色(RGB:0-255) [R] //颜色格式为(红,绿,蓝). 大多数单位使用(255,255,255)的颜色值和255的Alpha值. 透明值为0是不可见的.颜色值和Alpha值取值范围为0-255 native SetUnitVertexColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing
模型文件
属性
贴图
// 设置单位的贴图--只能替换模型中有Replaceable ID x 贴图的模型,ID为索引。不会替换大头像中的模型 native DzSetUnitTexture takes unit whichUnit, string path, integer texId returns nothing
函数
// 替换单位模型--不会替换大头像中的模型 [BZAPI] native DzSetUnitModel takes unit whichUnit, string path returns nothing
模型缩放
基础
函数
// 改变单位尺寸(按倍数) [R] native SetUnitScale takes unit whichUnit, real scaleX, real scaleY, real scaleZ returns nothing
选择圈
函数
// 闪动指示器(单位底部选择圈,对单位)--对 ${单位} 闪动指示器,使用颜色:(${Red}%, ${Green}%, ${Blue}%) Alpha通道值: ${Transparency},颜色值和Alpha通道值取值范围为0-255. [R] native UnitAddIndicator takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing
动画
属性
转向角度
基础
函数
// 设置单位与目标点的角度(弧度)为多少时,单位才开始向目标点移动 --为0时单位无法移动(因为与目标点的角度无法达到0°,推测旋转是用的线性插值的方式)--为180°则跳过第一部直接进入第二部(因为单位的前方与目标点的角度不会超过180°(最大为背对时)) [R] // ---单位前往目标点的操作分为两步: //-----1.单位先向目标点旋转,当与目标点的角度到达PropWindow设置的角度时,进入步骤2 //-----2.给单位一个向前的力(注意不是设置坐标而是施加力,因此如果转弯慢但PropWindow设置的太大时,单位会绕圈),同时旋转朝向至目标点 native SetUnitPropWindow takes unit whichUnit, real newPropWindowAngle returns nothing // 当前转向角度(弧度制) [R] native GetUnitPropWindow takes unit whichUnit returns real //默认PropWindow native GetUnitDefaultPropWindow takes unit whichUnit returns real
要求动画名
基础
//比如恶魔猎手添加'alternate'会显示为恶魔形态;农民添加'gold'则为背负黄金形态
即子动画名称
函数
// 添加/删除 单位动画附加名 [R]--给 ${单位} 附加动作 ${Tag} ,状态为 ${Add/Remove} //比如恶魔猎手添加'alternate'会显示为恶魔形态;农民添加'gold'则为背负黄金形态 native AddUnitAnimationProperties takes unit whichUnit, string animProperties, boolean add returns nothing
函数
// 骨骼方向约束--可以用来制作炮塔攻击时炮口转向目标点 // 使单位的某个骨骼朝向某个目标 native SetUnitLookAt takes unit whichUnit, string whichBone, unit lookAtTarget, real offsetX, real offsetY, real offsetZ returns nothing // 重置单位骨骼朝向 native ResetUnitLookAt takes unit whichUnit returns nothing // 改变单位动画播放速度(按倍数) 负数为反向播放 [R] //改变 ${单位} 的动画播放速度为正常速度的 ${timeScale} 倍 native SetUnitTimeScale takes unit whichUnit, real timeScale returns nothing //单位动画切换的混合时间 native SetUnitBlendTime takes unit whichUnit, real blendTime returns nothing //队列单位动作 native QueueUnitAnimation takes unit whichUnit, string whichAnimation returns nothing // 播放单位动作 native SetUnitAnimation takes unit whichUnit, string whichAnimation returns nothing // 播放单位指定序号的动作 [R] native SetUnitAnimationByIndex takes unit whichUnit, integer whichAnimation returns nothing // 播放单位动作 (指定概率) native SetUnitAnimationWithRarity takes unit whichUnit, string whichAnimation, raritycontrol rarity returns nothing
参数
rarity
//Trigger animation rarity controls 动画稀有度控制 //你知道有些单位有stand - 1、stand - 2、stand - 3等吗?好吧,这就是稀有的原因。Stand - 1 通常是默认动画,该单元只是循环一个支架。但是,stand - 2 通常是不同的东西,例如环顾四周或类似的东西。这些类型的动画被认为是“稀有”的。“频繁的”通常只是初始动画,例如 stand - 1。 //稀有度--普通--动画经常播放 constant raritycontrol RARITY_FREQUENT = ConvertRarityControl(0) //稀有度--稀有--动画很难触发 constant raritycontrol RARITY_RARE = ConvertRarityControl(1)
战斗
属性
主动攻击范围
基础
函数
//设置主动攻击范围 native SetUnitAcquireRange takes unit whichUnit, real newAcquireRange returns nothing
攻击
攻击范围(射程)
基础
函数
// 单位射程 (当前) native GetUnitAcquireRange takes unit whichUnit returns real // 单位射程 (默认) native GetUnitDefaultAcquireRange takes unit whichUnit returns real
基础伤害
函数
// 获取单位基础伤害--重制版 native BlzGetUnitBaseDamage takes unit whichUnit, integer weaponIndex returns integer // 设置基础伤害--重制版 native BlzSetUnitBaseDamage takes unit whichUnit, integer baseDamage, integer weaponIndex returns nothing
伤害骰子
函数
// 获取单位骰子数量--重制版 native BlzGetUnitDiceNumber takes unit whichUnit, integer weaponIndex returns integer // 设置单位骰子数--重制版 native BlzSetUnitDiceNumber takes unit whichUnit, integer diceNumber, integer weaponIndex returns nothing // 获取单位骰子面数--重制版 native BlzGetUnitDiceSides takes unit whichUnit, integer weaponIndex returns integer // 设置骰子面数--重制版 native BlzSetUnitDiceSides takes unit whichUnit, integer diceSides, integer weaponIndex returns nothing
攻击间隔
函数
// 攻击间隔--重制版 native BlzGetUnitAttackCooldown takes unit whichUnit, integer weaponIndex returns real // 设置攻击间隔--重制版 native BlzSetUnitAttackCooldown takes unit whichUnit, real cooldown, integer weaponIndex returns nothing
单位攻击目标类型
基础
常量
重制版
constant targetflag TARGET_FLAG_NONE = ConvertTargetFlag(1) constant targetflag TARGET_FLAG_GROUND = ConvertTargetFlag(2) constant targetflag TARGET_FLAG_AIR = ConvertTargetFlag(4) constant targetflag TARGET_FLAG_STRUCTURE = ConvertTargetFlag(8) constant targetflag TARGET_FLAG_WARD = ConvertTargetFlag(16) constant targetflag TARGET_FLAG_ITEM = ConvertTargetFlag(32) constant targetflag TARGET_FLAG_TREE = ConvertTargetFlag(64) constant targetflag TARGET_FLAG_WALL = ConvertTargetFlag(128) constant targetflag TARGET_FLAG_DEBRIS = ConvertTargetFlag(256) constant targetflag TARGET_FLAG_DECORATION = ConvertTargetFlag(512) constant targetflag TARGET_FLAG_BRIDGE = ConvertTargetFlag(1024)
基础护甲
函数
// 获取护甲--重制版 native BlzGetUnitArmor takes unit whichUnit returns real // 设置护甲--重制版 native BlzSetUnitArmor takes unit whichUnit, real armorAmount returns nothing
单位护甲类型
基础
常量
重制版
constant defensetype DEFENSE_TYPE_LIGHT = ConvertDefenseType(0) constant defensetype DEFENSE_TYPE_MEDIUM = ConvertDefenseType(1) constant defensetype DEFENSE_TYPE_LARGE = ConvertDefenseType(2) constant defensetype DEFENSE_TYPE_FORT = ConvertDefenseType(3) constant defensetype DEFENSE_TYPE_NORMAL = ConvertDefenseType(4) constant defensetype DEFENSE_TYPE_HERO = ConvertDefenseType(5) constant defensetype DEFENSE_TYPE_DIVINE = ConvertDefenseType(6) constant defensetype DEFENSE_TYPE_NONE = ConvertDefenseType(7)
单位装甲类型
基础
注意
只影响被近战单位攻击时的声音
常量
重制版
constant armortype ARMOR_TYPE_WHOKNOWS = ConvertArmorType(0) constant armortype ARMOR_TYPE_FLESH = ConvertArmorType(1) constant armortype ARMOR_TYPE_METAL = ConvertArmorType(2) constant armortype ARMOR_TYPE_WOOD = ConvertArmorType(3) constant armortype ARMOR_TYPE_ETHREAL = ConvertArmorType(4) constant armortype ARMOR_TYPE_STONE = ConvertArmorType(5)
函数
武器属性对象
重制版
unitweaponintegerfield
unitweaponrealfield
unitweaponbooleanfield
unitweaponstringfield
打断攻击
// 打断攻击--重制版 native BlzUnitInterruptAttack takes unit whichUnit returns nothing
英雄单位
状态
属性
三围
基础
常量
重制版
//力量 constant heroattribute HERO_ATTRIBUTE_STR = ConvertHeroAttribute(1) //智力 constant heroattribute HERO_ATTRIBUTE_INT = ConvertHeroAttribute(2) //敏捷 constant heroattribute HERO_ATTRIBUTE_AGI = ConvertHeroAttribute(3)
函数
// 设置英雄力量 [R] native SetHeroStr takes unit whichHero, integer newStr, boolean permanent returns nothing // 设置英雄敏捷 [R] native SetHeroAgi takes unit whichHero, integer newAgi, boolean permanent returns nothing // 设置英雄智力 [R] native SetHeroInt takes unit whichHero, integer newInt, boolean permanent returns nothing // 英雄力量 [R] native GetHeroStr takes unit whichHero, boolean includeBonuses returns integer // 英雄敏捷 [R] native GetHeroAgi takes unit whichHero, boolean includeBonuses returns integer // 英雄智力 [R] native GetHeroInt takes unit whichHero, boolean includeBonuses returns integer
经验值
// 英雄的经验值 native GetHeroXP takes unit whichHero returns integer // 设置英雄经验值 native SetHeroXP takes unit whichHero, integer newXpVal, boolean showEyeCandy returns nothing // 增加经验值 [R] native AddHeroXP takes unit whichHero, integer xpToAdd, boolean showEyeCandy returns nothing
// 允许/禁止经验获取 [R] native SuspendHeroXP takes unit whichHero, boolean flag returns nothing // 是否禁止经验获取 native IsSuspendedXP takes unit whichHero returns boolean
等级
基础
函数
// 降低等级 [R] //只能降低等级. 英雄经验将重置为该等级的初始值 native UnitStripHeroLevel takes unit whichHero, integer howManyLevels returns boolean // 设置英雄等级 native SetHeroLevel takes unit whichHero, integer level, boolean showEyeCandy returns nothing // 英雄等级 constant native GetHeroLevel takes unit whichHero returns integer
工具
复活
//立即复活(指定坐标) [R]--立即复活 ${英雄} 在(${X},${Y}), ${Show/Hide} 复活动画 //如果英雄正在祭坛复活,则会退回部分花费(默认为100%) native ReviveHero takes unit whichHero, real x, real y, boolean doEyecandy returns boolean // 复活英雄(位置) native ReviveHeroLoc takes unit whichHero, location loc, boolean doEyecandy returns boolean
文本
称谓
函数
// 英雄称谓 //如圣骑士会返回'无惧的布赞恩'而不是'圣骑士'. native GetHeroProperName takes unit whichHero returns string
// 设置英雄称谓--重制版 native BlzSetHeroProperName takes unit whichUnit, string heroProperName returns nothing
技能
英雄
基础
函数
// 未用完的技能点数 native GetHeroSkillPoints takes unit whichHero returns integer // 修改剩余技能点 [R] native UnitModifySkillPoints takes unit whichHero, integer skillPointDelta returns boolean
// 英雄学习技能 //命令 ${Hero} 学习技能 ${Skill} //只有当英雄有剩余技能点时有效 native SelectHeroSkill takes unit whichHero, integer abilcode returns nothing // 单位技能等级 [R] native GetUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer // 降低技能等级 [R] //改变死亡单位的光环技能会导致魔兽崩溃 native DecUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer // 提升技能等级 [R] //改变死亡单位的光环技能会导致魔兽崩溃 native IncUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer // 设置技能等级 [R] //改变死亡单位的光环技能会导致魔兽崩溃 native SetUnitAbilityLevel takes unit whichUnit, integer abilcode, integer level returns integer
建筑单位
进度
// 设置建筑建造进度条--设置 ${Building} 的建造进度条为 ${Progress}% //只作用于正在建造的建筑 native UnitSetConstructionProgress takes unit whichUnit, integer constructionPercentage returns nothing // 设置建筑升级进度条--设置 ${Building} 的升级进度条为 ${Progress}% //只作用于正在升级的建筑. 是建筑A升级为建筑B的升级,不是科技的研究 native UnitSetUpgradeProgress takes unit whichUnit, integer upgradePercentage returns nothing
金矿
储量
// 设置 ${金矿} 的黄金储量为 ${Quantity} native SetResourceAmount takes unit whichUnit, integer amount returns nothing // 添加金矿资源 native AddResourceAmount takes unit whichUnit, integer amount returns nothing // ${金矿} 的储金量--只对金矿有效 native GetResourceAmount takes unit whichUnit returns integer
传送门
目的地
// 传送门目的地X坐标--${传送门} 的目的地X坐标 native WaygateGetDestinationX takes unit waygate returns real // 传送门目的地Y坐标 native WaygateGetDestinationY takes unit waygate returns real // 设置传送门目的坐标 [R] native WaygateSetDestination takes unit waygate, real x, real y returns nothing
激活状态
//传送门激活/取消激活 native WaygateActivate takes unit waygate, boolean activate returns nothing //传送门是否激活 native WaygateIsActive takes unit waygate returns boolean
商店
添加物品
// 增加 物品-类型 (到所有商店)--添加 ${物品类型} 到所有市场并设置库存量: ${Count} 最大库存量: ${Max} // 影响所有拥有'出售物品'技能的单位 native AddItemToAllStock takes integer itemId, integer count, integer stockMax returns nothing // 增加 物品-类型 (到商店) native AddItemToStock takes unit whichStock, integer itemId, integer count, integer stockMax returns nothing // 增加 单位-类型 (到所有商店) native AddUnitToAllStock takes integer unitId, integer count, integer stockMax returns nothing // 增加 单位-类型 (到商店) native AddUnitToStock takes unit whichStock, integer unitId, integer count, integer stockMax returns nothing
删除物品
// 删除 物品-类型 (从所有商店) native RemoveItemFromAllStock takes integer itemId returns nothing // 删除 物品-类型 (从商店) native RemoveItemFromStock takes unit whichStock, integer itemId returns nothing // 删除 单位-类型 (从所有商店) native RemoveUnitFromAllStock takes integer unitId returns nothing // 删除 单位-类型 (从商店) native RemoveUnitFromStock takes unit whichStock, integer unitId returns nothing
限制出售
// 限制所有市场的可出售物品种类数为 ${Quantity}--影响所有拥有'出售物品'技能的单位 native SetAllItemTypeSlots takes integer slots returns nothing // 限制所有市场的可出售单位种类数为 ${Quantity}--影响所有拥有'出售单位'技能的单位 native SetAllUnitTypeSlots takes integer slots returns nothing // 限制 ${Marketplace} 的可出售物品种类数为 ${Quantity} native SetItemTypeSlots takes unit whichUnit, integer slots returns nothing // 限制 ${Marketplace} 的可出售单位种类数为 ${Quantity} native SetUnitTypeSlots takes unit whichUnit, integer slots returns nothing
函数
属性对象
重制版
unitintegerfield
unitrealfield
unitbooleanfield
unitstringfield
属性操作
基础
获取
// 单位布尔类型字段--重制版 native BlzGetUnitBooleanField takes unit whichUnit, unitbooleanfield whichField returns boolean // 获取单位整数类型字段--重制版 native BlzGetUnitIntegerField takes unit whichUnit, unitintegerfield whichField returns integer // Get Unit 实数类型字段--重制版 native BlzGetUnitRealField takes unit whichUnit, unitrealfield whichField returns real // 获取单位字符串字段--重制版 native BlzGetUnitStringField takes unit whichUnit, unitstringfield whichField returns string
设置
// 改变单位的布尔类型字段--重制版 native BlzSetUnitBooleanField takes unit whichUnit, unitbooleanfield whichField, boolean value returns boolean // 改变单位的整数类型字段--重制版 native BlzSetUnitIntegerField takes unit whichUnit, unitintegerfield whichField, integer value returns boolean // 改变单位的实数类型字段--重制版 native BlzSetUnitRealField takes unit whichUnit, unitrealfield whichField, real value returns boolean // 改变单位的字符串类型字段--重制版 native BlzSetUnitStringField takes unit whichUnit, unitstringfield whichField, string value returns boolean
单位武器
获取
// Unit Weapon--重制版 native BlzGetUnitWeaponBooleanField takes unit whichUnit, unitweaponbooleanfield whichField, integer index returns boolean native BlzGetUnitWeaponIntegerField takes unit whichUnit, unitweaponintegerfield whichField, integer index returns integer native BlzGetUnitWeaponRealField takes unit whichUnit, unitweaponrealfield whichField, integer index returns real native BlzGetUnitWeaponStringField takes unit whichUnit, unitweaponstringfield whichField, integer index returns string
设置
native BlzSetUnitWeaponBooleanField takes unit whichUnit, unitweaponbooleanfield whichField, integer index, boolean value returns boolean native BlzSetUnitWeaponIntegerField takes unit whichUnit, unitweaponintegerfield whichField, integer index, integer value returns boolean native BlzSetUnitWeaponRealField takes unit whichUnit, unitweaponrealfield whichField, integer index, real value returns boolean native BlzSetUnitWeaponStringField takes unit whichUnit, unitweaponstringfield whichField, integer index, string value returns boolean
单位皮肤
//获取单位皮肤--将单位模型切换为另一个单位的模型,包括配套的动画等设置都完全切换 native BlzGetUnitSkin takes unit whichUnit returns integer
//设置单位皮肤 native BlzSetUnitSkin takes unit whichUnit, integer skinId returns nothing
//使用皮肤创建单位 native BlzCreateUnitWithSkin takes player id, integer unitid, real x, real y, real face, integer skinId returns unit
生命周期
新建
// 新建单位(指定坐标) [R] native CreateUnit takes player id, integer unitid, real x, real y, real face returns unit // 新建单位(指定坐标) [R] native CreateUnitByName takes player whichPlayer, string unitname, real x, real y, real face returns unit // 新建单位(指定点) [R] native CreateUnitAtLoc takes player id, integer unitid, location whichLocation, real face returns unit // 新建单位(指定点) [R] native CreateUnitAtLocByName takes player id, string unitname, location whichLocation, real face returns unit
杀死
// 杀死单位 native KillUnit takes unit whichUnit returns nothing
删除
// 删除单位 native RemoveUnit takes unit whichUnit returns nothing
暂停/恢复
// 暂停单位--重制版 native BlzPauseUnitEx takes unit whichUnit, boolean flag returns nothing
// 暂停/恢复 [R] 暂停后无法对单位发出指令 native PauseUnit takes unit whichUnit, boolean flag returns nothing native IsUnitPaused takes unit whichHero returns boolean
死亡爆炸
//设置死亡方式 //设置 ${单位} ${爆炸} 在死亡时 native SetUnitExploded takes unit whichUnit, boolean exploded returns nothing
限时生命
// 取消限时生命--重制版 native BlzUnitCancelTimedLife takes unit whichUnit returns nothing
// 暂停/恢复生命周期 [R] native UnitPauseTimedLife takes unit whichUnit, boolean flag returns nothing
// 设置生命周期(到期后单位死亡)--为 ${单位} 设置 ${Buff Type} 类型的生命周期,持续时间为 ${Duration} 秒 [R] native UnitApplyTimedLife takes unit whichUnit, integer buffId, real duration returns nothing
触发器
cj
通用回调参数获取
// returns handle to unit which triggered the most recent event when called from // within a trigger action function...returns null handle when used incorrectly //当从触发动作函数中调用时,返回触发最近事件的单元的句柄...当使用不正确时返回空句柄 // 获取触发单位 constant native GetTriggerUnit takes nothing returns unit
// 注册单位的事件 native TriggerRegisterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent returns event
可用事件
老版本
//单位事件 - 隐藏 constant unitevent EVENT_UNIT_HIDDEN = ConvertUnitEvent(56) //单位事件 - 被选择 constant unitevent EVENT_UNIT_SELECTED = ConvertUnitEvent(57) //单位事件 - 被取消选择 constant unitevent EVENT_UNIT_DESELECTED = ConvertUnitEvent(58) //单位事件 - 开始建筑升级 constant unitevent EVENT_UNIT_UPGRADE_START = ConvertUnitEvent(66) //单位事件 - 取消建筑升级 constant unitevent EVENT_UNIT_UPGRADE_CANCEL = ConvertUnitEvent(67) //单位事件 - 完成建筑升级 constant unitevent EVENT_UNIT_UPGRADE_FINISH = ConvertUnitEvent(68) //单位事件 - 开始研究科技 constant unitevent EVENT_UNIT_RESEARCH_START = ConvertUnitEvent(72) //单位事件 - 取消研究科技 constant unitevent EVENT_UNIT_RESEARCH_CANCEL = ConvertUnitEvent(73) //单位事件 - 完成研究科技 constant unitevent EVENT_UNIT_RESEARCH_FINISH = ConvertUnitEvent(74) //单位事件 - 召唤一个单位 constant unitevent EVENT_UNIT_SUMMON = ConvertUnitEvent(84) //单位事件 - 被运输机装载 constant unitevent EVENT_UNIT_LOADED = ConvertUnitEvent(88)
状态达到限制事件
//单位事件 - 单位属性(生命值/魔法值)达到限制大小 constant unitevent EVENT_UNIT_STATE_LIMIT = ConvertUnitEvent(59)
回调参数获取
// EVENT_UNIT_STATE_LIMIT // 获取哪个状态达到限制 constant native GetEventUnitState takes nothing returns unitstate
伤害事件
常量
//单位事件 - 受到伤害 constant unitevent EVENT_UNIT_DAMAGED = ConvertUnitEvent(52)
回调参数获取
// 被伤害的生命值 constant native GetEventDamage takes nothing returns real // 伤害来源 constant native GetEventDamageSource takes nothing returns unit
//单位事件 - 造成伤害 constant unitevent EVENT_UNIT_DAMAGING = ConvertUnitEvent(314)
函数
伤害
// 设置单位伤害事件的伤害--重制版 native BlzSetEventDamage takes real damage returns nothing
伤害目标
// 获取事件伤害目标--重制版 native BlzGetEventDamageTarget takes nothing returns unit
攻击类型
// 获取事件攻击类型--重制版 native BlzGetEventAttackType takes nothing returns attacktype // 设置事件攻击类型--重制版 native BlzSetEventAttackType takes attacktype attackType returns boolean
// 正常 constant attacktype ATTACK_TYPE_NORMAL = ConvertAttackType(0) // 普通 constant attacktype ATTACK_TYPE_MELEE = ConvertAttackType(1) // 穿刺 constant attacktype ATTACK_TYPE_PIERCE = ConvertAttackType(2) // 攻城 constant attacktype ATTACK_TYPE_SIEGE = ConvertAttackType(3) // 魔法 constant attacktype ATTACK_TYPE_MAGIC = ConvertAttackType(4) // 混乱 constant attacktype ATTACK_TYPE_CHAOS = ConvertAttackType(5) // 英雄 constant attacktype ATTACK_TYPE_HERO = ConvertAttackType(6)
伤害类型
// 获取事件伤害类型--重制版 native BlzGetEventDamageType takes nothing returns damagetype // 设置事件伤害类型--重制版 native BlzSetEventDamageType takes damagetype damageType returns boolean
// 未知 constant damagetype DAMAGE_TYPE_UNKNOWN = ConvertDamageType(0) // 正常 constant damagetype DAMAGE_TYPE_NORMAL = ConvertDamageType(4) // 增强 constant damagetype DAMAGE_TYPE_ENHANCED = ConvertDamageType(5) // 火焰 constant damagetype DAMAGE_TYPE_FIRE = ConvertDamageType(8) // 寒冰 constant damagetype DAMAGE_TYPE_COLD = ConvertDamageType(9) // 闪电 constant damagetype DAMAGE_TYPE_LIGHTNING = ConvertDamageType(10) // 毒 constant damagetype DAMAGE_TYPE_POISON = ConvertDamageType(11) // 瘟疫 constant damagetype DAMAGE_TYPE_DISEASE = ConvertDamageType(12) // 瘟疫 constant damagetype DAMAGE_TYPE_DIVINE = ConvertDamageType(13) // 神圣 constant damagetype DAMAGE_TYPE_MAGIC = ConvertDamageType(14) // 音速 constant damagetype DAMAGE_TYPE_SONIC = ConvertDamageType(15) // 酸性 constant damagetype DAMAGE_TYPE_ACID = ConvertDamageType(16) // 势力 constant damagetype DAMAGE_TYPE_FORCE = ConvertDamageType(17) // 死亡 constant damagetype DAMAGE_TYPE_DEATH = ConvertDamageType(18) // 精神 constant damagetype DAMAGE_TYPE_MIND = ConvertDamageType(19) // 植物 constant damagetype DAMAGE_TYPE_PLANT = ConvertDamageType(20) // 防御 constant damagetype DAMAGE_TYPE_DEFENSIVE = ConvertDamageType(21) // 破坏 constant damagetype DAMAGE_TYPE_DEMOLITION = ConvertDamageType(22) // 慢性毒药 constant damagetype DAMAGE_TYPE_SLOW_POISON = ConvertDamageType(23) // 灵魂锁链 constant damagetype DAMAGE_TYPE_SPIRIT_LINK = ConvertDamageType(24) // 暗影打击 constant damagetype DAMAGE_TYPE_SHADOW_STRIKE = ConvertDamageType(25) // 通用 constant damagetype DAMAGE_TYPE_UNIVERSAL = ConvertDamageType(26)
武器类型
// 获取事件武器类型--重制版 native BlzGetEventWeaponType takes nothing returns weapontype // 设置事件武器类型--重制版 native BlzSetEventWeaponType takes weapontype weaponType returns boolean
// 无 constant weapontype WEAPON_TYPE_WHOKNOWS = ConvertWeaponType(0) //金属类--轻击 constant weapontype WEAPON_TYPE_METAL_LIGHT_CHOP = ConvertWeaponType(1) constant weapontype WEAPON_TYPE_METAL_MEDIUM_CHOP = ConvertWeaponType(2) constant weapontype WEAPON_TYPE_METAL_HEAVY_CHOP = ConvertWeaponType(3) //金属类--切割 constant weapontype WEAPON_TYPE_METAL_LIGHT_SLICE = ConvertWeaponType(4) constant weapontype WEAPON_TYPE_METAL_MEDIUM_SLICE = ConvertWeaponType(5) constant weapontype WEAPON_TYPE_METAL_HEAVY_SLICE = ConvertWeaponType(6) //金属类--猛击 constant weapontype WEAPON_TYPE_METAL_MEDIUM_BASH = ConvertWeaponType(7) constant weapontype WEAPON_TYPE_METAL_HEAVY_BASH = ConvertWeaponType(8) //金属类--穿透 constant weapontype WEAPON_TYPE_METAL_MEDIUM_STAB = ConvertWeaponType(9) constant weapontype WEAPON_TYPE_METAL_HEAVY_STAB = ConvertWeaponType(10) //木头类--切割 constant weapontype WEAPON_TYPE_WOOD_LIGHT_SLICE = ConvertWeaponType(11) constant weapontype WEAPON_TYPE_WOOD_MEDIUM_SLICE = ConvertWeaponType(12) constant weapontype WEAPON_TYPE_WOOD_HEAVY_SLICE = ConvertWeaponType(13) //木头类--猛击 constant weapontype WEAPON_TYPE_WOOD_LIGHT_BASH = ConvertWeaponType(14) constant weapontype WEAPON_TYPE_WOOD_MEDIUM_BASH = ConvertWeaponType(15) constant weapontype WEAPON_TYPE_WOOD_HEAVY_BASH = ConvertWeaponType(16) //木头类--穿透 constant weapontype WEAPON_TYPE_WOOD_LIGHT_STAB = ConvertWeaponType(17) constant weapontype WEAPON_TYPE_WOOD_MEDIUM_STAB = ConvertWeaponType(18) //爪子类--切割 constant weapontype WEAPON_TYPE_CLAW_LIGHT_SLICE = ConvertWeaponType(19) constant weapontype WEAPON_TYPE_CLAW_MEDIUM_SLICE = ConvertWeaponType(20) constant weapontype WEAPON_TYPE_CLAW_HEAVY_SLICE = ConvertWeaponType(21) //斧头类--中击 constant weapontype WEAPON_TYPE_AXE_MEDIUM_CHOP = ConvertWeaponType(22) //石头类--猛击 constant weapontype WEAPON_TYPE_ROCK_HEAVY_BASH = ConvertWeaponType(23)
是否是普通攻击
// 是否普通攻击--重制版 native BlzGetEventIsAttack takes nothing returns boolean
攻击事件
//单位事件 - 被攻击 //注意不是在单位被打中时才触发,只要攻击者开始攻击前摇,即使没有打出攻击也会触发 constant unitevent EVENT_UNIT_ATTACKED = ConvertUnitEvent(62)
回调参数获取
// 攻击的单位 constant native GetAttacker takes nothing returns unit
营救事件
//单位事件 - 被营救 constant unitevent EVENT_UNIT_RESCUED = ConvertUnitEvent(63)
回调参数获取
//救援者 constant native GetRescuer takes nothing returns unit
英雄事件
//单位事件 - 提升等级 constant unitevent EVENT_UNIT_HERO_LEVEL = ConvertUnitEvent(78)
回调参数获取
// 获取升级了的单位 constant native GetLevelingUnit takes nothing returns unit
//单位事件 - 学习技能 constant unitevent EVENT_UNIT_HERO_SKILL = ConvertUnitEvent(79)
回调参数获取
// 学习技能的英雄 constant native GetLearningUnit takes nothing returns unit // 学习技能 [R] constant native GetLearnedSkill takes nothing returns integer // 学习的技能的等级 constant native GetLearnedSkillLevel takes nothing returns integer
//单位事件 - 变得可重生 constant unitevent EVENT_UNIT_HERO_REVIVABLE = ConvertUnitEvent(80)
回调参数获取
// 可复活的英雄 constant native GetRevivableUnit takes nothing returns unit
//单位事件 - 开始复活英雄 constant unitevent EVENT_UNIT_HERO_REVIVE_START = ConvertUnitEvent(81) //单位事件 - 取消复活英雄 constant unitevent EVENT_UNIT_HERO_REVIVE_CANCEL = ConvertUnitEvent(82) //单位事件 - 完成复活英雄 constant unitevent EVENT_UNIT_HERO_REVIVE_FINISH = ConvertUnitEvent(83)
回调参数获取
// 正在复活的英雄 constant native GetRevivingUnit takes nothing returns unit
死亡事件
//单位事件 - 死亡 constant unitevent EVENT_UNIT_DEATH = ConvertUnitEvent(53)
回调参数获取
// 垂死的单位 constant native GetDyingUnit takes nothing returns unit // 凶手单位 constant native GetKillingUnit takes nothing returns unit
//单位事件 - 开始腐化 constant unitevent EVENT_UNIT_DECAY = ConvertUnitEvent(54)
回调参数获取
// 尸体腐烂单位 constant native GetDecayingUnit takes nothing returns unit
检测事件
//单位事件 - 被发现 constant unitevent EVENT_UNIT_DETECTED = ConvertUnitEvent(55)
回调参数获取
// 事件检测的玩家 constant native GetEventDetectingPlayer takes nothing returns player
攻击目标事件
// Events which may have a filter for the "other unit" //单位事件 - 指定了攻击目标 constant unitevent EVENT_UNIT_ACQUIRED_TARGET = ConvertUnitEvent(60) //单位事件 - 攻击目标进入攻击范围内 constant unitevent EVENT_UNIT_TARGET_IN_RANGE = ConvertUnitEvent(61)
回调参数获取
// 目标单位 constant native GetEventTargetUnit takes nothing returns unit
建筑事件
建造事件
//单位事件 - 取消建造 constant unitevent EVENT_UNIT_CONSTRUCT_CANCEL = ConvertUnitEvent(64) //单位事件 - 完成建造 constant unitevent EVENT_UNIT_CONSTRUCT_FINISH = ConvertUnitEvent(65)
回调参数获取
// 取消建造中的建筑 constant native GetCancelledStructure takes nothing returns unit // 已建造的建筑 constant native GetConstructedStructure takes nothing returns unit
训练事件
// Events which involve the specified unit performing // training of other units //单位事件 - 开始训练单位 constant unitevent EVENT_UNIT_TRAIN_START = ConvertUnitEvent(69)
回调参数获取
// 训练单位类型 constant native GetTrainedUnitType takes nothing returns integer
//单位事件 - 取消训练单位 constant unitevent EVENT_UNIT_TRAIN_CANCEL = ConvertUnitEvent(70) //单位事件 - 完成训练单位 constant unitevent EVENT_UNIT_TRAIN_FINISH = ConvertUnitEvent(71)
回调参数获取
// 训练单位类型 constant native GetTrainedUnitType takes nothing returns integer // EVENT_PLAYER_UNIT_TRAIN_FINISH // 训练完成的单位 constant native GetTrainedUnit takes nothing returns unit
出售事件
// 单位事件 - 单位被出售 constant unitevent EVENT_UNIT_SELL = ConvertUnitEvent(286)
基础
出售开始和结束都会触发事件
回调参数获取
// 正在出售的单位 constant native GetSellingUnit takes nothing returns unit // 出售完成的单位 constant native GetSoldUnit takes nothing returns unit // 出售给谁 constant native GetBuyingUnit takes nothing returns unit
物品事件
// 单位事件 - 出售物品 constant unitevent EVENT_UNIT_SELL_ITEM = ConvertUnitEvent(288)
回调参数获取
// 卖出的物品 constant native GetSoldItem takes nothing returns item
// 单位事件 - 抵押物品 constant unitevent EVENT_UNIT_PAWN_ITEM = ConvertUnitEvent(294)
//单位事件 - 丢弃物品---转交/出售都算丢弃 constant unitevent EVENT_UNIT_DROP_ITEM = ConvertUnitEvent(85) //单位事件 - 获得物品 constant unitevent EVENT_UNIT_PICKUP_ITEM = ConvertUnitEvent(86) //单位事件 - 使用物品 constant unitevent EVENT_UNIT_USE_ITEM = ConvertUnitEvent(87)
回调参数获取
// 获取操作物品的单位 constant native GetManipulatingUnit takes nothing returns unit // 被操作的物品 constant native GetManipulatedItem takes nothing returns item
指令事件
//单位事件 - 发布无目标指令 constant unitevent EVENT_UNIT_ISSUED_ORDER = ConvertUnitEvent(75)
回调参数获取
// 执行命令的单位 constant native GetOrderedUnit takes nothing returns unit // 命令id constant native GetIssuedOrderId takes nothing returns integer
//单位事件 - 发布指定点目标指令 constant unitevent EVENT_UNIT_ISSUED_POINT_ORDER = ConvertUnitEvent(76)
回调参数获取
// 命令发布点X坐标 [R] constant native GetOrderPointX takes nothing returns real // 命令发布点Y坐标 [R] constant native GetOrderPointY takes nothing returns real // 命令的位置 constant native GetOrderPointLoc takes nothing returns location
//单位事件 - 发布指定物体目标指令 constant unitevent EVENT_UNIT_ISSUED_TARGET_ORDER = ConvertUnitEvent(77)
回调参数获取
// 目标 constant native GetOrderTarget takes nothing returns widget // 目标可毁坏物 constant native GetOrderTargetDestructable takes nothing returns destructable // 目标物品 constant native GetOrderTargetItem takes nothing returns item // 目标单位 constant native GetOrderTargetUnit takes nothing returns unit
冰封王座拓展事件
// 单位事件 - 改变所有者 constant unitevent EVENT_UNIT_CHANGE_OWNER = ConvertUnitEvent(287) // 单位事件 - 准备施放技能 (前摇开始) constant unitevent EVENT_UNIT_SPELL_CHANNEL = ConvertUnitEvent(289) // 单位事件 - 开始施放技能 (前摇结束) constant unitevent EVENT_UNIT_SPELL_CAST = ConvertUnitEvent(290) // 单位事件 - 发动技能效果 (后摇开始) constant unitevent EVENT_UNIT_SPELL_EFFECT = ConvertUnitEvent(291) // 单位事件 - 发动技能结束 (后摇结束) constant unitevent EVENT_UNIT_SPELL_FINISH = ConvertUnitEvent(292) // 单位事件 - 中止施放技能 constant unitevent EVENT_UNIT_SPELL_ENDCAST = ConvertUnitEvent(293)
// 注册单位状态事件 // @param whichState [UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE, UNIT_STATE_MANA, UNIT_STATE_MAX_MANA] native TriggerRegisterUnitStateEvent takes trigger whichTrigger, unit whichUnit, unitstate whichState, limitop opcode, real limitval returns event
// 特定单位事件,比如使用EVENT_UNIT_TARGET_IN_RANGE当攻击目标进入当前单位的攻击范围内时,可在filter中对此目标进行过滤,只有当目标符合要求时才会触发 native TriggerRegisterFilterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent, boolexpr filter returns event
// 当某个单位进入指定单位的范围事件 native TriggerRegisterUnitInRange takes trigger whichTrigger, unit whichUnit, real range, boolexpr filter returns event
可破坏物
属性
生命周期
// 新建可破坏物,variation(样式) native CreateDestructable takes integer objectid, real x, real y, real face, real scale, integer variation returns destructable // 新建可破坏物 [R] native CreateDestructableZ takes integer objectid, real x, real y, real z, real face, real scale, integer variation returns destructable native CreateDeadDestructable takes integer objectid, real x, real y, real face, real scale, integer variation returns destructable // 新建可破坏物(死亡的) [R] native CreateDeadDestructableZ takes integer objectid, real x, real y, real z, real face, real scale, integer variation returns destructable // 删除 可毁坏物 native RemoveDestructable takes destructable d returns nothing // 杀死 可毁坏物 native KillDestructable takes destructable d returns nothing
显隐
// 显示/隐藏 [R] native ShowDestructable takes destructable d, boolean flag returns nothing
生命值
// 设置 可毁坏物 生命 (值) native SetDestructableLife takes destructable d, real life returns nothing // 获取生命值 (可毁坏物) native GetDestructableLife takes destructable d returns real //设置可破坏物的最大生命值 native SetDestructableMaxLife takes destructable d, real max returns nothing // 获取最大生命值 (可毁坏物) native GetDestructableMaxLife takes destructable d returns real
// 回复可破坏物生命值 native DestructableRestoreLife takes destructable d, real life, boolean birth returns nothing
无敌
//设置可破坏物无敌 native SetDestructableInvulnerable takes destructable d, boolean flag returns nothing //判断可破坏物是否无敌 native IsDestructableInvulnerable takes destructable d returns boolean
变换
位置
// 可破坏物所在X轴坐标 [R] native GetDestructableX takes destructable d returns real // 可破坏物所在Y轴坐标 [R] native GetDestructableY takes destructable d returns real
// 设置可破坏物位置 native DzDestructablePosition takes destructable d, real x, real y returns nothing
名称
// 可毁坏物的名字 native GetDestructableName takes destructable d returns string
类型
// 可破坏物的类型 native GetDestructableTypeId takes destructable d returns integer
闭塞高度
// 闭塞高度 (可毁坏物),即可破坏物可以阻挡视线的高度,比如树的高度为1个悬崖,那么当单位站在两个悬崖高度的悬崖上时,可以看见树后面的视野 native GetDestructableOccluderHeight takes destructable d returns real // 设置闭塞高度 native SetDestructableOccluderHeight takes destructable d, real height returns nothing
可以看见悬崖后的视野
动画
//队列可破坏物的动画 native QueueDestructableAnimation takes destructable d, string whichAnimation returns nothing //设置可破坏物的动画 native SetDestructableAnimation takes destructable d, string whichAnimation returns nothing // 改变可破坏物动画播放速度 [R] native SetDestructableAnimationSpeed takes destructable d, real speedFactor returns nothing
触发器
cj
回调参数获取
// 获取触发可破坏物 constant native GetTriggerDestructable takes nothing returns destructable
函数
皮肤
//已弃用 //获取模型,用来做单位替换 native BlzGetDestructableSkin takes destructable whichDestructable returns integer
//已弃用 //设置可破坏物皮肤 native BlzSetDestructableSkin takes destructable whichDestructable, integer skinId returns nothing
//使用皮肤创建可破坏物(z) native BlzCreateDestructableZWithSkin takes integer objectid, real x, real y, real z, real face, real scale, integer variation, integer skinId returns destructable //使用皮肤创建可破坏物 native BlzCreateDestructableWithSkin takes integer objectid, real x, real y, real face, real scale, integer variation, integer skinId returns destructable //使用皮肤创建死亡的可破坏物 native BlzCreateDeadDestructableWithSkin takes integer objectid, real x, real y, real face, real scale, integer variation, integer skinId returns destructable //使用皮肤创建死亡的可破坏物(z) native BlzCreateDeadDestructableZWithSkin takes integer objectid, real x, real y, real z, real face, real scale, integer variation, integer skinId returns destructable
工具
遍历
//选取矩形区域内的可破坏物并过滤,然后做动作. native EnumDestructablesInRect takes rect r, boolexpr filter, code actionFunc returns nothing
物品
常量
物品类型
cj
属性
cj
属性
属性对象
重制版
itemintegerfield
itembooleanfield
itemstringfield
生命周期
// 创建 native CreateItem takes integer itemid, real x, real y returns item // 删除物品 native RemoveItem takes item whichItem returns nothing
显隐
// 显示/隐藏 [R] native SetItemVisible takes item whichItem, boolean show returns nothing // 获取物品可见性 [R] native IsItemVisible takes item whichItem returns boolean
无敌
// 设置物品是否无敌的 native SetItemInvulnerable takes item whichItem, boolean flag returns nothing // 判断物品是无敌的 native IsItemInvulnerable takes item whichItem returns boolean
技能
// Item // 获取物品技能--重制版 // @param index 0-5 native BlzGetItemAbilityByIndex takes item whichItem, integer index returns ability // 获取物品技能--重制版 native BlzGetItemAbility takes item whichItem, integer abilCode returns ability // 物品添加技能--重制版 native BlzItemAddAbility takes item whichItem, integer abilCode returns boolean
// 物品移除技能--重制版 native BlzItemRemoveAbility takes item whichItem, integer abilCode returns boolean
所有者
// 获取物品的所有者 native GetItemPlayer takes item whichItem returns player // 设置物品所属 native SetItemPlayer takes item whichItem, player whichPlayer, boolean changeColor returns nothing // 物品是否有拥有者 native IsItemOwned takes item whichItem returns boolean
名称
// 物品名 constant native GetItemName takes item whichItem returns string
// 设置物品名字--重制版 native BlzSetItemName takes item whichItem, string name returns nothing
介绍
// 设置物品介绍--重制版 native BlzSetItemDescription takes item whichItem, string description returns nothing // 物品介绍--重制版 native BlzGetItemDescription takes item whichItem returns string
提示
// 设置物品提示--重制版 native BlzSetItemTooltip takes item whichItem, string tooltip returns nothing // 物品提示信息--重制版 native BlzGetItemTooltip takes item whichItem returns string // 设置物品扩展提示--重制版 native BlzSetItemExtendedTooltip takes item whichItem, string extendedTooltip returns nothing // 物品扩展提示信息--重制版 native BlzGetItemExtendedTooltip takes item whichItem returns string
图标
// 设置物品图标--重制版 native BlzSetItemIconPath takes item whichItem, string iconPath returns nothing // 物品图标--重制版 native BlzGetItemIconPath takes item whichItem returns string
使用次数
// 获取物品数量[使用次数] native GetItemCharges takes item whichItem returns integer // 设置物品数量[使用次数] native SetItemCharges takes item whichItem, integer charges returns nothing
用户数据
// 物品自定义值 native GetItemUserData takes item whichItem returns integer // 设置物品自定义数据 native SetItemUserData takes item whichItem, integer data returns nothing
等级
// 物品等级 native GetItemLevel takes item whichItem returns integer
id
// 物品的类别 native GetItemTypeId takes item i returns integer
类型
// 获取物品类型 native GetItemType takes item whichItem returns itemtype
//物品类型-永久---一般装备 constant itemtype ITEM_TYPE_PERMANENT = ConvertItemType(0) //物品类型-可叠加 constant itemtype ITEM_TYPE_CHARGED = ConvertItemType(1) //物品类型-能量提升-复活符/经验书/力量书/木材堆等 constant itemtype ITEM_TYPE_POWERUP = ConvertItemType(2) //物品类型-人造 constant itemtype ITEM_TYPE_ARTIFACT = ConvertItemType(3) //物品类型-可购买 constant itemtype ITEM_TYPE_PURCHASABLE = ConvertItemType(4) //物品类型-战役 constant itemtype ITEM_TYPE_CAMPAIGN = ConvertItemType(5) //物品类型-混杂 constant itemtype ITEM_TYPE_MISCELLANEOUS = ConvertItemType(6) //物品类型-未知 constant itemtype ITEM_TYPE_UNKNOWN = ConvertItemType(7) //物品类型-任何 constant itemtype ITEM_TYPE_ANY = ConvertItemType(8) // Deprecated, should use ITEM_TYPE_POWERUP // 已弃用,应使用 ITEM_TYPE_POWERUP constant itemtype ITEM_TYPE_TOME = ConvertItemType(2)
// 物品是力量提升分类的吗 [R] native IsItemPowerup takes item whichItem returns boolean // 物品是力量提升分类的吗 native IsItemIdPowerup takes integer itemId returns boolean
位置
// 物品的X轴坐标 [R] native GetItemX takes item i returns real // 物品的Y轴坐标 [R] native GetItemY takes item i returns real // 移动物品到坐标(立即)(指定坐标) [R] native SetItemPosition takes item i, real x, real y returns nothing
死亡掉落
// 设置物品是否死亡时掉落 native SetItemDropOnDeath takes item whichItem, boolean flag returns nothing
丢弃
// 设置物品可以丢弃 native SetItemDroppable takes item i, boolean flag returns nothing
出售
// 物品可被出售 [R] native IsItemSellable takes item whichItem returns boolean // 物品可以销售 native IsItemIdSellable takes integer itemId returns boolean
抵押
// 设置物品能否抵押 native SetItemPawnable takes item i, boolean flag returns nothing // 获取物品可被抵押 [R] native IsItemPawnable takes item whichItem returns boolean // 获取物品可以抵押 native IsItemIdPawnable takes integer itemId returns boolean
函数
重生神符
// 设置重生神符的产生单位类型,吃掉重生神符会产生指定单位 native SetItemDropID takes item whichItem, integer unitId returns nothing
属性操作
获取
// 物品的布尔类型字段--重制版 native BlzGetItemBooleanField takes item whichItem, itembooleanfield whichField returns boolean // 获取物品的整数类型字段--重制版 native BlzGetItemIntegerField takes item whichItem, itemintegerfield whichField returns integer // 物品的实数类型字段--重制版 native BlzGetItemRealField takes item whichItem, itemrealfield whichField returns real // 获取物品字符串字段--重制版 native BlzGetItemStringField takes item whichItem, itemstringfield whichField returns string
设置
// 改变物品的布尔类型字段--重制版 native BlzSetItemBooleanField takes item whichItem, itembooleanfield whichField, boolean value returns boolean // 改变物品的整数类型字段--重制版 native BlzSetItemIntegerField takes item whichItem, itemintegerfield whichField, integer value returns boolean // 改变物品的实数类型字段--重制版 native BlzSetItemRealField takes item whichItem, itemrealfield whichField, real value returns boolean // 改变物品的字符串类型字段--重制版 native BlzSetItemStringField takes item whichItem, itemstringfield whichField, string value returns boolean
// 设置特效缩放--重制版 native BlzSetSpecialEffectScale takes effect whichEffect, real scale returns nothing
物品皮肤
//获取物品皮肤--将物品模型切换为另一个物品的模型,用来做单位替换 native BlzGetItemSkin takes item whichItem returns integer
//设置物品皮肤 native BlzSetItemSkin takes item whichItem, integer skinId returns nothing
//使用皮肤创建物品 native BlzCreateItemWithSkin takes integer itemid, real x, real y, integer skinId returns item
工具
遍历
// 选取 区域内 所有物品在 做动作 r = 区域 , filter = 条件 , actionFunc = 动作 native EnumItemsInRect takes rect r, boolexpr filter, code actionFunc returns nothing
随机
//选择随机物品 //该功能为新版函数,使用新版等级作为参照对象. -1表示任何等级. native ChooseRandomItemEx takes itemtype whichType, integer level returns integer
装饰物
函数
动画
// 播放圆范围内地形装饰物动画--选取圆心为(${X},${Y}),半径为 ${半径} 的圆范围内的 ${装饰物类型}(选取方式:${选取方式}), 做 ${Animation Name} 动作(${允许/禁止} 随机播放) [R] //特殊动画名: 'show', 'hide', 'soundon', 'soundoff'. 随机播放:比如某装饰物有好几个'stand'动作,则允许该项时会随机抽取某个动作播放,而禁止该项时只播放首个动作 native SetDoodadAnimation takes real x, real y, real radius, integer doodadID, boolean nearestOnly, string animName, boolean animRandom returns nothing // 播放矩形区域内地形装饰物动画 [R] native SetDoodadAnimationRect takes rect r, integer doodadID, string animName, boolean animRandom returns nothing
可追踪物
属性
函数
生命周期
// Trackable API // 新建可追踪物--新建的可追踪物, 使用模型: ${模型名字} 所在位置: ( ${X轴} , ${Y轴} ) 面向角度: ${数值} 度 [R] //可用来响应鼠标的移动和点击. 会创建可追踪物 native CreateTrackable takes string trackableModelPath, real x, real y, real facing returns trackable
函数
触发器
cj
// 鼠标点击可追踪物 [R] native TriggerRegisterTrackableHitEvent takes trigger whichTrigger, trackable t returns event // 鼠标移动到追踪对象 [R] native TriggerRegisterTrackableTrackEvent takes trigger whichTrigger, trackable t returns event
回调参数获取
// EVENT_GAME_TRACKABLE_HIT // EVENT_GAME_TRACKABLE_TRACK // 事件响应 - 触发可追踪物 [R] constant native GetTriggeringTrackable takes nothing returns trackable
特效
属性
特效颜色
// 设置特效颜色--重制版 native BlzSetSpecialEffectColorByPlayer takes effect whichEffect, player whichPlayer returns nothing native BlzSetSpecialEffectColor takes effect whichEffect, integer r, integer g, integer b returns nothing
特效透明度
// 设置特效透明度--重制版 native BlzSetSpecialEffectAlpha takes effect whichEffect, integer alpha returns nothing
变换
特效缩放
// 获取特效大小--重制版 native BlzGetSpecialEffectScale takes effect whichEffect returns real
// 设置特效矩阵缩放--重制版 native BlzSetSpecialEffectMatrixScale takes effect whichEffect, real x, real y, real z returns nothing
特效位置
// 设置特效坐标--重制版 native BlzSetSpecialEffectPosition takes effect whichEffect, real x, real y, real z returns nothing
// 设置特效X坐标--重制版 native BlzSetSpecialEffectX takes effect whichEffect, real x returns nothing native BlzSetSpecialEffectY takes effect whichEffect, real y returns nothing // 设置特效Z坐标--重制版 native BlzSetSpecialEffectZ takes effect whichEffect, real z returns nothing // 设置特效点--重制版 native BlzSetSpecialEffectPositionLoc takes effect whichEffect, location loc returns nothing // 特效位置 - X--重制版 native BlzGetLocalSpecialEffectX takes effect whichEffect returns real // 特效位置 - Y--重制版 native BlzGetLocalSpecialEffectY takes effect whichEffect returns real // 特效位置 - Z--重制版 native BlzGetLocalSpecialEffectZ takes effect whichEffect returns real
特效高度
// 设置特效高度--重制版 native BlzSetSpecialEffectHeight takes effect whichEffect, real height returns nothing
旋转
// 设置特效朝向--重制版 native BlzSetSpecialEffectOrientation takes effect whichEffect, real yaw, real pitch, real roll returns nothing // 设置特效yaw--重制版 native BlzSetSpecialEffectYaw takes effect whichEffect, real yaw returns nothing // 设置特效纵摇--重制版 native BlzSetSpecialEffectPitch takes effect whichEffect, real pitch returns nothing // 设置特效滚摇--重制版 native BlzSetSpecialEffectRoll takes effect whichEffect, real roll returns nothing
矩阵
// 重置特效矩阵--重制版 native BlzResetSpecialEffectMatrix takes effect whichEffect returns nothing
特效时间
// 设置特效时间--重制版 native BlzSetSpecialEffectTimeScale takes effect whichEffect, real timeScale returns nothing native BlzSetSpecialEffectTime takes effect whichEffect, real time returns nothing
动画
播放
// 播放特效动画--重制版 native BlzPlaySpecialEffect takes effect whichEffect, animtype whichAnim returns nothing // 播放特效动画持续时间--重制版 native BlzPlaySpecialEffectWithTimeScale takes effect whichEffect, animtype whichAnim, real timeScale returns nothing
参数
whichAnim
基础
表明当前的主要动画状态
分类
//出生 constant animtype ANIM_TYPE_BIRTH = ConvertAnimType(0) constant animtype ANIM_TYPE_DEATH = ConvertAnimType(1) //尸体 constant animtype ANIM_TYPE_DECAY = ConvertAnimType(2) //消散 constant animtype ANIM_TYPE_DISSIPATE = ConvertAnimType(3) constant animtype ANIM_TYPE_STAND = ConvertAnimType(4) constant animtype ANIM_TYPE_WALK = ConvertAnimType(5) constant animtype ANIM_TYPE_ATTACK = ConvertAnimType(6) //变身 constant animtype ANIM_TYPE_MORPH = ConvertAnimType(7) //睡觉 constant animtype ANIM_TYPE_SLEEP = ConvertAnimType(8) //施法 constant animtype ANIM_TYPE_SPELL = ConvertAnimType(9) //大头像 constant animtype ANIM_TYPE_PORTRAIT = ConvertAnimType(10)
动画名
// 获取动画名--重制版 native BlzGetAnimName takes animtype whichAnim returns string
参数
whichAnim
基础
表明当前的主要动画状态
分类
//出生 constant animtype ANIM_TYPE_BIRTH = ConvertAnimType(0) constant animtype ANIM_TYPE_DEATH = ConvertAnimType(1) //尸体 constant animtype ANIM_TYPE_DECAY = ConvertAnimType(2) //消散 constant animtype ANIM_TYPE_DISSIPATE = ConvertAnimType(3) constant animtype ANIM_TYPE_STAND = ConvertAnimType(4) constant animtype ANIM_TYPE_WALK = ConvertAnimType(5) constant animtype ANIM_TYPE_ATTACK = ConvertAnimType(6) //变身 constant animtype ANIM_TYPE_MORPH = ConvertAnimType(7) //睡觉 constant animtype ANIM_TYPE_SLEEP = ConvertAnimType(8) //施法 constant animtype ANIM_TYPE_SPELL = ConvertAnimType(9) //大头像 constant animtype ANIM_TYPE_PORTRAIT = ConvertAnimType(10)
子动画
// 清除特效子动画--重制版 native BlzSpecialEffectClearSubAnimations takes effect whichEffect returns nothing // 移除特效子动画--重制版 native BlzSpecialEffectRemoveSubAnimation takes effect whichEffect, subanimtype whichSubAnim returns nothing // 添加特效子动画--重制版 native BlzSpecialEffectAddSubAnimation takes effect whichEffect, subanimtype whichSubAnim returns nothing
参数
whichSubAnim
基础
使用主类型和子动画类型进行组合 比如农民的 "Stand Gold","Stand - 3" 动画
分类
//根动画 constant subanimtype SUBANIM_TYPE_ROOTED = ConvertSubAnimType(11) //交替 constant subanimtype SUBANIM_TYPE_ALTERNATE_EX = ConvertSubAnimType(12) //循环 constant subanimtype SUBANIM_TYPE_LOOPING = ConvertSubAnimType(13) constant subanimtype SUBANIM_TYPE_SLAM = ConvertSubAnimType(14) constant subanimtype SUBANIM_TYPE_THROW = ConvertSubAnimType(15) constant subanimtype SUBANIM_TYPE_SPIKED = ConvertSubAnimType(16) constant subanimtype SUBANIM_TYPE_FAST = ConvertSubAnimType(17) constant subanimtype SUBANIM_TYPE_SPIN = ConvertSubAnimType(18) constant subanimtype SUBANIM_TYPE_READY = ConvertSubAnimType(19) constant subanimtype SUBANIM_TYPE_CHANNEL = ConvertSubAnimType(20) constant subanimtype SUBANIM_TYPE_DEFEND = ConvertSubAnimType(21) //胜利 constant subanimtype SUBANIM_TYPE_VICTORY = ConvertSubAnimType(22) //转向 constant subanimtype SUBANIM_TYPE_TURN = ConvertSubAnimType(23) constant subanimtype SUBANIM_TYPE_LEFT = ConvertSubAnimType(24) constant subanimtype SUBANIM_TYPE_RIGHT = ConvertSubAnimType(25) constant subanimtype SUBANIM_TYPE_FIRE = ConvertSubAnimType(26) //肉体 constant subanimtype SUBANIM_TYPE_FLESH = ConvertSubAnimType(27) //受击 constant subanimtype SUBANIM_TYPE_HIT = ConvertSubAnimType(28) //负伤 constant subanimtype SUBANIM_TYPE_WOUNDED = ConvertSubAnimType(29) constant subanimtype SUBANIM_TYPE_LIGHT = ConvertSubAnimType(30) constant subanimtype SUBANIM_TYPE_MODERATE = ConvertSubAnimType(31) constant subanimtype SUBANIM_TYPE_SEVERE = ConvertSubAnimType(32) constant subanimtype SUBANIM_TYPE_CRITICAL = ConvertSubAnimType(33) constant subanimtype SUBANIM_TYPE_COMPLETE = ConvertSubAnimType(34) //携带金币 constant subanimtype SUBANIM_TYPE_GOLD = ConvertSubAnimType(35) //携带木头 constant subanimtype SUBANIM_TYPE_LUMBER = ConvertSubAnimType(36) constant subanimtype SUBANIM_TYPE_WORK = ConvertSubAnimType(37) constant subanimtype SUBANIM_TYPE_TALK = ConvertSubAnimType(38) constant subanimtype SUBANIM_TYPE_FIRST = ConvertSubAnimType(39) constant subanimtype SUBANIM_TYPE_SECOND = ConvertSubAnimType(40) constant subanimtype SUBANIM_TYPE_THIRD = ConvertSubAnimType(41) constant subanimtype SUBANIM_TYPE_FOURTH = ConvertSubAnimType(42) constant subanimtype SUBANIM_TYPE_FIFTH = ConvertSubAnimType(43) constant subanimtype SUBANIM_TYPE_ONE = ConvertSubAnimType(44) constant subanimtype SUBANIM_TYPE_TWO = ConvertSubAnimType(45) constant subanimtype SUBANIM_TYPE_THREE = ConvertSubAnimType(46) constant subanimtype SUBANIM_TYPE_FOUR = ConvertSubAnimType(47) constant subanimtype SUBANIM_TYPE_FIVE = ConvertSubAnimType(48) constant subanimtype SUBANIM_TYPE_SMALL = ConvertSubAnimType(49) constant subanimtype SUBANIM_TYPE_MEDIUM = ConvertSubAnimType(50) constant subanimtype SUBANIM_TYPE_LARGE = ConvertSubAnimType(51) constant subanimtype SUBANIM_TYPE_UPGRADE = ConvertSubAnimType(52) constant subanimtype SUBANIM_TYPE_DRAIN = ConvertSubAnimType(53) constant subanimtype SUBANIM_TYPE_FILL = ConvertSubAnimType(54) constant subanimtype SUBANIM_TYPE_CHAINLIGHTNING = ConvertSubAnimType(55) constant subanimtype SUBANIM_TYPE_EATTREE = ConvertSubAnimType(56) constant subanimtype SUBANIM_TYPE_PUKE = ConvertSubAnimType(57) constant subanimtype SUBANIM_TYPE_FLAIL = ConvertSubAnimType(58) constant subanimtype SUBANIM_TYPE_OFF = ConvertSubAnimType(59) constant subanimtype SUBANIM_TYPE_SWIM = ConvertSubAnimType(60) constant subanimtype SUBANIM_TYPE_ENTANGLE = ConvertSubAnimType(61) constant subanimtype SUBANIM_TYPE_BERSERK = ConvertSubAnimType(62)
函数
特效
销毁特效
// 销毁特效 native DestroyEffect takes effect whichEffect returns nothing
模型特效
// 新建特效(创建到坐标)--新建特效 ${Model File} 在(${X},${Y})处 [R] native AddSpecialEffect takes string modelName, real x, real y returns effect // 新建特效(创建到点) [R] native AddSpecialEffectLoc takes string modelName, location where returns effect // 新建特效(创建到单位)--新建特效 ${Model File} 并绑定到 ${单位} 的 ${Attachment Point} 附加点上 [R] native AddSpecialEffectTarget takes string modelName, widget targetWidget, string attachPointName returns effect
技能特效
常量
effecttype
//点目标效果 constant effecttype EFFECT_TYPE_EFFECT = ConvertEffectType(0) //目标效果 constant effecttype EFFECT_TYPE_TARGET = ConvertEffectType(1) //施法者效果 constant effecttype EFFECT_TYPE_CASTER = ConvertEffectType(2) //特殊效果 constant effecttype EFFECT_TYPE_SPECIAL = ConvertEffectType(3) //区域效果 constant effecttype EFFECT_TYPE_AREA_EFFECT = ConvertEffectType(4) //投射物效果 constant effecttype EFFECT_TYPE_MISSILE = ConvertEffectType(5) //闪电效果 constant effecttype EFFECT_TYPE_LIGHTNING = ConvertEffectType(6)
指定要使用技能的哪个特效属性
新建
//新建特效(指定技能名称,创建到坐标)--没有人知道abilityString 应该是什么 native AddSpellEffect takes string abilityString, effecttype t, real x, real y returns effect //新建特效(指定技能名称,创建到点)--没有人知道abilityString 应该是什么 native AddSpellEffectLoc takes string abilityString, effecttype t,location where returns effect // 新建特效(指定技能id,创建到坐标)--${技能} 的 ${EffectType} , 创建到坐标(${X},${Y})[R] native AddSpellEffectById takes integer abilityId, effecttype t,real x, real y returns effect // 新建特效(指定技能id,创建到点) [R] native AddSpellEffectByIdLoc takes integer abilityId, effecttype t,location where returns effect //新建特效(指定技能名称,创建到单位) native AddSpellEffectTarget takes string modelName, effecttype t, widget targetWidget, string attachPoint returns effect // 新建特效(指定技能id,创建到单位)--${技能} 的 ${EffectType} , 绑定到 ${单位} 的 ${String} 附加点 [R] native AddSpellEffectTargetById takes integer abilityId, effecttype t, widget targetWidget, string attachPoint returns effect
获取
//返回技能效果的模型路径,不管该效果是否存在.实际上就是技能编辑器中按Ctrl+D看到的文本内容. 该效果有多个模型时,序号表示取哪一个模型,如果该序号对应的文本内容不存在则返回上一序号 native GetAbilityEffect takes string abilityString, effecttype t, integer index returns string native GetAbilityEffectById takes integer abilityId, effecttype t, integer index returns string
闪电效果
新建闪电效果
//示例:call AddLightning("DRAL",false,0,0,500,500) //会创建闪电效果. 允许检查可见性则在起始点和终结点都不可见时将不创建闪电效果 // 新建闪电效果--新建闪电效果: ${闪电类型} (${Boolean}检查可见性) 起始点:(${X},${Y}) 终结点:(${X},${Y}) [R] native AddLightning takes string codeName, boolean checkVisibility, real x1, real y1, real x2, real y2 returns lightning // 新建闪电效果(指定Z轴) [R] native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning
参数
codeName
`CLPB`,闪电链 - 主 `CLSB`,闪电链 - 次 `DRAB`,汲取 `DRAL`,生命汲取 `DRAM`,魔法汲取 `AFOD`,死亡之指 `FORK`,叉状闪电 `HWPB`,医疗波 - 主 `HWSB`,医疗波 - 次 `CHIM`,闪电攻击 `LEAS`,魔法镣铐 `MBUR`,法力燃烧 `MFPB`,魔力之焰 `SPLK`,灵魂锁链
Splats\LightningData.slk
销毁闪电特效
// 销毁闪电特效 native DestroyLightning takes lightning whichBolt returns boolean
移动闪电效果
// 移动闪电效果 native MoveLightning takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real x2, real y2 returns boolean // 移动闪电效果(指定坐标)--移动 ${Lightning} 到新位置,(${Boolean} 检查可见性) 新起始点: (${X},${Y},${Z}) 新终结点: (${X},${Y},${Z}) [R] //可指定Z坐标. 允许检查可见性则在指定起始点和终结点都不可见时将不移动闪电效果 native MoveLightningEx takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns boolean
颜色
//Alpha通道值--取值范围0-1. Alpha通道值为0是完全透明的. 可使用'闪电效果 - 改变颜色'动作来改变Alpha通道值 native GetLightningColorA takes lightning whichBolt returns real //取值范围0-1. 可使用'闪电效果 - 改变颜色'动作来改变颜色值 native GetLightningColorR takes lightning whichBolt returns real native GetLightningColorG takes lightning whichBolt returns real native GetLightningColorB takes lightning whichBolt returns real //颜色格式为(红,绿,蓝). 颜色和Alpha通道值取值范围0-1. Alpha通道值为0即完全透明 native SetLightningColor takes lightning whichBolt, real r, real g, real b, real a returns boolean
命令按钮效果
//创建命令按钮效果--重制版 native CreateCommandButtonEffect takes integer abilityId, string order returns commandbuttoneffect //创建升级命令按钮效果--重制版 native CreateUpgradeCommandButtonEffect takes integer whichUprgade returns commandbuttoneffect //创建学习命令按钮效果--重制版 native CreateLearnCommandButtonEffect takes integer abilityId returns commandbuttoneffect //销毁命令按钮效果--重制版 native DestroyCommandButtonEffect takes commandbuttoneffect whichEffect returns nothing
技能
属性
提示信息
// 设置技能提示信息--重制版 native BlzSetAbilityTooltip takes integer abilCode, string tooltip, integer level returns nothing // 设置技能提示信息(自动施法启用)--重制版 native BlzSetAbilityActivatedTooltip takes integer abilCode, string tooltip, integer level returns nothing // 设置技能扩展提示信息--重制版 native BlzSetAbilityExtendedTooltip takes integer abilCode, string extendedTooltip, integer level returns nothing // 设置技能扩展提示信息(自动施法启用)--重制版 native BlzSetAbilityActivatedExtendedTooltip takes integer abilCode, string extendedTooltip, integer level returns nothing // 设置提示信息(学习)--重制版 native BlzSetAbilityResearchTooltip takes integer abilCode, string researchTooltip, integer level returns nothing // 设置扩展提示信息(学习)--重制版 native BlzSetAbilityResearchExtendedTooltip takes integer abilCode, string researchExtendedTooltip, integer level returns nothing // 技能提示信息--重制版 native BlzGetAbilityTooltip takes integer abilCode, integer level returns string // 技能提示信息(自动施法启用)--重制版 native BlzGetAbilityActivatedTooltip takes integer abilCode, integer level returns string // 技能扩展提示信息--重制版 native BlzGetAbilityExtendedTooltip takes integer abilCode, integer level returns string // 技能扩展提示信息(自动施法启用)--重制版 native BlzGetAbilityActivatedExtendedTooltip takes integer abilCode, integer level returns string // 技能提示信息(学习)--重制版 native BlzGetAbilityResearchTooltip takes integer abilCode, integer level returns string // 技能扩展提示信息(学习)--重制版 native BlzGetAbilityResearchExtendedTooltip takes integer abilCode, integer level returns string
技能图标
// 设置技能图标--重制版 native BlzSetAbilityIcon takes integer abilCode, string iconPath returns nothing // 技能图标--重制版 native BlzGetAbilityIcon takes integer abilCode returns string // 设置技能图标(自动施法启用时)--重制版 native BlzSetAbilityActivatedIcon takes integer abilCode, string iconPath returns nothing // 技能图标(自动施法启用时)--重制版 native BlzGetAbilityActivatedIcon takes integer abilCode returns string
技能位置
// 技能位置 - X--重制版 native BlzGetAbilityPosX takes integer abilCode returns integer // 技能位置 - Y--重制版 native BlzGetAbilityPosY takes integer abilCode returns integer // 设置技能位置X--重制版 native BlzSetAbilityPosX takes integer abilCode, integer x returns nothing // 设置技能位置Y--重制版 native BlzSetAbilityPosY takes integer abilCode, integer y returns nothing // 技能位置 - X (自动施法)--重制版 native BlzGetAbilityActivatedPosX takes integer abilCode returns integer // 技能位置 - Y (自动施法)--重制版 native BlzGetAbilityActivatedPosY takes integer abilCode returns integer // 设置技能位置X(自动施法启用)--重制版 native BlzSetAbilityActivatedPosX takes integer abilCode, integer x returns nothing // 设置技能位置Y(自动施法启用)--重制版 native BlzSetAbilityActivatedPosY takes integer abilCode, integer y returns nothing
技能魔法消耗
// 技能魔法消耗--重制版 native BlzGetAbilityManaCost takes integer abilId, integer level returns integer
技能冷却时间
// 技能冷却时间--重制版 native BlzGetAbilityCooldown takes integer abilId, integer level returns real
音效
常量
//单次音效 constant soundtype SOUND_TYPE_EFFECT = ConvertSoundType(0) //循环音效 constant soundtype SOUND_TYPE_EFFECT_LOOPED = ConvertSoundType(1)
函数
//获取技能音效--通过技能名--同样,实际上就是技能编辑器中按Ctrl+D看到的文本内容 native GetAbilitySound takes string abilityString, soundtype t returns string //获取技能音效--通过技能id native GetAbilitySoundById takes integer abilityId, soundtype t returns string
特效
常量
//点目标效果 constant effecttype EFFECT_TYPE_EFFECT = ConvertEffectType(0) //目标效果 constant effecttype EFFECT_TYPE_TARGET = ConvertEffectType(1) //施法者效果 constant effecttype EFFECT_TYPE_CASTER = ConvertEffectType(2) //特殊效果 constant effecttype EFFECT_TYPE_SPECIAL = ConvertEffectType(3) //区域效果 constant effecttype EFFECT_TYPE_AREA_EFFECT = ConvertEffectType(4) //投射物效果 constant effecttype EFFECT_TYPE_MISSILE = ConvertEffectType(5) //闪电效果 constant effecttype EFFECT_TYPE_LIGHTNING = ConvertEffectType(6)
指定要使用技能的哪个特效属性
函数
//返回技能效果的模型路径,不管该效果是否存在.实际上就是技能编辑器中按Ctrl+D看到的文本内容. 该效果有多个模型时,序号表示取哪一个模型,如果该序号对应的文本内容不存在则返回上一序号 native GetAbilityEffect takes string abilityString, effecttype t, integer index returns string native GetAbilityEffectById takes integer abilityId, effecttype t, integer index returns string
函数
属性对象
常量
重制版
abilitystringlevelfield
abilitybooleanlevelfield
abilityreallevelfield
abilityintegerlevelfield
属性操作
基础属性
获取
// 技能布尔类型字段--重制版 native BlzGetAbilityBooleanField takes ability whichAbility, abilitybooleanfield whichField returns boolean // 技能的整数类型字段--重制版 native BlzGetAbilityIntegerField takes ability whichAbility, abilityintegerfield whichField returns integer // 技能的实数类型字段--重制版 native BlzGetAbilityRealField takes ability whichAbility, abilityrealfield whichField returns real // 技能字符串字段--重制版 native BlzGetAbilityStringField takes ability whichAbility, abilitystringfield whichField returns string
设置
// 改变技能的布尔类型字段--重制版 native BlzSetAbilityBooleanField takes ability whichAbility, abilitybooleanfield whichField, boolean value returns boolean // 改变技能的整数类型字段--重制版 native BlzSetAbilityIntegerField takes ability whichAbility, abilityintegerfield whichField, integer value returns boolean // 改变技能的实数类型字段--重制版 native BlzSetAbilityRealField takes ability whichAbility, abilityrealfield whichField, real value returns boolean // 改变技能的字符串类型字段--重制版 native BlzSetAbilityStringField takes ability whichAbility, abilitystringfield whichField, string value returns boolean
随等级改变的属性
单值
获取
// 技能随等级改变的布尔类型字段--重制版 native BlzGetAbilityBooleanLevelField takes ability whichAbility, abilitybooleanlevelfield whichField, integer level returns boolean // 技能随等级改变的整数类型字段--重制版 native BlzGetAbilityIntegerLevelField takes ability whichAbility, abilityintegerlevelfield whichField, integer level returns integer // 技能随等级改变的实数类型字段--重制版 native BlzGetAbilityRealLevelField takes ability whichAbility, abilityreallevelfield whichField, integer level returns real // 技能字符串等级字段--重制版 native BlzGetAbilityStringLevelField takes ability whichAbility, abilitystringlevelfield whichField, integer level returns string
设置
// 改变技能的随等级改变的布尔类型字段--重制版 native BlzSetAbilityBooleanLevelField takes ability whichAbility, abilitybooleanlevelfield whichField, integer level, boolean value returns boolean // 改变技能随等级改变的整数类型字段--重制版 native BlzSetAbilityIntegerLevelField takes ability whichAbility, abilityintegerlevelfield whichField, integer level, integer value returns boolean // 改变技能随等级改变的实数类型字段--重制版 native BlzSetAbilityRealLevelField takes ability whichAbility, abilityreallevelfield whichField, integer level, real value returns boolean // 改变技能随等级改变的字符串类型字段--重制版 native BlzSetAbilityStringLevelField takes ability whichAbility, abilitystringlevelfield whichField, integer level, string value returns boolean
数组
获取
// 技能随等级改变的布尔数组类型字段--重制版 native BlzGetAbilityBooleanLevelArrayField takes ability whichAbility, abilitybooleanlevelarrayfield whichField, integer level, integer index returns boolean // 技能随等级改变的整数数组类型字段--重制版 native BlzGetAbilityIntegerLevelArrayField takes ability whichAbility, abilityintegerlevelarrayfield whichField, integer level, integer index returns integer // 技能随等级改变的实数数组类型字段--重制版 native BlzGetAbilityRealLevelArrayField takes ability whichAbility, abilityreallevelarrayfield whichField, integer level, integer index returns real // 技能随等级改变的字符串数组类型字段--重制版 native BlzGetAbilityStringLevelArrayField takes ability whichAbility, abilitystringlevelarrayfield whichField, integer level, integer index returns string
设置
// 改变技能随等级改变的布尔数组类型字段--重制版 native BlzSetAbilityBooleanLevelArrayField takes ability whichAbility, abilitybooleanlevelarrayfield whichField, integer level, integer index, boolean value returns boolean // 改变技能随等级改变的整数数组类型字段--重制版 native BlzSetAbilityIntegerLevelArrayField takes ability whichAbility, abilityintegerlevelarrayfield whichField, integer level, integer index, integer value returns boolean // 改变技能随等级改变的实数数组类型字段--重制版 native BlzSetAbilityRealLevelArrayField takes ability whichAbility, abilityreallevelarrayfield whichField, integer level, integer index, real value returns boolean // 改变技能随等级改变的字符串数组类型字段--重制版 native BlzSetAbilityStringLevelArrayField takes ability whichAbility, abilitystringlevelarrayfield whichField, integer level, integer index, string value returns boolean
添加元素
// 技能随等级改变的布尔类型字段 - 添加值--重制版 native BlzAddAbilityBooleanLevelArrayField takes ability whichAbility, abilitybooleanlevelarrayfield whichField, integer level, boolean value returns boolean // 技能随等级改变的整数类型字段 - 添加值--重制版 native BlzAddAbilityIntegerLevelArrayField takes ability whichAbility, abilityintegerlevelarrayfield whichField, integer level, integer value returns boolean // 技能随等级改变的实数类型字段 - 添加值--重制版 native BlzAddAbilityRealLevelArrayField takes ability whichAbility, abilityreallevelarrayfield whichField, integer level, real value returns boolean // 技能随等级改变的字符串类型字段 - 添加值--重制版 native BlzAddAbilityStringLevelArrayField takes ability whichAbility, abilitystringlevelarrayfield whichField, integer level, string value returns boolean
移除元素
// 技能随等级改变的布尔类型字段 - 移除值--重制版 native BlzRemoveAbilityBooleanLevelArrayField takes ability whichAbility, abilitybooleanlevelarrayfield whichField, integer level, boolean value returns boolean // 技能随等级改变的整数类型字段 - 移除值--重制版 native BlzRemoveAbilityIntegerLevelArrayField takes ability whichAbility, abilityintegerlevelarrayfield whichField, integer level, integer value returns boolean // 技能随等级改变的实数类型字段 - 移除值--重制版 native BlzRemoveAbilityRealLevelArrayField takes ability whichAbility, abilityreallevelarrayfield whichField, integer level, real value returns boolean // 技能随等级改变的字符串类型字段 - 移除值--重制版 native BlzRemoveAbilityStringLevelArrayField takes ability whichAbility, abilitystringlevelarrayfield whichField, integer level, string value returns boolean
区域
函数
cj
工具
基础
// 添加单元点(指定坐标) [R]--可以创建不规则区域 native RegionAddCell takes region whichRegion, real x, real y returns nothing // 添加单元点(指定点) [R]----可以创建不规则区域 native RegionAddCellAtLoc takes region whichRegion, location whichLocation returns nothing // 移除单元点(指定坐标) [R] native RegionClearCell takes region whichRegion, real x, real y returns nothing // 移除单元点(指定点) [R] native RegionClearCellAtLoc takes region whichRegion, location whichLocation returns nothing
判断
// 单位检查 native IsUnitInRegion takes region whichRegion, unit whichUnit returns boolean // 包含坐标 native IsPointInRegion takes region whichRegion, real x, real y returns boolean // 包含点 native IsLocationInRegion takes region whichRegion, location whichLocation returns boolean
触发器
任务
属性
生命周期
// Quest API // 新建任务--新建一个任务.注:这条毫无用处,别用——everguo [R] native CreateQuest takes nothing returns quest // 销毁任务--被删除的任务将不再显示在任务列表 native DestroyQuest takes quest whichQuest returns nothing
任务文本
// 设置任务标题 native QuestSetTitle takes quest whichQuest, string title returns nothing // 设置任务介绍--设置 ${Quest} 的任务说明为: ${文字} native QuestSetDescription takes quest whichQuest, string description returns nothing
任务图标
// 设置任务图标 native QuestSetIconPath takes quest whichQuest, string iconPath returns nothing
必须完成
//设置任务是必需的--类似于主线任务 native QuestSetRequired takes quest whichQuest, boolean required returns nothing // 任务是必须完成的 native IsQuestRequired takes quest whichQuest returns boolean
任务状态
//设置任务完成 native QuestSetCompleted takes quest whichQuest, boolean completed returns nothing //设置任务被发现 native QuestSetDiscovered takes quest whichQuest, boolean discovered returns nothing //设置任务失败 native QuestSetFailed takes quest whichQuest, boolean failed returns nothing // 启用/禁用 任务--被禁用的任务将不会显示在任务列表 [R] native QuestSetEnabled takes quest whichQuest, boolean enabled returns nothing
// 任务完成 native IsQuestCompleted takes quest whichQuest returns boolean // 任务找到 native IsQuestDiscovered takes quest whichQuest returns boolean // 任务失败 native IsQuestFailed takes quest whichQuest returns boolean // 允许任务 native IsQuestEnabled takes quest whichQuest returns boolean
任务项目
// 创建任务项目 native QuestCreateItem takes quest whichQuest returns questitem // 改变任务项目说明 native QuestItemSetDescription takes questitem whichQuestItem, string description returns nothing // 设置任务项目完成 native QuestItemSetCompleted takes questitem whichQuestItem, boolean completed returns nothing // 任务项目完成 native IsQuestItemCompleted takes questitem whichQuestItem returns boolean
失败条件
// 创建失败条件--失败条件会在每个任务中显示 native CreateDefeatCondition takes nothing returns defeatcondition // 被删除的失败条件会从每个任务中移除 native DestroyDefeatCondition takes defeatcondition whichCondition returns nothing // 改变失败条件说明 native DefeatConditionSetDescription takes defeatcondition whichCondition, string description returns nothing
声音
基础
属性
截断距离
//设置声音截断距离--地图距离,玩家镜头距离音源超过该范围则切断声音 native SetSoundDistanceCutoff takes sound soundHandle, real cutoff returns nothing
多通道
声音的通道
//设置声音的通道,也就是对声音分组,然后可以调整每个组的音量 native SetSoundChannel takes sound soundHandle, integer channel returns nothing
音量
// 设置多通道音量--设置 ${Volume Channel} 的音量为 ${Volume} [R] //音量取值范围0-1 native VolumeGroupSetVolume takes volumegroup vgroup, real scale returns nothing //重置所有通道音量为预设值 native VolumeGroupReset takes nothing returns nothing
参数
vgrop
//单位移动声音 constant volumegroup SOUND_VOLUMEGROUP_UNITMOVEMENT = ConvertVolumeGroup(0) //单位回应声音 constant volumegroup SOUND_VOLUMEGROUP_UNITSOUNDS = ConvertVolumeGroup(1) //战斗声音 constant volumegroup SOUND_VOLUMEGROUP_COMBAT = ConvertVolumeGroup(2) //动画和法术声音 constant volumegroup SOUND_VOLUMEGROUP_SPELLS = ConvertVolumeGroup(3) //UI用户界面声音 constant volumegroup SOUND_VOLUMEGROUP_UI = ConvertVolumeGroup(4) //音乐 constant volumegroup SOUND_VOLUMEGROUP_MUSIC = ConvertVolumeGroup(5) //环境音 constant volumegroup SOUND_VOLUMEGROUP_AMBIENTSOUNDS = ConvertVolumeGroup(6) //火焰声音 constant volumegroup SOUND_VOLUMEGROUP_FIRE = ConvertVolumeGroup(7)
音效音量
// 设置音效音量--音量取值范围0-127 [R] native SetSoundVolume takes sound soundHandle, integer volume returns nothing
速率
//设置 ${音效} 的速率为 ${数值}--表示正常速率的倍数 native SetSoundPitch takes sound soundHandle, real pitch returns nothing
3D音效
3D音效衰减范围
// these calls are only valid if the sound was created with 3d enabled--只有在启用 3d 的情况下创建声音时,这些调用才有效--该动作仅用于3D音效. 注意不一定要达到最大范围,音量衰减到一定程度也会变没的 // 设置3D音效衰减范围--设置 ${3D音效} 的衰减最小范围: ${数值} 最大范围: ${数值} native SetSoundDistances takes sound soundHandle, real minDist, real maxDist returns nothing
声锥角度
//设置声锥角度 native SetSoundConeAngles takes sound soundHandle, real inside, real outside, integer outsideVolume returns nothing
声锥方向
//设置声锥方向 native SetSoundConeOrientation takes sound soundHandle, real x, real y, real z returns nothing
位置
// 设置3D音效位置(指定坐标) [R] native SetSoundPosition takes sound soundHandle, real x, real y, real z returns nothing //将 ${3D音效} 绑定到 ${单位} native AttachSoundToUnit takes sound soundHandle, unit whichUnit returns nothing
声速
//设置声速 native SetSoundVelocity takes sound soundHandle, real x, real y, real z returns nothing
持续时间
//设置声音持续时间 native SetSoundDuration takes sound soundHandle, integer duration returns nothing //获取声音持续时间 native GetSoundDuration takes sound soundHandle returns integer //获取声音文件持续时间 native GetSoundFileDuration takes string musicFileName returns integer
函数
声音环境
//新声音环境 native NewSoundEnvironment takes string environmentName returns nothing
生命周期
//创建声音--[eaxSetting--扩展字符串,好像没什么作用] native CreateSound takes string fileName, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate, string eaxSetting returns sound //创建声音,但将slk中某个声音的设置应用于此声音,这些设置位于以下 SLK 文件的标签下: /* UI\SoundInfo\AbilitySounds.slk UI\SoundInfo\AmbienceSounds.slk UI\SoundInfo\AnimSounds.slk UI\SoundInfo\DialogSounds.slk UI\SoundInfo\UISounds.slk UI\SoundInfo\UnitAckSounds.slk UI\SoundInfo\UnitCombatSounds.slk */ native CreateSoundFilenameWithLabel takes string fileName, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate, string SLKEntryName returns sound //使用slk中的声音模板创建声音 native CreateSoundFromLabel takes string soundLabel, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate returns sound //销毁声音 native KillSoundWhenDone takes sound soundHandle returns nothing //创建数字音乐--MIDI 的文件大小都非常小。MIDI 是为器乐制作的,因此您不会找到任何有人唱歌的 MIDI 文件。https://www.hiveworkshop.com/threads/using-midi-music-in-wc3.217591/ native CreateMIDISound takes string soundLabel, integer fadeInRate, integer fadeOutRate returns sound
属性替换
//使用slk文件中的某个声音属性替换现有声音的属性 native SetSoundParamsFromLabel takes sound soundHandle, string soundLabel returns nothing
播放
普通
//播放声音 native StartSound takes sound soundHandle returns nothing // the following method must be called immediately after calling "StartSound"--调用“StartSound”后必须立即调用以下方法 // 设置音效播放时间点--设置 ${音效} 的播放时间点为 ${Offset} 毫秒 [R] //音效必须是正在播放的. 不能用于3D音效 native SetSoundPlayPosition takes sound soundHandle, integer millisecs returns nothing //停止声音 native StopSound takes sound soundHandle, boolean killWhenDone, boolean fadeOut returns nothing
//获取音效播放状态 native GetSoundIsPlaying takes sound soundHandle returns boolean
矩形区域
//在矩形区域中播放声音 native RegisterStackedSound takes sound soundHandle, boolean byPosition, real rectwidth, real rectheight returns nothing //取消在矩形区域中播放声音 native UnregisterStackedSound takes sound soundHandle, boolean byPosition, real rectwidth, real rectheight returns nothing
加载
//获取音效是否正在加载 native GetSoundIsLoading takes sound soundHandle returns boolean
技能音效
//获取技能音效--通过技能名--同样,实际上就是技能编辑器中按Ctrl+D看到的文本内容 native GetAbilitySound takes string abilityString, soundtype t returns string //获取技能音效--通过技能id native GetAbilitySoundById takes integer abilityId, soundtype t returns string
封装
函数
背景音乐
设置源
// Music Interface. Note that if music is disabled, these calls do nothing--音乐界面。 请注意,如果音乐被禁用,这些调用不会执行任何操作 // 设置背景音乐列表--设置背景音乐列表为: ${Music} , ${允许/禁止} 随机播放, 开始播放序号为 ${Index} [R] //可指定播放文件或播放目录 native SetMapMusic takes string musicName, boolean random, integer index returns nothing //清空背景音乐列表 native ClearMapMusic takes nothing returns nothing
播放
//播放背景音乐 native PlayMusic takes string musicName returns nothing //播放 ${背景音乐} ,跳过开始 ${Offset} 秒,淡入时间: ${Fade Time} 秒 native PlayMusicEx takes string musicName, integer frommsecs, integer fadeinmsecs returns nothing //停止背景音乐 ${渐出/立即} native StopMusic takes boolean fadeOut returns nothing //恢复背景音乐 native ResumeMusic takes nothing returns nothing
// 设置背景音乐播放时间点--设置当前背景音乐的播放时间点为 ${Offset} 毫秒 [R] native SetMusicPlayPosition takes integer millisecs returns nothing
音量
// 设置背景音乐音量--音量取值范围为0-127 [R] native SetMusicVolume takes integer volume returns nothing
主题音乐
播放
// 播放主题音乐--播放主题音乐一次,然后恢复原来的音乐 [C] native PlayThematicMusic takes string musicFileName returns nothing // 跳播主题音乐--播放 ${Music Theme} 主题音乐,跳过开始 ${Offset} 毫秒 [R] native PlayThematicMusicEx takes string musicFileName, integer frommsecs returns nothing // 停止主题音乐[C] native EndThematicMusic takes nothing returns nothing
// 设置主题音乐播放时间点--设置当前主题音乐播放时间点为 ${Offset} 毫秒 [R] native SetThematicMusicPlayPosition takes integer millisecs returns nothing
音量
//设置主题音乐音量--重制版 native SetThematicMusicVolume takes integer volume returns nothing
电影与声音
面部动画
//设置声音面部动画名称(将声音和面部动画绑定)--重制版 native SetSoundFacialAnimationLabel takes sound soundHandle, string animationLabel returns boolean //设置声音面部动画组名称--重制版 native SetSoundFacialAnimationGroupLabel takes sound soundHandle, string groupLabel returns boolean //设置声音面部动画集文件路径--重制版 native SetSoundFacialAnimationSetFilepath takes sound soundHandle, string animationSetFilepath returns boolean
对话
//Subtitle support that is attached to the soundHandle rather than as disperate data with the legacy UI--附加到 soundHandle 的字幕支持,而不是使用旧版 UI 分散数据 //设置对话者姓名键(将声音和对话者姓名绑定)--重制版 native SetDialogueSpeakerNameKey takes sound soundHandle, string speakerName returns boolean //获取对话者姓名键--重制版 native GetDialogueSpeakerNameKey takes sound soundHandle returns string //设置对话文本键--重制版 native SetDialogueTextKey takes sound soundHandle, string dialogueText returns boolean //获取对话文本键--重制版 native GetDialogueTextKey takes sound soundHandle returns string
图像
属性
显隐
// 显示/隐藏 [R] native ShowImage takes image whichImage, boolean flag returns nothing
高度
// 改变图像高度--设置 ${Image} ${Enable/Disable} Z轴显示,并设置高度为 ${Height}--使用这个函数才能设置图像高度 native SetImageConstantHeight takes image whichImage, boolean flag, real height returns nothing
位置
// 改变图像位置(指定坐标)--改变 ${Image} 的位置为(${X},${Y}),Z轴偏移为 ${Z} [R] native SetImagePosition takes image whichImage, real x, real y, real z returns nothing
颜色
// 改变图像颜色--颜色格式为(红,绿,蓝). Alpha值为0是不可见的. 颜色值和Alpha值取值范围0-255 [R] native SetImageColor takes image whichImage, integer red, integer green, integer blue, integer alpha returns nothing
渲染状态
// 改变图像着色状态--未发现有任何作用 native SetImageRender takes image whichImage, boolean flag returns nothing // 改变图像永久着色状态--要显示图像则必须开启该项 native SetImageRenderAlways takes image whichImage, boolean flag returns nothing
水上渲染
// 改变图像水上状态--设置 ${Image} : ${Enable/Disable} 水面显示, ${Enable/Disable} 水的Alpha通道 //如果标志为真,则在水面上绘制指定图像。第二个布尔值开启时(useWaterAlpha)会显著降低水面下图像的透明度,从而更好地与水体进行混合。 //imageType大于1(ImageTypeSelection)的类型都无法在深水区域上显示。 native SetImageAboveWater takes image whichImage, boolean flag, boolean useWaterAlpha returns nothing
图像类型
// 改变图像类型 native SetImageType takes image whichImage, integer imageType returns nothing
参数
imageType
0=阴影 //无法正常显示图像 1=选择 //很亮 2=指示器 //同样很亮 3=闭塞标志 //同样很亮 4=地面纹理变化 //跟地面纹理差不多亮度 5=最顶端 //无法正常显示图像
函数
生命周期
// 新建图像--新建图像: ${Image} 大小:(${X},${Y},${Z}) 创建点:(${X},${Y},${Z}) 原点坐标:(${X},${Y},${Z}) 图像类型: ${Type} [R] //使用'图像 - 设置永久渲染状态'动作才能显示图像. 大小、创建点和原点格式为(X,Y,Z). 创建点作为图像的左下角位置. 会创建图像 //图像默认原点(或者说锚点)为图像左下角,如果将图像原点修改为Size/2,则可以使用图像的中间点作为锚点进行放置 使用'图像 - 设置永久渲染状态'才能显示图像. 创建点作为图像的左下角位置. 该功能存在Bug,会在图像上和右面多出256象素. 所以需要支持Alpha通道的图像且上和右面最后一行像素为透明才能完美显示 */ native CreateImage takes string file, real sizeX, real sizeY, real sizeZ, real posX, real posY, real posZ, real originX, real originY, real originZ, integer imageType returns image // 删除图像 native DestroyImage takes image whichImage returns nothing
参数
imageType
0=阴影 //无法正常显示图像 1=选择 //很亮 2=指示器 //同样很亮 3=闭塞标志 //同样很亮 4=地面纹理变化 //跟地面纹理差不多亮度 5=最顶端 //无法正常显示图像
工具
计时器
函数
cj
// 新建计时器 [R] native CreateTimer takes nothing returns timer // 删除计时器 [R] native DestroyTimer takes timer whichTimer returns nothing // 运行计时器 [C] // @param whichTimer 计时器对象 // @param timeout 超时 // @param periodic 是否循环 native TimerStart takes timer whichTimer, real timeout, boolean periodic, code handlerFunc returns nothing // 计时器经过的时间 native TimerGetElapsed takes timer whichTimer returns real // 计时器剩余时间 native TimerGetRemaining takes timer whichTimer returns real // 计时器初始的时间 native TimerGetTimeout takes timer whichTimer returns real // 暂停计时器 [R] native PauseTimer takes timer whichTimer returns nothing // 恢复计时器 [R] native ResumeTimer takes timer whichTimer returns nothing // 事件响应 - 计时器期满 // 与TimerStart一同使用,在TimerStart的回调函数中使用,以便获取调用此函数的计时器对象 native GetExpiredTimer takes nothing returns timer
触发器对象
函数
cj
基础
基础
// 新建触发 [R] native CreateTrigger takes nothing returns trigger // 删除触发器 [R] native DestroyTrigger takes trigger whichTrigger returns nothing // 重置触发 native ResetTrigger takes trigger whichTrigger returns nothing // 打开触发器 native EnableTrigger takes trigger whichTrigger returns nothing // 关掉触发器 native DisableTrigger takes trigger whichTrigger returns nothing // 触发器打开 native IsTriggerEnabled takes trigger whichTrigger returns boolean // 挂起触发 native TriggerWaitOnSleeps takes trigger whichTrigger, boolean flag returns nothing // 触发是否挂起 native IsTriggerWaitOnSleeps takes trigger whichTrigger returns boolean
// 触发器睡眠--单位 秒 native TriggerSleepAction takes real timeout returns nothing
// @deprecated--已弃用--等待声音继续播放多少时间(如果超过声音持续时间,则直接触发) //该功能只对于当前播放的3D-音效有效. 如果该音效未播放或已经结束, 则该功能无效. native TriggerWaitForSound takes sound s, real offset returns nothing
// 运行触发器 (忽略条件) native TriggerExecute takes trigger whichTrigger returns nothing // 运行触发器 (忽略条件) // @deprecated--已弃用 native TriggerExecuteWait takes trigger whichTrigger returns nothing
条件
// 添加触发器限制条件 native TriggerAddCondition takes trigger whichTrigger, boolexpr condition returns triggercondition // 移除触发器限制条件 native TriggerRemoveCondition takes trigger whichTrigger, triggercondition whichCondition returns nothing // 清空触发器限制条件 native TriggerClearConditions takes trigger whichTrigger returns nothing
// 触发器条件是否成立 native TriggerEvaluate takes trigger whichTrigger returns boolean
动作
// 添加触发器动作 native TriggerAddAction takes trigger whichTrigger, code actionFunc returns triggeraction // 移除触发器动作 native TriggerRemoveAction takes trigger whichTrigger, triggeraction whichAction returns nothing // 清空触发器动作 native TriggerClearActions takes trigger whichTrigger returns nothing
同步
native TriggerSyncStart takes nothing returns nothing native TriggerSyncReady takes nothing returns nothing
参考
https://www.hiveworkshop.com/threads/a-really-really-ridiculously-easy-way-to-sync-data-new-gethost-command.114475/
工具
// 当前触发器 constant native GetTriggeringTrigger takes nothing returns trigger // 获取触发了的事件ID constant native GetTriggerEventId takes nothing returns eventid // 触发器赋值统计 constant native GetTriggerEvalCount takes trigger whichTrigger returns integer // 触发器运行次数统计 constant native GetTriggerExecCount takes trigger whichTrigger returns integer
回调参数获取
// 匹配的单位 constant native GetFilterUnit takes nothing returns unit // 选取的单位 constant native GetEnumUnit takes nothing returns unit // 匹配的可毁坏物 constant native GetFilterDestructable takes nothing returns destructable // 选取的可毁坏物 constant native GetEnumDestructable takes nothing returns destructable // 匹配的物品 constant native GetFilterItem takes nothing returns item // 选取的物品 constant native GetEnumItem takes nothing returns item // 解析tags constant native ParseTags takes string taggedString returns string // 匹配的玩家 constant native GetFilterPlayer takes nothing returns player // 选取的玩家 constant native GetEnumPlayer takes nothing returns player
容器
数学容器
坐标点
函数
cj
// 转换坐标到点 native Location takes real x, real y returns location // 清除点 [R] native RemoveLocation takes location whichLocation returns nothing // 移动点 [R] native MoveLocation takes location whichLocation, real newX, real newY returns nothing // X 坐标 native GetLocationX takes location whichLocation returns real // Y 坐标 native GetLocationY takes location whichLocation returns real // This function is asynchronous. The values it returns are not guaranteed synchronous between each player. // If you attempt to use it in a synchronous manner, it may cause a desync. //这个函数是异步的。 它返回的值不保证每个播放器之间的同步。 如果您尝试以同步方式使用它,可能会导致不同步。 // 点的Z轴高度 [R] native GetLocationZ takes location whichLocation returns real
矩形
函数
cj
// 将坐标转换为区域 native Rect takes real minx, real miny, real maxx, real maxy returns rect // 将点转换为区域 native RectFromLoc takes location min, location max returns rect // 删除矩形区域 [R] native RemoveRect takes rect whichRect returns nothing // 设置矩形区域(指定坐标) [R] native SetRect takes rect whichRect, real minx, real miny, real maxx, real maxy returns nothing // 设置矩形区域(指定点) [R] native SetRectFromLoc takes rect whichRect, location min, location max returns nothing // 移动矩形区域(指定坐标) [R] native MoveRectTo takes rect whichRect, real newCenterX, real newCenterY returns nothing // 移动区域 native MoveRectToLoc takes rect whichRect, location newCenterLoc returns nothing // 区域中心的 X 坐标 native GetRectCenterX takes rect whichRect returns real // 区域中心的 Y 坐标 native GetRectCenterY takes rect whichRect returns real // 区域最小 X 坐标 native GetRectMinX takes rect whichRect returns real // 区域最小 Y 坐标 native GetRectMinY takes rect whichRect returns real // 区域最大 X 坐标 native GetRectMaxX takes rect whichRect returns real // 区域最大 Y 坐标 native GetRectMaxY takes rect whichRect returns real
哈希表
生命周期
// <1.24> 新建哈希表 [C] native InitHashtable takes nothing returns hashtable // <1.24> 清空哈希表 [C] native FlushParentHashtable takes hashtable table returns nothing // <1.24> 清空哈希表主索引 [C] native FlushChildHashtable takes hashtable table, integer parentKey returns nothing
存入
// <1.24> 保存整数 [C] native SaveInteger takes hashtable table, integer parentKey, integer childKey, integer value returns nothing // <1.24> 保存实数 [C] native SaveReal takes hashtable table, integer parentKey, integer childKey, real value returns nothing // <1.24> 保存布尔 [C] native SaveBoolean takes hashtable table, integer parentKey, integer childKey, boolean value returns nothing // <1.24> 保存字符串 [C] native SaveStr takes hashtable table, integer parentKey, integer childKey, string value returns boolean // <1.24> 保存玩家 [C] native SavePlayerHandle takes hashtable table, integer parentKey, integer childKey, player whichPlayer returns boolean native SaveWidgetHandle takes hashtable table, integer parentKey, integer childKey, widget whichWidget returns boolean // <1.24> 保存可破坏物 [C] native SaveDestructableHandle takes hashtable table, integer parentKey, integer childKey, destructable whichDestructable returns boolean // <1.24> 保存物品 [C] native SaveItemHandle takes hashtable table, integer parentKey, integer childKey, item whichItem returns boolean // <1.24> 保存单位 [C] native SaveUnitHandle takes hashtable table, integer parentKey, integer childKey, unit whichUnit returns boolean native SaveAbilityHandle takes hashtable table, integer parentKey, integer childKey, ability whichAbility returns boolean // <1.24> 保存计时器 [C] native SaveTimerHandle takes hashtable table, integer parentKey, integer childKey, timer whichTimer returns boolean // <1.24> 保存触发器 [C] native SaveTriggerHandle takes hashtable table, integer parentKey, integer childKey, trigger whichTrigger returns boolean // <1.24> 保存触发条件 [C] native SaveTriggerConditionHandle takes hashtable table, integer parentKey, integer childKey, triggercondition whichTriggercondition returns boolean // <1.24> 保存触发动作 [C] native SaveTriggerActionHandle takes hashtable table, integer parentKey, integer childKey, triggeraction whichTriggeraction returns boolean // <1.24> 保存触发事件 [C] native SaveTriggerEventHandle takes hashtable table, integer parentKey, integer childKey, event whichEvent returns boolean // <1.24> 保存玩家组 [C] native SaveForceHandle takes hashtable table, integer parentKey, integer childKey, force whichForce returns boolean // <1.24> 保存单位组 [C] native SaveGroupHandle takes hashtable table, integer parentKey, integer childKey, group whichGroup returns boolean // <1.24> 保存点 [C] native SaveLocationHandle takes hashtable table, integer parentKey, integer childKey, location whichLocation returns boolean // <1.24> 保存区域(矩型) [C] native SaveRectHandle takes hashtable table, integer parentKey, integer childKey, rect whichRect returns boolean // <1.24> 保存布尔表达式 [C] native SaveBooleanExprHandle takes hashtable table, integer parentKey, integer childKey, boolexpr whichBoolexpr returns boolean // <1.24> 保存音效 [C] native SaveSoundHandle takes hashtable table, integer parentKey, integer childKey, sound whichSound returns boolean // <1.24> 保存特效 [C] native SaveEffectHandle takes hashtable table, integer parentKey, integer childKey, effect whichEffect returns boolean // <1.24> 保存单位池 [C] native SaveUnitPoolHandle takes hashtable table, integer parentKey, integer childKey, unitpool whichUnitpool returns boolean // <1.24> 保存物品池 [C] native SaveItemPoolHandle takes hashtable table, integer parentKey, integer childKey, itempool whichItempool returns boolean // <1.24> 保存任务 [C] native SaveQuestHandle takes hashtable table, integer parentKey, integer childKey, quest whichQuest returns boolean // <1.24> 保存任务要求 [C] native SaveQuestItemHandle takes hashtable table, integer parentKey, integer childKey, questitem whichQuestitem returns boolean // <1.24> 保存失败条件 [C] native SaveDefeatConditionHandle takes hashtable table, integer parentKey, integer childKey, defeatcondition whichDefeatcondition returns boolean // <1.24> 保存计时器窗口 [C] native SaveTimerDialogHandle takes hashtable table, integer parentKey, integer childKey, timerdialog whichTimerdialog returns boolean // <1.24> 保存排行榜 [C] native SaveLeaderboardHandle takes hashtable table, integer parentKey, integer childKey, leaderboard whichLeaderboard returns boolean // <1.24> 保存多面板 [C] native SaveMultiboardHandle takes hashtable table, integer parentKey, integer childKey, multiboard whichMultiboard returns boolean // <1.24> 保存多面板项目 [C] native SaveMultiboardItemHandle takes hashtable table, integer parentKey, integer childKey, multiboarditem whichMultiboarditem returns boolean // <1.24> 保存可追踪物 [C] native SaveTrackableHandle takes hashtable table, integer parentKey, integer childKey, trackable whichTrackable returns boolean // <1.24> 保存对话框 [C] native SaveDialogHandle takes hashtable table, integer parentKey, integer childKey, dialog whichDialog returns boolean // <1.24> 保存对话框按钮 [C] native SaveButtonHandle takes hashtable table, integer parentKey, integer childKey, button whichButton returns boolean // <1.24> 保存漂浮文字 [C] native SaveTextTagHandle takes hashtable table, integer parentKey, integer childKey, texttag whichTexttag returns boolean // <1.24> 保存闪电效果 [C] native SaveLightningHandle takes hashtable table, integer parentKey, integer childKey, lightning whichLightning returns boolean // <1.24> 保存图像 [C] native SaveImageHandle takes hashtable table, integer parentKey, integer childKey, image whichImage returns boolean // <1.24> 保存地面纹理变化 [C] native SaveUbersplatHandle takes hashtable table, integer parentKey, integer childKey, ubersplat whichUbersplat returns boolean // <1.24> 保存区域(不规则) [C] native SaveRegionHandle takes hashtable table, integer parentKey, integer childKey, region whichRegion returns boolean // <1.24> 保存迷雾状态 [C] native SaveFogStateHandle takes hashtable table, integer parentKey, integer childKey, fogstate whichFogState returns boolean // <1.24> 保存可见度修正器 [C] native SaveFogModifierHandle takes hashtable table, integer parentKey, integer childKey, fogmodifier whichFogModifier returns boolean // <1.24> 保存实体对象 [C] native SaveAgentHandle takes hashtable table, integer parentKey, integer childKey, agent whichAgent returns boolean // <1.24> 保存哈希表 [C] native SaveHashtableHandle takes hashtable table, integer parentKey, integer childKey, hashtable whichHashtable returns boolean // <1.29> 保存框架 native SaveFrameHandle takes hashtable table, integer parentKey, integer childKey, framehandle whichFrameHandle returns boolean
读取
// <1.24> 从哈希表提取整数 [C] native LoadInteger takes hashtable table, integer parentKey, integer childKey returns integer // <1.24> 从哈希表提取实数 [C] native LoadReal takes hashtable table, integer parentKey, integer childKey returns real // <1.24> 从哈希表提取布尔 [C] native LoadBoolean takes hashtable table, integer parentKey, integer childKey returns boolean // <1.24> 从哈希表提取字符串 [C] native LoadStr takes hashtable table, integer parentKey, integer childKey returns string // <1.24> 从哈希表提取玩家 [C] native LoadPlayerHandle takes hashtable table, integer parentKey, integer childKey returns player native LoadWidgetHandle takes hashtable table, integer parentKey, integer childKey returns widget // <1.24> 从哈希表提取可破坏物 [C] native LoadDestructableHandle takes hashtable table, integer parentKey, integer childKey returns destructable // <1.24> 从哈希表提取物品 [C] native LoadItemHandle takes hashtable table, integer parentKey, integer childKey returns item // <1.24> 从哈希表提取单位 [C] native LoadUnitHandle takes hashtable table, integer parentKey, integer childKey returns unit native LoadAbilityHandle takes hashtable table, integer parentKey, integer childKey returns ability // <1.24> 从哈希表提取计时器 [C] native LoadTimerHandle takes hashtable table, integer parentKey, integer childKey returns timer // <1.24> 从哈希表提取触发器 [C] native LoadTriggerHandle takes hashtable table, integer parentKey, integer childKey returns trigger // <1.24> 从哈希表提取触发条件 [C] native LoadTriggerConditionHandle takes hashtable table, integer parentKey, integer childKey returns triggercondition // <1.24> 从哈希表提取触发动作 [C] native LoadTriggerActionHandle takes hashtable table, integer parentKey, integer childKey returns triggeraction // <1.24> 从哈希表提取触发事件 [C] native LoadTriggerEventHandle takes hashtable table, integer parentKey, integer childKey returns event // <1.24> 从哈希表提取玩家组 [C] native LoadForceHandle takes hashtable table, integer parentKey, integer childKey returns force // <1.24> 从哈希表提取单位组 [C] native LoadGroupHandle takes hashtable table, integer parentKey, integer childKey returns group // <1.24> 从哈希表提取点 [C] native LoadLocationHandle takes hashtable table, integer parentKey, integer childKey returns location // <1.24> 从哈希表提取区域(矩型) [C] native LoadRectHandle takes hashtable table, integer parentKey, integer childKey returns rect // <1.24> 从哈希表提取布尔表达式 [C] native LoadBooleanExprHandle takes hashtable table, integer parentKey, integer childKey returns boolexpr // <1.24> 从哈希表提取音效 [C] native LoadSoundHandle takes hashtable table, integer parentKey, integer childKey returns sound // <1.24> 从哈希表提取特效 [C] native LoadEffectHandle takes hashtable table, integer parentKey, integer childKey returns effect // <1.24> 从哈希表提取单位池 [C] native LoadUnitPoolHandle takes hashtable table, integer parentKey, integer childKey returns unitpool // <1.24> 从哈希表提取物品池 [C] native LoadItemPoolHandle takes hashtable table, integer parentKey, integer childKey returns itempool // <1.24> 从哈希表提取任务 [C] native LoadQuestHandle takes hashtable table, integer parentKey, integer childKey returns quest // <1.24> 从哈希表提取任务要求 [C] native LoadQuestItemHandle takes hashtable table, integer parentKey, integer childKey returns questitem // <1.24> 从哈希表提取失败条件 [C] native LoadDefeatConditionHandle takes hashtable table, integer parentKey, integer childKey returns defeatcondition // <1.24> 从哈希表提取计时器窗口 [C] native LoadTimerDialogHandle takes hashtable table, integer parentKey, integer childKey returns timerdialog // <1.24> 从哈希表提取排行榜 [C] native LoadLeaderboardHandle takes hashtable table, integer parentKey, integer childKey returns leaderboard // <1.24> 从哈希表提取多面板 [C] native LoadMultiboardHandle takes hashtable table, integer parentKey, integer childKey returns multiboard // <1.24> 从哈希表提取多面板项目 [C] native LoadMultiboardItemHandle takes hashtable table, integer parentKey, integer childKey returns multiboarditem // <1.24> 从哈希表提取可追踪物 [C] native LoadTrackableHandle takes hashtable table, integer parentKey, integer childKey returns trackable // <1.24> 从哈希表提取对话框 [C] native LoadDialogHandle takes hashtable table, integer parentKey, integer childKey returns dialog // <1.24> 从哈希表提取对话框按钮 [C] native LoadButtonHandle takes hashtable table, integer parentKey, integer childKey returns button // <1.24> 从哈希表提取漂浮文字 [C] native LoadTextTagHandle takes hashtable table, integer parentKey, integer childKey returns texttag // <1.24> 从哈希表提取闪电效果 [C] native LoadLightningHandle takes hashtable table, integer parentKey, integer childKey returns lightning // <1.24> 从哈希表提取图象 [C] native LoadImageHandle takes hashtable table, integer parentKey, integer childKey returns image // <1.24> 从哈希表提取地面纹理变化 [C] native LoadUbersplatHandle takes hashtable table, integer parentKey, integer childKey returns ubersplat // <1.24> 从哈希表提取区域(不规则) [C] native LoadRegionHandle takes hashtable table, integer parentKey, integer childKey returns region // <1.24> 从哈希表提取迷雾状态 [C] native LoadFogStateHandle takes hashtable table, integer parentKey, integer childKey returns fogstate // <1.24> 从哈希表提取可见度修正器 [C] native LoadFogModifierHandle takes hashtable table, integer parentKey, integer childKey returns fogmodifier // <1.24> 从哈希表提取哈希表 [C] native LoadHashtableHandle takes hashtable table, integer parentKey, integer childKey returns hashtable // <1.29> 从哈希表提取框架 native LoadFrameHandle takes hashtable table, integer parentKey, integer childKey returns framehandle
删除
//移除整数 native RemoveSavedInteger takes hashtable table, integer parentKey, integer childKey returns nothing //移除实数 native RemoveSavedReal takes hashtable table, integer parentKey, integer childKey returns nothing //移除布尔 native RemoveSavedBoolean takes hashtable table, integer parentKey, integer childKey returns nothing //移除字符串 native RemoveSavedString takes hashtable table, integer parentKey, integer childKey returns nothing //移除handle native RemoveSavedHandle takes hashtable table, integer parentKey, integer childKey returns nothing
判断
//是否保存有整数 native HaveSavedInteger takes hashtable table, integer parentKey, integer childKey returns boolean //是否保存有实现 native HaveSavedReal takes hashtable table, integer parentKey, integer childKey returns boolean //是否保存有布尔 native HaveSavedBoolean takes hashtable table, integer parentKey, integer childKey returns boolean //是否保存有字符串 native HaveSavedString takes hashtable table, integer parentKey, integer childKey returns boolean //是否保存有handle native HaveSavedHandle takes hashtable table, integer parentKey, integer childKey returns boolean
对象容器
游戏缓存
生命周期
//读取所有缓存--从本地硬盘读取缓存数据 //只对单机游戏有效,从本地硬盘读取缓存数据,主要用来实现战役关卡间的数据传递 native ReloadGameCachesFromDisk takes nothing returns boolean // 新建游戏缓存 [R] native InitGameCache takes string campaignFile returns gamecache // 保存游戏缓存--只对单机游戏有效,保存缓存数据到本地硬盘,主要用来实现战役关卡间的数据传递. native SaveGameCache takes gamecache whichCache returns boolean // 删除缓存 [C] native FlushGameCache takes gamecache cache returns nothing
存入
// 记录整数 native StoreInteger takes gamecache cache, string missionKey, string key, integer value returns nothing // 记录实数 native StoreReal takes gamecache cache, string missionKey, string key, real value returns nothing // 记录布尔值 native StoreBoolean takes gamecache cache, string missionKey, string key, boolean value returns nothing // 记录单位 native StoreUnit takes gamecache cache, string missionKey, string key, unit whichUnit returns boolean // 记录字符串 native StoreString takes gamecache cache, string missionKey, string key, string value returns boolean
删除
// 删除类别 native FlushStoredMission takes gamecache cache, string missionKey returns nothing // 删除整数 native FlushStoredInteger takes gamecache cache, string missionKey, string key returns nothing // 删除实数 native FlushStoredReal takes gamecache cache, string missionKey, string key returns nothing // 删除布尔值 native FlushStoredBoolean takes gamecache cache, string missionKey, string key returns nothing // 删除单位 native FlushStoredUnit takes gamecache cache, string missionKey, string key returns nothing // 删除字符串 native FlushStoredString takes gamecache cache, string missionKey, string key returns nothing
读取
// Will return 0 if the specified value's data is not found in the cache //如果在缓存中找不到指定值的数据,则将返回0 // 缓存读取整数 [C] native GetStoredInteger takes gamecache cache, string missionKey, string key returns integer // 缓存读取实数 [C] native GetStoredReal takes gamecache cache, string missionKey, string key returns real // 读取布尔值[R] native GetStoredBoolean takes gamecache cache, string missionKey, string key returns boolean // 读取字符串 [C] native GetStoredString takes gamecache cache, string missionKey, string key returns string // 恢复单位 native RestoreUnit takes gamecache cache, string missionKey, string key, player forWhichPlayer, real x, real y, real facing returns unit
判断
//判断是否存储的有整数 native HaveStoredInteger takes gamecache cache, string missionKey, string key returns boolean //判断是否存储的有实数 native HaveStoredReal takes gamecache cache, string missionKey, string key returns boolean //判断是否存储的有布尔 native HaveStoredBoolean takes gamecache cache, string missionKey, string key returns boolean //判断是否存储的有单位 native HaveStoredUnit takes gamecache cache, string missionKey, string key returns boolean //判断是否存储的有字符串 native HaveStoredString takes gamecache cache, string missionKey, string key returns boolean
同步
//同步存储的整数 native SyncStoredInteger takes gamecache cache, string missionKey, string key returns nothing //同步存储的实数 native SyncStoredReal takes gamecache cache, string missionKey, string key returns nothing //同步存储的布尔值 native SyncStoredBoolean takes gamecache cache, string missionKey, string key returns nothing //同步存储的单位 native SyncStoredUnit takes gamecache cache, string missionKey, string key returns nothing //同步存储的字符串 native SyncStoredString takes gamecache cache, string missionKey, string key returns nothing
单位池
生命周期
// 新建单位池 [R] native CreateUnitPool takes nothing returns unitpool // 删除单位池 [R] native DestroyUnitPool takes unitpool whichPool returns nothing
添加
// 添加单位类型--在 ${单位池} 中添加一个 ${单位} 比重为 ${数值} [R] // 比重越高被选择的机率越大 native UnitPoolAddUnitType takes unitpool whichPool, integer unitId, real weight returns nothing
删除
// 删除单位类型 [R] native UnitPoolRemoveUnitType takes unitpool whichPool, integer unitId returns nothing
取出
// 选择并放置单位--从 ${单位池} 中为 ${玩家} 任意选择一个单位并放置到点( ${X} , ${Y} ) 面向 ${度} [R] native PlaceRandomUnit takes unitpool whichPool, player forWhichPlayer, real x, real y, real facing returns unit
物品池
生命周期
// 新建物品池 [R] native CreateItemPool takes nothing returns itempool // 删除物品池 [R] native DestroyItemPool takes itempool whichItemPool returns nothing
添加
// 添加物品类型--权重越高被选择的机率越大 [R] native ItemPoolAddItemType takes itempool whichItemPool, integer itemId, real weight returns nothing
删除
// 删除物品类型 [R] native ItemPoolRemoveItemType takes itempool whichItemPool, integer itemId returns nothing
取出
// 选择并放置物品 [R] native PlaceRandomItem takes itempool whichItemPool, real x, real y returns item
单位组(Group)
生命周期
// 新建的单位组 [R] native CreateGroup takes nothing returns group // 删除单位组 [R] native DestroyGroup takes group whichGroup returns nothing // 清除 native GroupClear takes group whichGroup returns nothing
读取
// 获取单位组大小 native BlzGroupGetSize takes group whichGroup returns integer // 获取单位组中下标的单位 native BlzGroupUnitAt takes group whichGroup, integer index returns unit
添加/删除
单位组
// 单位组添加单位组 [快速的] native BlzGroupAddGroupFast takes group whichGroup, group addGroup returns integer
// 单位组移除单位组 [快速的] native BlzGroupRemoveGroupFast takes group whichGroup, group removeGroup returns integer
单位
直接
// 添加单位 [R] native GroupAddUnit takes group whichGroup, unit whichUnit returns boolean // 移除单位 [R] native GroupRemoveUnit takes group whichGroup, unit whichUnit returns boolean
根据名称
// 添加单位--选择指定名称的所有单位并过滤 native GroupEnumUnitsOfType takes group whichGroup, string unitname, boolexpr filter returns nothing // 添加单位--选择指定名称的所有单位并过滤 // @param countLimit 上限,最多只添加上限个单位 native GroupEnumUnitsOfTypeCounted takes group whichGroup, string unitname, boolexpr filter, integer countLimit returns nothing
根据玩家
// 添加单位--选择指定玩家的所有单位并过滤 native GroupEnumUnitsOfPlayer takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
//添加单位--选择某个玩家选择的单位 native GroupEnumUnitsSelected takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
根据范围
// 添加单位--选择矩形范围内的单位并过滤 native GroupEnumUnitsInRect takes group whichGroup, rect r, boolexpr filter returns nothing // 添加单位--选择矩形范围内的单位并过滤 // @param countLimit 上限 native GroupEnumUnitsInRectCounted takes group whichGroup, rect r, boolexpr filter, integer countLimit returns nothing
// 添加单位--选择圆形范围内的单位并过滤(坐标) native GroupEnumUnitsInRange takes group whichGroup, real x, real y, real radius, boolexpr filter returns nothing // 添加单位--选择圆形范围内的单位并过滤(点) native GroupEnumUnitsInRangeOfLoc takes group whichGroup, location whichLocation, real radius, boolexpr filter returns nothing // 添加单位--选择圆形范围内的单位并过滤(坐标)(不建议使用) // @deprecated native GroupEnumUnitsInRangeCounted takes group whichGroup, real x, real y, real radius, boolexpr filter, integer countLimit returns nothing // 添加单位--选择圆形范围内的单位并过滤(点)(不建议使用) // @deprecated native GroupEnumUnitsInRangeOfLocCounted takes group whichGroup, location whichLocation, real radius, boolexpr filter, integer countLimit returns nothing
发布命令
// 发送单位组命令到 没有目标 native GroupImmediateOrder takes group whichGroup, string order returns boolean // 发布命令(无目标)(ID) native GroupImmediateOrderById takes group whichGroup, integer order returns boolean // 发布命令(指定坐标) [R] native GroupPointOrder takes group whichGroup, string order, real x, real y returns boolean // 发送单位组命令到 点 native GroupPointOrderLoc takes group whichGroup, string order, location whichLocation returns boolean // 发布命令(指定坐标)(ID) native GroupPointOrderById takes group whichGroup, integer order, real x, real y returns boolean // 发布命令(指定点)(ID) native GroupPointOrderByIdLoc takes group whichGroup, integer order, location whichLocation returns boolean // 发送单位组命令到 单位 native GroupTargetOrder takes group whichGroup, string order, widget targetWidget returns boolean // 发布命令(指定单位)(ID) native GroupTargetOrderById takes group whichGroup, integer order, widget targetWidget returns boolean
遍历
// 单位组中第一个单位 native FirstOfGroup takes group whichGroup returns unit
// 选取所有单位在单位组做 多动作 native ForGroup takes group whichGroup, code callback returns nothing // 单位组中第一个单位
判断
// 单位在 单位组 constant native IsUnitInGroup takes unit whichUnit, group whichGroup returns boolean
玩家组(Force)
生命周期
// 新建玩家组 [R] native CreateForce takes nothing returns force // 删除玩家组 [R] native DestroyForce takes force whichForce returns nothing
添加/删除
// 添加玩家 [R] native ForceAddPlayer takes force whichForce, player whichPlayer returns nothing // 移除玩家 [R] native ForceRemovePlayer takes force whichForce, player whichPlayer returns nothing
// 添加玩家--选择所有玩家并过滤 native ForceEnumPlayers takes force whichForce, boolexpr filter returns nothing // 添加玩家--选择所有玩家并过滤 // @param countLimit 上限 native ForceEnumPlayersCounted takes force whichForce, boolexpr filter, integer countLimit returns nothing // 添加玩家--选择某个玩家联盟玩家并过滤 native ForceEnumAllies takes force whichForce, player whichPlayer, boolexpr filter returns nothing // 添加玩家--选择某个玩家的敌对玩家并过滤 native ForceEnumEnemies takes force whichForce, player whichPlayer, boolexpr filter returns nothing
// 清除玩家组 native ForceClear takes force whichForce returns nothing
获取
//是否有玩家 native BlzForceHasPlayer takes force whichForce, player whichPlayer returns boolean
遍历
// 选取所有玩家在玩家组做动作(单一的) native ForForce takes force whichForce, code callback returns nothing
判断
// 单位是否在指定队伍里 constant native IsUnitInForce takes unit whichUnit, force whichForce returns boolean
// 玩家在玩家组 constant native IsPlayerInForce takes player whichPlayer, force whichForce returns boolean
UI
UI控件
基础控件
复合控件
对话框
常量
事件
//对话框事件 - 对话框按钮被点击 constant dialogevent EVENT_DIALOG_BUTTON_CLICK = ConvertDialogEvent(90) //对话框事件 - 对话框被点击 constant dialogevent EVENT_DIALOG_CLICK = ConvertDialogEvent(91)
触发器
// 对话框被点击 native TriggerRegisterDialogEvent takes trigger whichTrigger, dialog whichDialog returns event // 对话框按钮被点击 [R] native TriggerRegisterDialogButtonEvent takes trigger whichTrigger, button whichButton returns event
回调参数获取
// EVENT_DIALOG_BUTTON_CLICK // 获取点击按钮 constant native GetClickedButton takes nothing returns button // 获取点击对话框 constant native GetClickedDialog takes nothing returns dialog
内容
// 清空对话框--清除对话框的标题和按钮 native DialogClear takes dialog whichDialog returns nothing // 设置对话框信息--改变 ${Dialog} 的标题为 ${Title} native DialogSetMessage takes dialog whichDialog, string messageText returns nothing
按钮
// 添加对话框按钮 [R] native DialogAddButton takes dialog whichDialog, string buttonText, integer hotkey returns button // 添加退出游戏按钮 [R]--为 ${对话框} 添加退出游戏按钮(${跳过} 计分屏) 按钮标题为: ${文字} 快捷键为: ${HotKey} //该函数创建的按钮并不被纪录到'最后创建的对话框按钮'.当该按钮被点击时会退出游戏 native DialogAddQuitButton takes dialog whichDialog, boolean doScoreScreen, string buttonText, integer hotkey returns button
管理器
生命周期
// 新建对话框 [R] native DialogCreate takes nothing returns dialog // 删除对话框 [R] native DialogDestroy takes dialog whichDialog returns nothing // 显示/隐藏 [R] native DialogDisplay takes player whichPlayer, dialog whichDialog, boolean flag returns nothing
漂浮文字
生命周期
// 新建漂浮文字 [R] native CreateTextTag takes nothing returns texttag native DestroyTextTag takes texttag t returns nothing //暂停状态暂停漂浮文字的移动和生命计时 native SetTextTagSuspended takes texttag t, boolean flag returns nothing //设置永久显示 native SetTextTagPermanent takes texttag t, boolean flag returns nothing //设置 ${Floating Text} 的已存在时间为 ${Time} 秒 //该动作并不影响永久性漂浮文字 native SetTextTagAge takes texttag t, real age returns nothing //设置 ${Floating Text} 的显示时间为 ${Time} 秒 //该动作并不影响永久性漂浮文字. 当显示时间到期时,系统会自动清除该漂浮文字 native SetTextTagLifespan takes texttag t, real lifespan returns nothing //设置 ${Floating Text} 的渐变消逝时间点为 ${Time} 秒 //该动作并不影响永久性漂浮文字. 当漂浮文字存在时间到达该值时会开始淡化消逝 native SetTextTagFadepoint takes texttag t, real fadepoint returns nothing
显隐
// 显示/隐藏 (所有玩家)--对所有玩家 ${Show/Hide} ${Floating Text} [R] native SetTextTagVisibility takes texttag t, boolean flag returns nothing
内容
// 改变文字内容--改变 ${Floating Text} 的内容为 ${文字} ,字体大小: ${Size} [R] //采用原始字体大小单位. 字体大小不能超过0.5 native SetTextTagText takes texttag t, string s, real height returns nothing
位置
// 改变位置(坐标)--改变 ${Floating Text} 的位置为(${X},${Y}) ,Z轴高度为 ${Z} [R] native SetTextTagPos takes texttag t, real x, real y, real heightOffset returns nothing //改变 ${Floating Text} 的位置到 ${单位} 头顶Z轴偏移 ${Z} 处 native SetTextTagPosUnit takes texttag t, unit whichUnit, real heightOffset returns nothing
颜色
// 改变颜色 [R] native SetTextTagColor takes texttag t, integer red, integer green, integer blue, integer alpha returns nothing
速度
// 设置速率--设置 ${Floating Text} 的X轴速率: ${XSpeed} ,Y轴速率: ${YSpeed} [R] //对移动后的漂浮文字设置速率,该漂浮文字会先回到原点再向设定的角度移动. 这里的1约等于游戏中的1800速度 native SetTextTagVelocity takes texttag t, real xvel, real yvel returns nothing
属性
变换
锚点
重制版
// 清空Frame锚点--重制版 native BlzFrameClearAllPoints takes framehandle frame returns nothing // 设置所有锚点到目标frame上--重制版 native BlzFrameSetAllPoints takes framehandle frame, framehandle relative returns nothing
位置
老版本
// 设置窗体相对位置 // @param point [0:左上|1:上|2:右上|3:左|4:中|5:右|6:左下|7:下|8:右下] // @param relativeFrame 相对容器,一般使用DzGetGameUI() frame窗体会根据relativeFrame确定自己的位置,当relativeFrame窗体移动时frame窗体也会相对移动 // @param relativePoint [0:左上|1:上|2:右上|3:左|4:中|5:右|6:左下|7:下|8:右下] // @param x 为0.8比例 // @param y 为0.6比例 native DzFrameSetPoint takes integer frame, integer point, integer relativeFrame, integer relativePoint, real x, real y returns nothing // 设置窗体绝对位置 // @param point [0:左上|1:上|2:右上|3:左|4:中|5:右|6:左下|7:下|8:右下] // @param x 为0.8比例 // @param y 为0.6比例 native DzFrameSetAbsolutePoint takes integer frame, integer point, real x, real y returns nothing // 清空窗体锚点 native DzFrameClearAllPoints takes integer frame returns nothing // 设置所有锚点到目标窗体上--移动 ${frame} 的 所有锚点 到 ${frame} 上 native DzFrameSetAllPoints takes integer frame, integer relativeFrame returns boolean
参数
point
FramePoints_TopLeft=0,左上 FramePoints_Top =1,顶部 FramePoints_TopRight=2,右上 FramePoints_Left=3,左侧 FramePoints_Center=4,中心 FramePoints_Right=5,右侧 FramePoints_BottomLeft=6,左下 FramePoints_Bottom=7,底部 FramePoints_BottomRight=8,右下
重制版
// 设置Frame的相对位置--重制版 native BlzFrameSetPoint takes framehandle frame, framepointtype point, framehandle relative, framepointtype relativePoint, real x, real y returns nothing // 设置Frame的绝对位置--重制版 native BlzFrameSetAbsPoint takes framehandle frame, framepointtype point, real x, real y returns nothing
// 左上 constant framepointtype FRAMEPOINT_TOPLEFT = ConvertFramePointType(0) // 上 constant framepointtype FRAMEPOINT_TOP = ConvertFramePointType(1) // 右上 constant framepointtype FRAMEPOINT_TOPRIGHT = ConvertFramePointType(2) // 左 constant framepointtype FRAMEPOINT_LEFT = ConvertFramePointType(3) // 中间 constant framepointtype FRAMEPOINT_CENTER = ConvertFramePointType(4) // 右 constant framepointtype FRAMEPOINT_RIGHT = ConvertFramePointType(5) // 左下 constant framepointtype FRAMEPOINT_BOTTOMLEFT = ConvertFramePointType(6) // 下 constant framepointtype FRAMEPOINT_BOTTOM = ConvertFramePointType(7) // 右下 constant framepointtype FRAMEPOINT_BOTTOMRIGHT = ConvertFramePointType(8)
缩放
// 缩放Frame--重制版 native BlzFrameSetScale takes framehandle frame, real scale returns nothing
// 设置缩放 native DzFrameSetScale takes integer frame, real scale returns nothing
大小
重制版
// 设置Frame大小--重制版 native BlzFrameSetSize takes framehandle frame, real width, real height returns nothing
// 获取Frame高度--重制版 native BlzFrameGetHeight takes framehandle frame returns real // 获取Frame宽度--重制版 native BlzFrameGetWidth takes framehandle frame returns real
老版本
// 获取 Frame 的 高度 [NEW] native DzFrameGetHeight takes integer frame returns real
// 设置窗体大小 native DzFrameSetSize takes integer frame, real w, real h returns nothing
显隐
// 设置Frame可见--重制版 native BlzFrameSetVisible takes framehandle frame, boolean visible returns nothing // Frame是否可见--重制版 native BlzFrameIsVisible takes framehandle frame returns boolean
// 显示/隐藏窗体 // @param enable [true: 显示| false: 隐藏] native DzFrameShow takes integer frame, boolean enable returns nothing
名称
// 获取Frame的名字--重制版 native BlzFrameGetName takes framehandle frame returns string
文本
重制版
// 设置Frame文本--重制版 native BlzFrameSetText takes framehandle frame, string text returns nothing // 获取Frame文本--重制版 native BlzFrameGetText takes framehandle frame returns string // Frame添加文本--重制版 native BlzFrameAddText takes framehandle frame, string text returns nothing // 设置Frame文本颜色--重制版 native BlzFrameSetTextColor takes framehandle frame, integer color returns nothing
老版本
// 设置文字(支持EditBox, TextFrame, TextArea, SimpleFontString、GlueEditBoxWar3、SlashChatBox、TimerTextFrame、TextButtonFrame、GlueTextButton) native DzFrameSetText takes integer frame, string text returns nothing // 获取文字(支持EditBox, TextFrame, TextArea, SimpleFontString) native DzFrameGetText takes integer frame returns string // 设置文字颜色(支持TextFrame, EditBox) native DzFrameSetTextColor takes integer frame, integer color returns nothing
// 转换rgba色值--返回一个整数,用于设置Frame颜色--参数0~255取值 native DzGetColor takes integer a, integer r, integer g, integer b returns integer
字体
// 设置字体--重制版 native BlzFrameSetFont takes framehandle frame, string fileName, real height, integer flags returns nothing
// 设置字体 [NEW]--"支持EditBox、SimpleFontString、SimpleMessageFrame以及非SimpleFrame类型的例如TEXT,flag作用未知" // 修改字体大小 // @param fileName 可选值["Fonts\dffn_b31.ttf", "Fonts\\DFHeiMd.ttf", "Fonts\\dfst-m3u.ttf", "Fonts\\FRIZQT__.TTF", "Fonts\\NIM_____.ttf", "Fonts\\tt5500m_.ttf"] // @param height 字体大小 // @param flag 加粗、斜体或者加粗+斜体 native DzFrameSetFont takes integer frame, string fileName, real height, integer flag returns nothing
字体对齐方式
// 设置字体对齐方式--重制版 native BlzFrameSetTextAlignment takes framehandle frame, textaligntype vert, textaligntype horz returns nothing
constant textaligntype TEXT_JUSTIFY_TOP = ConvertTextAlignType(0) constant textaligntype TEXT_JUSTIFY_MIDDLE = ConvertTextAlignType(1) constant textaligntype TEXT_JUSTIFY_BOTTOM = ConvertTextAlignType(2) constant textaligntype TEXT_JUSTIFY_LEFT = ConvertTextAlignType(3) constant textaligntype TEXT_JUSTIFY_CENTER = ConvertTextAlignType(4) constant textaligntype TEXT_JUSTIFY_RIGHT = ConvertTextAlignType(5)
// 设置对齐方式 [NEW] // @param align 对齐方式 [0:左|1:中|2:右] native DzFrameSetTextAlignment takes integer frame, integer align returns nothing
字数
重制版
// 设置Frame字数限制--重制版 native BlzFrameSetTextSizeLimit takes framehandle frame, integer size returns nothing // 获取Frame字数限制--重制版 native BlzFrameGetTextSizeLimit takes framehandle frame returns integer
老版本
// 设置字数限制(支持EditBox) native DzFrameSetTextSizeLimit takes integer frame, integer size returns nothing // 获取字数限制(支持EditBox) native DzFrameGetTextSizeLimit takes integer frame returns integer
焦点
// 设置Frame焦点--重制版 native BlzFrameSetFocus takes framehandle frame, boolean flag returns nothing
模型
// 设置Frame模型--重制版 native BlzFrameSetModel takes framehandle frame, string modelFile, integer cameraIndex returns nothing
// 设置模型(支持Sprite、Model、StatusBar)--"设置 ${frame} 的模型文件为 ${modelFile} ModelType:${modelType} Flag:${flag}" native DzFrameSetModel takes integer frame, string modelFile, integer modelType, integer flag returns nothing
动画
// 设置Frame动画--重制版 native BlzFrameSetSpriteAnimate takes framehandle frame, integer primaryProp, integer flags returns nothing
// 设置动画--"设置 ${frame} 播放序号 ${animId} 的动画 自动播放:${autocast}" native DzFrameSetAnimate takes integer frame, integer animId, boolean autocast returns nothing // 设置动画进度(autocast为false时可用) native DzFrameSetAnimateOffset takes integer frame, real offset returns nothing
图片
// 设置Frame图片--重制版 native BlzFrameSetTexture takes framehandle frame, string texFile, integer flag, boolean blend returns nothing
// 设置texture(支持Backdrop、SimpleStatusBar)--"设置 ${frame} 的贴图为:${texture} 是否平铺 ${flag}" native DzFrameSetTexture takes integer frame, string texture, integer flag returns nothing
启用/禁用
// 启用/禁用Frame--重制版 native BlzFrameSetEnable takes framehandle frame, boolean enabled returns nothing // 获取Frame是启/禁用状态--重制版 native BlzFrameGetEnable takes framehandle frame returns boolean
// 设置窗体禁用/启用 // @param enable false 禁用后 按钮 或者文本 不再遮挡鼠标 native DzFrameSetEnable takes integer name, boolean enable returns nothing // 获取控件是否启用 native DzFrameGetEnable takes integer frame returns boolean
透明度
重制版
// 设置Frame透明度--重制版 native BlzFrameSetAlpha takes framehandle frame, integer alpha returns nothing // 获取Frame透明度--重制版 native BlzFrameGetAlpha takes framehandle frame returns integer
老版本
// 设置透明度(0-255) native DzFrameSetAlpha takes integer frame, integer alpha returns nothing // 获取透明度(0-255) native DzFrameGetAlpha takes integer frame returns integer
颜色
// 设置Frame颜色--重制版 native BlzFrameSetVertexColor takes framehandle frame, integer color returns nothing
// 转换颜色--重制版 native BlzConvertColor takes integer a, integer r, integer g, integer b returns integer
// 设置颜色(支持SimpleStatusBar) native DzFrameSetVertexColor takes integer frame, integer color returns nothing
// 转换rgba色值--返回一个整数,用于设置Frame颜色--参数0~255取值 native DzGetColor takes integer a, integer r, integer g, integer b returns integer
提示
重制版
// 设置Frame提示--重制版 native BlzFrameSetTooltip takes framehandle frame, framehandle tooltip returns nothing
老版本
// 原生 - 鼠标提示--鼠标移动到物品或技能按钮上显示的提示窗,初始位于技能栏上方 native DzFrameGetTooltip takes nothing returns integer // 设置提示 鼠标进入按钮时的提示窗体 有数量限制 建议自己用进入事件模拟 native DzFrameSetTooltip takes integer frame, integer tooltip returns nothing
值
重制版
// 设置当前值--重制版 native BlzFrameSetValue takes framehandle frame, real value returns nothing // 获取当前值--重制版 native BlzFrameGetValue takes framehandle frame returns real // 设置最大最小值--重制版 native BlzFrameSetMinMaxValue takes framehandle frame, real minValue, real maxValue returns nothing
老版本
// 获取当前值(支持Slider、SimpleStatusBar、StatusBar) native DzFrameGetValue takes integer frame returns real // 设置当前值(支持Slider、SimpleStatusBar、StatusBar) native DzFrameSetValue takes integer frame, real value returns nothing
// 设置最大最小值(支持Slider、SimpleStatusBar、StatusBar) native DzFrameSetMinMaxValue takes integer frame, real minValue, real maxValue returns nothing
步长
// 设置Step值--重制版 native BlzFrameSetStepSize takes framehandle frame, real stepSize returns nothing
// 设置Step值(支持Slider) native DzFrameSetStepValue takes integer frame, real step returns nothing
优先级
// 设置Frame优先级--重制版 native BlzFrameSetLevel takes framehandle frame, integer level returns nothing
// 设置优先级 [NEW] // @param priority 当两个frame重叠时,值大的覆盖值少的, 正常情况是后创建的覆盖前创建的 native DzFrameSetPriority takes integer frame, integer priority returns nothing
父级
重制版
// 设置父Frame--重制版 native BlzFrameSetParent takes framehandle frame, framehandle parent returns nothing // 获取父Frame--重制版 native BlzFrameGetParent takes framehandle frame returns framehandle
老版本
// 设置父窗口 [NEW] native DzFrameSetParent takes integer frame, integer parent returns nothing // 获取 Frame 的 Parent [NEW] native DzFrameGetParent takes integer frame returns integer
子级
// 获取Frame子组件数量 (1.32.7)--重制版 native BlzFrameGetChildrenCount takes framehandle frame returns integer
// 获取Frame子组件 (1.32.7)--重制版 native BlzFrameGetChild takes framehandle frame, integer index returns framehandle
函数
用户UI
//启用/禁用用户UI--没什么实际效果 native EnableUserUI takes boolean b returns nothing
变换
位置
// UI自动设置位置--重制版 native BlzEnableUIAutoPosition takes boolean enable returns nothing
toc文件
// 导入toc文件--重制版 native BlzLoadTOCFile takes string TOCFile returns boolean
// 加载Toc文件列表 (Toc table of contents) native DzLoadToc takes string fileName returns nothing
生命周期
重制版
// 创建Frame--重制版 native BlzCreateFrame takes string name, framehandle owner, integer priority, integer createContext returns framehandle // 创建SimpleFrame--重制版 native BlzCreateSimpleFrame takes string name, framehandle owner, integer createContext returns framehandle // 创建指定类型名的Frame--重制版 native BlzCreateFrameByType takes string typeName, string name, framehandle owner, string inherits, integer createContext returns framehandle // 删除Frame--重制版 native BlzDestroyFrame takes framehandle frame returns nothing
老版本
// 创建窗体--名字为fdf文件中的名字,ID默认填0。重复创建同名Frame会导致游戏退出时显示崩溃消息,如需避免可以使用Tag创建 native DzCreateFrame takes string frame, integer parent, integer id returns integer // 创建简单的窗体 部分原生窗体设置父窗体或者被设置父窗体直接崩溃 可用简单窗体 // @param frame fdf中预设的窗体控件名 可用汉字 // @param parent 父ui窗体 注意 子窗体必在父窗体之上 同一父窗体可用优先级修改上下顺序 默认顺序为创建顺序 父窗体和优先级创建后只可修改一次 多次无效 // @param parent id 如果需要设置两个相同的fdf模板可用此id区分 获取时通过 DzFrameFindByName 函数填写对应的 id native DzCreateSimpleFrame takes string frame, integer parent, integer id returns integer // 根据tag创建窗体--此处名字可以自定义,类型和模版填写fdf文件中的内容。通过此函数创建的Frame无法获取到子Frame //创建 类型:${type} 名字:${frame} 父节点:${parent} 模版:${template} ID:${Id} /* 见BlzCreateFrame() */ native DzCreateFrameByTagName takes string frameType, string name, integer parent, string template, integer id returns integer // 销毁窗体 native DzDestroyFrame takes integer frame returns nothing
查找
重制版
// 查找frame--重制版 native BlzGetFrameByName takes string name, integer createContext returns framehandle
老版本
// 通过名称查找窗体 name为fdf内设置好的窗体模板名 // 通过名称查找普通窗体--ID默认填0,同名时优先获取最后被创建的。非Simple类的Frame类型都用此函数来获取Frame。 native DzFrameFindByName takes string name, integer id returns integer native DzSimpleFrameFindByName takes string name, integer id returns integer // 查找字符串--ID默认填0,同名时优先获取最后被创建的。SimpleFontString为fdf中的Frame类型。 // 获取名字为 ${name} 的子SimpleFontString ID:${Id} native DzSimpleFontStringFindByName takes string name, integer id returns integer // 获取名字为 ${name} 的子SimpleTexture ID:${Id}--ID默认填0,同名时优先获取最后被创建的。SimpleTexture为fdf中的Frame类型。 native DzSimpleTextureFindByName takes string name, integer id returns integer
模拟点击
// 点击Frame--重制版 native BlzFrameClick takes framehandle frame returns nothing
// 点击窗体 native DzClickFrame takes integer frame returns nothing
硬件
鼠标
锁定位置
// 锁定鼠标--重制版 native BlzFrameCageMouse takes framehandle frame, boolean enable returns nothing
// 鼠标限制在用户界面内 native DzFrameCageMouse takes integer frame, boolean enable returns nothing
判断
// 鼠标是否在UI上 native DzIsMouseOverUI takes nothing returns boolean
焦点
// 鼠标所在的Frame控件--不是所有类型的Frame都能响应鼠标,能响应的有BUTTON,TEXT等 native DzGetMouseFocus takes nothing returns integer // 设置焦点--设置 ${frame} 获取焦点 ${enable} native DzFrameSetFocus takes integer frame, boolean enable returns boolean
显隐
// 隐藏界面元素--隐藏所有界面UI //不在地图初始化时调用则会残留小地图和时钟模型 native DzFrameHideInterface takes nothing returns nothing
界面更新回调
// 设置界面更新回调(非同步)--当玩家 ${player} 每帧绘制 时 //注意,这个事件只会异步执行!帧数间隔不稳定,执行间隔也不同!这个事件不能注销,请勿重复注册! native DzFrameSetUpdateCallback takes string func returns nothing // 界面更新回调 native DzFrameSetUpdateCallbackByCode takes code funcHandle returns nothing
触发器
重制版
// 注册Frame事件--重制版 native BlzTriggerRegisterFrameEvent takes trigger whichTrigger, framehandle frame, frameeventtype eventId returns event
回调参数获取
获取触发的Frame
// 获取触发的Frame--重制版 native BlzGetTriggerFrame takes nothing returns framehandle
触发的事件类型
// 获取触发的事件类型--重制版 native BlzGetTriggerFrameEvent takes nothing returns frameeventtype
constant frameeventtype FRAMEEVENT_CONTROL_CLICK = ConvertFrameEventType(1) constant frameeventtype FRAMEEVENT_MOUSE_ENTER = ConvertFrameEventType(2) constant frameeventtype FRAMEEVENT_MOUSE_LEAVE = ConvertFrameEventType(3) constant frameeventtype FRAMEEVENT_MOUSE_UP = ConvertFrameEventType(4) constant frameeventtype FRAMEEVENT_MOUSE_DOWN = ConvertFrameEventType(5) constant frameeventtype FRAMEEVENT_MOUSE_WHEEL = ConvertFrameEventType(6) constant frameeventtype FRAMEEVENT_CHECKBOX_CHECKED = ConvertFrameEventType(7) constant frameeventtype FRAMEEVENT_CHECKBOX_UNCHECKED = ConvertFrameEventType(8) constant frameeventtype FRAMEEVENT_EDITBOX_TEXT_CHANGED = ConvertFrameEventType(9) constant frameeventtype FRAMEEVENT_POPUPMENU_ITEM_CHANGED = ConvertFrameEventType(10) constant frameeventtype FRAMEEVENT_MOUSE_DOUBLECLICK = ConvertFrameEventType(11) constant frameeventtype FRAMEEVENT_SPRITE_ANIM_UPDATE = ConvertFrameEventType(12) constant frameeventtype FRAMEEVENT_SLIDER_VALUE_CHANGED = ConvertFrameEventType(13) constant frameeventtype FRAMEEVENT_DIALOG_CANCEL = ConvertFrameEventType(14) constant frameeventtype FRAMEEVENT_DIALOG_ACCEPT = ConvertFrameEventType(15) constant frameeventtype FRAMEEVENT_EDITBOX_ENTER = ConvertFrameEventType(16)
触发的Frame值
// 获取触发的Frame值--重制版 native BlzGetTriggerFrameValue takes nothing returns real
触发的Frame文本
// 获取触发的Frame文本--重制版 native BlzGetTriggerFrameText takes nothing returns string
参数
eventId
constant frameeventtype FRAMEEVENT_CONTROL_CLICK = ConvertFrameEventType(1) constant frameeventtype FRAMEEVENT_MOUSE_ENTER = ConvertFrameEventType(2) constant frameeventtype FRAMEEVENT_MOUSE_LEAVE = ConvertFrameEventType(3) constant frameeventtype FRAMEEVENT_MOUSE_UP = ConvertFrameEventType(4) constant frameeventtype FRAMEEVENT_MOUSE_DOWN = ConvertFrameEventType(5) constant frameeventtype FRAMEEVENT_MOUSE_WHEEL = ConvertFrameEventType(6) constant frameeventtype FRAMEEVENT_CHECKBOX_CHECKED = ConvertFrameEventType(7) constant frameeventtype FRAMEEVENT_CHECKBOX_UNCHECKED = ConvertFrameEventType(8) constant frameeventtype FRAMEEVENT_EDITBOX_TEXT_CHANGED = ConvertFrameEventType(9) constant frameeventtype FRAMEEVENT_POPUPMENU_ITEM_CHANGED = ConvertFrameEventType(10) constant frameeventtype FRAMEEVENT_MOUSE_DOUBLECLICK = ConvertFrameEventType(11) constant frameeventtype FRAMEEVENT_SPRITE_ANIM_UPDATE = ConvertFrameEventType(12) constant frameeventtype FRAMEEVENT_SLIDER_VALUE_CHANGED = ConvertFrameEventType(13) constant frameeventtype FRAMEEVENT_DIALOG_CANCEL = ConvertFrameEventType(14) constant frameeventtype FRAMEEVENT_DIALOG_ACCEPT = ConvertFrameEventType(15) constant frameeventtype FRAMEEVENT_EDITBOX_ENTER = ConvertFrameEventType(16)
老版本
// 注册用户界面事件回调--注册 ${frame} 的 ${事件类型} 事件 运行:${func name} 是否同步:${sync} // @param eventId [1: 鼠标点击| 2: 鼠标进入|3: 鼠标离开|4: 鼠标释放|5: 未知|6: 鼠标滚轮|7: 未知|8: 未知|9: 未知|10: 未知|11: 未知|12: 鼠标双击] // @param sync [true: 同步|false: 异步]--同步则一个玩家触发时所有玩家都会触发 native DzFrameSetScript takes integer frame, integer eventId, string func, boolean sync returns nothing // 注册UI事件回调(func handle) 注册点击按钮触发的动作 // @param sync [true: 同步|false: 异步] native DzFrameSetScriptByCode takes integer frame, integer eventId, code funcHandle, boolean sync returns nothing
参数
eventId
/* FrameEvent_None=0,frameevent,0,无 FrameEvent_Evenr_Pressed=0,frameevent,1,鼠标点击 FrameEvent_Mouse_Enter=0,frameevent,2,鼠标进入 FrameEvent_Mouse_Leave=0,frameevent,3,鼠标离开 FrameEvent_Mouse_Up=0,frameevent,4,鼠标释放 FrameEvent_Mouse_Down=0,frameevent,5,鼠标按下 FrameEvent_Mouse_Wheel=0,frameevent,6,鼠标轮滚 FrameEvent_Checkbox_Checked=0,frameevent,7,选择框--选中 FrameEvent_Checkbox_Unchecked=0,frameevent,8,选择框--取消选中 FrameEvent_Editbox_Text_Changed=0,frameevent,9,文本编辑框--内容改变 FrameEvent_Popupmenu_Item_Change_Start=0,frameevent,10,弹出菜单--选项改变 FrameEvent_Popupmenu_Item_Changed_Start=0,frameevent,11,弹出菜单--选项改变 FrameEvent_Mouse_Doubleclick=0,frameevent,12,鼠标双击 FrameEvent_Sprite_Anim_Update=0,frameevent,13,图像动画更新 */
回调参数获取
// 事件响应 - 获取触发ui的玩家 native DzGetTriggerUIEventPlayer takes nothing returns player // 事件响应 - 触发的Frame native DzGetTriggerUIEventFrame takes nothing returns integer
原生界面
分类
右上角
计时器窗口
属性
生命周期
// 新建计时器窗口 [R] native CreateTimerDialog takes timer t returns timerdialog // 销毁计时器窗口 native DestroyTimerDialog takes timerdialog whichDialog returns nothing
显隐
// 显示/隐藏 计时器窗口(所有玩家)--计时器窗口不能在地图初始化时显示 [R] native TimerDialogDisplay takes timerdialog whichDialog, boolean display returns nothing // 判断计时器窗口是否显示 native IsTimerDialogDisplayed takes timerdialog whichDialog returns boolean
标题
// 设置计时器窗口标题 native TimerDialogSetTitle takes timerdialog whichDialog, string title returns nothing
颜色
// 改变计时器窗口文字颜色--颜色格式为(红,绿,蓝). Alpha通道值0为不可见. 颜色值和透明值值取值范围为0-255 [R] native TimerDialogSetTitleColor takes timerdialog whichDialog, integer red, integer green, integer blue, integer alpha returns nothing // 改变计时器窗口计时颜色--颜色格式为(红,绿,蓝). Alpha通道值0为不可见. 颜色值和透明值值取值范围为0-255 [R] native TimerDialogSetTimeColor takes timerdialog whichDialog, integer red, integer green, integer blue, integer alpha returns nothing
速率
// 设置计时器窗口速率--同时计时器显示时间也会随之变化. 就是说60秒的计时器设置为2倍速则显示时间也会变为120秒 [R] native TimerDialogSetSpeed takes timerdialog whichDialog, real speedMultFactor returns nothing
值
// 可以修改倒计时窗口的时间,可以开启另一个计时器每隔一段时间,修改倒计时窗口时间,从而实现正计时 native TimerDialogSetRealTimeRemaining takes timerdialog whichDialog, real timeRemaining returns nothing
排行榜
属性
生命周期
// 新建排行榜--排行榜不能在地图初始化时显示. 标题为空则不显示标题栏 [R] native CreateLeaderboard takes nothing returns leaderboard //删除排行榜 native DestroyLeaderboard takes leaderboard lb returns nothing
标题
//设置 ${Leaderboard} 的标题为 ${文字} native LeaderboardSetLabel takes leaderboard lb, string label returns nothing //获取标题 native LeaderboardGetLabelText takes leaderboard lb returns string
行数
// 行数--包含标题栏,即使标题栏为空 native LeaderboardGetItemCount takes leaderboard lb returns integer
大小
//设置大小 native LeaderboardSetSizeByItemCount takes leaderboard lb, integer count returns nothing
显隐
// 显示/隐藏 [R] native LeaderboardDisplay takes leaderboard lb, boolean show returns nothing // 是否显示排行榜 native IsLeaderboardDisplayed takes leaderboard lb returns boolean
外观
// 设置文字颜色--颜色格式为(红,绿,蓝). Alpha通道值0为不可见. 颜色值和Alpha通道值取值范围为0-255 [R] native LeaderboardSetLabelColor takes leaderboard lb, integer red, integer green, integer blue, integer alpha returns nothing // 设置数值颜色--颜色格式为(红,绿,蓝). Alpha通道值0为不可见. 颜色值和Alpha通道值取值范围为0-255 [R] native LeaderboardSetValueColor takes leaderboard lb, integer red, integer green, integer blue, integer alpha returns nothing //设置 ${Leaderboard} 的显示样式: ${Show/Hide} 标题, ${Show/Hide} 文字, ${Show/Hide} 分数, ${Show/Hide} 图标 native LeaderboardSetStyle takes leaderboard lb, boolean showLabel, boolean showNames, boolean showValues, boolean showIcons returns nothing
项目
生命周期
//添加 ${Player} 到 ${Leaderboard} ,使用名字: ${文字} 设置分数: ${Value} native LeaderboardAddItem takes leaderboard lb, string label, integer value, player p returns nothing //移除项目 native LeaderboardRemoveItem takes leaderboard lb, integer index returns nothing //把 ${Player} 从 ${Leaderboard} 移除 native LeaderboardRemovePlayerItem takes leaderboard lb, player p returns nothing // 清空 [R] native LeaderboardClear takes leaderboard lb returns nothing
值/名称
//设置项目值 native LeaderboardSetItemValue takes leaderboard lb, integer whichItem, integer val returns nothing //设置项目名称 native LeaderboardSetItemLabel takes leaderboard lb, integer whichItem, string val returns nothing
外观
//设置项目样式 native LeaderboardSetItemStyle takes leaderboard lb, integer whichItem, boolean showLabel, boolean showValue, boolean showIcon returns nothing //设置颜色 native LeaderboardSetItemLabelColor takes leaderboard lb, integer whichItem, integer red, integer green, integer blue, integer alpha returns nothing //设置值颜色 native LeaderboardSetItemValueColor takes leaderboard lb, integer whichItem, integer red, integer green, integer blue, integer alpha returns nothing
函数
排序
//值排序 native LeaderboardSortItemsByValue takes leaderboard lb, boolean ascending returns nothing //玩家排序 native LeaderboardSortItemsByPlayer takes leaderboard lb, boolean ascending returns nothing //名称排序 native LeaderboardSortItemsByLabel takes leaderboard lb, boolean ascending returns nothing
获取排名
//${Player} 在 ${Leaderboard} 的排名 native LeaderboardGetPlayerIndex takes leaderboard lb, player p returns integer
判断
//玩家在排行榜 native LeaderboardHasPlayerItem takes leaderboard lb, player p returns boolean
玩家使用的排行榜
// 设置玩家使用的排行榜--每个玩家只能显示一个排行榜 [R] native PlayerSetLeaderboard takes player toPlayer, leaderboard lb returns nothing //玩家使用的排行榜 native PlayerGetLeaderboard takes player toPlayer returns leaderboard
多面板
属性
生命周期
// Create a multiboard object // 新建多面板--多面板不能在地图初始化时显示 [R] native CreateMultiboard takes nothing returns multiboard //销毁多面板 native DestroyMultiboard takes multiboard lb returns nothing
显隐
// 显示/隐藏 [R] native MultiboardDisplay takes multiboard lb, boolean show returns nothing // 是已显示的 native IsMultiboardDisplayed takes multiboard lb returns boolean
// meant to unequivocally suspend display of existing and // subsequently displayed multiboards //旨在明确暂停现有和随后显示的多板的显示 // 显示/隐藏多面板模式(作用于整个多面板功能)--隐藏多面板模式将无法显示任何多面板 [R] native MultiboardSuppressDisplay takes boolean flag returns nothing
最大/最小化
// 最大/最小化--最小化的多面板只显示标题 [R] native MultiboardMinimize takes multiboard lb, boolean minimize returns nothing // 多列面板 是最小化的 native IsMultiboardMinimized takes multiboard lb returns boolean
行/列
// 清空该多面板中的所有行和列 native MultiboardClear takes multiboard lb returns nothing
// 获得多列面板 的行数 native MultiboardGetRowCount takes multiboard lb returns integer // 获得多列面板 的列数 native MultiboardGetColumnCount takes multiboard lb returns integer // 改变多列面板'列数' native MultiboardSetColumnCount takes multiboard lb, integer count returns nothing // 改变多列面板'行数' native MultiboardSetRowCount takes multiboard lb, integer count returns nothing
标题
// 改变 多列面板 标题 native MultiboardSetTitleText takes multiboard lb, string label returns nothing // 多列面板 的标题 native MultiboardGetTitleText takes multiboard lb returns string // 设置标题颜色--颜色格式为(红,绿,蓝). Alpha值为0是不可见的. 颜色值和Alpha值取值范围为0-255 [R] native MultiboardSetTitleTextColor takes multiboard lb, integer red, integer green, integer blue, integer alpha returns nothing
项目
生命周期
// funcs for modifying individual items // 获取多面板项目--(0,0)作为多面板首项,会创建多面板项目 [R] native MultiboardGetItem takes multiboard lb, integer row, integer column returns multiboarditem // 删除多面板项目 [R] //并不会影响对多面板的显示. 多面板项目指向多面板但不附属于多面板 native MultiboardReleaseItem takes multiboarditem mbi returns nothing
文本/值
// 设置指定项目文本(也就是值)--设置 ${多面板项目} 的项目文本为 ${文字} [R] native MultiboardSetItemValue takes multiboarditem mbi, string val returns nothing // 设置所有项目文本--设置 ${多面板} 的所有项目文本为 ${文字} [R] native MultiboardSetItemsValue takes multiboard lb, string value returns nothing
显示外观
// broadcast settings to all items // 设置所有项目显示风格--设置 ${多面板} 的所有项目显示风格: ${Show/Hide} 文字 ${Show/Hide} 图标 [R] native MultiboardSetItemsStyle takes multiboard lb, boolean showValues, boolean showIcons returns nothing // 设置所有项目颜色--颜色格式为(红,绿,蓝). Alpha值为0是不可见的. 颜色值和Alpha值取值范围为0-255 [R] native MultiboardSetItemsValueColor takes multiboard lb, integer red, integer green, integer blue, integer alpha returns nothing // 设置所有项目宽度--设置 ${多面板} 的所有项目宽度为 ${Width} 倍屏幕宽度[R] native MultiboardSetItemsWidth takes multiboard lb, real width returns nothing // 设置所有项目图标--设置 ${多面板} 的所有项目图标为 ${Icon File} [R] native MultiboardSetItemsIcon takes multiboard lb, string iconPath returns nothing // 设置指定项目显示风格 [R] native MultiboardSetItemStyle takes multiboarditem mbi, boolean showValue, boolean showIcon returns nothing // 设置指定项目颜色 [R] native MultiboardSetItemValueColor takes multiboarditem mbi, integer red, integer green, integer blue, integer alpha returns nothing // 设置指定项目宽度 [R] native MultiboardSetItemWidth takes multiboarditem mbi, real width returns nothing // 设置指定项目图标 [R] native MultiboardSetItemIcon takes multiboarditem mbi, string iconFileName returns nothing
菜单栏
分类
游戏菜单
函数
// %%% SetCampaignMenuRace is deprecated. It must remain to support // old maps which use it, but all new maps should use SetCampaignMenuRaceEx // %%% SetCampaignMenuRace 已被弃用。 它必须保留以支持使用它的旧地图,但所有新地图都应使用 SetCampaignMenuRaceEx // 切换战役菜单为指定种族的菜单 @deprecated("这方法不建议使用,应该使用SetCampaignMenuRaceEx代替") native SetCampaignMenuRace takes race r returns nothing // 切换战役菜单为指定种族的菜单 native SetCampaignMenuRaceEx takes integer campaignIndex returns nothing
分类
装载游戏
//显示加载游戏对话框--菜单->装载游戏 native DisplayLoadDialog takes nothing returns nothing
结束游戏
重新开始任务
// 禁用 重新开始任务按钮 native DisableRestartMission takes boolean flag returns nothing
任务
//闪动任务按钮 native FlashQuestDialogButton takes nothing returns nothing //强制任务对话框更新 native ForceQuestDialogUpdate takes nothing returns nothing
函数
// 原生 - 界面按钮--左上的菜单等按钮,索引从0开始 native DzFrameGetUpperButtonBarButton takes integer buttonId returns integer
计分屏
计分屏
// 显示/隐藏计分屏显示 [R]--只能在地图脚本的config函数中使用 native SetPlayerOnScoreScreen takes player whichPlayer, boolean flag returns nothing
系统消息框
// 原生 - 系统消息框--包含显示消息给玩家 及 显示Debug消息 等 native DzFrameGetUnitMessage takes nothing returns integer
上方消息框
// 原生 - 上方消息框--高维修费用 等消息 native DzFrameGetTopMessage takes nothing returns integer
用户交互
聊天栏
函数
显示信息
// 对 ${玩家} 在屏幕位移(${X},${Y})处显示文本: ${文字} [R] //显示时间取决于文字长度. 位移的取值在0-1之间. 可使用'本地玩家'实现对所有玩家发送消息. native DisplayTextToPlayer takes player toPlayer, real x, real y, string message returns nothing // 对玩家显示文本消息(指定时间)--对 ${玩家} 在屏幕位移(${X},${Y})处显示 ${时间} 秒的文本信息: ${文字} [R] native DisplayTimedTextToPlayer takes player toPlayer, real x, real y, real duration, string message returns nothing //模拟玩家聊天 //call DisplayTimedTextFromPlayer(Player(0), 0, 0, 50, "Player %s has send you %s some gold")--将打印“Player WorldEdit has sent you some gold.--第一个s%被替换为玩家名称 native DisplayTimedTextFromPlayer takes player toPlayer, real x, real y, real duration, string message returns nothing
清除
// 清空文本信息(所有玩家)--清空玩家屏幕上的文本信息 [R] native ClearTextMessages takes nothing returns nothing
模拟聊天
// 模拟玩家聊天--重制版 native BlzDisplayChatMessage takes player whichPlayer, integer recipient, string message returns nothing
获取
// 原生 - 玩家聊天信息框 native DzFrameGetChatMessage takes nothing returns integer
小地图
属性
小地图信号
// 小地图信号(所有玩家)--对所有玩家发送小地图信号到坐标(${X},${Y}) 持续时间: ${Duration} 秒 [R] native PingMinimap takes real x, real y, real duration returns nothing // 小地图信号(指定颜色)(所有玩家)--对所有玩家发送小地图信号到坐标(${X},${Y}) 持续时间: ${Duration} 秒, 信号颜色:(${Red},${Green},${Blue}) 信号类型: ${Style}--颜色格式为(红,绿,蓝). 颜色值取值范围为0-255 [R] /* PingStyleNormal=0,pingstyle,true,惊叹号 PingStyleExtra=0,pingstyle,false,普通 */ native PingMinimapEx takes real x, real y, real duration, integer red, integer green, integer blue, boolean extraEffects returns nothing
小地图图标
常量
//战争迷雾状态--黑色迷雾 constant fogstate FOG_OF_WAR_MASKED = ConvertFogState(1) //战争迷雾状态--战争迷雾 constant fogstate FOG_OF_WAR_FOGGED = ConvertFogState(2) //战争迷雾状态--没有迷雾 constant fogstate FOG_OF_WAR_VISIBLE = ConvertFogState(4)
函数
单位图标
//为单位创建小地图图标--重制版 native CreateMinimapIconOnUnit takes unit whichUnit, integer red, integer green, integer blue, string pingPath, fogstate fogVisibility returns minimapicon
位置图标
//在指定位置创建小地图图标--重制版 native CreateMinimapIcon takes real x, real y, integer red, integer green, integer blue, string pingPath, fogstate fogVisibility returns minimapicon
//在指定位置创建小地图图标--重制版 native CreateMinimapIconAtLoc takes location where, integer red, integer green, integer blue, string pingPath, fogstate fogVisibility returns minimapicon
销毁
// 销毁小地图图标--重制版 native DestroyMinimapIcon takes minimapicon pingId returns nothing
//标记小地图图标为销毁--重制版 native SetMinimapIconOrphanDestroy takes minimapicon whichMinimapIcon, boolean doDestroy returns nothing
显示状态
//设置小地图图标显示状态--重制版 native SetMinimapIconVisible takes minimapicon whichMinimapIcon, boolean visible returns nothing
特殊图标
// 改变小地图的特殊图标 native SetAltMinimapIcon takes string iconPath returns nothing
小地图功能按钮
属性
联盟/野生动物显示
分类
联盟显示按钮
// 联盟颜色显示设置--0为不开启. 1为小地图显示. 2为小地图和游戏都显示 native GetAllyColorFilterState takes nothing returns integer // 设置联盟颜色显示状态为 ${State}--0为不开启. 1为小地图显示. 2为小地图和游戏都显示. 相当于游戏中Alt+A功能 native SetAllyColorFilterState takes integer state returns nothing
野生动物按钮
// 野生单位显示是开启的 native GetCreepCampFilterState takes nothing returns boolean // 显示/隐藏野生生物图标在小地图--相当于游戏中Alt+R功能 native SetCreepCampFilterState takes boolean state returns nothing
函数
// 允许/禁止小地图按钮--${Enable/Disable} 联盟颜色显示按钮, ${Enable/Disable} 中立生物显示按钮 native EnableMinimapFilterButtons takes boolean enableAlly, boolean enableCreep returns nothing
函数
// 原生 - 小地图按钮--小地图右侧竖排按钮,索引从0开始 native DzFrameGetMinimapButton takes integer buttonId returns integer
小地图背景
// 设置小地图使用的地图图像文件--重制版 native BlzChangeMinimapTerrainTex takes string texFile returns boolean
// 原生UI - 设置小地图背景贴图 native DzSetWar3MapMap takes string map returns nothing
函数
获取
// 原生UI -小地图 native DzFrameGetMinimap takes nothing returns integer
英雄图标
属性
// 保留英雄按钮--为玩家保留 ${Number} 个左上角英雄图标 //因为共享单位而被控制的其他玩家英雄的图标将在保留位置之后开始显示 native SetReservedLocalHeroButtons takes integer reserved returns nothing
函数
// 原生 - 英雄按钮--左侧的英雄头像,参数表示第N+1个英雄,索引从0开始 native DzFrameGetHeroBarButton takes integer buttonId returns integer // 原生 - 英雄血条--左侧的英雄头像下的血条,参数表示第N+1个英雄,索引从0开始 native DzFrameGetHeroHPBar takes integer buttonId returns integer // 原生 - 英雄蓝条--左侧的英雄头像下的蓝条,参数表示第N+1个英雄,索引从0开始 native DzFrameGetHeroManaBar takes integer buttonId returns integer
大头像
// 原生UI - 单位大头像 native DzFrameGetPortrait takes nothing returns integer
物品栏
// 原生 - 物品栏按钮--索引从0开始 native DzFrameGetItemBarButton takes integer buttonId returns integer
技能栏
// 原生 - 技能按钮--参考物编中的技能按钮(x,y)坐标 native DzFrameGetCommandBarButton takes integer row, integer column returns integer
游戏UI
// 原生 - 游戏UI--一般用作创建自定义UI的父节点 native DzGetGameUI takes nothing returns integer
渲染黑边
// 原生UI - 修改游戏渲染黑边范围--修改游戏渲染黑边: 上方高度:${upperHeight} 下方高度:${bottomHeight} native DzFrameEditBlackBorders takes real upperHeight, real bottomHeight returns nothing
函数
原生UI
重制版
// 获取原生UI--重制版 native BlzGetOriginFrame takes originframetype frameType, integer index returns framehandle
constant originframetype ORIGIN_FRAME_GAME_UI = ConvertOriginFrameType(0) constant originframetype ORIGIN_FRAME_COMMAND_BUTTON = ConvertOriginFrameType(1) constant originframetype ORIGIN_FRAME_HERO_BAR = ConvertOriginFrameType(2) constant originframetype ORIGIN_FRAME_HERO_BUTTON = ConvertOriginFrameType(3) constant originframetype ORIGIN_FRAME_HERO_HP_BAR = ConvertOriginFrameType(4) constant originframetype ORIGIN_FRAME_HERO_MANA_BAR = ConvertOriginFrameType(5) constant originframetype ORIGIN_FRAME_HERO_BUTTON_INDICATOR = ConvertOriginFrameType(6) constant originframetype ORIGIN_FRAME_ITEM_BUTTON = ConvertOriginFrameType(7) constant originframetype ORIGIN_FRAME_MINIMAP = ConvertOriginFrameType(8) constant originframetype ORIGIN_FRAME_MINIMAP_BUTTON = ConvertOriginFrameType(9) constant originframetype ORIGIN_FRAME_SYSTEM_BUTTON = ConvertOriginFrameType(10) constant originframetype ORIGIN_FRAME_TOOLTIP = ConvertOriginFrameType(11) constant originframetype ORIGIN_FRAME_UBERTOOLTIP = ConvertOriginFrameType(12) constant originframetype ORIGIN_FRAME_CHAT_MSG = ConvertOriginFrameType(13) constant originframetype ORIGIN_FRAME_UNIT_MSG = ConvertOriginFrameType(14) constant originframetype ORIGIN_FRAME_TOP_MSG = ConvertOriginFrameType(15) constant originframetype ORIGIN_FRAME_PORTRAIT = ConvertOriginFrameType(16) constant originframetype ORIGIN_FRAME_WORLD_FRAME = ConvertOriginFrameType(17) constant originframetype ORIGIN_FRAME_SIMPLE_UI_PARENT = ConvertOriginFrameType(18) constant originframetype ORIGIN_FRAME_PORTRAIT_HP_TEXT = ConvertOriginFrameType(19) constant originframetype ORIGIN_FRAME_PORTRAIT_MANA_TEXT = ConvertOriginFrameType(20) constant originframetype ORIGIN_FRAME_UNIT_PANEL_BUFF_BAR = ConvertOriginFrameType(21) constant originframetype ORIGIN_FRAME_UNIT_PANEL_BUFF_BAR_LABEL = ConvertOriginFrameType(22)
// 隐藏原生界面--重制版 native BlzHideOriginFrames takes boolean enable returns nothing
老版本
// 不明觉厉 native DzOriginalUIAutoResetPoint takes boolean enable returns nothing
系统
输入设备
分类
键盘
触发器
通用回调参数获取
重制版
// 事件响应 - 获取触发的按键--响应 [硬件] - 按键事件 //鼠标和键盘都能用 native DzGetTriggerKey takes nothing returns integer
老版本
// 事件响应 - 获取触发硬件事件的玩家--响应 [硬件] - 按键事件 滚轮事件 窗口大小变化事件 native DzGetTriggerKeyPlayer takes nothing returns player
按键
// 注册键盘点击触发--请使用“获取触发硬件事件的玩家”来获取触发玩家 native DzTriggerRegisterKeyEvent takes trigger trig, integer key, integer status, boolean sync, string func returns nothing // 注册键盘点击触发 native DzTriggerRegisterKeyEventByCode takes trigger trig, integer key, integer status, boolean sync, code funcHandle returns nothing
参数
key
GameKey_A=0,gamekey,'A',A GameKey_B=0,gamekey,'B',B GameKey_C=0,gamekey,'C',C GameKey_D=0,gamekey,'D',D GameKey_E=0,gamekey,'E',E GameKey_F=0,gamekey,'F',F GameKey_G=0,gamekey,'G',G GameKey_H=0,gamekey,'H',H GameKey_I=0,gamekey,'I',I GameKey_J=0,gamekey,'J',J GameKey_K=0,gamekey,'K',K GameKey_L=0,gamekey,'L',L GameKey_M=0,gamekey,'M',M GameKey_N=0,gamekey,'N',N GameKey_O=0,gamekey,'O',O GameKey_P=0,gamekey,'P',P GameKey_Q=0,gamekey,'Q',Q GameKey_R=0,gamekey,'R',R GameKey_S=0,gamekey,'S',S GameKey_T=0,gamekey,'T',T GameKey_U=0,gamekey,'U',U GameKey_V=0,gamekey,'V',V GameKey_W=0,gamekey,'W',W GameKey_X=0,gamekey,'X',X GameKey_Y=0,gamekey,'Y',Y GameKey_Z=0,gamekey,'Z',Z GameKey_0=0,gamekey,48,0 GameKey_1=0,gamekey,49,1 GameKey_2=0,gamekey,50,2 GameKey_3=0,gamekey,51,3 GameKey_4=0,gamekey,52,4 GameKey_5=0,gamekey,53,5 GameKey_6=0,gamekey,53,6 GameKey_7=0,gamekey,55,7 GameKey_8=0,gamekey,56,8 GameKey_9=0,gamekey,57,9 GameKey_Tab=0,gamekey,9,Tab GameKey_Space=0,gamekey,32,空格 GameKey_Enter=0,gamekey,513,回车 GameKey_Backspace=0,gamekey,514,退格 GameKey_Shift=0,gamekey,0,Shift GameKey_Tab=0,gamekey,516,→ //GameKey_Tab=0,gamekey,517,↑ //GameKey_Tab=0,gamekey,518,← //GameKey_Tab=0,gamekey,519,↓
status
GameKeyAction_Press=0,gamekeyaction,1,点击 GameKeyAction_Release=0,gamekeyaction,0,释放
变种触发器
//键盘注册同步事件 function DzTriggerRegisterKeyEventTrg takes trigger trg, integer status, integer btn returns nothing if trg == null then return endif call DzTriggerRegisterKeyEvent(trg, btn, status, true, null) endfunction
函数
模拟玩家操作
//命令 ${Player} 按下 ${Key} 键--模拟了玩家的动作,所以它可能不同步,就像玩家按下键盘按钮一样 native ForceUIKey takes string key returns nothing //模拟玩家抬起键盘按钮 native ForceUICancel takes nothing returns nothing
鼠标
属性
光标
// 光标--重制版 native BlzEnableCursor takes boolean enable returns nothing
位置
重制版
// 设置鼠标位置--重制版 native BlzSetMousePos takes integer x, integer y returns nothing
老版本
转换为游戏内位置
// 获取鼠标在游戏内的坐标X native DzGetMouseTerrainX takes nothing returns real // 获取鼠标在游戏内的坐标Y native DzGetMouseTerrainY takes nothing returns real // 获取鼠标在游戏内的坐标Z native DzGetMouseTerrainZ takes nothing returns real
屏幕位置
// 获取鼠标屏幕坐标X native DzGetMouseX takes nothing returns integer // 获取鼠标屏幕坐标Y native DzGetMouseY takes nothing returns integer
窗口位置
// 获取鼠标游戏窗口坐标X native DzGetMouseXRelative takes nothing returns integer // 获取鼠标游戏窗口坐标Y native DzGetMouseYRelative takes nothing returns integer
设置位置
// 设置鼠标位置 native DzSetMousePos takes integer x, integer y returns nothing
焦点
单位
// 获取鼠标锁定的单位--重制版 native BlzGetMouseFocusUnit takes nothing returns unit
// 取鼠标指向的单位 native DzGetUnitUnderMouse takes nothing returns unit
UI
// 鼠标是否在UI上 native DzIsMouseOverUI takes nothing returns boolean
// 鼠标所在的Frame控件--不是所有类型的Frame都能响应鼠标,能响应的有BUTTON,TEXT等 native DzGetMouseFocus takes nothing returns integer // 设置焦点--设置 ${frame} 获取焦点 ${enable} native DzFrameSetFocus takes integer frame, boolean enable returns boolean
触发器
按键
// 注册鼠标点击触发(sync为true时,调用TriggerExecute(一个玩家触发则所有玩家都会触发)。为false时,直接运行action函数,可以异步不掉线,action里不要有同步操作) native DzTriggerRegisterMouseEvent takes trigger trig, integer btn, integer status, boolean sync, string func returns nothing // 注册鼠标点击触发(sync为true时,调用TriggerExecute(一个玩家触发则所有玩家都会触发)。为false时,直接运行action函数,可以异步不掉线,action里不要有同步操作) native DzTriggerRegisterMouseEventByCode takes trigger trig, integer btn, integer status, boolean sync, code funcHandle returns nothing
参数
btn
GameKey_Mouse_Left=0,gamekey,1,鼠标左键 GameKey_Mouse_Right=0,gamekey,2,鼠标右键
status
GameKeyAction_Press=0,gamekeyaction,1,点击 GameKeyAction_Release=0,gamekeyaction,0,释放
sync
true
sync为true时,调用TriggerExecute(一个玩家触发则所有玩家都会触发
false
为false时,直接运行action函数,可以异步不掉线,action里不要有同步操作
回调参数获取
重制版
// 触发鼠标位置X--返回可玩地图中的位置--重制版 //在任意触发事件的回调函数中使用,来获取事件触发时的鼠标位置 native BlzGetTriggerPlayerMouseX takes nothing returns real // 获取触发鼠标位置Y--重制版 native BlzGetTriggerPlayerMouseY takes nothing returns real // 获取触发鼠标位置--重制版 native BlzGetTriggerPlayerMousePosition takes nothing returns location // 获取触发鼠标按键--重制版 native BlzGetTriggerPlayerMouseButton takes nothing returns mousebuttontype
// 左键--重制版 constant mousebuttontype MOUSE_BUTTON_TYPE_LEFT = ConvertMouseButtonType(1) // 滚轮--重制版 constant mousebuttontype MOUSE_BUTTON_TYPE_MIDDLE = ConvertMouseButtonType(2) // 右键--重制版 constant mousebuttontype MOUSE_BUTTON_TYPE_RIGHT = ConvertMouseButtonType(3)
老版本
// 事件响应 - 获取触发的按键--响应 [硬件] - 按键事件 //鼠标和键盘都能用 native DzGetTriggerKey takes nothing returns integer
返回值
GameKey_Mouse_Left=0,gamekey,1,鼠标左键 GameKey_Mouse_Right=0,gamekey,2,鼠标右键 GameKey_A=0,gamekey,'A',A GameKey_B=0,gamekey,'B',B GameKey_C=0,gamekey,'C',C GameKey_D=0,gamekey,'D',D GameKey_E=0,gamekey,'E',E GameKey_F=0,gamekey,'F',F GameKey_G=0,gamekey,'G',G GameKey_H=0,gamekey,'H',H GameKey_I=0,gamekey,'I',I GameKey_J=0,gamekey,'J',J GameKey_K=0,gamekey,'K',K GameKey_L=0,gamekey,'L',L GameKey_M=0,gamekey,'M',M GameKey_N=0,gamekey,'N',N GameKey_O=0,gamekey,'O',O GameKey_P=0,gamekey,'P',P GameKey_Q=0,gamekey,'Q',Q GameKey_R=0,gamekey,'R',R GameKey_S=0,gamekey,'S',S GameKey_T=0,gamekey,'T',T GameKey_U=0,gamekey,'U',U GameKey_V=0,gamekey,'V',V GameKey_W=0,gamekey,'W',W GameKey_X=0,gamekey,'X',X GameKey_Y=0,gamekey,'Y',Y GameKey_Z=0,gamekey,'Z',Z GameKey_0=0,gamekey,48,0 GameKey_1=0,gamekey,49,1 GameKey_2=0,gamekey,50,2 GameKey_3=0,gamekey,51,3 GameKey_4=0,gamekey,52,4 GameKey_5=0,gamekey,53,5 GameKey_6=0,gamekey,53,6 GameKey_7=0,gamekey,55,7 GameKey_8=0,gamekey,56,8 GameKey_9=0,gamekey,57,9 GameKey_Tab=0,gamekey,9,Tab GameKey_Space=0,gamekey,32,空格 GameKey_Enter=0,gamekey,513,回车 GameKey_Backspace=0,gamekey,514,退格 GameKey_Shift=0,gamekey,0,Shift GameKey_Tab=0,gamekey,516,→ //GameKey_Tab=0,gamekey,517,↑ //GameKey_Tab=0,gamekey,518,← //GameKey_Tab=0,gamekey,519,↓
// 事件响应 - 获取触发硬件事件的玩家--响应 [硬件] - 按键事件 滚轮事件 窗口大小变化事件 native DzGetTriggerKeyPlayer takes nothing returns player
变种触发器
//鼠标注册同步事件 function DzTriggerRegisterMouseEventTrg takes trigger trg, integer status, integer btn returns nothing if trg == null then return endif call DzTriggerRegisterMouseEvent(trg, btn, status, true, null) endfunction
滚轮
// 任意玩家滑动鼠标滚轮--请使用“获取触发硬件事件的玩家”来获取触发玩家,滚轮的方向由“获取滚轮变化值”的正负来判断 native DzTriggerRegisterMouseWheelEvent takes trigger trig, boolean sync, string func returns nothing // 注册鼠标滚轮触发 native DzTriggerRegisterMouseWheelEventByCode takes trigger trig, boolean sync, code funcHandle returns nothing
回调参数获取
// 获取滚轮delta--响应 [硬件] - 鼠标滚轮事件,正负区分上下 native DzGetWheelDelta takes nothing returns integer
变种触发器
//鼠标滚轮注册同步事件 function DzTriggerRegisterMouseWheelEventTrg takes trigger trg returns nothing if trg == null then return endif call DzTriggerRegisterMouseWheelEvent(trg, true, null) endfunction
位置
// 任意玩家移动鼠标--"请使用“获取触发硬件事件的玩家”来获取触发玩家" native DzTriggerRegisterMouseMoveEvent takes trigger trig, boolean sync, string func returns nothing // 注册鼠标移动触发 native DzTriggerRegisterMouseMoveEventByCode takes trigger trig, boolean sync, code funcHandle returns nothing
变种触发器
//鼠标移动注册同步事件 function DzTriggerRegisterMouseMoveEventTrg takes trigger trg returns nothing if trg == null then return endif call DzTriggerRegisterMouseMoveEvent(trg, true, null) endfunction
函数
判断
// 判断按键是否按下 native DzIsKeyDown takes integer iKey returns boolean
参数
iKey
GameKey_Mouse_Left=0,gamekey,1,鼠标左键 GameKey_Mouse_Right=0,gamekey,2,鼠标右键 GameKey_A=0,gamekey,'A',A GameKey_B=0,gamekey,'B',B GameKey_C=0,gamekey,'C',C GameKey_D=0,gamekey,'D',D GameKey_E=0,gamekey,'E',E GameKey_F=0,gamekey,'F',F GameKey_G=0,gamekey,'G',G GameKey_H=0,gamekey,'H',H GameKey_I=0,gamekey,'I',I GameKey_J=0,gamekey,'J',J GameKey_K=0,gamekey,'K',K GameKey_L=0,gamekey,'L',L GameKey_M=0,gamekey,'M',M GameKey_N=0,gamekey,'N',N GameKey_O=0,gamekey,'O',O GameKey_P=0,gamekey,'P',P GameKey_Q=0,gamekey,'Q',Q GameKey_R=0,gamekey,'R',R GameKey_S=0,gamekey,'S',S GameKey_T=0,gamekey,'T',T GameKey_U=0,gamekey,'U',U GameKey_V=0,gamekey,'V',V GameKey_W=0,gamekey,'W',W GameKey_X=0,gamekey,'X',X GameKey_Y=0,gamekey,'Y',Y GameKey_Z=0,gamekey,'Z',Z GameKey_0=0,gamekey,48,0 GameKey_1=0,gamekey,49,1 GameKey_2=0,gamekey,50,2 GameKey_3=0,gamekey,51,3 GameKey_4=0,gamekey,52,4 GameKey_5=0,gamekey,53,5 GameKey_6=0,gamekey,53,6 GameKey_7=0,gamekey,55,7 GameKey_8=0,gamekey,56,8 GameKey_9=0,gamekey,57,9 GameKey_Tab=0,gamekey,9,Tab GameKey_Space=0,gamekey,32,空格 GameKey_Enter=0,gamekey,513,回车 GameKey_Backspace=0,gamekey,514,退格 GameKey_Shift=0,gamekey,0,Shift GameKey_Tab=0,gamekey,516,→ //GameKey_Tab=0,gamekey,517,↑ //GameKey_Tab=0,gamekey,518,← //GameKey_Tab=0,gamekey,519,↓
客户端
属性
激活状态
重制版
// 获取本地客户端是否激活--重制版 native BlzIsLocalClientActive takes nothing returns boolean
老版本
// 判断窗口是否激活 native DzIsWindowActive takes nothing returns boolean
变换
大小
属性
重制版
// 获取本地客户端宽度--重制版 native BlzGetLocalClientWidth takes nothing returns integer // 获取本地客户端高度--重制版 native BlzGetLocalClientHeight takes nothing returns integer
老版本
// 获取war3窗口宽度 native DzGetWindowWidth takes nothing returns integer // 获取war3窗口高度 native DzGetWindowHeight takes nothing returns integer
触发器
// 注册war3窗口大小变化事件--任意玩家改变窗口大小 native DzTriggerRegisterWindowResizeEvent takes trigger trig, boolean sync, string func returns nothing // 注册war3窗口大小变化事件--任意玩家改变窗口大小 native DzTriggerRegisterWindowResizeEventByCode takes trigger trig, boolean sync, code funcHandle returns nothing
回调参数获取
// 事件响应 - 获取触发硬件事件的玩家--响应 [硬件] - 按键事件 滚轮事件 窗口大小变化事件 native DzGetTriggerKeyPlayer takes nothing returns player
变种触发器
//注册窗口调整大小事件--窗口大小变化事件 //请使用“获取触发硬件事件的玩家”来获取触发玩家。这个事件会在玩家拖动窗口大小时频繁触发 function DzTriggerRegisterWindowResizeEventTrg takes trigger trg returns nothing if trg == null then return endif call DzTriggerRegisterWindowResizeEvent(trg, true, null) endfunction
位置
// 获取war3窗口X坐标 native DzGetWindowX takes nothing returns integer // 获取war3窗口Y坐标 native DzGetWindowY takes nothing returns integer
屏幕比例
// 自定义屏幕比例--原生 - 修改屏幕比例(FOV) native DzSetCustomFovFix takes real value returns nothing // 使用宽屏模式 native DzEnableWideScreen takes boolean enable returns nothing
本地语言
// 获取语言--重制版 native BlzGetLocale takes nothing returns string
//获取本地化 native DzGetLocale takes nothing returns string
// 本地字符串 [R] native GetLocalizedString takes string source returns string // 本地热键 native GetLocalizedHotkey takes string source returns integer
触发器
// 注册玩家键盘事件--重制版 native BlzTriggerRegisterPlayerKeyEvent takes trigger whichTrigger, player whichPlayer, oskeytype key, integer metaKey, boolean keyDown returns event
回调参数获取
// 获取触发的按键--重制版 native BlzGetTriggerPlayerKey takes nothing returns oskeytype // 获取触发的特殊按键--重制版 native BlzGetTriggerPlayerMetaKey takes nothing returns integer // 获取触发的按键被按下--重制版 native BlzGetTriggerPlayerIsKeyDown takes nothing returns boolean
参数
key
constant oskeytype OSKEY_BACKSPACE = ConvertOsKeyType($08) constant oskeytype OSKEY_TAB = ConvertOsKeyType($09) constant oskeytype OSKEY_CLEAR = ConvertOsKeyType($0C) constant oskeytype OSKEY_RETURN = ConvertOsKeyType($0D) constant oskeytype OSKEY_SHIFT = ConvertOsKeyType($10) constant oskeytype OSKEY_CONTROL = ConvertOsKeyType($11) constant oskeytype OSKEY_ALT = ConvertOsKeyType($12) constant oskeytype OSKEY_PAUSE = ConvertOsKeyType($13) constant oskeytype OSKEY_CAPSLOCK = ConvertOsKeyType($14) constant oskeytype OSKEY_KANA = ConvertOsKeyType($15) constant oskeytype OSKEY_HANGUL = ConvertOsKeyType($15) constant oskeytype OSKEY_JUNJA = ConvertOsKeyType($17) constant oskeytype OSKEY_FINAL = ConvertOsKeyType($18) constant oskeytype OSKEY_HANJA = ConvertOsKeyType($19) constant oskeytype OSKEY_KANJI = ConvertOsKeyType($19) constant oskeytype OSKEY_ESCAPE = ConvertOsKeyType($1B) constant oskeytype OSKEY_CONVERT = ConvertOsKeyType($1C) constant oskeytype OSKEY_NONCONVERT = ConvertOsKeyType($1D) constant oskeytype OSKEY_ACCEPT = ConvertOsKeyType($1E) constant oskeytype OSKEY_MODECHANGE = ConvertOsKeyType($1F) constant oskeytype OSKEY_SPACE = ConvertOsKeyType($20) constant oskeytype OSKEY_PAGEUP = ConvertOsKeyType($21) constant oskeytype OSKEY_PAGEDOWN = ConvertOsKeyType($22) constant oskeytype OSKEY_END = ConvertOsKeyType($23) constant oskeytype OSKEY_HOME = ConvertOsKeyType($24) constant oskeytype OSKEY_LEFT = ConvertOsKeyType($25) constant oskeytype OSKEY_UP = ConvertOsKeyType($26) constant oskeytype OSKEY_RIGHT = ConvertOsKeyType($27) constant oskeytype OSKEY_DOWN = ConvertOsKeyType($28) constant oskeytype OSKEY_SELECT = ConvertOsKeyType($29) constant oskeytype OSKEY_PRINT = ConvertOsKeyType($2A) constant oskeytype OSKEY_EXECUTE = ConvertOsKeyType($2B) constant oskeytype OSKEY_PRINTSCREEN = ConvertOsKeyType($2C) constant oskeytype OSKEY_INSERT = ConvertOsKeyType($2D) constant oskeytype OSKEY_DELETE = ConvertOsKeyType($2E) constant oskeytype OSKEY_HELP = ConvertOsKeyType($2F) constant oskeytype OSKEY_0 = ConvertOsKeyType($30) constant oskeytype OSKEY_1 = ConvertOsKeyType($31) constant oskeytype OSKEY_2 = ConvertOsKeyType($32) constant oskeytype OSKEY_3 = ConvertOsKeyType($33) constant oskeytype OSKEY_4 = ConvertOsKeyType($34) constant oskeytype OSKEY_5 = ConvertOsKeyType($35) constant oskeytype OSKEY_6 = ConvertOsKeyType($36) constant oskeytype OSKEY_7 = ConvertOsKeyType($37) constant oskeytype OSKEY_8 = ConvertOsKeyType($38) constant oskeytype OSKEY_9 = ConvertOsKeyType($39) constant oskeytype OSKEY_A = ConvertOsKeyType($41) constant oskeytype OSKEY_B = ConvertOsKeyType($42) constant oskeytype OSKEY_C = ConvertOsKeyType($43) constant oskeytype OSKEY_D = ConvertOsKeyType($44) constant oskeytype OSKEY_E = ConvertOsKeyType($45) constant oskeytype OSKEY_F = ConvertOsKeyType($46) constant oskeytype OSKEY_G = ConvertOsKeyType($47) constant oskeytype OSKEY_H = ConvertOsKeyType($48) constant oskeytype OSKEY_I = ConvertOsKeyType($49) constant oskeytype OSKEY_J = ConvertOsKeyType($4A) constant oskeytype OSKEY_K = ConvertOsKeyType($4B) constant oskeytype OSKEY_L = ConvertOsKeyType($4C) constant oskeytype OSKEY_M = ConvertOsKeyType($4D) constant oskeytype OSKEY_N = ConvertOsKeyType($4E) constant oskeytype OSKEY_O = ConvertOsKeyType($4F) constant oskeytype OSKEY_P = ConvertOsKeyType($50) constant oskeytype OSKEY_Q = ConvertOsKeyType($51) constant oskeytype OSKEY_R = ConvertOsKeyType($52) constant oskeytype OSKEY_S = ConvertOsKeyType($53) constant oskeytype OSKEY_T = ConvertOsKeyType($54) constant oskeytype OSKEY_U = ConvertOsKeyType($55) constant oskeytype OSKEY_V = ConvertOsKeyType($56) constant oskeytype OSKEY_W = ConvertOsKeyType($57) constant oskeytype OSKEY_X = ConvertOsKeyType($58) constant oskeytype OSKEY_Y = ConvertOsKeyType($59) constant oskeytype OSKEY_Z = ConvertOsKeyType($5A) constant oskeytype OSKEY_LMETA = ConvertOsKeyType($5B) constant oskeytype OSKEY_RMETA = ConvertOsKeyType($5C) constant oskeytype OSKEY_APPS = ConvertOsKeyType($5D) constant oskeytype OSKEY_SLEEP = ConvertOsKeyType($5F) constant oskeytype OSKEY_NUMPAD0 = ConvertOsKeyType($60) constant oskeytype OSKEY_NUMPAD1 = ConvertOsKeyType($61) constant oskeytype OSKEY_NUMPAD2 = ConvertOsKeyType($62) constant oskeytype OSKEY_NUMPAD3 = ConvertOsKeyType($63) constant oskeytype OSKEY_NUMPAD4 = ConvertOsKeyType($64) constant oskeytype OSKEY_NUMPAD5 = ConvertOsKeyType($65) constant oskeytype OSKEY_NUMPAD6 = ConvertOsKeyType($66) constant oskeytype OSKEY_NUMPAD7 = ConvertOsKeyType($67) constant oskeytype OSKEY_NUMPAD8 = ConvertOsKeyType($68) constant oskeytype OSKEY_NUMPAD9 = ConvertOsKeyType($69) constant oskeytype OSKEY_MULTIPLY = ConvertOsKeyType($6A) constant oskeytype OSKEY_ADD = ConvertOsKeyType($6B) constant oskeytype OSKEY_SEPARATOR = ConvertOsKeyType($6C) constant oskeytype OSKEY_SUBTRACT = ConvertOsKeyType($6D) constant oskeytype OSKEY_DECIMAL = ConvertOsKeyType($6E) constant oskeytype OSKEY_DIVIDE = ConvertOsKeyType($6F) constant oskeytype OSKEY_F1 = ConvertOsKeyType($70) constant oskeytype OSKEY_F2 = ConvertOsKeyType($71) constant oskeytype OSKEY_F3 = ConvertOsKeyType($72) constant oskeytype OSKEY_F4 = ConvertOsKeyType($73) constant oskeytype OSKEY_F5 = ConvertOsKeyType($74) constant oskeytype OSKEY_F6 = ConvertOsKeyType($75) constant oskeytype OSKEY_F7 = ConvertOsKeyType($76) constant oskeytype OSKEY_F8 = ConvertOsKeyType($77) constant oskeytype OSKEY_F9 = ConvertOsKeyType($78) constant oskeytype OSKEY_F10 = ConvertOsKeyType($79) constant oskeytype OSKEY_F11 = ConvertOsKeyType($7A) constant oskeytype OSKEY_F12 = ConvertOsKeyType($7B) constant oskeytype OSKEY_F13 = ConvertOsKeyType($7C) constant oskeytype OSKEY_F14 = ConvertOsKeyType($7D) constant oskeytype OSKEY_F15 = ConvertOsKeyType($7E) constant oskeytype OSKEY_F16 = ConvertOsKeyType($7F) constant oskeytype OSKEY_F17 = ConvertOsKeyType($80) constant oskeytype OSKEY_F18 = ConvertOsKeyType($81) constant oskeytype OSKEY_F19 = ConvertOsKeyType($82) constant oskeytype OSKEY_F20 = ConvertOsKeyType($83) constant oskeytype OSKEY_F21 = ConvertOsKeyType($84) constant oskeytype OSKEY_F22 = ConvertOsKeyType($85) constant oskeytype OSKEY_F23 = ConvertOsKeyType($86) constant oskeytype OSKEY_F24 = ConvertOsKeyType($87) constant oskeytype OSKEY_NUMLOCK = ConvertOsKeyType($90) constant oskeytype OSKEY_SCROLLLOCK = ConvertOsKeyType($91) constant oskeytype OSKEY_OEM_NEC_EQUAL = ConvertOsKeyType($92) constant oskeytype OSKEY_OEM_FJ_JISHO = ConvertOsKeyType($92) constant oskeytype OSKEY_OEM_FJ_MASSHOU = ConvertOsKeyType($93) constant oskeytype OSKEY_OEM_FJ_TOUROKU = ConvertOsKeyType($94) constant oskeytype OSKEY_OEM_FJ_LOYA = ConvertOsKeyType($95) constant oskeytype OSKEY_OEM_FJ_ROYA = ConvertOsKeyType($96) constant oskeytype OSKEY_LSHIFT = ConvertOsKeyType($A0) constant oskeytype OSKEY_RSHIFT = ConvertOsKeyType($A1) constant oskeytype OSKEY_LCONTROL = ConvertOsKeyType($A2) constant oskeytype OSKEY_RCONTROL = ConvertOsKeyType($A3) constant oskeytype OSKEY_LALT = ConvertOsKeyType($A4) constant oskeytype OSKEY_RALT = ConvertOsKeyType($A5) constant oskeytype OSKEY_BROWSER_BACK = ConvertOsKeyType($A6) constant oskeytype OSKEY_BROWSER_FORWARD = ConvertOsKeyType($A7) constant oskeytype OSKEY_BROWSER_REFRESH = ConvertOsKeyType($A8) constant oskeytype OSKEY_BROWSER_STOP = ConvertOsKeyType($A9) constant oskeytype OSKEY_BROWSER_SEARCH = ConvertOsKeyType($AA) constant oskeytype OSKEY_BROWSER_FAVORITES = ConvertOsKeyType($AB) constant oskeytype OSKEY_BROWSER_HOME = ConvertOsKeyType($AC) constant oskeytype OSKEY_VOLUME_MUTE = ConvertOsKeyType($AD) constant oskeytype OSKEY_VOLUME_DOWN = ConvertOsKeyType($AE) constant oskeytype OSKEY_VOLUME_UP = ConvertOsKeyType($AF) constant oskeytype OSKEY_MEDIA_NEXT_TRACK = ConvertOsKeyType($B0) constant oskeytype OSKEY_MEDIA_PREV_TRACK = ConvertOsKeyType($B1) constant oskeytype OSKEY_MEDIA_STOP = ConvertOsKeyType($B2) constant oskeytype OSKEY_MEDIA_PLAY_PAUSE = ConvertOsKeyType($B3) constant oskeytype OSKEY_LAUNCH_MAIL = ConvertOsKeyType($B4) constant oskeytype OSKEY_LAUNCH_MEDIA_SELECT = ConvertOsKeyType($B5) constant oskeytype OSKEY_LAUNCH_APP1 = ConvertOsKeyType($B6) constant oskeytype OSKEY_LAUNCH_APP2 = ConvertOsKeyType($B7) constant oskeytype OSKEY_OEM_1 = ConvertOsKeyType($BA) constant oskeytype OSKEY_OEM_PLUS = ConvertOsKeyType($BB) constant oskeytype OSKEY_OEM_COMMA = ConvertOsKeyType($BC) constant oskeytype OSKEY_OEM_MINUS = ConvertOsKeyType($BD) constant oskeytype OSKEY_OEM_PERIOD = ConvertOsKeyType($BE) constant oskeytype OSKEY_OEM_2 = ConvertOsKeyType($BF) constant oskeytype OSKEY_OEM_3 = ConvertOsKeyType($C0) constant oskeytype OSKEY_OEM_4 = ConvertOsKeyType($DB) constant oskeytype OSKEY_OEM_5 = ConvertOsKeyType($DC) constant oskeytype OSKEY_OEM_6 = ConvertOsKeyType($DD) constant oskeytype OSKEY_OEM_7 = ConvertOsKeyType($DE) constant oskeytype OSKEY_OEM_8 = ConvertOsKeyType($DF) constant oskeytype OSKEY_OEM_AX = ConvertOsKeyType($E1) constant oskeytype OSKEY_OEM_102 = ConvertOsKeyType($E2) constant oskeytype OSKEY_ICO_HELP = ConvertOsKeyType($E3) constant oskeytype OSKEY_ICO_00 = ConvertOsKeyType($E4) constant oskeytype OSKEY_PROCESSKEY = ConvertOsKeyType($E5) constant oskeytype OSKEY_ICO_CLEAR = ConvertOsKeyType($E6) constant oskeytype OSKEY_PACKET = ConvertOsKeyType($E7) constant oskeytype OSKEY_OEM_RESET = ConvertOsKeyType($E9) constant oskeytype OSKEY_OEM_JUMP = ConvertOsKeyType($EA) constant oskeytype OSKEY_OEM_PA1 = ConvertOsKeyType($EB) constant oskeytype OSKEY_OEM_PA2 = ConvertOsKeyType($EC) constant oskeytype OSKEY_OEM_PA3 = ConvertOsKeyType($ED) constant oskeytype OSKEY_OEM_WSCTRL = ConvertOsKeyType($EE) constant oskeytype OSKEY_OEM_CUSEL = ConvertOsKeyType($EF) constant oskeytype OSKEY_OEM_ATTN = ConvertOsKeyType($F0) constant oskeytype OSKEY_OEM_FINISH = ConvertOsKeyType($F1) constant oskeytype OSKEY_OEM_COPY = ConvertOsKeyType($F2) constant oskeytype OSKEY_OEM_AUTO = ConvertOsKeyType($F3) constant oskeytype OSKEY_OEM_ENLW = ConvertOsKeyType($F4) constant oskeytype OSKEY_OEM_BACKTAB = ConvertOsKeyType($F5) constant oskeytype OSKEY_ATTN = ConvertOsKeyType($F6) constant oskeytype OSKEY_CRSEL = ConvertOsKeyType($F7) constant oskeytype OSKEY_EXSEL = ConvertOsKeyType($F8) constant oskeytype OSKEY_EREOF = ConvertOsKeyType($F9) constant oskeytype OSKEY_PLAY = ConvertOsKeyType($FA) constant oskeytype OSKEY_ZOOM = ConvertOsKeyType($FB) constant oskeytype OSKEY_NONAME = ConvertOsKeyType($FC) constant oskeytype OSKEY_PA1 = ConvertOsKeyType($FD) constant oskeytype OSKEY_OEM_CLEAR = ConvertOsKeyType($FE)
本地化
皮肤管理器
//皮肤管理器获取本地路径(使用函数 SkinManagerGetLocalPath 时,也可以在代码中使用此字体)--重制版 native SkinManagerGetLocalPath takes string key returns string