SkinLogic.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  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. if not heroGrid then
  272. return
  273. end
  274. local skinId = heroGrid.skinOn
  275. if not skinId then
  276. return
  277. end
  278. return SkinExcel[skinId].body,SkinExcel[skinId].head
  279. --[[if not human.db.skinBag then
  280. return
  281. end
  282. local bagDB = getBag(human)
  283. if human.heroSkin[heroInd] then
  284. local skinInd = human.heroSkin[heroInd][1]
  285. local skinID = bagDB[skinInd].id
  286. return SkinExcel[skinID].body,SkinExcel[skinID].head
  287. end]]
  288. end
  289. function getHeroSkin(human,heroInd)
  290. local heroId = HeroLogic.getHeroIdByIndex(human,heroInd)
  291. if not heroId then
  292. return
  293. end
  294. local heroGrid = HeroLogic.getHeroGrid(human,heroId,heroInd)
  295. local skinId = heroGrid.skinOn
  296. if not skinId then
  297. return
  298. end
  299. return SkillExcel[skinId]
  300. --[=[if not human or not human.db.skinBag then
  301. return
  302. end
  303. local bagDB = getBag(human)
  304. if human.heroSkin[heroInd] then
  305. local skinInd = human.heroSkin[heroInd][1]
  306. local skinID = bagDB[skinInd].id
  307. local skinConf = SkinExcel[skinID]
  308. local skillConf = SkillExcel[human.heroSkin[heroInd][2]]
  309. return skinConf,skillConf
  310. end]=]
  311. end
  312. function getBodyByHeroId(human, heroid)
  313. if not human then return end
  314. local list = HeroLogic.getHeroListById(human, heroid)
  315. if #list > 0 then
  316. local heroIdx = list[1]
  317. return getBody(human, heroIdx)
  318. end
  319. end
  320. local function calcSkinAttr(human)
  321. local skinBag = human.db.skinBag
  322. if not skinBag then
  323. return
  324. end
  325. local attrMap = {}
  326. for i = 1,#skinBag do
  327. local data = skinBag[i]
  328. local skinCfg = SkinExcel[data.id]
  329. for _,attr in pairs(skinCfg.attrs) do
  330. attrMap[attr[1]] = attrMap[attr[1]] or 0
  331. attrMap[attr[1]] = attrMap[attr[1]] + attr[2]
  332. end
  333. end
  334. return attrMap
  335. end
  336. -------------------------- protocol --------------------------
  337. -- 皮肤信息查询
  338. function skinQuery(human)
  339. local msgRet = Msg.gc.GC_SKIN_BAG
  340. local data = skinListQuery(human)
  341. local cnt = 0
  342. for _,info in pairs(data) do
  343. cnt = cnt + 1
  344. msgRet.data[cnt].ind = info.idx
  345. msgRet.data[cnt].id = info.id
  346. msgRet.data[cnt].isOn = info.state
  347. end
  348. msgRet.data[0] = cnt
  349. msgRet.isEnd = 1
  350. local bSend = false
  351. local maxLen = #msgRet.list -- 每次最多只能传30个
  352. cnt = 0
  353. for id in pairs(SkinExcel) do
  354. cnt = cnt + 1
  355. skinNetGen(human,msgRet.list[cnt],id)
  356. if cnt >= maxLen then
  357. msgRet.list[0] = maxLen
  358. cnt = 0
  359. Msg.send(msgRet,human.fd)
  360. msgRet.isEnd = 2
  361. bSend = true
  362. end
  363. end
  364. msgRet.list[0] = cnt
  365. if bSend then
  366. msgRet.isEnd = 3
  367. end
  368. Msg.send(msgRet,human.fd)
  369. end
  370. -- 皮肤穿戴功能
  371. function skinOp(human,heroIdx,skinIdx)
  372. if skinIdx == 0 then
  373. skinOff(human,heroIdx)
  374. else
  375. skinOn(human,skinIdx,heroIdx)
  376. end
  377. local retMsg = Msg.gc.GC_SKIN_ON
  378. retMsg.heroId = heroIdx
  379. retMsg.skinInd = skinIdx
  380. Msg.send(retMsg,human.fd)
  381. end
  382. -- 皮肤解锁
  383. function skinUnlock(human,id)
  384. local skinCfg = assert(SkinExcel[id],"invalid skinId is ",id)
  385. local isUnlock = false
  386. for i = 1,#human.db.skinBag do
  387. local skin = human.db.skinBag[i]
  388. if skin.id == id then
  389. isUnlock =true
  390. break
  391. end
  392. end
  393. --[[for _,skin in pairs(human.db.skinBag) do
  394. if skin.id == id then
  395. isUnlock =true
  396. break
  397. end
  398. end]]
  399. -- 皮肤已经解锁
  400. if isUnlock then
  401. -- 发放皮肤重复物品
  402. local itemList = {}
  403. for _,item in pairs(skinCfg.repeated) do
  404. itemList[#itemList+1] = {
  405. item[1],item[2]
  406. }
  407. end
  408. return BagLogic.addItemList(human,itemList,"skin")
  409. --Broadcast.sendErr(human, ":skin repeat:"..Lang.SKIN_REPEAT)
  410. --return
  411. end
  412. local now = os.time()
  413. human.db.skinBag[#human.db.skinBag + 1] = {
  414. id = id,
  415. ttl = -1,
  416. state = 0,
  417. getTime = now,
  418. }
  419. -- 解锁头像
  420. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_1, skinCfg.head)
  421. -- 解锁身体
  422. if skinCfg.body ~= 0 then
  423. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_3, skinCfg.body)
  424. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_5, skinCfg.body)
  425. end
  426. -- 所有角色属性提升
  427. -- 回复给客户端
  428. local msgRet = Msg.gc.GC_SKIN_UPDATE
  429. local data = msgRet.list[1].data
  430. data.ind = #human.db.skinBag
  431. data.isOn = 0
  432. skinNetGen(human,data.data,id)
  433. msgRet.list[1].op = 1
  434. msgRet.list[0] = 1
  435. Msg.send(msgRet,human.fd)
  436. --更新数据
  437. RoleAttr.cleanHeroAttrCache(human)
  438. RoleAttr.doCalc(human)
  439. ObjHuman.sendAttr(human, RoleDefine.ZHANDOULI)
  440. end
  441. -- 计算皮肤属性
  442. function doCalcSkinHero(human,attrs)
  443. local skinBag = human.db.skinBag
  444. local attrMap = {}
  445. for i = 1,#skinBag do
  446. local data = skinBag[i]
  447. local skinCfg = SkinExcel[data.id]
  448. for _,attr in pairs(skinCfg.attrs) do
  449. attrMap[attr[1]] = attrMap[attr[1]] or 0
  450. attrMap[attr[1]] = attrMap[attr[1]] + attr[2]
  451. end
  452. end
  453. --[=[for id in pairs(skinBag) do
  454. local skinCfg = SkinExcel[id]
  455. for _,attr in pairs(skinCfg.attrs) do
  456. attrMap[attr[1]] = attrMap[attr[1]] or 0
  457. attrMap[attr[1]] = attrMap[attr[1]] + attr[2]
  458. end
  459. end]=]
  460. for attr,cnt in pairs(attrMap) do
  461. RoleAttr.updateValue(attr,cnt, attrs)
  462. end
  463. end
  464. function onFightBegin(human)
  465. local skinAttrMap = calcSkinAttr(human)
  466. if not skinAttrMap or not next(skinAttrMap) then
  467. return
  468. end
  469. for pos = 1,CombatDefine.COMBAT_HERO_ALL_CNT do
  470. local obj = CombatImpl.objList[pos]
  471. if obj then
  472. for attr,cnt in ipairs(skinAttrMap) do
  473. obj.sysAttr[attr] = obj.sysAttr[attr] or 0
  474. obj.sysAttr[attr] = obj.sysAttr[attr] +cnt
  475. end
  476. obj.isSysAttrChange = true
  477. end
  478. end
  479. end
  480. -- 登录检测英雄皮肤装备数据
  481. function OnLoginCheckEquipSkin(human, bSyncClient)
  482. if not human then
  483. return
  484. end
  485. local skinBag = human.db.skinBag
  486. if not skinBag then
  487. return
  488. end
  489. -- 检测的英雄
  490. local tCheckHero = {}
  491. for i = 1,#skinBag do
  492. local data = skinBag[i]
  493. local nSkinID = data.id
  494. local tConfig = SkinExcel[nSkinID]
  495. if not tConfig then
  496. print("[OnLoginCheckEquipSkin] 严重问题, 找不到对应皮肤的配置 nSkinID = "..nSkinID)
  497. break
  498. end
  499. local nHeroID = tConfig.heroId
  500. tCheckHero[nHeroID] = tCheckHero[nHeroID] or {}
  501. -- 找所有皮肤中是否有装备着的
  502. local bEquip, nNowSkinID = false, 0
  503. for nHaveSkinID, v in pairs(tCheckHero[nHeroID]) do
  504. if v == 1 then
  505. bEquip = true
  506. nNowSkinID = nHaveSkinID
  507. break
  508. end
  509. end
  510. if data.state == 1 then
  511. if false == bEquip then
  512. tCheckHero[nHeroID][nSkinID] = 1 -- 装备标识
  513. -- 所有英雄进行装备皮肤
  514. local heroIdxList = HeroLogic.getHeroListById(human, nHeroID)
  515. local headID = RoleHeadLogic.getRoleAppearance(human, RoleHeadLogic.HEAD_TYPE_1)
  516. local bodyID = RoleHeadLogic.getRoleAppearance(human, RoleHeadLogic.HEAD_TYPE_3)
  517. for _,idx in ipairs(heroIdxList) do
  518. human.db.heroBag[idx].skinOn = nSkinID
  519. -- RoleHeadLogic.setHead(human,tConfig.head,RoleHeadLogic.HEAD_TYPE_1)
  520. -- if tConfig.body ~= 0 then
  521. -- RoleHeadLogic.setHead(human,tConfig.body,RoleHeadLogic.HEAD_TYPE_3)
  522. -- end
  523. end
  524. if headID <= 0 then
  525. RoleHeadLogic.setHead(human,tConfig.head,RoleHeadLogic.HEAD_TYPE_1)
  526. end
  527. if bodyID <= 0 and tConfig.body ~= 0 then
  528. RoleHeadLogic.setHead(human,tConfig.body,RoleHeadLogic.HEAD_TYPE_3)
  529. end
  530. print("[OnLoginCheckEquipSkin] 对玩家英雄设置了皮肤 nSkinID = "..nSkinID.." nHeroID = "..nHeroID)
  531. else
  532. tCheckHero[nHeroID][nSkinID] = 0 -- 未装备标识
  533. data.state = 0
  534. print("[OnLoginCheckEquipSkin] 同一个英雄穿上了两个皮肤!! 进行修正 nHeroID = "
  535. .. nHeroID.." nNowSkinID = "..nNowSkinID .. " nSkinID = "..nSkinID)
  536. end
  537. else
  538. tCheckHero[nHeroID][nSkinID] = 0 -- 未装备标识
  539. if false == bEquip then
  540. local heroIdxList = HeroLogic.getHeroListById(human, nHeroID)
  541. local heroCfg = HeroExcel[nHeroID]
  542. for _,idx in ipairs(heroIdxList) do
  543. -- 脱下皮肤 并且还原默认身体 icon和head
  544. human.db.heroBag[idx].skinOn = nil
  545. --local defaultHead = RoleHeadLogic.getDefaultHead(human)
  546. -- RoleHeadLogic.setHead(human,heroCfg.head,RoleHeadLogic.HEAD_TYPE_1)
  547. -- RoleHeadLogic.setHead(human,heroCfg.body,RoleHeadLogic.HEAD_TYPE_3)
  548. end
  549. local headID = RoleHeadLogic.getRoleAppearance(human, RoleHeadLogic.HEAD_TYPE_1)
  550. local bodyID = RoleHeadLogic.getRoleAppearance(human, RoleHeadLogic.HEAD_TYPE_3)
  551. if headID <= 0 then
  552. RoleHeadLogic.setHead(human,tConfig.head,RoleHeadLogic.HEAD_TYPE_1)
  553. end
  554. if bodyID <= 0 then
  555. RoleHeadLogic.setHead(human,tConfig.body,RoleHeadLogic.HEAD_TYPE_3)
  556. end
  557. print("[OnLoginCheckEquipSkin] 对玩家英雄设置取消了皮肤 nHeroID = "..nHeroID.." nSkinID = "..nSkinID)
  558. end
  559. end
  560. end
  561. if bSyncClient then
  562. skinQuery(human)
  563. print("[OnLoginCheckEquipSkin] 同步数据结束")
  564. end
  565. end