RegBattleAction
RegBattleAction (DoFile, InitFuncName);
函数功能:
创建一个所有玩家或者宠物使用什么类型的远程道具。
请求方式:
| 参数名 | 是否必须 | 类型 | 说明 |
|---|---|---|---|
| DoFile | 是 | string | 脚本文件路径(如是本文件则填写nil) |
| InitFuncName | 是 | string | 响应事件处理函数的名称,声明格式参考 如下 |
参数说明:
| 参数名 | 是否必须 | 类型 | 说明 |
|---|---|---|---|
| Index | 是 | int | 响应事件的对象索引 |
| ItemType | 是 | int | 使用的道具类型 |
返回值:
| 类型 | 是否必须 | 正常 | 修改返回 |
|---|---|---|---|
| int | 是 | ItemType | 6回力、5小刀、4弓箭 |
操作实例:
function RegBattleAction_Callback(Index, ItemType)
local IndexType = Char.GetData(Index,%对象_类型%);
if(IndexType == %对象_玩家%)then
return 4;--如果对象是玩家直接修改成弓箭
end
if(IndexType == %对象_宠物%)then
return 5;--如果对象是宠物直接修改成小刀
end
return ItemType;
end备注:
- 返回错误代码请使用 GetErrorStr 获取具体错误信息。
作者:105493660 创建时间:2020-10-22 15:58
更新时间:2025-12-24 21:35
更新时间:2025-12-24 21:35