SkinLogic.lua 19 KB

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