AngelMajorEquipment.lua 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. --- 大天使装备
  2. --- Generated by EmmyLua(https://github.com/EmmyLua)
  3. --- Created by zhoutao.
  4. --- DateTime: 2024/11/8 17:54
  5. AngelMajorEquipment = {}
  6. local this = {}
  7. this.RedId = 102
  8. --- 发送大天使装备属性信息
  9. --- @param actor table 角色
  10. function AngelMajorEquipment.sendAngelEquipAttrInfo(actor)
  11. local attrInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  12. if table.isNullOrEmpty(attrInfo) then
  13. sendluamsg(actor, LuaMessageIdToClient.RES_ALL_ANGEL_EQUIPMENT_ATTR_INFO, {})
  14. return
  15. end
  16. sendluamsg(actor, LuaMessageIdToClient.RES_ALL_ANGEL_EQUIPMENT_ATTR_INFO, attrInfo)
  17. end
  18. --- 获取指定大天使装备属性
  19. ---@param actor table 角色
  20. ---@param msgData table 消息数据
  21. function AngelMajorEquipment.getEquipAttrById(actor, msgData)
  22. if not this.isOpen(actor) then
  23. return
  24. end
  25. local itemConfigId = msgData["itemConfigId"]
  26. if not this.isAngelEquip(itemConfigId) then
  27. return
  28. end
  29. local itemId = msgData["itemId"]
  30. local attrInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  31. if table.isNullOrEmpty(attrInfo) then
  32. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_ATTR_INFO, {})
  33. return
  34. end
  35. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_ATTR_INFO, {
  36. [itemId] = attrInfo[itemId]
  37. })
  38. end
  39. --- 穿戴大天使装备后增减对应的属性值
  40. ---@param actor table 角色
  41. ---@param oldItemId number 旧道具唯一id
  42. ---@param itemId number 新道具唯一id
  43. ---@param itemConfigId number 道具配置id
  44. function AngelMajorEquipment.afterPutOnAngelEquipment(actor, oldItemId, itemId, itemConfigId)
  45. if not this.isOpen(actor) then
  46. return
  47. end
  48. if this.isAngelEquip(itemConfigId) then
  49. local equipAttr = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  50. local basicAtt = ""
  51. if not table.isNullOrEmpty(equipAttr) then
  52. local attrInfo = equipAttr[itemId]
  53. if not table.isNullOrEmpty(attrInfo) then
  54. local level = attrInfo["level"]
  55. local groupId = ConfigDataManager.getTableValue("cfg_equip_angelGroup", "angelEquipGroup", "id", itemConfigId)
  56. local tableValue = ConfigDataManager.getTable("cfg_equip_angelAtt", "ornamentsGroup", groupId, "lv", level)
  57. if table.isNullOrEmpty(tableValue) then
  58. gameDebug.print("getAngelEquipAttrTableValue is nil itemConfigId:" .. itemConfigId .. " itemLevel:" .. level)
  59. return
  60. end
  61. basicAtt = tableValue[1]["basicatt"]
  62. if string.isNullOrEmpty(basicAtt) then
  63. return
  64. end
  65. end
  66. end
  67. if oldItemId and oldItemId == 0 then
  68. -- 增加属性
  69. this.addAngelEquipAttr(actor, basicAtt, itemId)
  70. -- 增加圣杯词条属性
  71. if not table.isNullOrEmpty(equipAttr) then
  72. local attrInfo = equipAttr[itemId]
  73. if not table.isNullOrEmpty(attrInfo) then
  74. local grails = attrInfo["grails"]
  75. if not table.isNullOrEmpty(grails) then
  76. local grailInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_GRAIL_ENTRY_INFO)
  77. for grailId, _ in pairs(grails) do
  78. AngelMajorGrail.grailAttrHandle(actor, grailInfo[grailId], grailId, true)
  79. end
  80. end
  81. end
  82. end
  83. else
  84. -- 将穿着的装备提升的属性移除
  85. local key = string.format(RoleAttrKey.ANGEL_MAJOR_EQUIPMENT, oldItemId)
  86. RoleAttr.clearRoleAttrAndDB(actor, key)
  87. -- 增加属性
  88. this.addAngelEquipAttr(actor, basicAtt, itemId)
  89. -- 减少并增加圣杯词条属性
  90. if not table.isNullOrEmpty(equipAttr) then
  91. local oldAttrInfo = equipAttr[oldItemId]
  92. local grailInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_GRAIL_ENTRY_INFO)
  93. if not table.isNullOrEmpty(oldAttrInfo) then
  94. local oldGrails = oldAttrInfo["grails"]
  95. if not table.isNullOrEmpty(oldGrails) then
  96. for grailId, _ in pairs(oldGrails) do
  97. AngelMajorGrail.grailAttrHandle(actor, grailInfo[grailId], grailId, false)
  98. end
  99. end
  100. end
  101. local newAttrInfo = equipAttr[itemId]
  102. if not table.isNullOrEmpty(newAttrInfo) then
  103. local newGrails = newAttrInfo["grails"]
  104. if not table.isNullOrEmpty(newGrails) then
  105. for grailId, _ in pairs(newGrails) do
  106. AngelMajorGrail.grailAttrHandle(actor, grailInfo[grailId], grailId, true)
  107. end
  108. end
  109. end
  110. end
  111. end
  112. -- 发送当前装备下圣杯词条信息
  113. this.SendOptEquipGrailInfo(actor, itemId, 1)
  114. -- 判断圣杯红点
  115. local result = AngelMajorGrail.checkEnter(actor)
  116. RedPoint.sendOneRedPoint(actor, this.RedId, result)
  117. -- 更新开服竞技排行数据
  118. local lv = AngelMajorEquipment.getLvSum(actor)
  119. OpenServerCompetition.updateRankData(actor, CompetitionType.ANGEL, lv)
  120. -- 判断是否满足大天使圣杯套装并增加属性
  121. AngelMajorGrail.checkAngelGrailSuitCondition(actor)
  122. end
  123. end
  124. --- 脱下大天使装备后减对应的属性值
  125. ---@param actor table 角色
  126. ---@param itemId number 道具唯一id
  127. ---@param itemConfigId number 道具配置id
  128. function AngelMajorEquipment.afterTakeOffAngelEquipment(actor, itemId, itemConfigId)
  129. if not this.isOpen(actor) then
  130. return
  131. end
  132. if this.isAngelEquip(itemConfigId) then
  133. local key = string.format(RoleAttrKey.ANGEL_MAJOR_EQUIPMENT, itemId)
  134. RoleAttr.clearRoleAttrAndDB(actor, key)
  135. -- 去除圣杯词条属性
  136. local equipInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  137. if not table.isNullOrEmpty(equipInfo) then
  138. local attrInfo = equipInfo[itemId]
  139. if not table.isNullOrEmpty(attrInfo) then
  140. local grailInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_GRAIL_ENTRY_INFO)
  141. if not table.isNullOrEmpty(attrInfo) then
  142. local grails = attrInfo["grails"]
  143. if not table.isNullOrEmpty(grails) then
  144. for grailId, _ in pairs(grails) do
  145. AngelMajorGrail.grailAttrHandle(actor, grailInfo[grailId], grailId, false)
  146. end
  147. end
  148. end
  149. end
  150. end
  151. -- 发送当前装备下圣杯词条信息
  152. this.SendOptEquipGrailInfo(actor, itemId, 2)
  153. -- 判断圣杯红点
  154. local result = AngelMajorGrail.checkEnter(actor)
  155. RedPoint.sendOneRedPoint(actor, this.RedId, result)
  156. -- 更新开服竞技排行数据
  157. local lv = AngelMajorEquipment.getLvSum(actor)
  158. OpenServerCompetition.updateRankData(actor, CompetitionType.ANGEL, lv)
  159. -- 判断是否满足大天使圣杯套装并增加属性
  160. AngelMajorGrail.checkAngelGrailSuitCondition(actor)
  161. end
  162. end
  163. function this.SendOptEquipGrailInfo(actor, equipId, opt)
  164. local equipAttr = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  165. if table.isNullOrEmpty(equipAttr) then
  166. gameDebug.print(getbaseinfo(actor, "rolename"), " AngelMajorGrail.getEquipAllEntryInfo equipAttr is nil")
  167. return
  168. end
  169. local equipInfo = equipAttr[equipId]
  170. if table.isNullOrEmpty(equipInfo) then
  171. gameDebug.print(getbaseinfo(actor, "rolename"), " AngelMajorGrail.getEquipAllEntryInfo equipInfo is nil")
  172. return
  173. end
  174. local grails = equipInfo["grails"]
  175. local res = {}
  176. if not table.isNullOrEmpty(grails) then
  177. local entryInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_GRAIL_ENTRY_INFO)
  178. for grailId, info in pairs(grails) do
  179. local temp = AngelMajorGrail.combineRes(grailId, info, entryInfo)
  180. local attrInfo = temp["attrInfo"]
  181. if attrInfo and AngelMajorGrail.isActiveGrail(actor, grailId) then
  182. attrInfo["active"] = true
  183. end
  184. res[grailId] = temp
  185. end
  186. end
  187. sendluamsg(actor, LuaMessageIdToClient.RES_EQUIP_OPT_ENTRY_INFO, { opt = opt, res = res })
  188. end
  189. --- 初始化大天使装备成长属性
  190. ---@param actor table 角色
  191. ---@param itemId number 道具唯一id
  192. ---@param cfgId number 道具配置id
  193. function AngelMajorEquipment.initAngelEquipmentAttr(actor, itemId, cfgId)
  194. if this.isAngelEquip(cfgId) then
  195. local equipAttr = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  196. -- 初始化装备成长属性
  197. if not table.isNullOrEmpty(equipAttr) then
  198. local itemAttr = equipAttr[itemId]
  199. if table.isNullOrEmpty(itemAttr) then
  200. equipAttr[itemId] = {
  201. ["level"] = 0,
  202. ["exp"] = 0,
  203. ["rank"] = 1,
  204. ["grails"] = {}
  205. }
  206. end
  207. else
  208. equipAttr = {
  209. [itemId] = {
  210. ["level"] = 0,
  211. ["exp"] = 0,
  212. ["rank"] = 1,
  213. ["grails"] = {}
  214. }
  215. }
  216. end
  217. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, equipAttr)
  218. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_ATTR_INFO, {
  219. [itemId] = equipAttr[itemId]
  220. })
  221. end
  222. end
  223. --- 销毁大天使装备
  224. ---@param actor table 角色
  225. ---@param cfgId number 道具配置id
  226. ---@param itemId number 道具唯一id
  227. function AngelMajorEquipment.destroyAngelEquip(actor, cfgId, itemId)
  228. if not this.isOpen(actor) then
  229. return
  230. end
  231. if this.isAngelEquip(cfgId) then
  232. local equipAttr = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  233. if table.isNullOrEmpty(equipAttr) then
  234. return
  235. end
  236. -- 清除圣杯词条数据
  237. local attrInfo = equipAttr[itemId]
  238. if not table.isNullOrEmpty(attrInfo) then
  239. local grails = attrInfo["grails"]
  240. if not table.isNullOrEmpty(grails) then
  241. local grailInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_GRAIL_ENTRY_INFO)
  242. for grailId, _ in pairs(grails) do
  243. grailInfo[grailId] = nil
  244. end
  245. setplaydef(actor, PlayerDefKey.angel.ANGEL_GRAIL_ENTRY_INFO, grailInfo)
  246. end
  247. end
  248. equipAttr[itemId] = nil
  249. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, equipAttr)
  250. sendluamsg(actor, LuaMessageIdToClient.RES_DESTROY_ANGEL_EQUIPMENT, itemId)
  251. end
  252. end
  253. --- 突破大天使装备
  254. ---@param actor table 角色
  255. ---@param itemId number 道具唯一id
  256. function AngelMajorEquipment.breakEquipment(actor, msgData)
  257. if not this.isOpen(actor) then
  258. return
  259. end
  260. local itemConfigId = msgData["itemConfigId"]
  261. if not this.isAngelEquip(itemConfigId) then
  262. return
  263. end
  264. local itemId = msgData["itemId"]
  265. local groupId = msgData["groupId"]
  266. local equipAttr = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  267. local attrInfo = equipAttr[itemId]
  268. if table.isNullOrEmpty(attrInfo) then
  269. return
  270. end
  271. local level = attrInfo["level"]
  272. local rank = attrInfo["rank"]
  273. local grails = attrInfo["grails"]
  274. local tableValue = ConfigDataManager.getTable("cfg_equip_angelAtt", "ornamentsGroup", groupId, "lv", level)
  275. if table.isNullOrEmpty(tableValue) then
  276. return
  277. end
  278. local breakMaterial = tableValue[1]["breakmaterial"]
  279. if string.isNullOrEmpty(breakMaterial) then
  280. return
  281. end
  282. -- 根据配置的道具信息消耗道具进行突破
  283. local items = string.split(breakMaterial, "|")
  284. local result = true
  285. for _, costItems in pairs(items) do
  286. local tmps = string.split(costItems, "#")
  287. local costItemId = tmps[1]
  288. local costItemCount = tmps[2]
  289. if not Bag.checkItem(actor, costItemId, costItemCount) then
  290. result = false
  291. break
  292. end
  293. end
  294. if result then
  295. for _, costItems in pairs(items) do
  296. local tmps = string.split(costItems, "#")
  297. local costItemId = tmps[1]
  298. local costItemCount = tmps[2]
  299. removeitemfrombag(actor, costItemId, costItemCount, 0, 9999, ItemAction.ANGEL_EQUIPMENT_BREAK_COST)
  300. end
  301. equipAttr[itemId] = {
  302. ["level"] = level + 1,
  303. ["exp"] = 0,
  304. ["rank"] = rank + 1,
  305. ["grails"] = grails,
  306. }
  307. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, equipAttr)
  308. -- 突破后增加对应的属性
  309. local basicAtt = tableValue[1]["basicatt"]
  310. if string.isNullOrEmpty(basicAtt) then
  311. return
  312. end
  313. this.addAngelEquipAttr(actor, basicAtt, itemId)
  314. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_ATTR_INFO, {
  315. [itemId] = equipAttr[itemId]
  316. })
  317. -- 响应装备突破结果
  318. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_BREAK_RESULT, result)
  319. else
  320. -- 响应装备突破结果
  321. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_BREAK_RESULT, result)
  322. end
  323. -- 红点判断
  324. local checkEnter = AngelMajorGrail.checkEnter(actor)
  325. RedPoint.sendOneRedPoint(actor, this.RedId, checkEnter)
  326. end
  327. --- 攻击指定怪物增加大天使装备经验值
  328. ---@param actor table 角色
  329. ---@param fightData table 战斗数据
  330. function AngelMajorEquipment.attack(actor, fightData)
  331. if not this.isOpen(actor) then
  332. return
  333. end
  334. if isofflineplay(actor) then
  335. return
  336. end
  337. local targetType = fightData["targettype"]
  338. local targetConfigId = fightData["targetcfgid"]
  339. if targetType == 2 then
  340. local angelExp = ConfigDataManager.getTableValue("cfg_monster", "angelExp", "id", targetConfigId)
  341. angelExp = angelExp and tonumber(angelExp) or 0
  342. if angelExp == 0 then
  343. return
  344. end
  345. local equipmentData = getputonequipinfo(actor)
  346. if table.isNullOrEmpty(equipmentData) then
  347. return
  348. end
  349. local isLevelUp = false
  350. local mark = false
  351. local attrInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  352. if table.isNullOrEmpty(attrInfo) then
  353. return
  354. end
  355. local equipId = {}
  356. for _, v in pairs(equipmentData) do
  357. local tempExp = angelExp
  358. -- 判断是否拥有大天使装备经验加成buff
  359. local expBoostInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIP_EXP_BOOST_INFO)
  360. if not table.isNullOrEmpty(expBoostInfo) then
  361. local delayTime = expBoostInfo[tonumber(BuffId.ANGEL_EXP_BOOST_ID)]["delayTime"]
  362. local value = expBoostInfo[tonumber(BuffId.ANGEL_EXP_BOOST_ID)]["value"]
  363. local now = getbaseinfo(actor, "now")
  364. if now <= delayTime then
  365. tempExp = math.round(tempExp + (tempExp * value / 100))
  366. end
  367. end
  368. mark, isLevelUp = this.addAngelEquipExp(actor, attrInfo, v, tempExp, isLevelUp)
  369. if not mark then
  370. break
  371. end
  372. table.insert(equipId, v["id"])
  373. end
  374. if isLevelUp then
  375. -- 更新开服竞技排行数据
  376. local lv = AngelMajorEquipment.getLvSum(actor)
  377. OpenServerCompetition.updateRankData(actor, CompetitionType.ANGEL, lv)
  378. end
  379. local equipInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  380. local res = {}
  381. for _, v in pairs(equipId) do
  382. res[v] = equipInfo[v]
  383. end
  384. sendluamsg(actor, LuaMessageIdToClient.RES_ALL_ANGEL_EQUIPMENT_ATTR_INFO, res)
  385. end
  386. end
  387. --- 检查type=2的类型是否满足穿戴条件
  388. ---@param actor table 角色
  389. ---@param id number cfg_equip_angelSuit表id
  390. ---@return boolean, number 是否满足穿戴条件,增加的天赋点
  391. function AngelMajorEquipment.checkDressedConditionType2(actor, id)
  392. local tableValue = ConfigDataManager.getTable("cfg_equip_angelSuit", "id", id, "career", getbaseinfo(actor, "getbasecareer"))
  393. if table.isNullOrEmpty(tableValue) then
  394. gameDebug.print("AngelMajorEquipment.checkDressedCondition cfg_equip_angelSuit表id不存在")
  395. return false, 0
  396. end
  397. local dressedEquip = getputonequipinfo(actor)
  398. if table.isNullOrEmpty(dressedEquip) then
  399. return false, 0
  400. end
  401. local dressedCount = 0
  402. for _, v in pairs(dressedEquip) do
  403. local itemConfigId = v["cfgid"]
  404. if this.isAngelEquip(itemConfigId) then
  405. dressedCount = dressedCount + 1
  406. end
  407. end
  408. local equipAttr = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  409. local wearingCount = tableValue[1]["wearingcount"]
  410. if dressedCount < tonumber(wearingCount) then
  411. return false, 0
  412. end
  413. -- 装备组#部件数量#等级|装备组#部件数量#等级
  414. local angelLv = tableValue[1]["angellv"]
  415. if string.isNullOrEmpty(angelLv) then
  416. return false, 0
  417. end
  418. local split = string.split(angelLv, "|")
  419. local result = true
  420. local temp = {}
  421. for _, v in pairs(split) do
  422. -- 判断条件是否满足
  423. local tmp_split = string.split(v, "#")
  424. local groupId = tmp_split[1]
  425. local count = tmp_split[2]
  426. local level = tmp_split[3]
  427. local sum = 0
  428. for _, equipInfo in pairs(dressedEquip) do
  429. local itemConfigId = equipInfo["cfgid"]
  430. if this.isAngelEquip(itemConfigId) then
  431. local itemId = tonumber(equipInfo["id"])
  432. if not table.contains(temp, itemId) then
  433. local equipGroupId = ConfigDataManager.getTableValue("cfg_equip_angelGroup", "angelEquipSuit", "id", itemConfigId)
  434. if tonumber(groupId) == tonumber(equipGroupId) then
  435. local attrInfo = equipAttr[itemId]
  436. local equipLevel = attrInfo["level"]
  437. if equipLevel >= tonumber(level) then
  438. sum = sum + 1
  439. if sum >= tonumber(count) then
  440. table.insert(temp, itemId)
  441. goto outer
  442. end
  443. end
  444. end
  445. end
  446. end
  447. end
  448. :: outer ::
  449. if sum < tonumber(count) then
  450. result = false
  451. end
  452. end
  453. return result, result and tableValue[1]["count"] or 0
  454. end
  455. --- 检查条件是否满足增加天赋点,满足直接被动增加
  456. ---@param actor table 角色
  457. function this.checkConditionIncrementTalentPoint(actor)
  458. -- 获取穿着的装备等级和
  459. local levelSum = AngelMajorEquipment.getLvSum(actor)
  460. if levelSum == 0 then
  461. return
  462. end
  463. local tableValues = ConfigDataManager.getTable("cfg_equip_angelSuit", "type", 1, "career", getbaseinfo(actor, "getbasecareer"))
  464. local alreadyIncrementId = getplaydef(actor, PlayerDefKey.angel.ANGEL_TALENT_ALREADY_INCREMENT_ID)
  465. alreadyIncrementId = alreadyIncrementId and tonumber(alreadyIncrementId) or 0
  466. for _, tableValue in pairs(tableValues) do
  467. local id = tonumber(tableValue["id"])
  468. if alreadyIncrementId >= id then
  469. goto continue
  470. end
  471. local angelLv = tableValue["angellv"]
  472. if levelSum >= tonumber(angelLv) then
  473. AngelMajorTalent.incrementTalentPoint(actor, tableValue["count"])
  474. setplaydef(actor, PlayerDefKey.angel.ANGEL_TALENT_ALREADY_INCREMENT_ID, id)
  475. end
  476. :: continue ::
  477. end
  478. end
  479. -- 获取大天使装备等级和
  480. function AngelMajorEquipment.getLvSum(actor)
  481. local dressedEquipment = getputonequipinfo(actor)
  482. if table.isNullOrEmpty(dressedEquipment) then
  483. return 0
  484. end
  485. local equipAttr = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA) or {}
  486. local levelSum = 0
  487. for _, v in pairs(dressedEquipment) do
  488. local itemId = v["id"]
  489. local itemConfigId = v["cfgid"]
  490. if this.isAngelEquip(itemConfigId) then
  491. local attr = equipAttr[itemId]
  492. levelSum = levelSum + tonumber(attr["level"])
  493. end
  494. end
  495. return levelSum
  496. end
  497. --- 使用大天使经验药水或经验加成药水
  498. ---@param actor table 角色对象
  499. ---@param itemConfigId number 道具配置id
  500. ---@param count number 使用数量
  501. function AngelMajorEquipment.useExperienceBoostItem(actor, itemConfigId, count)
  502. local tableValue = ConfigDataManager.getTable("cfg_item", "id", itemConfigId)
  503. if not tableValue then
  504. return
  505. end
  506. local type = tonumber(tableValue[1]["type"])
  507. local subType = tonumber(tableValue[1]["subtype"])
  508. -- 经验加成药水使用
  509. if type == ItemType.DRUG and subType == ItemSubType.ANGEL_EXP_BOOST then
  510. local useParam = tableValue[1]["useparam"]
  511. if string.isNullOrEmpty(useParam) then
  512. return
  513. end
  514. local param = string.split(useParam, "#")
  515. local buffId = tonumber(param[3])
  516. local buffInfo = ConfigDataManager.getTable("cfg_buff", "id", buffId)
  517. local totalTime = tonumber(buffInfo[1]["bufftotaltime"])
  518. local boostValue = tonumber(param[1])
  519. local boostInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIP_EXP_BOOST_INFO)
  520. local now = getbaseinfo(actor, "now")
  521. for i = 1, count do
  522. if not table.isNullOrEmpty(boostInfo) then
  523. local time = boostInfo[tonumber(BuffId.ANGEL_EXP_BOOST_ID)]["delayTime"]
  524. local value = boostInfo[tonumber(BuffId.ANGEL_EXP_BOOST_ID)]["value"]
  525. if time and time > now then
  526. boostInfo[tonumber(BuffId.ANGEL_EXP_BOOST_ID)] = {
  527. ["delayTime"] = time + totalTime,
  528. ["value"] = boostValue > value and boostValue or value
  529. }
  530. else
  531. local endTime = now + totalTime
  532. boostInfo[tonumber(BuffId.ANGEL_EXP_BOOST_ID)] = {
  533. ["delayTime"] = endTime,
  534. ["value"] = boostValue > value and boostValue or value
  535. }
  536. end
  537. else
  538. local endTime = now + totalTime
  539. boostInfo = {
  540. [tonumber(BuffId.ANGEL_EXP_BOOST_ID)] = {
  541. ["delayTime"] = endTime,
  542. ["value"] = boostValue
  543. }
  544. }
  545. end
  546. end
  547. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIP_EXP_BOOST_INFO, boostInfo)
  548. this.delayCloseExpBoostBuff(actor, boostInfo[tonumber(BuffId.ANGEL_EXP_BOOST_ID)]["delayTime"] - now)
  549. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIP_EXP_BOOST_INFO, boostInfo)
  550. end
  551. -- 经验药水使用
  552. if type == ItemType.DRUG and subType == ItemSubType.ANGEL_EXP then
  553. local useParam = tableValue[1]["useparam"]
  554. if string.isNullOrEmpty(useParam) then
  555. return
  556. end
  557. local partAndExp = string.toStringStringMap(useParam, "#", "|")
  558. local putOnEquipInfo = getputonequipinfo(actor)
  559. if table.isNullOrEmpty(putOnEquipInfo) then
  560. return
  561. end
  562. local equipInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  563. for i = 1, count do
  564. local isLevelUp = false
  565. for _, v in pairs(putOnEquipInfo) do
  566. local cfgId = v["cfgid"]
  567. if this.isAngelEquip(cfgId) then
  568. local part = ConfigDataManager.getTableValue("cfg_item", "strPart", "id", cfgId)
  569. if string.contains(part, "#") then
  570. local partSplit = string.split(part, "#")
  571. local exp = 0
  572. for _, partItem in pairs(partSplit) do
  573. exp = partAndExp[partItem]
  574. end
  575. if exp then
  576. exp = tonumber(exp)
  577. _, isLevelUp = this.addAngelEquipExp(actor, equipInfo, v, exp, isLevelUp)
  578. end
  579. else
  580. if partAndExp[part] then
  581. local exp = tonumber(partAndExp[part])
  582. _, isLevelUp = this.addAngelEquipExp(actor, equipInfo, v, exp, isLevelUp)
  583. end
  584. end
  585. end
  586. end
  587. if isLevelUp then
  588. -- 更新开服竞技排行数据
  589. local lv = AngelMajorEquipment.getLvSum(actor)
  590. OpenServerCompetition.updateRankData(actor, CompetitionType.ANGEL, lv)
  591. sendluamsg(actor, LuaMessageIdToClient.RES_ALL_ANGEL_EQUIPMENT_ATTR_INFO, equipInfo)
  592. end
  593. end
  594. sendluamsg(actor, LuaMessageIdToClient.RES_ALL_ANGEL_EQUIPMENT_ATTR_INFO, equipInfo)
  595. end
  596. end
  597. --- 获取指定玩家的指定大天使装备成长属性
  598. ---@param actor table 角色对象
  599. ---@param msgData table 消息数据
  600. function AngelMajorEquipment.getPlayerAngelEquipInfo(actor, msgData)
  601. local rid = msgData["rid"]
  602. local hostId = msgData["hostId"]
  603. local serverId = getbaseinfo(actor, "serverid")
  604. local targetActor = getactor(actor, rid)
  605. -- 非本服玩家走异步接口拿数据
  606. if not string.isNullOrEmpty(hostId) and tonumber(hostId) ~= tonumber(serverId) then
  607. getplaydefasync(actor, targetActor:toString(), PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, actor:toString())
  608. else
  609. local equipInfo = getplaydef(targetActor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  610. if table.isNullOrEmpty(equipInfo) then
  611. return
  612. end
  613. sendluamsg(actor, LuaMessageIdToClient.RES_OTHER_ANGE_EQUIP_INFO, equipInfo)
  614. end
  615. end
  616. --- 发送对应玩家的大天使装备信息
  617. ---@param actor table 角色对象
  618. ---@param equipInfo table 大天使装备信息
  619. ---@param params table 参数
  620. function AngelMajorEquipment.sendPlayerAngelEquipInfo(actor, equipInfo, params)
  621. local player = getactor(params)
  622. sendluamsg(player, LuaMessageIdToClient.RES_OTHER_ANGE_EQUIP_INFO, equipInfo)
  623. end
  624. --- 添加大天使装备的圣杯等级
  625. ---@param actor table 角色对象
  626. ---@param grailId number 圣杯id
  627. ---@param grailLevel number 圣杯等级
  628. function AngelMajorEquipment.addGrailLevel(actor, grailId, grailLevel)
  629. local equipData = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  630. if not table.isNullOrEmpty(equipData) then
  631. for _, v in pairs(equipData) do
  632. local grails = v["grails"]
  633. if not table.isNullOrEmpty(grails) and not table.isNullOrEmpty(grails[grailId]) then
  634. grails[grailId]["level"] = grailLevel
  635. end
  636. end
  637. end
  638. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, equipData)
  639. end
  640. --- 登录
  641. ---@param actor table 角色对象
  642. function AngelMajorEquipment.login(actor)
  643. -- 发送所有大天使装备信息
  644. AngelMajorEquipment.sendAngelEquipAttrInfo(actor)
  645. -- 大天使经验药水过期计算
  646. local boostInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIP_EXP_BOOST_INFO)
  647. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIP_EXP_BOOST_INFO, boostInfo and boostInfo or {})
  648. if not table.isNullOrEmpty(boostInfo) then
  649. local now = getbaseinfo(actor, "now")
  650. local delayTime = boostInfo[tonumber(BuffId.ANGEL_EXP_BOOST_ID)]["delayTime"]
  651. this.delayCloseExpBoostBuff(actor, delayTime - now)
  652. end
  653. end
  654. --- 获取已穿戴的大天使装备id列表
  655. ---@param actor table 角色对象
  656. ---@return table 大天使装备id列表
  657. function AngelMajorEquipment.getPutOnEquipIds(actor)
  658. local putOnEquipIds = {}
  659. local equipInfo = getputonequipinfo(actor)
  660. if not table.isNullOrEmpty(equipInfo) then
  661. for _, v in pairs(equipInfo) do
  662. local cfgId = v["cfgid"]
  663. if this.isAngelEquip(cfgId) then
  664. table.insert(putOnEquipIds, v["id"])
  665. end
  666. end
  667. end
  668. return putOnEquipIds
  669. end
  670. --- 判断是否开启
  671. ---@param actor table 角色对象
  672. function this.isOpen(actor)
  673. -- 获取当前角色等级
  674. local level = getbaseinfo(actor, "level")
  675. -- 获取等级限制配置
  676. local levelLimit = ConfigDataManager.getTableValue("cfg_global", "value", "id", GlobalConfigId.ANGEL_EQUIPMENT_LEVEL_LIMIT)
  677. if string.isNullOrEmpty(levelLimit) then
  678. return false
  679. end
  680. -- 返回结果
  681. return level >= tonumber(levelLimit)
  682. end
  683. --- 判断是否为大天使装备
  684. ---@param itemConfigId number 道具配置id
  685. function this.isAngelEquip(itemConfigId)
  686. local tableValue = ConfigDataManager.getTable("cfg_equip_angelGroup", "id", itemConfigId)
  687. return not table.isNullOrEmpty(tableValue)
  688. end
  689. --- 给角色添加大天使装备对应的属性
  690. ---@param actor table 角色对象
  691. ---@param basicAtt string 增加的属性
  692. ---@param itemId number 道具id
  693. function this.addAngelEquipAttr(actor, basicAtt, itemId)
  694. if string.isNullOrEmpty(basicAtt) then
  695. return
  696. end
  697. local attrTable = string.split(basicAtt, "|")
  698. local temp = {}
  699. for _, attr in pairs(attrTable) do
  700. local tmps = string.split(attr, "#")
  701. local attrId = tmps[1]
  702. local attrValue = tmps[2]
  703. if tonumber(attrValue) == 0 then
  704. goto continue
  705. end
  706. temp[tonumber(attrId)] = tonumber(attrValue)
  707. :: continue ::
  708. end
  709. -- 表里配的不是增长的属性值,所以此处先清空之前增加的属性值再做添加属性操作
  710. local attrKey = string.format(RoleAttrKey.ANGEL_MAJOR_EQUIPMENT, itemId)
  711. RoleAttr.clearRoleAttrAndDB(actor, attrKey)
  712. RoleAttr.addAndSaveRoleAttr(actor, attrKey, temp)
  713. this.checkConditionIncrementTalentPoint(actor)
  714. end
  715. --- 添加大天使装备经验
  716. ---@param actor table 角色对象
  717. ---@param attrInfo table 大天使装备属性信息
  718. ---@param equip table 装备信息
  719. ---@param tempExp number 临时经验值
  720. ---@param isLevelUp boolean 是否升级
  721. function this.addAngelEquipExp(actor, attrInfo, equip, tempExp, isLevelUp)
  722. local itemId = equip["id"]
  723. local itemConfigId = equip["cfgid"]
  724. if not this.isAngelEquip(itemConfigId) then
  725. return true, isLevelUp
  726. end
  727. if table.isNullOrEmpty(attrInfo) then
  728. return false, isLevelUp
  729. end
  730. local itemAttrInfo = attrInfo[itemId]
  731. if table.isNullOrEmpty(itemAttrInfo) then
  732. return false, isLevelUp
  733. end
  734. local itemLevel = itemAttrInfo["level"]
  735. local itemExp = itemAttrInfo["exp"]
  736. local rank = itemAttrInfo["rank"]
  737. local grails = itemAttrInfo["grails"]
  738. local groupId = ConfigDataManager.getTableValue("cfg_equip_angelGroup", "angelEquipGroup", "id", itemConfigId)
  739. local tableValue = ConfigDataManager.getTable("cfg_equip_angelAtt", "ornamentsGroup", groupId, "lv", itemLevel)
  740. if not tableValue then
  741. return true, isLevelUp
  742. end
  743. local levelUpNeedExp = tableValue[1]["lvdeplete"]
  744. -- 如果达到满级则直接返回
  745. if string.isNullOrEmpty(levelUpNeedExp) then
  746. return true, isLevelUp
  747. end
  748. local breakMaterial = tableValue[1]["breakmaterial"]
  749. if not string.isNullOrEmpty(breakMaterial) and itemExp == tonumber(levelUpNeedExp) then
  750. -- 此前已经达到突破等级后直接跳过此次循环
  751. return true, isLevelUp
  752. end
  753. if tempExp >= tonumber(levelUpNeedExp) then
  754. while tempExp >= tonumber(levelUpNeedExp) do
  755. tempExp = tempExp - tonumber(levelUpNeedExp)
  756. itemLevel = itemLevel + 1
  757. isLevelUp = true
  758. local angelAtt = ConfigDataManager.getTable("cfg_equip_angelAtt", "ornamentsGroup", groupId, "lv", itemLevel)
  759. breakMaterial = angelAtt[1]["breakmaterial"]
  760. levelUpNeedExp = angelAtt[1]["lvdeplete"]
  761. -- 突破材料判断,达到突破等级后
  762. if not string.isNullOrEmpty(breakMaterial) then
  763. attrInfo[itemId] = {
  764. ["level"] = itemLevel,
  765. ["exp"] = tonumber(levelUpNeedExp),
  766. ["rank"] = rank,
  767. ["grails"] = grails
  768. }
  769. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, attrInfo)
  770. -- 通知客户端可以突破
  771. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_CAN_BREAK, itemId)
  772. this.addAngelEquipAttr(actor, angelAtt[1]["basicatt"], itemId)
  773. return true, isLevelUp
  774. else
  775. attrInfo[itemId] = {
  776. ["level"] = itemLevel,
  777. ["exp"] = 0,
  778. ["rank"] = rank,
  779. ["grails"] = grails
  780. }
  781. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, attrInfo)
  782. end
  783. end
  784. if isLevelUp then
  785. -- 升级后增加对应的属性
  786. local basicAtt = ConfigDataManager.getTableValue("cfg_equip_angelAtt", "basicAtt", "ornamentsGroup", groupId, "lv", itemLevel)
  787. if string.isNullOrEmpty(basicAtt) then
  788. return true, isLevelUp
  789. end
  790. this.addAngelEquipAttr(actor, basicAtt, itemId)
  791. end
  792. end
  793. local addExp = itemExp + tempExp
  794. if addExp >= tonumber(levelUpNeedExp) then
  795. -- 突破材料判断,达到突破等级后
  796. if not string.isNullOrEmpty(breakMaterial) then
  797. attrInfo[itemId] = {
  798. ["level"] = itemLevel,
  799. ["exp"] = tonumber(levelUpNeedExp),
  800. ["rank"] = rank,
  801. ["grails"] = grails
  802. }
  803. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, attrInfo)
  804. -- 通知客户端可以突破
  805. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_CAN_BREAK, itemId)
  806. return true, isLevelUp
  807. else
  808. -- 没有达到突破等级,直接升级
  809. itemLevel = itemLevel + 1
  810. isLevelUp = true
  811. itemExp = addExp - tonumber(levelUpNeedExp)
  812. attrInfo[itemId] = {
  813. ["level"] = itemLevel,
  814. ["exp"] = itemExp,
  815. ["rank"] = rank,
  816. ["grails"] = grails
  817. }
  818. -- 升级后增加对应的属性
  819. local basicAtt = ConfigDataManager.getTableValue("cfg_equip_angelAtt", "basicAtt", "ornamentsGroup", groupId, "lv", itemLevel)
  820. if string.isNullOrEmpty(basicAtt) then
  821. return true, isLevelUp
  822. end
  823. this.addAngelEquipAttr(actor, basicAtt, itemId)
  824. end
  825. else
  826. attrInfo[itemId] = {
  827. ["level"] = itemLevel,
  828. ["exp"] = addExp,
  829. ["rank"] = rank,
  830. ["grails"] = grails
  831. }
  832. end
  833. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, attrInfo)
  834. return true, isLevelUp
  835. end
  836. --- 延迟关闭天使装备经验加成buff
  837. ---@param actor table 角色对象
  838. ---@param delayTime number 延迟时间
  839. function this.delayCloseExpBoostBuff(actor, delayTime)
  840. intervalcalldelay(actor, delayTime, 1000, 1, "angelexpboostclear")
  841. end
  842. --- 天使装备经验加成buff延迟关闭
  843. function angelexpboostclear(actor)
  844. local boostInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIP_EXP_BOOST_INFO)
  845. if not table.isNullOrEmpty(boostInfo) then
  846. local now = getbaseinfo(actor, "now")
  847. local delayTime = boostInfo[tonumber(BuffId.ANGEL_EXP_BOOST_ID)]["delayTime"]
  848. if now >= delayTime then
  849. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIP_EXP_BOOST_INFO, {})
  850. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_EQUIP_EXP_BOOST_INFO, { [tonumber(BuffId.ANGEL_EXP_BOOST_ID)] = {} })
  851. end
  852. end
  853. end
  854. --- 根据条件发送已激活与可激活的天赋大师id信息
  855. ---@param actor table 角色
  856. --[[function this.sendActiveTalentInfo(actor)
  857. local career = getbaseinfo(actor, "getbasecareer")
  858. local tables = ConfigDataManager.getTable("cfg_equip_angelSuit", "type", 2, "career", career)
  859. local res = {}
  860. local activeIds = getplaydef(actor, PlayerDefKey.angel.ANGEL_TALENT_ACTIVE_ID)
  861. activeIds = activeIds and activeIds or {}
  862. local canActiveIds = getplaydef(actor, PlayerDefKey.angel.ANGEL_TALENT_CAN_ACTIVE_ID)
  863. canActiveIds = canActiveIds and canActiveIds or {}
  864. for _, v in pairs(tables) do
  865. local id = tonumber(v["id"])
  866. if table.contains(activeIds, id) then
  867. goto mark
  868. end
  869. local result, _ = AngelMajorEquipment.checkDressedConditionType2(actor, id)
  870. if result then
  871. if table.contains(canActiveIds, id) then
  872. goto mark
  873. else
  874. table.insert(canActiveIds, id)
  875. setplaydef(actor, PlayerDefKey.angel.ANGEL_TALENT_CAN_ACTIVE_ID, canActiveIds)
  876. end
  877. else
  878. if table.contains(canActiveIds, id) then
  879. table.removeByValue(canActiveIds, id)
  880. setplaydef(actor, PlayerDefKey.angel.ANGEL_TALENT_CAN_ACTIVE_ID, canActiveIds)
  881. else
  882. goto mark
  883. end
  884. end
  885. :: mark ::
  886. end
  887. res["activeIds"] = activeIds and activeIds or {}
  888. res["canActiveIds"] = canActiveIds and canActiveIds or {}
  889. sendluamsg(actor, LuaMessageIdToClient.RES_ANGEL_TALENT_ACTIVE_INFO, res)
  890. end]]
  891. --- 测试增加大天使装备经验
  892. ---@param actor table 角色对象
  893. ---@param exp number 经验值
  894. function addangelequipexp(actor, exp)
  895. local angelExp = tonumber(exp)
  896. local equipmentData = getputonequipinfo(actor)
  897. if table.isNullOrEmpty(equipmentData) then
  898. return
  899. end
  900. local isLevelUp = false
  901. local mark = false
  902. local attrInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  903. for _, v in pairs(equipmentData) do
  904. local tempExp = angelExp
  905. mark, isLevelUp = this.addAngelEquipExp(actor, attrInfo, v, tempExp, isLevelUp)
  906. if not mark then
  907. break
  908. end
  909. end
  910. if isLevelUp then
  911. -- 更新开服竞技排行数据
  912. local lv = AngelMajorEquipment.getLvSum(actor)
  913. OpenServerCompetition.updateRankData(actor, CompetitionType.ANGEL, lv)
  914. sendluamsg(actor, LuaMessageIdToClient.RES_ALL_ANGEL_EQUIPMENT_ATTR_INFO, attrInfo)
  915. end
  916. sendluamsg(actor, LuaMessageIdToClient.RES_ALL_ANGEL_EQUIPMENT_ATTR_INFO, attrInfo)
  917. end
  918. function AngelMajorEquipment.grailsDataHandle()
  919. local isHandle = getsysvar(SystemVarConst.GRAILS_DATA_IS_HANDLE)
  920. if not isHandle then
  921. jprint("================================>grailsDataHandle start")
  922. local allRole = getallrolesummaryinfos()
  923. if not table.isNullOrEmpty(allRole) then
  924. for _, role in pairs(allRole) do
  925. local actor = role["actor"]
  926. local equipData = getplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA)
  927. if not table.isNullOrEmpty(equipData) then
  928. local grailInfo = getplaydef(actor, PlayerDefKey.angel.ANGEL_GRAIL_ENTRY_INFO)
  929. for _, v in pairs(equipData) do
  930. local grails = v["grails"]
  931. if not table.isNullOrEmpty(grails) then
  932. for grailId, data in pairs(grails) do
  933. local level = data["level"]
  934. if string.isNullOrEmpty(level) then
  935. local entryInfo = grailInfo[grailId]
  936. if not table.isNullOrEmpty(entryInfo) then
  937. grails[grailId]["level"] = entryInfo["level"]
  938. end
  939. end
  940. end
  941. end
  942. end
  943. end
  944. setplaydef(actor, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA, equipData)
  945. end
  946. end
  947. setsysvar(SystemVarConst.GRAILS_DATA_IS_HANDLE, true)
  948. jprint("================================>grailsDataHandle end")
  949. end
  950. end
  951. --- 合服变量处理
  952. function AngelMajorEquipment.combine()
  953. local hosts = gethosts()
  954. for _, host in ipairs(hosts) do
  955. setsysvar(host, SystemVarConst.GRAILS_DATA_IS_HANDLE, false)
  956. end
  957. end