SkinLogic.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. local Msg = require("core.Msg")
  2. local Grid = require("bag.Grid")
  3. local BagLogic = require("bag.BagLogic")
  4. local Broadcast = require("broadcast.Broadcast")
  5. local Lang = require("common.Lang")
  6. local Util = require("common.Util")
  7. local ItemDefine = require("bag.ItemDefine")
  8. local BeSkill = require("combat.BeSkill")
  9. local HeroLogic = require("hero.HeroLogic")
  10. local RoleHeadLogic = require("role.RoleHeadLogic")
  11. local SkinExcel = require("excel.skin").skin
  12. local HeroExcel = require("excel.hero").hero
  13. local SkillExcel = require("excel.skin").skill
  14. local OutExcel = require("excel.skin").out
  15. local ItemExcel = require("excel.item").item
  16. local RoleAttr = require("role.RoleAttr")
  17. local CombatDefine = require("combat.CombatDefine")
  18. local CombatImpl = require("combat.CombatImpl")
  19. local RoleDefine = require("role.RoleDefine")
  20. local ObjHuman = require("core.ObjHuman")
  21. local function getBag(human)
  22. if not (human.skinBag and human.heroSkin) then
  23. human.skinBag = {}
  24. human.heroSkin = {}
  25. human.hasSkin = {}
  26. for i = 1,human.db.skinBag[0] do
  27. local data = human.db.skinBag[i]
  28. if data then
  29. if data.heroInd then
  30. local skinSkillID
  31. local heroGrid = human.db.heroBag[data.heroInd]
  32. if not heroGrid then
  33. data.heroInd = nil
  34. else
  35. local heroID = heroGrid.id
  36. local heroConf = HeroExcel[heroID]
  37. for _,v in ipairs(heroConf.skin) do
  38. if v[1] == data.id then
  39. human.heroSkin[data.heroInd] = {i,tonumber(v[2])}
  40. end
  41. end
  42. end
  43. end
  44. human.skinBag[i] = data.id
  45. human.hasSkin[data.id] = human.hasSkin[data.id] or {}
  46. human.hasSkin[data.id][i] = 1
  47. end
  48. end
  49. end
  50. return human.db.skinBag
  51. end
  52. --[[
  53. skin = {
  54. ttl = number -- 有效时长 -1表示永久
  55. state = number -- 0表示未穿戴 1 表示穿戴
  56. } -- skin 拥有唯一性
  57. ]]
  58. -- 获取所有皮肤信息
  59. local function skinListQuery(human)
  60. local skinBag = human.db.skinBag
  61. local ret = {}
  62. for i = 1,#skinBag do
  63. local data = skinBag[i]
  64. ret[data.id] = {
  65. idx = i,
  66. id = data.id,
  67. ttl = data.ttl,
  68. state = data.state,
  69. }
  70. end
  71. return ret
  72. end
  73. -- 获取皮肤为skinId的皮肤
  74. local function skinQueryById(human,skinId)
  75. local skin = human.db.skinBag[skinId]
  76. if skin then
  77. return {
  78. id = skinId,
  79. ttl = skin.ttl,
  80. state = skin.state,
  81. }
  82. end
  83. end
  84. local function skinQueryIdxById(human,skinId)
  85. local skinBag = human.db.skinBag
  86. for i = 1,#skinBag do
  87. local data = skinBag[i]
  88. if data.id == skinId then
  89. return i
  90. end
  91. end
  92. end
  93. -- 生成发送给客户端的皮肤数据
  94. local function skinNetGen(human,net,id)
  95. local skinCfg = assert(SkinExcel[id],"invalid skinId is ",id)
  96. net.id = id
  97. net.heroId = skinCfg.heroId or 0
  98. net.name = skinCfg.name
  99. net.desc = skinCfg.desc
  100. net.head = skinCfg.head
  101. net.body = skinCfg.body
  102. net.icon = skinCfg.icon
  103. net.camp = skinCfg.camp
  104. net.order = skinCfg.order
  105. net.type = skinCfg.type
  106. local attrLen = 0
  107. for k,v in ipairs(skinCfg.attrs) do
  108. attrLen = attrLen + 1
  109. net.attrs[attrLen].key = v[1]
  110. net.attrs[attrLen].value = v[2]
  111. end
  112. net.attrs[0] = attrLen
  113. net.heroName = HeroExcel[skinCfg.heroId] and HeroExcel[skinCfg.heroId].name or ""
  114. end
  115. -- 皮肤脱下
  116. --[[
  117. @param2 = heroIdx -- 对应英雄存档的idx
  118. ]]
  119. local function skinOff(human,heroIdx)
  120. local heroId = HeroLogic.getHeroIdByIndex(human,heroIdx)
  121. local heroGrid = HeroLogic.getHeroGrid(human,heroId,heroIdx)
  122. local skinId = heroGrid.skinOn
  123. -- 英雄不存在 或者 英雄未穿戴皮肤
  124. if not heroGrid or not skinId then
  125. return Broadcast.sendErr(human, heroIdx..":heroIdx:"..Lang.SKIN_PARAM_ERR)
  126. end
  127. local skinIdx = nil
  128. for idx,skin in pairs(human.db.skinBag) do
  129. if idx > 0 and skin.id == skinId then
  130. skinIdx = idx
  131. human.db.skinBag[idx].state = 0
  132. break
  133. end
  134. end
  135. assert(skinIdx,"param error")
  136. -- 对所有heroId相同的英雄操作
  137. local heroIdxList = HeroLogic.getHeroListById(human,heroId)
  138. local heroCfg = HeroExcel[heroId]
  139. for _,idx in ipairs(heroIdxList) do
  140. -- 脱下皮肤 并且还原默认身体 icon和head
  141. human.db.heroBag[idx].skinOn = nil
  142. --local defaultHead = RoleHeadLogic.getDefaultHead(human)
  143. RoleHeadLogic.setHead(human,heroCfg.head,RoleHeadLogic.HEAD_TYPE_1)
  144. RoleHeadLogic.setHead(human,heroCfg.body,RoleHeadLogic.HEAD_TYPE_3)
  145. end
  146. -- 回复给客户端
  147. local msgRet = Msg.gc.GC_SKIN_UPDATE
  148. local data = msgRet.list[1].data
  149. data.ind = skinIdx
  150. data.isOn = 0
  151. skinNetGen(human,data.data,skinId)
  152. msgRet.list[1].op = 3
  153. msgRet.list[0] = 1
  154. Msg.send(msgRet,human.fd)
  155. end
  156. -- 皮肤穿戴
  157. --[[
  158. @param2 = id -- 皮肤Id
  159. @param3 = heroIdx -- 对应英雄存档的idx
  160. ]]
  161. local function skinOn(human,skinIdx,heroIdx)
  162. --local idx = skinQueryIdxById(human,skinIdx)
  163. local skin = human.db.skinBag[skinIdx]
  164. -- 当前skin不存在 或者 皮肤已经穿戴
  165. if not skin or skin.state == 1 then
  166. return Broadcast.sendErr(human, skinIdx..":skinOn:"..Lang.SKIN_PARAM_ERR)
  167. end
  168. local heroId = HeroLogic.getHeroIdByIndex(human,heroIdx)
  169. local heroGrid = HeroLogic.getHeroGrid(human,heroId,heroIdx)
  170. -- 英雄不存在 或者 英雄已经装备当前皮肤
  171. if not heroGrid then
  172. return Broadcast.sendErr(human, heroIdx..":heroIdx:"..Lang.SKIN_PARAM_ERR)
  173. end
  174. if heroGrid.skinOn == skin.id then
  175. return Broadcast.sendErr(human, Lang.SKIN_DOUBLE_ON)
  176. end
  177. if heroGrid.skinOn then
  178. skinOff(human,heroIdx)
  179. end
  180. local skinCfg = SkinExcel[skin.id]
  181. human.db.skinBag[skinIdx].state = 1
  182. -- 对所有heroId相同的英雄操作
  183. local heroIdxList = HeroLogic.getHeroListById(human,heroId)
  184. for _,idx in ipairs(heroIdxList) do
  185. human.db.heroBag[idx].skinOn = skin.id
  186. RoleHeadLogic.setHead(human,skinCfg.head,RoleHeadLogic.HEAD_TYPE_1)
  187. if skinCfg.body ~= 0 then
  188. RoleHeadLogic.setHead(human,skinCfg.body,RoleHeadLogic.HEAD_TYPE_3)
  189. end
  190. end
  191. -- 回复给客户端
  192. local msgRet = Msg.gc.GC_SKIN_UPDATE
  193. local data = msgRet.list[1].data
  194. data.ind = skinIdx
  195. data.isOn = 1
  196. skinNetGen(human,data.data,skin.id)
  197. msgRet.list[1].op = 3
  198. msgRet.list[0] = 1
  199. Msg.send(msgRet,human.fd)
  200. end
  201. --------------------------------------------------------------
  202. function initAfterHot()
  203. for _,outConf in pairs(OutExcel) do
  204. outConf.totalWeight = 0
  205. for _,v in ipairs(outConf.out) do
  206. outConf.totalWeight = outConf.totalWeight + v[2]
  207. end
  208. end
  209. SkinExcel = require("excel.skin").skin
  210. HeroExcel = require("excel.hero").hero
  211. SkillExcel = require("excel.skin").skill
  212. ItemExcel = require("excel.item").item
  213. end
  214. -- 优先使用皮肤的技能,新版本没有默认返回false
  215. function setSkill(human,heroInd,heroConf,obj)
  216. return false
  217. --[[if not human then return end
  218. if not human.db.skinBag then
  219. --假人
  220. return
  221. end
  222. local bagDB = getBag(human)
  223. local skinSkillID = human.heroSkin[heroInd] and human.heroSkin[heroInd][2]
  224. if not skinSkillID then
  225. return
  226. end
  227. local skillConf = SkillExcel[skinSkillID]
  228. Skill.setSkill(obj, heroConfig,skillConf)
  229. BeSkill.setBeSkill(obj,heroConf,skillConf)
  230. return true]]
  231. end
  232. function checkHeroSkinById(human,heroId)
  233. if not human then
  234. return
  235. end
  236. local heroIdxList = HeroLogic.getHeroListById(human,heroId)
  237. if not next(heroIdxList) then
  238. return
  239. end
  240. local idx = heroIdxList[1]
  241. return human.db.heroBag[idx].skinOn
  242. end
  243. function checkHeroSkin(human, heroInd)
  244. if not heroInd then return end
  245. if not human or not human.db or not human.db.heroBag then return end
  246. local heroId = HeroLogic.getHeroIdByIndex(human,heroInd)
  247. local heroGrid = HeroLogic.getHeroGrid(human,heroId,heroInd)
  248. if heroGrid.skinOn then
  249. return heroGrid.skinOn,true
  250. end
  251. --[[if not human.db.skinBag then
  252. return
  253. end
  254. local bagDB = getBag(human)
  255. if human.heroSkin[heroInd] then
  256. local skinInd = human.heroSkin[heroInd][1]
  257. local skinID = bagDB[skinInd].id
  258. --local skillID = human.heroSkin[heroInd][2]
  259. return skinID,true
  260. else
  261. return
  262. end]]
  263. end
  264. -- 检查是否有皮肤body
  265. function getBody(human,heroInd)
  266. if not heroInd then
  267. return
  268. end
  269. local heroId = HeroLogic.getHeroIdByIndex(human,heroInd)
  270. local heroGrid = HeroLogic.getHeroGrid(human,heroId,heroInd)
  271. local skinId = heroGrid.skinOn
  272. if not skinId then
  273. return
  274. end
  275. if SkinExcel[skinId].heroId == heroId then
  276. return SkinExcel[skinId].body,SkinExcel[skinId].head
  277. else
  278. print("[getBody] 英雄装备的身体ID不正确 heroId = "..heroId)
  279. local tHeroCof = HeroExcel[heroId]
  280. if tHeroCof then
  281. print("[getBody] 英雄装备的身体ID不正确,返回基础配置 heroId = "..heroId.." body = "..tHeroCof.body.." head = "..tHeroCof.head)
  282. return tHeroCof.body, tHeroCof.head
  283. end
  284. end
  285. --[[if not human.db.skinBag then
  286. return
  287. end
  288. local bagDB = getBag(human)
  289. if human.heroSkin[heroInd] then
  290. local skinInd = human.heroSkin[heroInd][1]
  291. local skinID = bagDB[skinInd].id
  292. return SkinExcel[skinID].body,SkinExcel[skinID].head
  293. end]]
  294. end
  295. function getHeroSkin(human,heroInd)
  296. local heroId = HeroLogic.getHeroIdByIndex(human,heroInd)
  297. if not heroId then
  298. return
  299. end
  300. local heroGrid = HeroLogic.getHeroGrid(human,heroId,heroInd)
  301. local skinId = heroGrid.skinOn
  302. if not skinId then
  303. return
  304. end
  305. return SkillExcel[skinId]
  306. --[=[if not human or not human.db.skinBag then
  307. return
  308. end
  309. local bagDB = getBag(human)
  310. if human.heroSkin[heroInd] then
  311. local skinInd = human.heroSkin[heroInd][1]
  312. local skinID = bagDB[skinInd].id
  313. local skinConf = SkinExcel[skinID]
  314. local skillConf = SkillExcel[human.heroSkin[heroInd][2]]
  315. return skinConf,skillConf
  316. end]=]
  317. end
  318. function getBodyByHeroId(human, heroid)
  319. if not human then return end
  320. local list = HeroLogic.getHeroListById(human, heroid)
  321. if #list > 0 then
  322. local heroIdx = list[1]
  323. return getBody(human, heroIdx)
  324. end
  325. end
  326. local function calcSkinAttr(human)
  327. local skinBag = human.db.skinBag
  328. if not skinBag then
  329. return
  330. end
  331. local attrMap = {}
  332. for i = 1,#skinBag do
  333. local data = skinBag[i]
  334. local skinCfg = SkinExcel[data.id]
  335. for _,attr in pairs(skinCfg.attrs) do
  336. attrMap[attr[1]] = attrMap[attr[1]] or 0
  337. attrMap[attr[1]] = attrMap[attr[1]] + attr[2]
  338. end
  339. end
  340. return attrMap
  341. end
  342. -------------------------- protocol --------------------------
  343. -- 皮肤信息查询
  344. function skinQuery(human)
  345. local msgRet = Msg.gc.GC_SKIN_BAG
  346. local data = skinListQuery(human)
  347. local cnt = 0
  348. for _,info in pairs(data) do
  349. cnt = cnt + 1
  350. msgRet.data[cnt].ind = info.idx
  351. msgRet.data[cnt].id = info.id
  352. msgRet.data[cnt].isOn = info.state
  353. end
  354. msgRet.data[0] = cnt
  355. msgRet.isEnd = 1
  356. local bSend = false
  357. local maxLen = #msgRet.list -- 每次最多只能传30个
  358. cnt = 0
  359. for id in pairs(SkinExcel) do
  360. cnt = cnt + 1
  361. skinNetGen(human,msgRet.list[cnt],id)
  362. if cnt >= maxLen then
  363. msgRet.list[0] = maxLen
  364. cnt = 0
  365. Msg.send(msgRet,human.fd)
  366. msgRet.isEnd = 2
  367. bSend = true
  368. end
  369. end
  370. msgRet.list[0] = cnt
  371. if bSend then
  372. msgRet.isEnd = 3
  373. end
  374. Msg.send(msgRet,human.fd)
  375. end
  376. -- 皮肤穿戴功能
  377. function skinOp(human,heroIdx,skinIdx)
  378. if skinIdx == 0 then
  379. skinOff(human,heroIdx)
  380. else
  381. skinOn(human,skinIdx,heroIdx)
  382. end
  383. local retMsg = Msg.gc.GC_SKIN_ON
  384. retMsg.heroId = heroIdx
  385. retMsg.skinInd = skinIdx
  386. Msg.send(retMsg,human.fd)
  387. end
  388. -- 皮肤解锁
  389. function skinUnlock(human,id)
  390. local skinCfg = assert(SkinExcel[id],"invalid skinId is ",id)
  391. local isUnlock = false
  392. for i = 1,#human.db.skinBag do
  393. local skin = human.db.skinBag[i]
  394. if skin.id == id then
  395. isUnlock =true
  396. break
  397. end
  398. end
  399. --[[for _,skin in pairs(human.db.skinBag) do
  400. if skin.id == id then
  401. isUnlock =true
  402. break
  403. end
  404. end]]
  405. -- 皮肤已经解锁
  406. if isUnlock then
  407. -- 发放皮肤重复物品
  408. local itemList = {}
  409. for _,item in pairs(skinCfg.repeated) do
  410. itemList[#itemList+1] = {
  411. item[1],item[2]
  412. }
  413. end
  414. return BagLogic.addItemList(human,itemList,"skin")
  415. --Broadcast.sendErr(human, ":skin repeat:"..Lang.SKIN_REPEAT)
  416. --return
  417. end
  418. local now = os.time()
  419. human.db.skinBag[#human.db.skinBag + 1] = {
  420. id = id,
  421. ttl = -1,
  422. state = 0,
  423. getTime = now,
  424. }
  425. -- 解锁头像
  426. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_1, skinCfg.head)
  427. -- 解锁身体
  428. if skinCfg.body ~= 0 then
  429. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_3, skinCfg.body)
  430. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_5, skinCfg.body)
  431. end
  432. -- 所有角色属性提升
  433. -- 回复给客户端
  434. local msgRet = Msg.gc.GC_SKIN_UPDATE
  435. local data = msgRet.list[1].data
  436. data.ind = #human.db.skinBag
  437. data.isOn = 0
  438. skinNetGen(human,data.data,id)
  439. msgRet.list[1].op = 1
  440. msgRet.list[0] = 1
  441. Msg.send(msgRet,human.fd)
  442. --更新数据
  443. RoleAttr.cleanHeroAttrCache(human)
  444. RoleAttr.doCalc(human)
  445. ObjHuman.sendAttr(human, RoleDefine.ZHANDOULI)
  446. end
  447. -- 计算皮肤属性
  448. function doCalcSkinHero(human,attrs)
  449. local skinBag = human.db.skinBag
  450. local attrMap = {}
  451. for i = 1,#skinBag do
  452. local data = skinBag[i]
  453. local skinCfg = SkinExcel[data.id]
  454. for _,attr in pairs(skinCfg.attrs) do
  455. attrMap[attr[1]] = attrMap[attr[1]] or 0
  456. attrMap[attr[1]] = attrMap[attr[1]] + attr[2]
  457. end
  458. end
  459. --[=[for id in pairs(skinBag) do
  460. local skinCfg = SkinExcel[id]
  461. for _,attr in pairs(skinCfg.attrs) do
  462. attrMap[attr[1]] = attrMap[attr[1]] or 0
  463. attrMap[attr[1]] = attrMap[attr[1]] + attr[2]
  464. end
  465. end]=]
  466. for attr,cnt in pairs(attrMap) do
  467. RoleAttr.updateValue(attr,cnt, attrs)
  468. end
  469. end
  470. function onFightBegin(human)
  471. local skinAttrMap = calcSkinAttr(human)
  472. if not skinAttrMap or not next(skinAttrMap) then
  473. return
  474. end
  475. for pos = 1,CombatDefine.COMBAT_HERO_ALL_CNT do
  476. local obj = CombatImpl.objList[pos]
  477. if obj then
  478. for attr,cnt in ipairs(skinAttrMap) do
  479. obj.sysAttr[attr] = obj.sysAttr[attr] or 0
  480. obj.sysAttr[attr] = obj.sysAttr[attr] +cnt
  481. end
  482. obj.isSysAttrChange = true
  483. end
  484. end
  485. end
  486. -- 登录检测英雄皮肤装备数据
  487. function OnLoginCheckEquipSkin(human, bSyncClient)
  488. if not human then
  489. return
  490. end
  491. local skinBag = human.db.skinBag
  492. if not skinBag then
  493. return
  494. end
  495. -- 检测的英雄
  496. local tCheckHero = {}
  497. for i = 1,#skinBag do
  498. local data = skinBag[i]
  499. local nSkinID = data.id
  500. local tConfig = SkinExcel[nSkinID]
  501. if not tConfig then
  502. print("[OnLoginCheckEquipSkin] 严重问题, 找不到对应皮肤的配置 nSkinID = "..nSkinID)
  503. break
  504. end
  505. local nHeroID = tConfig.heroId
  506. tCheckHero[nHeroID] = tCheckHero[nHeroID] or {}
  507. -- 找所有皮肤中是否有装备着的
  508. local bEquip, nNowSkinID = false, 0
  509. for nHaveSkinID, v in pairs(tCheckHero[nHeroID]) do
  510. if v == 1 then
  511. bEquip = true
  512. nNowSkinID = nHaveSkinID
  513. break
  514. end
  515. end
  516. if data.state == 1 then
  517. if false == bEquip then
  518. tCheckHero[nHeroID][nSkinID] = 1 -- 装备标识
  519. -- 所有英雄进行装备皮肤
  520. local heroIdxList = HeroLogic.getHeroListById(human, nHeroID)
  521. local headID = RoleHeadLogic.getRoleAppearance(human, RoleHeadLogic.HEAD_TYPE_1)
  522. local bodyID = RoleHeadLogic.getRoleAppearance(human, RoleHeadLogic.HEAD_TYPE_3)
  523. for _,idx in ipairs(heroIdxList) do
  524. human.db.heroBag[idx].skinOn = nSkinID
  525. -- RoleHeadLogic.setHead(human,tConfig.head,RoleHeadLogic.HEAD_TYPE_1)
  526. -- if tConfig.body ~= 0 then
  527. -- RoleHeadLogic.setHead(human,tConfig.body,RoleHeadLogic.HEAD_TYPE_3)
  528. -- end
  529. end
  530. if headID <= 0 then
  531. RoleHeadLogic.setHead(human,tConfig.head,RoleHeadLogic.HEAD_TYPE_1)
  532. end
  533. if bodyID <= 0 and tConfig.body ~= 0 then
  534. RoleHeadLogic.setHead(human,tConfig.body,RoleHeadLogic.HEAD_TYPE_3)
  535. end
  536. print("[OnLoginCheckEquipSkin] 对玩家英雄设置了皮肤 nSkinID = "..nSkinID.." nHeroID = "..nHeroID)
  537. else
  538. tCheckHero[nHeroID][nSkinID] = 0 -- 未装备标识
  539. data.state = 0
  540. print("[OnLoginCheckEquipSkin] 同一个英雄穿上了两个皮肤!! 进行修正 nHeroID = "
  541. .. nHeroID.." nNowSkinID = "..nNowSkinID .. " nSkinID = "..nSkinID)
  542. end
  543. else
  544. tCheckHero[nHeroID][nSkinID] = 0 -- 未装备标识
  545. if false == bEquip then
  546. local heroIdxList = HeroLogic.getHeroListById(human, nHeroID)
  547. local heroCfg = HeroExcel[nHeroID]
  548. for _,idx in ipairs(heroIdxList) do
  549. -- 脱下皮肤 并且还原默认身体 icon和head
  550. human.db.heroBag[idx].skinOn = nil
  551. --local defaultHead = RoleHeadLogic.getDefaultHead(human)
  552. -- RoleHeadLogic.setHead(human,heroCfg.head,RoleHeadLogic.HEAD_TYPE_1)
  553. -- RoleHeadLogic.setHead(human,heroCfg.body,RoleHeadLogic.HEAD_TYPE_3)
  554. end
  555. local headID = RoleHeadLogic.getRoleAppearance(human, RoleHeadLogic.HEAD_TYPE_1)
  556. local bodyID = RoleHeadLogic.getRoleAppearance(human, RoleHeadLogic.HEAD_TYPE_3)
  557. if headID <= 0 then
  558. RoleHeadLogic.setHead(human,tConfig.head,RoleHeadLogic.HEAD_TYPE_1)
  559. end
  560. if bodyID <= 0 then
  561. RoleHeadLogic.setHead(human,tConfig.body,RoleHeadLogic.HEAD_TYPE_3)
  562. end
  563. print("[OnLoginCheckEquipSkin] 对玩家英雄设置取消了皮肤 nHeroID = "..nHeroID.." nSkinID = "..nSkinID)
  564. end
  565. end
  566. end
  567. if bSyncClient then
  568. skinQuery(human)
  569. print("[OnLoginCheckEquipSkin] 同步数据结束")
  570. end
  571. end