EquipRandom.lua 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. EquipRandom = {}
  2. EquipRandom.Config = {
  3. -- 必须添加的属性ID列表
  4. FORCE_ATTR_IDS = {305012, -- 幸运一击伤害加成
  5. 900 -- 幸运(灵魂宝石成功率)
  6. },
  7. -- 属性值配置(可以根据需要调整)
  8. ATTR_VALUES = {
  9. [305012] = 500, -- 幸运一击伤害加成 +5%
  10. [900] = 2500 -- 幸运(灵魂宝石成功率)+25%
  11. },
  12. -- 是否启用强制属性添加
  13. ENABLED = true,
  14. -- 调试模式
  15. DEBUG_MODE = true,
  16. -- 装备类型过滤(只对装备类型为2的物品生效)
  17. EQUIP_TYPE = 2,
  18. -- 排除的物品ID列表(不需要添加属性的装备)
  19. EXCLUDE_ITEMS = {
  20. -- 可以在这里添加不需要添加属性的装备ID
  21. }
  22. }
  23. function EquipRandom.init(actor)
  24. end
  25. -- 检查装备是否已有指定属性
  26. -- @itemData 装备的属性
  27. -- @attrId 属性ID
  28. function EquipRandom.hasAttribute(itemData, attrId)
  29. -- 检查基础属性
  30. if itemData.basicattr then
  31. for _, attr in pairs(itemData.basicattr) do
  32. if tonumber(attr.attrid) == tonumber(attrId) then
  33. return true, attr.value
  34. end
  35. end
  36. end
  37. -- 检查词条属性
  38. if itemData.entries then
  39. for _, entry in pairs(itemData.entries) do
  40. if tonumber(entry.attrid) == tonumber(attrId) then
  41. return true, entry.value
  42. end
  43. end
  44. end
  45. -- 检查幸运属性
  46. if itemData.luckyattr then
  47. for _, attr in pairs(itemData.luckyattr) do
  48. if tonumber(attr.attrid) == tonumber(attrId) then
  49. return true, attr.value
  50. end
  51. end
  52. end
  53. -- 检查魔法属性
  54. if itemData.magicattr then
  55. for _, attr in pairs(itemData.magicattr) do
  56. if tonumber(attr.attrid) == tonumber(attrId) then
  57. return true, attr.value
  58. end
  59. end
  60. end
  61. return false, 0
  62. end
  63. -- 检测装备是否为卓越装备
  64. function EquipRandom.isExcellentEquip(itemData)
  65. if not itemData then
  66. return false, 0, "无装备数据"
  67. end
  68. -- 检查是否有词条属性
  69. if not itemData.entries or table.isNullOrEmpty(itemData.entries) then
  70. return false, 0, "无词条属性"
  71. end
  72. -- 计算词条数量
  73. local entryCount = 0
  74. for _ in pairs(itemData.entries) do
  75. entryCount = entryCount + 1
  76. end
  77. -- 判断是否为卓越装备(通常2个或以上词条为卓越)
  78. local isExcellent = entryCount >= 1
  79. -- 卓越等级
  80. local grade = ""
  81. if entryCount >= 4 then
  82. grade = "卓越4星"
  83. elseif entryCount >= 3 then
  84. grade = "卓越3星"
  85. elseif entryCount >= 2 then
  86. grade = "卓越2星"
  87. elseif entryCount >= 1 then
  88. grade = "卓越1星"
  89. else
  90. grade = "普通装备"
  91. end
  92. return isExcellent, entryCount, grade
  93. end
  94. -- 检测装备是否已有幸运属性
  95. function EquipRandom.hasLuckyAttr(itemQuip)
  96. -- 检查是否已经添加过强制属性
  97. for _, attrId in ipairs(EquipRandom.Config.FORCE_ATTR_IDS) do
  98. local hasAttr, attrValue = EquipRandom.hasAttribute(itemQuip, attrId)
  99. if hasAttr then
  100. return true
  101. end
  102. end
  103. return false
  104. end
  105. -- 直接给装备添加词条属性的方法
  106. -- @param actor 玩家对象
  107. -- @param itemId 装备ID
  108. -- @param entryId 词条ID(例如:攻击力、防御力等)
  109. -- @param entryValue 词条数值
  110. function EquipRandom.AddEntryToEquip(actor, itemId, entryId, entryValue)
  111. -- 检查装备是否存在
  112. local equipInfo = getequipinfo(actor, itemId, 1)
  113. if not equipInfo or not equipInfo.id then
  114. info(actor, "装备不存在!")
  115. return
  116. end
  117. info(string.format("AddEntryToEquip 添加词条 %s %s %s 值:%s", actor, itemId, entryId, entryValue))
  118. -- 检查词条ID和数值是否合法
  119. if not entryId or not entryValue then
  120. info(actor, "词条ID或数值无效!")
  121. return
  122. end
  123. -- 获取当前装备的词条列表
  124. local currentEntries = API.GetItemData(actor, itemId, "entries") or {}
  125. -- 检查词条是否已存在
  126. local entryExists = false
  127. for i, entry in ipairs(currentEntries) do
  128. if entry.id == entryId then
  129. -- 更新已有词条的数值
  130. currentEntries[i].value = entryValue
  131. entryExists = true
  132. break
  133. end
  134. end
  135. -- 使用API添加词条
  136. local newEntry = {
  137. attrid = entryId,
  138. grade = 0,
  139. value = entryValue,
  140. entryid = 1
  141. }
  142. -- 如果词条不存在,则添加新词条
  143. if not entryExists then
  144. table.insert(currentEntries, newEntry)
  145. end
  146. info('更新后的词条列表', currentEntries)
  147. -- 保存更新后的词条列表
  148. API.SetItemData(actor, itemId, "entries", currentEntries)
  149. -- 刷新装备属性(如果需要)
  150. Equip_QiangHua.sendAttr(actor, itemId)
  151. -- 推送红点通知
  152. sendluamsg(actor, LuaNetMsg.Equip_DuanZao_MsgID, {})
  153. -- 提示玩家操作成功
  154. info(actor, "装备词条已更新!")
  155. end
  156. -- 获取幸运的几率和属性
  157. function EquipRandom.getLuckvalue(actor, itemCfg, itemQuip, itemId)
  158. -- 检测装备是否已有幸运属性
  159. if EquipRandom.hasLuckyAttr(itemQuip) then
  160. info("getLuckvalue 装备已有幸运属性,跳过添加")
  161. return
  162. end
  163. local luckrandom = itemCfg.luckrandom
  164. if luckrandom == nil or luckrandom == "" then
  165. info("cfg_equip_entryLib getLuckvalue 装备没有幸运属性配置")
  166. return nil
  167. end
  168. local luckrandomSplit = string.split(luckrandom, "#")
  169. local randomNum = tonumber(luckrandomSplit[1]) or 0
  170. local randomValue = math.random(1, 10000)
  171. info(string.format("getLuckvalue 幸运属性配置 几率:%d", randomNum))
  172. if randomValue > randomNum then
  173. info("getLuckvalue 未触发幸运属性", randomValue, randomNum)
  174. return
  175. end
  176. EquipRandom.setLuck2(actor, itemQuip)
  177. -- local addedAttrs = {}
  178. -- local entryCount = 0
  179. -- for _, attrId in ipairs(EquipRandom.Config.FORCE_ATTR_IDS) do
  180. -- -- 修正:从配置中获取属性值,如果没有则使用默认值
  181. -- local attrValue = EquipRandom.Config.ATTR_VALUES[attrId]
  182. -- if attrValue then
  183. -- entryCount = entryCount + 1
  184. -- -- 修正:如果需要从 luckrandomSplit 中获取值,应该使用正确的索引
  185. -- -- luckrandomSplit[1] 是几率,luckrandomSplit[2] 是第一个属性值,luckrandomSplit[3] 是第二个属性值
  186. -- if #luckrandomSplit > entryCount then
  187. -- local configValue = tonumber(luckrandomSplit[entryCount + 1])
  188. -- if configValue then
  189. -- attrValue = configValue
  190. -- end
  191. -- end
  192. -- info(string.format("getLuckvalue 幸运属性配置 值:%d", attrValue))
  193. -- -- 使用API添加词条
  194. -- local newEntry = {
  195. -- attrid = attrId,
  196. -- grade = 0,
  197. -- value = attrValue,
  198. -- entryid = entryCount
  199. -- }
  200. -- addequipentry(actor, itemId, newEntry)
  201. -- table.insert(addedAttrs, attrId .. "=" .. attrValue)
  202. -- if EquipRandom.Config.DEBUG_MODE then
  203. -- info("EquipRandom: 为装备 " .. itemId .. " 添加词条: " .. attrId .. "=" .. attrValue)
  204. -- end
  205. -- end
  206. -- end
  207. -- info("getLuckvalue 添加幸运属性完成", itemQuip)
  208. -- jprint(itemQuip)
  209. end
  210. function EquipRandom.setLuck(actor, itemQuip, itemCfg)
  211. -- 检测装备是否已有幸运属性
  212. if EquipRandom.hasLuckyAttr(itemQuip) then
  213. return
  214. end
  215. local luckrandom = itemCfg.luckrandom
  216. if luckrandom == nil or luckrandom == "" then
  217. info("cfg_equip_entryLib getLuckvalue 装备没有幸运属性配置")
  218. return nil
  219. end
  220. local luckrandomSplit = string.split(luckrandom, "#")
  221. local randomNum = tonumber(luckrandomSplit[1]) or 0
  222. local addedAttrs = {}
  223. local entryCount = 0
  224. for _, attrId in ipairs(EquipRandom.Config.FORCE_ATTR_IDS) do
  225. -- 修正:从配置中获取属性值,如果没有则使用默认值
  226. local attrValue = EquipRandom.Config.ATTR_VALUES[attrId]
  227. if attrValue then
  228. entryCount = entryCount + 1
  229. -- 修正:如果需要从 luckrandomSplit 中获取值,应该使用正确的索引
  230. -- luckrandomSplit[1] 是几率,luckrandomSplit[2] 是第一个属性值,luckrandomSplit[3] 是第二个属性值
  231. if #luckrandomSplit > entryCount then
  232. local configValue = tonumber(luckrandomSplit[entryCount + 1])
  233. if configValue then
  234. attrValue = configValue
  235. end
  236. end
  237. -- 使用API添加词条
  238. local newEntry = {
  239. attrid = attrId,
  240. grade = 0,
  241. value = attrValue,
  242. entryid = entryCount
  243. }
  244. addequipentry(actor, itemQuip.id, newEntry)
  245. table.insert(addedAttrs, attrId .. "=" .. attrValue)
  246. end
  247. end
  248. end
  249. function EquipRandom.isAddLuck(luckrandom)
  250. if luckrandom == nil or luckrandom == "" then
  251. return false
  252. end
  253. local luckrandomSplit = string.split(luckrandom, "#")
  254. local randomNum = tonumber(luckrandomSplit[1]) or 0
  255. local randomValue = math.random(1, 10000)
  256. if randomValue > randomNum then
  257. return false
  258. end
  259. return true
  260. end
  261. -- 直接增加装备强化等级的方法
  262. -- @param actor 玩家对象
  263. -- @param itemId 装备ID
  264. -- @param times 需要增加的强化次数
  265. function EquipRandom.DirectIncreaseStrengthLevel(actor, itemId, times)
  266. -- 获取当前强化等级
  267. local currentLevel = API.GetItemData(actor, itemId, "strengthlv") or 0
  268. -- 检查装备是否存在
  269. local equipInfo = getequipinfo(actor, itemId, 1)
  270. if not equipInfo or not equipInfo.id then
  271. info(actor, "装备不存在!", itemId)
  272. return
  273. end
  274. -- 检查强化次数是否合法
  275. if times <= 0 then
  276. info(actor, "强化次数必须大于0!")
  277. return
  278. end
  279. -- 计算新的强化等级
  280. local newLevel = currentLevel + times
  281. -- 检查强化等级是否超过上限(假设最高强化等级为20)
  282. local maxLevel = 20
  283. if newLevel > maxLevel then
  284. info(actor, "强化等级已超过上限(" .. maxLevel .. "级)!")
  285. newLevel = maxLevel
  286. end
  287. -- 直接设置新的强化等级
  288. API.SetItemData(actor, itemId, "strengthlv", newLevel)
  289. -- -- 刷新装备属性
  290. -- Equip_QiangHua.sendAttr(actor, itemId)
  291. -- 重新计算强化后的穿戴需求
  292. -- 刷新流光效果
  293. API.refreshLiuGuang(actor, itemId)
  294. -- 通知客户端更新(这是关键!)
  295. local cfgId = equipInfo.cfgid
  296. Equip_QiangHua.RefreshLevel(actor, itemId, cfgId)
  297. -- -- 推送红点通知
  298. -- info(actor, LuaNetMsg.Equip_DuanZao_MsgID, {})
  299. -- -- 提示玩家强化成功
  300. -- info(actor, "装备强化等级已增加至 " .. newLevel .. " 级!")
  301. end
  302. -- 处理强化等级随机
  303. function EquipRandom.processStrengthLevelRandom(actor, itemId, strengthConfig)
  304. local configs = string.split(strengthConfig, "|")
  305. -- info('处理强化等级随机', configs)
  306. for _, config in ipairs(configs) do
  307. local parts = string.split(config, "#")
  308. if #parts >= 2 then
  309. local level = tonumber(parts[1]) or 0
  310. local chance = tonumber(parts[2]) or 0
  311. local randomValue = math.random(1, 10000)
  312. if randomValue <= chance then
  313. -- info("触发强化等级随机", "等级:", level, "几率:", chance, "随机值:", randomValue)
  314. EquipRandom.DirectIncreaseStrengthLevel(actor, itemId, level)
  315. break -- 只触发一次
  316. end
  317. end
  318. end
  319. end
  320. function EquipRandom.getStrengthLevelRandom(strengthConfig)
  321. if strengthConfig == nil or strengthConfig == "" then
  322. return 0
  323. end
  324. local configs = string.split(strengthConfig, "|")
  325. for _, config in ipairs(configs) do
  326. local parts = string.split(config, "#")
  327. if #parts >= 2 then
  328. local level = tonumber(parts[1]) or 0
  329. local chance = tonumber(parts[2]) or 0
  330. local randomValue = math.random(1, 10000)
  331. if randomValue <= chance then
  332. return level
  333. end
  334. end
  335. end
  336. return 0
  337. end
  338. -- 处理追加等级随机
  339. function EquipRandom.processAppendLevelRandom(actor, itemId, appendConfig)
  340. local configs = string.split(appendConfig, "|")
  341. info('处理追加等级随机', configs)
  342. for _, config in ipairs(configs) do
  343. local parts = string.split(config, "#")
  344. if #parts >= 2 then
  345. local level = tonumber(parts[1]) or 0
  346. local chance = tonumber(parts[2]) or 0
  347. local randomValue = math.random(1, 10000)
  348. if randomValue <= chance then
  349. info("触发追加等级随机", "等级:", level, "几率:", chance, "随机值:", randomValue)
  350. EquipRandom.DirectIncreaseAppendLevel(actor, itemId, level)
  351. break -- 只触发一次
  352. end
  353. end
  354. end
  355. end
  356. function EquipRandom.getAppendLevelRandom(appendConfig)
  357. if appendConfig == nil or appendConfig == "" then
  358. return 0
  359. end
  360. local configs = string.split(appendConfig, "|")
  361. for _, config in ipairs(configs) do
  362. local parts = string.split(config, "#")
  363. if #parts >= 2 then
  364. local level = tonumber(parts[1]) or 0
  365. local chance = tonumber(parts[2]) or 0
  366. local randomValue = math.random(1, 10000)
  367. if randomValue <= chance then
  368. return level
  369. end
  370. end
  371. end
  372. return 0
  373. end
  374. -- 直接增加装备追加等级的方法
  375. -- @param actor 玩家对象
  376. -- @param itemId 装备ID
  377. -- @param appendTimes 需要增加的追加次数
  378. function EquipRandom.DirectIncreaseAppendLevel(actor, itemId, appendTimes)
  379. -- 获取当前追加等级
  380. local currentAppendLevel = API.GetItemData(actor, itemId, "appendlv") or 0
  381. -- 检查装备是否存在
  382. local equipInfo = getequipinfo(actor, itemId, 1)
  383. if not equipInfo or not equipInfo.id then
  384. info(actor, "装备不存在!")
  385. return
  386. end
  387. -- 检查追加次数是否合法
  388. if appendTimes <= 0 then
  389. info(actor, "追加次数必须大于0!")
  390. return
  391. end
  392. -- 计算新的追加等级
  393. local newAppendLevel = currentAppendLevel + appendTimes
  394. -- 检查追加等级是否超过上限(假设最高追加等级为10)
  395. local maxAppendLevel = 10
  396. if newAppendLevel > maxAppendLevel then
  397. info(actor, "追加等级已超过上限(" .. maxAppendLevel .. "级)!")
  398. newAppendLevel = maxAppendLevel
  399. end
  400. -- 直接设置新的追加等级
  401. API.SetItemData(actor, itemId, "appendlv", newAppendLevel)
  402. -- -- 刷新装备属性(如果需要)
  403. -- Equip_QiangHua.sendAttr(actor, itemId)
  404. -- -- 推送红点通知
  405. -- sendluamsg(actor, LuaNetMsg.Equip_DuanZao_MsgID, {})
  406. -- -- 提示玩家追加成功
  407. -- info(actor, "装备追加等级已增加至 " .. newAppendLevel .. " 级!")
  408. end
  409. function try(func, catch)
  410. local ok, err = pcall(func)
  411. if not ok and catch then
  412. catch(err)
  413. end
  414. end
  415. function EquipRandom.resetEquipSkill(actor, itemQuip)
  416. if itemQuip.skill ~= nil and table.count(itemQuip.skill) > 0 then
  417. return
  418. end
  419. if itemQuip.luaextdata ~= nil and itemQuip.luaextdata.skillinfo ~= nil then
  420. for i, v in ipairs(itemQuip.luaextdata.skillinfo) do
  421. setequipskillbyid(actor, itemQuip.id, v.skillid, v.skilllevel)
  422. end
  423. end
  424. end
  425. function EquipRandom.newItmToBag(actor, itemId, itemCfgId)
  426. local type = ConfigDataManager.getTableValue("cfg_item", "type", "id", itemCfgId)
  427. if tonumber(type) ~= ItemType.EQUIP then
  428. return
  429. end
  430. local itemQuip = getequipinfo(actor, itemId, 1)
  431. if not itemQuip then
  432. return
  433. end
  434. -- 重新生成技能
  435. EquipRandom.resetEquipSkill(actor, itemQuip)
  436. -- local strengthlv = API.GetItemData(actor, itemId, "strengthlv") or 0
  437. if itemQuip.luaextdata ~= nil and itemQuip.luaextdata.strengthlv ~= nil and itemQuip.luaextdata.strengthlv > 0 then
  438. API.refreshLiuGuang(actor, itemId)
  439. end
  440. local isNew = API.GetItemData(actor, itemId, "isaddattr") or 0
  441. if isNew ~= nil and isNew == 1 then
  442. return
  443. end
  444. API.SetItemData(actor, itemId, "isaddattr", 1)
  445. -- -- 获取装备配置信息
  446. local itemCfg = ConfigDataManager.getTable("cfg_equip_entryLib", "id", itemCfgId)
  447. if itemCfg == nil then
  448. return
  449. end
  450. if #itemCfg > 0 then
  451. itemCfg = itemCfg[1]
  452. end
  453. -- 处理强化等级随机
  454. if itemCfg.strengthlevelrandom and itemCfg.strengthlevelrandom ~= "" and
  455. (itemQuip.luaextdata == nil or itemQuip.luaextdata.strengthlv == nil) then
  456. EquipRandom.processStrengthLevelRandom(actor, itemId, itemCfg.strengthlevelrandom)
  457. end
  458. -- 处理追加等级随机
  459. if itemCfg.appendlevelrandom and itemCfg.appendlevelrandom ~= "" and
  460. (itemQuip.luaextdata == nil or itemQuip.luaextdata.appendlv == nil) then
  461. EquipRandom.processAppendLevelRandom(actor, itemId, itemCfg.appendlevelrandom)
  462. end
  463. -- 处理随机属性问题
  464. if (itemQuip.luaextdata ~= nil and itemQuip.luaextdata.entryaddnum ~= nil and itemQuip.luaextdata.entryaddnum ~= 0) then
  465. local cfgEquip = ConfigDataManager.getById("cfg_equip_entryLib", itemQuip.cfgid)
  466. if cfgEquip.att1 ~= nil and cfgEquip.att1 ~= "" then
  467. local cfgEquipAtts = ConfigDataManager.getTable("cfg_equip_att")
  468. local tmpIndex = 0
  469. local tmpentrys = API.TableDeepcopy(itemQuip.entries)
  470. local entrys = {}
  471. for i, v in ipairs(tmpentrys) do
  472. table.insert(entrys, {
  473. value = v.value,
  474. entryid = tostring(v.entryid),
  475. attrid = tostring(v.attrid)
  476. })
  477. end
  478. local count = 200
  479. for i = 1, count do
  480. if tmpIndex >= itemQuip.luaextdata.entryaddnum then
  481. break
  482. end
  483. local addEntry = EquipRefined.equipEntryRandomAttrOne(itemQuip, cfgEquip, cfgEquipAtts)
  484. if addEntry ~= nil then
  485. local hasAttr, v = table.findByCondi(entrys, function(a)
  486. return a.attrid == addEntry.attrid;
  487. end)
  488. if hasAttr == nil then
  489. tmpIndex = tmpIndex + 1
  490. table.insert(entrys, addEntry)
  491. end
  492. end
  493. end
  494. local result = resetequipentry(actor, itemQuip.id, entrys)
  495. if not result then
  496. info("随机生成词条失败")
  497. end
  498. API.SetItemData(actor, itemId, "entryaddnum", 0)
  499. end
  500. end
  501. if itemQuip.luaextdata ~= nil and itemQuip.luaextdata.addLuck ~= nil then
  502. if itemQuip.luaextdata.addLuck == 1 then
  503. EquipRandom.setLuck2(actor, itemQuip)
  504. end
  505. else
  506. EquipRandom.getLuckvalue(actor, itemCfg, itemQuip, itemId)
  507. end
  508. API.SetItemData(actor, itemId, "form", itemQuip.fromnewest)
  509. end
  510. function EquipRandom.setLuck2(actor, itemQuip)
  511. -- 检测装备是否已有幸运属性
  512. if EquipRandom.hasLuckyAttr(itemQuip) then
  513. return
  514. end
  515. local tmpentrys = API.TableDeepcopy(itemQuip.entries)
  516. local entrys = {}
  517. for i, v in ipairs(tmpentrys) do
  518. table.insert(entrys, {
  519. value = v.value,
  520. entryid = tostring(v.entryid),
  521. attrid = tostring(v.attrid)
  522. })
  523. end
  524. local entryCount = table.count(entrys)
  525. for _, attrId in ipairs(EquipRandom.Config.FORCE_ATTR_IDS) do
  526. -- 修正:从配置中获取属性值,如果没有则使用默认值
  527. local attrValue = EquipRandom.Config.ATTR_VALUES[attrId]
  528. if attrValue then
  529. entryCount = entryCount + 1
  530. -- 使用API添加词条
  531. local newEntry = {
  532. attrid = tostring(attrId),
  533. grade = 0,
  534. value = attrValue,
  535. entryid = tostring(entryCount)
  536. }
  537. table.insert(entrys, newEntry)
  538. end
  539. end
  540. local result = resetequipentry(actor, itemQuip.id, entrys)
  541. if not result then
  542. info("随机生成词条失败")
  543. end
  544. end