Lua接口/服务端函数索引/生活技能与装备

来自天龙知识库
雪舞留言 | 贡献2026年9月7日 (一) 19:16的版本 (整理当前服务端 Lua 接口:注册名称、参数、返回值与调用说明)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航跳到搜索

首页 · 服务端接口 · 调用约定

生活技能与装备:117 个接口,120 个调用名称。
函数 / 别名 调用与用途
AddBagItemSlot AddBagItemSlot(sceneId, selfId, bagIndex)
按当前孔数的概率为装备增加第一至第三个宝石孔。
AddBagItemSlotFour AddBagItemSlotFour(sceneId, selfId, bagIndex)
为符合条件的装备直接增加第四个宝石孔。
AddGPOwner AddGPOwner(SceneID, OwnerID)
向生长点管理中加入指定归属记录。
AddItemToBox AddItemToBox(sceneId, ItemBoxID, iQualityType, iBoxItemCount, ...)
向指定物品箱追加物品。
AddStorePointOnScene AddStorePointOnScene(SceneID, StorePointType, x, z)
在场景中添加藏宝点。
CreateMonsterOnScene CreateMonsterOnScene()
已废弃的怪物创建入口。请使用 LuaFnCreateMonster。
已废弃
DelGPOwner DelGPOwner(SceneID, OwnerID)
删除生长点管理中的指定归属记录。
DelStorePointOnScene DelStorePointOnScene(sceneId, StorePointType, index)
从场景中删除指定藏宝点。
DropBoxEnterScene DropBoxEnterScene(x, z, sceneId)
创建场景掉落物品盒。
EnableItemBoxPickOwnerTime EnableItemBoxPickOwnerTime(SceneID, ItemBoxID)
开始计算物品箱的归属者拾取保护时间。
FindStorePointOnScene FindStorePointOnScene(sceneId, StorePointType, x, z)
在场景中查找藏宝点并返回索引。
GeEquipReqLevel GeEquipReqLevel(itemTableIndex)
返回装备需求等级,非装备返回 -1。
GemEnchasing GemEnchasing(sceneId, selfId, gemBagIndex, equipBagIndex)
执行宝石镶嵌。
GetAbilityExp GetAbilityExp(sceneId, selfId, abilityId)
获得生活技能经验
GetAbilityExpPlus GetAbilityExpPlus(sceneId, selfId, itemTypeSn)
获得生活技能经验
GetAbilityObjIndex GetAbilityObjIndex(sceneId, selfId, Index)
读取当前生活技能操作中指定材料条目对应的背包位置。
GetAbilityOperaRobotTime GetAbilityOperaRobotTime(sceneId, selfId)
获得生活技能挂机器时间
GetBagGemCount GetBagGemCount(sceneId, selfId, BagPos)
读取指定背包位置装备的宝石孔位上限。
GetBagItemDur GetBagItemDur(sceneId, selfId, BagPos)
获取背包中物品的耐久度
GetBagItemIdent GetBagItemIdent(sceneId, selfId, BagPos)
获取背包中物品的鉴定属性
GetBagItemLevel GetBagItemLevel(sceneId, selfId, BagIndex)
返回物品级别
GetBagItemParam GetBagItemParam(sceneId, selfId, BagPos, StartPos, Type)
获取背包中物品的参数
GetBagItemTransfer GetBagItemTransfer(sceneId, selfId, bagIndex)
返回背包物品的转移描述字符串。
GetBagPosByItemSn GetBagPosByItemSn(sceneId, selfId, itemTableIndex)
返回背包中首个指定物品的位置,不要求物品解锁。
GetBagPosByItemSnAvailableBind GetBagPosByItemSnAvailableBind(sceneId, selfId, itemTableIndex, onlyBind)
查找未加交易锁和密码锁的指定物品,并可限定为绑定物品。
GetBoxItemParam GetBoxItemParam(sceneId, arg2, itemBoxId, itemIndex, startPos, type)
返回物品盒指定物品的参数。
GetChangeFaceItemIdAndItemCount GetChangeFaceItemIdAndItemCount(faceStyle)
返回更换脸型需要的物品编号和数量。
GetChangeHairItemIdAndItemCount GetChangeHairItemIdAndItemCount(hairStyle)
返回更换发型需要的物品编号和数量。
GetChangeHeadInfo GetChangeHeadInfo(headStyle)
返回更换头像需要的物品编号和数量。
GetCommonItemGrade GetCommonItemGrade(itemTableIndex)
返回原料或普通物品的品级,其他类别返回 -1。
GetGemEmbededCount GetGemEmbededCount(sceneId, selfId, BagPos)
读取指定背包位置装备上已镶嵌的宝石数量。
GetGemEmbededType GetGemEmbededType(sceneId, selfId, bagIndex, gemIndex)
返回装备指定镶嵌槽中的宝石类型。
GetGPCountByOwner GetGPCountByOwner(SceneID, OwnerID)
读取指定归属对象名下的生长点数量。
GetHumanGUID GetHumanGUID(sceneId, selfId)
根据玩家的场景对象 ID 读取角色 GUID。
GetHumanWorldX GetHumanWorldX(sceneId, selfId)
获得Obj_Human的世界坐标X 参数SceneID,HumanID,返回WorldX
GetHumanWorldZ GetHumanWorldZ(sceneId, selfId)
获得Obj_Human的世界坐标Z 参数SceneID,HumanID,返回WorldZ
GetItemApt GetItemApt(sceneId, selfId, bagIndex, nAptitudeType)
返回装备指定资质的等级值。
GetItemBagPos GetItemBagPos(sceneId, selfId, itemTableIndex, findUnlock)
按是否要求解锁返回指定物品的首个背包位置。
GetItemBoxMaxGrowTime GetItemBoxMaxGrowTime(SceneID, ItemBoxID)
读取物品箱的最大生长时间。
GetItemBoxOpenFlag GetItemBoxOpenFlag(SceneID, ItemBoxID)
读取物品箱的开启状态标志。
GetItemBoxOwner GetItemBoxOwner(SceneID, ItemBoxID)
读取物品箱的归属对象 ID。
GetItemBoxRecycleTimes GetItemBoxRecycleTimes(sceneId, ItemBoxID)
读取物品箱的回收或采集次数。
GetItemBoxRequireAbilityID GetItemBoxRequireAbilityID(sceneId, ItemBoxID)
获得Obj_ItemBox需要的生活技能编号
GetItemBoxWorldPosX GetItemBoxWorldPosX(SceneID, ItemBoxID)
读取物品箱的 X 坐标。
GetItemBoxWorldPosZ GetItemBoxWorldPosZ(SceneID, ItemBoxID)
读取物品箱的 Z 坐标。
GetItemClass GetItemClass(itemTableIndex)
返回物品编号中的物品类别。
GetItemEquipPoint GetItemEquipPoint(itemTableIndex)
返回装备穿戴部位,非装备返回 -1。
GetItemIndex GetItemIndex(itemIndex)
从物品序列编号中解析物品索引部分。
GetItemLevel GetItemLevel(sceneId, selfId, itemId)
读取普通物品或任务物品配置中的等级值。
GetItemName GetItemName(sceneId, itemIndex)
从物品表返回物品名称。
GetItemNameID GetItemNameID(itemTableIndex)
返回装备名称资源编号,非装备返回 -1。
GetItemQuality
LuaFnGetItemQuality
GetItemQuality(itemIndex)
从物品序列编号中解析品质部分。
GetStoreMapSceneID GetStoreMapSceneID(sceneId, selfId, bagIndex)
获得藏宝图场景ID
GetStoreMapX GetStoreMapX(sceneId, selfId, bagIndex)
获得藏宝图位置X
GetStoreMapZ GetStoreMapZ(sceneId, selfId, bagIndex)
读取指定背包藏宝图记录的 Z 坐标。
GetStorePointType GetStorePointType(sceneId, index)
在场景里获得一个藏宝点类型
IsEquipItem IsEquipItem(itemTableIndex)
判断物品编号是否属于装备。
IsPrescrLearned
LuaFnIsPrescrLearned
IsPrescrLearned(sceneId, selfId, PrescrID)
判断是否已经学会某项配方
IsWhiteEquip IsWhiteEquip(itemTableIndex)
判断装备配置是否固定为零条随机属性。
ItemBoxEnterScene ItemBoxEnterScene(x, z, iBoxType, sceneId, iQualityType, iBoxItemCount, ...)
在指定场景坐标创建物品箱,并按后续物品编号填充。
LuaFnChangeVisual LuaFnChangeVisual(sceneId, selfId, equipBagIndex, materialBagIndex, visualIndex)
按物品外观表替换装备外观。
LuaFnCompoundRandom LuaFnCompoundRandom(randomIndex)
从指定合成随机表中取得随机结果,表索引范围为 0 到 127。
LuaFnCreateMonster LuaFnCreateMonster(SceneID, MonsterType, x, z, iAIType, iAIScript, ScriptID)
按怪物类型、坐标和脚本参数在场景内动态创建怪物。
LuaFnDeleteMonster LuaFnDeleteMonster(SceneID, ObjID)
删除动态创建的怪物或 NPC。
LuaFnEquipEnhance LuaFnEquipEnhance(sceneId, selfId, equipBagIndex, materialBagIndex)
扣除强化费用,执行强化并同步物品;成功返回 0,新强化等级,
LuaFnEquipEnhanceCheck LuaFnEquipEnhanceCheck(sceneId, selfId, equipBagIndex, materialBagIndex)
检查装备强化条件;成功返回 0,失败返回错误码。
LuaFnEquipLevelUp LuaFnEquipLevelUp(sceneId, selfId, equipBagIndex, materialBagIndex)
按装备升级表执行一次装备升档。
LuaFnEquipLock LuaFnEquipLock(sceneId, selfId, bagIndex)
设置装备持久锁并同步完整物品信息。
LuaFnEquipUnLock LuaFnEquipUnLock(sceneId, selfId, bagIndex)
取消装备持久锁并同步完整物品信息。
LuaFnFaileTimes LuaFnFaileTimes(sceneId, selfId, equipBagIndex, materialBagIndex, decrease)
消耗一次装备强化失败次数,或按参数清零。
LuaFnGemEmbedRandom LuaFnGemEmbedRandom()
取得宝石镶嵌流程使用的随机结果。
LuaFnGetAbilityLevelUpConfig LuaFnGetAbilityLevelUpConfig(abilityId, nLevel)
读取生活技能指定等级的升级费用、经验与等级限制。
LuaFnGetAbilityLevelUpConfig2 LuaFnGetAbilityLevelUpConfig2(abilityId, nLevel)
读取生活技能升级配置,额外返回附加金钱与经验要求。
LuaFnGetAbilityMaxLevel LuaFnGetAbilityMaxLevel(abilityId)
读取生活技能配置允许的最大等级。
LuaFnGetBagEquipType LuaFnGetBagEquipType(sceneId, selfId, nBagPos)
通过背包格子查到该物品是哪种装备(如果不是装备,则返回 -1)
LuaFnGetEquipFaileTimes LuaFnGetEquipFaileTimes(sceneId, selfId, bagIndex)
返回装备强化失败次数;暗器和非装备返回 0 或字段值。
LuaFnGetItemBindStatus LuaFnGetItemBindStatus(sceneId, selfId, bagIndex)
返回物品绑定状态;位置无效返回 2,未绑定返回 0,已绑定返回 1。
LuaFnGetItemBoxGrowPointType LuaFnGetItemBoxGrowPointType(sceneId, itemBoxId)
返回生长点物品盒类型;对象不存在时返回 -1。
LuaFnGetItemCreator LuaFnGetItemCreator(sceneId, selfId, bagIndex)
返回物品存在标记和创建者名称;空格只返回 0。
LuaFnGetItemPosByItemDataID LuaFnGetItemPosByItemDataID(sceneId, selfId, itemDataId, beginPos)
从指定容器位置开始查找物品数据编号,返回对应背包位置。
LuaFnGetItemPrice LuaFnGetItemPrice(sceneId, itemDataId)
返回物品配置表中的基础价格。
LuaFnGetItemType LuaFnGetItemType(uSerialNumber)
根据物品序列号得到物品的 Type
LuaFnIsJudgeApt LuaFnIsJudgeApt(sceneId, selfId, bagIndex)
返回装备资质鉴定状态:1 已鉴定,2 待鉴定,3 无资质,0 可鉴定,-1 无效。
LuaFnIsMarkOrEnhance LuaFnIsMarkOrEnhance(sceneId, selfId, bagIndex, queryType)
queryType 为 1 时返回持久锁,否则返回装备强化等级。
LuaFnItemBind LuaFnItemBind(sceneId, selfId, bagIndex)
绑定指定背包格中的物品,并立即向客户端同步物品状态。
LuaFnItemBoxEnterSceneEx LuaFnItemBoxEnterSceneEx(sceneId, x, z, boxType, recycleTime)
创建带指定回收时间的物品盒。
LuaFnJudgeApt LuaFnJudgeApt(sceneId, selfId, bagIndex)
鉴定装备资质,成功后同步完整物品信息。
LuaFnLockCheck LuaFnLockCheck(sceneId, selfId, bagIndex, cost)
检查物品加锁条件,返回 0 或定义的负错误码。
LuaFnRefreshItemInfo LuaFnRefreshItemInfo(sceneId, selfId, bagIndex)
立即向玩家重发指定格的完整物品信息,并返回 -1。
LuaFnReSetItemApt LuaFnReSetItemApt(sceneId, selfId, bagIndex)
重置装备六项资质并返回资质等级结果。
LuaFnSendAbilityFailureMsg LuaFnSendAbilityFailureMsg(sceneId, selfId, abilityId, recipeId, itemSerial)
向客户端发送生活技能失败结果。
LuaFnSendAbilitySuccessMsg LuaFnSendAbilitySuccessMsg(sceneId, selfId, AbilityId, RecipeId, ItemSerialNum)
向客户端发送物品制造成功的消息
LuaFnSetEquipFaileTimes LuaFnSetEquipFaileTimes(sceneId, selfId, bagIndex, nTimes)
写入装备强化失败次数并返回状态码。
LuaFnSetItemCreator LuaFnSetItemCreator(sceneId, selfId, nBagPos, szCreatorName)
给背包里的某个物品增加创建者名称
LuaFnStilettoCostExe LuaFnStilettoCostExe(sceneId, selfId, costIndex, stuffBagPos, consumeIndex)
扣除暗器打孔材料和费用。
LuaFnTryRecieveItemIgnoreFatigueState LuaFnTryRecieveItemIgnoreFatigueState(sceneId, selfId, iItemId, iReason)
与 LuaFnTryRecieveItem 相同,但不执行疲劳状态门禁。
LuaFnUnLockCheck LuaFnUnLockCheck(sceneId, selfId, bagIndex, cost)
检查物品解锁条件,未持久加锁时返回 -3。
QueryAreaStandingTime QueryAreaStandingTime(sceneId, selfId)
查询玩家在事件区域停留的时间
QueryHumanAbility QueryHumanAbility(sceneId, selfId, abilityId)
查询human Ability是否学习
QueryHumanAbilityLevel QueryHumanAbilityLevel(sceneId, selfId, AbilityID)
查询Obj_Human生活技能等级 SceneID,HumanID,AbilityID
ResetAreaStandingTime ResetAreaStandingTime(sceneId, selfId)
重新设置玩家进入事件区域的时间(作为下一次触发事件的时间戳)
SetAbilityExp SetAbilityExp(sceneId, selfId, abilityId, abilityExp)
设置生活技能经验,发送的时候 / 100 是为了整型运算方便
SetAbilityOperaRobotTime SetAbilityOperaRobotTime(sceneId, selfId, RobotTime)
设置生活技能挂机器时间
SetAbilityOperaTime SetAbilityOperaTime(sceneId, selfId, OperaTime)
设置生活技能操作时间
SetAllItemPWLock SetAllItemPWLock(sceneId, selfId, bLock)
按既定规则批量设置人物物品二级密码锁。
SetAllPetPWLock SetAllPetPWLock(sceneId, selfId, bLock)
按既定规则批量设置宠物二级密码锁。
SetBagItemDur SetBagItemDur(sceneId, selfId, BagPos, Dur)
设置背包中物品的耐久度
SetBagItemIdent SetBagItemIdent(sceneId, selfId, BagPos)
设置背包中物品的鉴定属性
SetBagItemParam SetBagItemParam(sceneId, selfId, BagPos, StartPos, Type, value)
设置背包中物品的参数
SetBoxItemParam SetBoxItemParam(sceneId, arg2, itemBoxId, itemIndex, startPos, type, value)
设置物品盒指定物品的参数。
SetHumanAbilityLevel SetHumanAbilityLevel(sceneId, selfId, abilityId, abilityLvl)
设置人物生活技能级别,SceneID,HumanID,AbilityID,AbilityLevel
SetItemBoxMaxGrowTime SetItemBoxMaxGrowTime(SceneID, ItemBoxID, maxGrowTime)
设置物品箱的最大生长时间。
SetItemBoxOwner SetItemBoxOwner(sceneId, ItemBoxID, OwnerID)
设置物品箱的归属对象。
SetItemBoxPickOwnerTime SetItemBoxPickOwnerTime(SceneID, ItemBoxID, PickProtTime)
设置物品箱的归属者拾取保护时长。
SetItemBoxRecycleTimes SetItemBoxRecycleTimes(sceneId, ItemBoxID, RecycleTimes)
设置物品箱的回收或采集次数。
SetPrescription SetPrescription(sceneId, selfId, PrescrID, LearnOrAbandon)
学会某项合成配方(只能操作学会,不能操作放弃具体某项配方,具体
TryRecieveItem
LuaFnTryRecieveItem
TryRecieveItem(sceneId, selfId, iItemId, iReason)
尝试接受物品