DragonNestLogic.lua 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. ---- 冰龙巢穴 版本2
  2. --[[
  3. db.dragonCopy = {
  4. time = 1
  5. hurt = 1
  6. dayHurt = 1
  7. maxHurt = 1
  8. }
  9. ]]
  10. local Lang = require("common.Lang")
  11. local Msg = require("core.Msg")
  12. local ObjHuman = require("core.ObjHuman")
  13. local Util = require("common.Util")
  14. local CopyExcel = require("excel.copy")
  15. local Grid = require("bag.Grid")
  16. local BagLogic = require("bag.BagLogic")
  17. local CombatDefine = require("combat.CombatDefine")
  18. local CombatLogic = require("combat.CombatLogic")
  19. local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
  20. local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
  21. local Broadcast = require("broadcast.Broadcast")
  22. local MonsterExcel = require("excel.monster")
  23. local HeroLogic = require("hero.HeroLogic")
  24. local BRoleLogic = require("billboard.BRoleLogic")
  25. local BillboardDB = require("billboard.BillboardDB")
  26. local BillboardDefine = require("billboard.BillboardDefine")
  27. local RoleLogic = require("role.RoleLogic")
  28. local CommonDB = require("common.CommonDB")
  29. local ChengjiuLogic = require("chengjiu.ChengjiuLogic")
  30. local ChengjiuDefine = require("chengjiu.ChengjiuDefine")
  31. local CombatImpl = require("combat.CombatImpl")
  32. local BeSkill = require("combat.BeSkill")
  33. local SkillExcel = require("excel.skill").skill
  34. local HeroGrowUp = require("absAct.HeroGrowUp")
  35. local MengxinLogic = require("present.MengxinLogic")
  36. local RoleDBLogic = require("role.RoleDBLogic")
  37. local YunYingLogic = require("yunying.YunYingLogic")
  38. CITIAO_BY_ATTACK = 1 -- 词条对玩家生效
  39. CITIAO_BY_DEFEND = 2 -- 词条对BOSS生效
  40. function updateDaily(human)
  41. if human.db.dragonCopy and not Util.isSameDay(human.db.dragonCopy.time) then
  42. human.db.dragonCopy.time = os.time()
  43. human.db.dragonCopy.hurt = 0
  44. human.db.dragonCopy.dayHurt = 0
  45. human.db.dragonCopy.dayGet = nil
  46. human.db.dragonCopy.read = nil
  47. human.db.dragonCopy.getDay = nil
  48. human.db.dragonCopy.maxCombatInfo = nil
  49. end
  50. end
  51. function init(human)
  52. if not human.db.dragonCopy then
  53. human.db.dragonCopy = {}
  54. human.db.dragonCopy.time = os.time()
  55. human.db.dragonCopy.hurt = 0
  56. human.db.dragonCopy.dayHurt = 0
  57. human.db.dragonCopy.historyGet = {}
  58. end
  59. end
  60. DRAGON_CITIAO_RARE_MAX = nil
  61. function randomCiTiao()
  62. if not DRAGON_CITIAO_RARE_MAX then
  63. -- 防止策划删减 词条
  64. DRAGON_CITIAO_RARE_MAX = 0
  65. for k, v in pairs(CopyExcel.dragoncitiao) do
  66. if v then
  67. DRAGON_CITIAO_RARE_MAX = DRAGON_CITIAO_RARE_MAX + v.quanzhong
  68. end
  69. end
  70. end
  71. local list = {}
  72. local getRare = 0
  73. for i = 1 , 3 do
  74. local random = math.random(1, DRAGON_CITIAO_RARE_MAX - getRare)
  75. for k, v in pairs(CopyExcel.dragoncitiao) do
  76. if not list[k] and random <= v.quanzhong then
  77. list[k] = i
  78. getRare = getRare + v.quanzhong
  79. break
  80. elseif not list[k] then
  81. -- 防止循环最后一个是 已经随机过的 导致 随机不出来
  82. random = random - v.quanzhong
  83. end
  84. end
  85. end
  86. return list
  87. end
  88. function getSvrCiTiao()
  89. local list = CommonDB.getDragonNestCitiao()
  90. local weekTime = Util.getWeekStartTime(os.time())
  91. if not list or not list.time or list.time ~= weekTime then
  92. local list = randomCiTiao()
  93. CommonDB.setDragonNestCitiao(list, weekTime)
  94. return CommonDB.getDragonNestCitiao()
  95. else
  96. return list
  97. end
  98. end
  99. function getNextCiTiaoTime()
  100. local now = os.time()
  101. local weekTime = Util.getWeekStartTime(now + 7 * 24 * 60 * 60)
  102. return weekTime - now
  103. end
  104. local function fontRank(msgRet, human)
  105. local board = BillboardDB.getBoard(BillboardDefine.TYPE_DRAGON)
  106. if board then
  107. for i = 1 , 3 do
  108. local rankData = board.rank2data[i]
  109. if rankData then
  110. msgRet.topRank[0] = msgRet.topRank[0] + 1
  111. local net = msgRet.topRank[msgRet.topRank[0]]
  112. net.rank = i
  113. if rankData and rankData.roleBase then
  114. RoleLogic.makeRoleBase(rankData.roleBase, net.roleBase)
  115. else
  116. local roleUuid = rankData and rankData.uuid or ""
  117. RoleLogic.getRoleBaseByUuid(roleUuid, net.roleBase)
  118. end
  119. net.hurt = rankData and rankData.value1 or 0
  120. end
  121. end
  122. end
  123. local myRank = BillboardDB.getRank(BillboardDefine.TYPE_DRAGON, human.db._id)
  124. if myRank then
  125. local rankData = BillboardDB.getRankData(BillboardDefine.TYPE_DRAGON, myRank)
  126. if rankData then
  127. msgRet.myRank[0] = msgRet.myRank[0] + 1
  128. local net = msgRet.myRank[msgRet.myRank[0]]
  129. net.rank = myRank
  130. if rankData and rankData.roleBase then
  131. RoleLogic.makeRoleBase(rankData.roleBase, net.roleBase)
  132. else
  133. local roleUuid = rankData and rankData.uuid or ""
  134. RoleLogic.getRoleBaseByUuid(roleUuid, net.roleBase)
  135. end
  136. net.hurt = rankData and rankData.value1 or 0
  137. end
  138. -- 自己在前四名 不显示 自己的前一名
  139. if myRank and myRank > 4 then
  140. local lastData = BillboardDB.getRankData(BillboardDefine.TYPE_DRAGON, myRank - 1)
  141. if lastData then
  142. msgRet.myRank[0] = msgRet.myRank[0] + 1
  143. local net = msgRet.myRank[msgRet.myRank[0]]
  144. net.rank = myRank - 1
  145. if lastData and lastData.roleBase then
  146. RoleLogic.makeRoleBase(lastData.roleBase, net.roleBase)
  147. else
  148. local roleUuid = lastData and lastData.uuid or ""
  149. RoleLogic.getRoleBaseByUuid(roleUuid, net.roleBase)
  150. end
  151. net.hurt = lastData and lastData.value1 or 0
  152. end
  153. end
  154. end
  155. end
  156. function fontNextItem(msgRet, human)
  157. local list = {}
  158. local get
  159. msgRet.nextSanbei = 1
  160. for k, v in ipairs(CopyExcel.dragonReward) do
  161. if msgRet.dayHurt < v.need and not get then
  162. get = 1
  163. msgRet.nextHurt = v.need
  164. for j, h in ipairs(v.reward) do
  165. local net = msgRet.items[j]
  166. Grid.makeItem(net, h[1], h[2])
  167. end
  168. msgRet.items[0] = #v.reward
  169. if human.db.dragonCopy.historyGet and human.db.dragonCopy.historyGet[k] then
  170. msgRet.nextSanbei = 0
  171. end
  172. elseif msgRet.dayHurt >= v.need then
  173. local beiShu = human.db.dragonCopy.getDay and human.db.dragonCopy.getDay[k] or nil
  174. if not beiShu then
  175. if human.db.dragonCopy.historyGet and human.db.dragonCopy.historyGet[k] then
  176. beiShu = 1
  177. else
  178. beiShu = 3
  179. end
  180. end
  181. beiShu = beiShu or 1
  182. for j, h in ipairs(v.reward) do
  183. list[h[1]] = list[h[1]] or 0
  184. list[h[1]] = list[h[1]] + (h[2] * beiShu)
  185. end
  186. end
  187. end
  188. local len = 0
  189. for k, v in pairs(list) do
  190. len = len + 1
  191. local net = msgRet.dayReward[len]
  192. Grid.makeItem(net, k, v)
  193. end
  194. msgRet.dayReward[0] = len
  195. end
  196. -- 封装 BOSS 技能详情
  197. function fontDragonSkill(msgRet, monsterOutID)
  198. local monsterID = MonsterExcel.monsterOut[monsterOutID].member[1][1]
  199. local monsterConfig = MonsterExcel.monster[monsterID]
  200. local len = 0
  201. for k, v in ipairs(monsterConfig.skillList) do
  202. len = len + 1
  203. HeroLogic.makeSkillNet(msgRet.skillList[len], v)
  204. end
  205. for k , v in ipairs(monsterConfig.beSkillList) do
  206. if len < 4 then
  207. len = len + 1
  208. HeroLogic.makeSkillNet(msgRet.skillList[len], v)
  209. end
  210. end
  211. msgRet.skillList[0] = len
  212. end
  213. function fontCiTiao(msgRet, human)
  214. local list = getSvrCiTiao()
  215. for k, index in pairs(list.citiao) do
  216. local config = CopyExcel.dragoncitiao[k]
  217. if index == 1 then
  218. msgRet.ciTiaoA = config.citiao
  219. elseif index == 2 then
  220. msgRet.ciTiaoB = config.citiao
  221. else
  222. msgRet.ciTiaoC = config.citiao
  223. end
  224. end
  225. end
  226. function ciTiaoQuery(human)
  227. init(human)
  228. local list = getSvrCiTiao()
  229. local dragon = human.db.dragonCopy
  230. local msgRet = Msg.gc.GC_COPY_DRAGON_BOSS_CITIAO
  231. msgRet.time = dragon.time
  232. msgRet.read = dragon.read and 1 or 0
  233. msgRet.isGuide = human.db.dragonCopy and human.db.dragonCopy.isGuide or 1
  234. msgRet.ctEndTime = getNextCiTiaoTime()
  235. human.db.dragonCopy.isGuide = 0
  236. local len = 0
  237. for id in pairs(list.citiao) do
  238. len = len + 1
  239. local config = CopyExcel.dragoncitiao[id]
  240. local net = msgRet.list[len]
  241. net.id = id
  242. net.name = config.citiao
  243. net.desc = config.miaoshu
  244. end
  245. msgRet.list[0] = len
  246. Msg.send(msgRet, human.fd)
  247. dragon.read = 1
  248. end
  249. function query(human, isFight)
  250. init(human)
  251. if not human.db.dragonCopy.read then
  252. ciTiaoQuery(human)
  253. return
  254. end
  255. local msgRet = Msg.gc.GC_COPY_DRAGON_QUERY
  256. msgRet.dayGet = 0
  257. msgRet.topRank[0] = 0
  258. msgRet.myRank[0] = 0
  259. msgRet.dayHurt = 0
  260. msgRet.nextHurt = 0
  261. msgRet.items[0] = 0
  262. msgRet.ciTiaoA = ""
  263. msgRet.ciTiaoB = ""
  264. msgRet.ciTiaoC = ""
  265. msgRet.dayReward[0] = 0
  266. msgRet.ctEndTime = getNextCiTiaoTime()
  267. msgRet.isFight = isFight and 1 or 0
  268. if human.db.dragonCopy then
  269. msgRet.dayHurt = human.db.dragonCopy.dayHurt
  270. msgRet.dayGet = human.db.dragonCopy.dayGet and 1 or 0
  271. end
  272. fontCiTiao(msgRet)
  273. fontNextItem(msgRet, human)
  274. fontRank(msgRet, human)
  275. human.dragonfirstLogin = 1
  276. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1202)
  277. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1209)
  278. -- Msg.trace(msgRet)
  279. Msg.send(msgRet, human.fd)
  280. end
  281. -- BOSS查询
  282. function bossQuery(human)
  283. local msgRet = Msg.gc.GC_COPY_DRAGON_BOSS_QUERY
  284. local config = CopyExcel.dragon[1]
  285. msgRet.id = 1
  286. msgRet.desc = config.desc
  287. fontDragonSkill(msgRet, config.monsterOutID)
  288. Msg.send(msgRet, human.fd)
  289. end
  290. -- 伤害排名 查询
  291. function rankQuery(human)
  292. local msgRet = Msg.gc.GC_COPY_DRAGON_RANK_QUERY
  293. msgRet.rankList[0] = 0
  294. local board = BillboardDB.getBoard(BillboardDefine.TYPE_DRAGON)
  295. if board then
  296. for i = 1, #board.rank2data do
  297. local rankData = board.rank2data[i]
  298. if rankData then
  299. msgRet.rankList[0] = msgRet.rankList[0] + 1
  300. local net = msgRet.rankList[msgRet.rankList[0]]
  301. net.rank = i
  302. if rankData and rankData.roleBase then
  303. RoleLogic.makeRoleBase(rankData.roleBase, net.roleBase)
  304. else
  305. local roleUuid = rankData and rankData.uuid or ""
  306. RoleLogic.getRoleBaseByUuid(roleUuid, net.roleBase)
  307. end
  308. net.hurt = rankData and rankData.value1 or 0
  309. end
  310. end
  311. end
  312. -- 获取排行区间 奖励 给予前端处理 放到各个名词后面 显示排名奖励
  313. for k, v in ipairs(CopyExcel.dragonRank) do
  314. local net = msgRet.rankItem[k]
  315. net.minRank = v.minRank
  316. net.maxRank = v.maxRank
  317. for j, h in ipairs(v.reward) do
  318. Grid.makeItem(net.item[j], h[1], h[2])
  319. end
  320. net.item[0] = #v.reward
  321. end
  322. msgRet.rankItem[0] = #CopyExcel.dragonRank
  323. Msg.send(msgRet, human.fd)
  324. end
  325. function hurtRewardQuery(human)
  326. local msgRet = Msg.gc.GC_COPY_DRAGON_HURT_QUERY
  327. msgRet.isEnd = 0
  328. msgRet.maxHurt = human.db.dragonCopy and human.db.dragonCopy.maxHurt or 0
  329. local len = 0
  330. for k, v in ipairs(CopyExcel.dragonReward) do
  331. len = len + 1
  332. local net = msgRet.list[len]
  333. net.id = k
  334. net.need = v.need
  335. net.sanbei = 1
  336. net.isGet = 0
  337. if human.db.dragonCopy.historyGet and human.db.dragonCopy.historyGet[k] then
  338. net.sanbei = 0
  339. end
  340. if human.db.dragonCopy.getDay and human.db.dragonCopy.getDay[k] then
  341. net.isGet = 1
  342. end
  343. for j, h in ipairs(v.reward) do
  344. Grid.makeItem(net.reward[j], h[1], h[2])
  345. end
  346. net.reward[0] = #v.reward
  347. if len >= 30 then
  348. msgRet.list[0] = len
  349. Msg.send(msgRet, human.fd)
  350. len = 0
  351. end
  352. end
  353. msgRet.isEnd = 1
  354. msgRet.list[0] = len
  355. Msg.send(msgRet, human.fd)
  356. end
  357. ------------------------------------ combat ----------------
  358. function getCombatMonsterOutID(human, side, args)
  359. if side ~= CombatDefine.DEFEND_SIDE then return end
  360. local config = CopyExcel.dragon[1]
  361. return config.monsterOutID
  362. end
  363. function getCombatObjList(human, side, args)
  364. if side ~= CombatDefine.DEFEND_SIDE then return end
  365. local monsterOutID = getCombatMonsterOutID(human, side)
  366. return CombatLogic.getMonsterObjList(monsterOutID, CombatDefine.COMBAT_OBJ_TYPE3 , args)
  367. end
  368. function getMapID()
  369. local config = CopyExcel.dragon[1]
  370. return config.mapID
  371. end
  372. function fight(human)
  373. -- 今日已经领取 不让继续挑战 前端已做置灰处理
  374. --if human.db.dragonCopy and human.db.dragonCopy.dayGet then
  375. --return
  376. --end
  377. local config = CopyExcel.dragon[1]
  378. CombatLogic.combatBegin(human, config.mapID, 1 , CombatDefine.COMBAT_TYPE20)
  379. HeroGrowUp.onCallback(human, HeroGrowUp.TASKTYPE9, 1)
  380. YunYingLogic.onCallBack(human, "onBinglong",1)
  381. end
  382. function setSkillAndBeskill(human,combatInfo)
  383. local list = getSvrCiTiao()
  384. local myList = {}
  385. local bossList = {}
  386. for k, v in pairs(list.citiao) do
  387. local config = CopyExcel.dragoncitiao[k]
  388. if config.shengxiao == CITIAO_BY_ATTACK then
  389. myList[#myList+1] = config.skillID
  390. elseif config.shengxiao == CITIAO_BY_DEFEND then
  391. bossList[#bossList+1] = config.skillID
  392. end
  393. end
  394. if #myList > 0 then
  395. for _,pos in ipairs(CombatDefine.SIDE2POS[CombatDefine.ATTACK_SIDE]) do
  396. local obj = CombatImpl.objList[pos]
  397. if obj then
  398. for _, skillID in ipairs(myList) do
  399. local skillConfig = SkillExcel[skillID]
  400. if skillConfig.beSkillType == BeSkill.BESKILL_TYPE24 then
  401. for _,skillID in ipairs(skillConfig.args) do
  402. local skillConfig = SkillExcel[skillID]
  403. obj.beSkillList[skillConfig.beSkillType] = obj.beSkillList[skillConfig.beSkillType] or {}
  404. obj.beSkillList[skillConfig.beSkillType][#obj.beSkillList[skillConfig.beSkillType] + 1] = {
  405. skillID,
  406. skillConfig.beSkillLimit > 0 and skillConfig.beSkillLimit,skillConfig.cd[1] or 0,
  407. skillConfig.cd[2] or 0, 0}
  408. end
  409. else
  410. obj.beSkillList[skillConfig.beSkillType] = obj.beSkillList[skillConfig.beSkillType] or {}
  411. obj.beSkillList[skillConfig.beSkillType][#obj.beSkillList[skillConfig.beSkillType] + 1] = {
  412. skillID,
  413. skillConfig.beSkillLimit > 0 and skillConfig.beSkillLimit,skillConfig.cd[1] or 0,
  414. skillConfig.cd[2] or 0, 0}
  415. end
  416. end
  417. end
  418. end
  419. end
  420. if #bossList > 0 then
  421. for _,pos in ipairs(CombatDefine.SIDE2POS[CombatDefine.DEFEND_SIDE]) do
  422. local obj = CombatImpl.objList[pos]
  423. if obj then
  424. for _, skillID in ipairs(bossList) do
  425. local skillConfig = SkillExcel[skillID]
  426. if skillConfig.beSkillType == BeSkill.BESKILL_TYPE24 then
  427. for _,skillID in ipairs(skillConfig.args) do
  428. local skillConfig = SkillExcel[skillID]
  429. obj.beSkillList[skillConfig.beSkillType] = obj.beSkillList[skillConfig.beSkillType] or {}
  430. obj.beSkillList[skillConfig.beSkillType][#obj.beSkillList[skillConfig.beSkillType] + 1] = {
  431. skillID,
  432. skillConfig.beSkillLimit > 0 and skillConfig.beSkillLimit,skillConfig.cd[1] or 0,
  433. skillConfig.cd[2] or 0, 0}
  434. end
  435. else
  436. obj.beSkillList[skillConfig.beSkillType] = obj.beSkillList[skillConfig.beSkillType] or {}
  437. obj.beSkillList[skillConfig.beSkillType][#obj.beSkillList[skillConfig.beSkillType] + 1] = {
  438. skillID,
  439. skillConfig.beSkillLimit > 0 and skillConfig.beSkillLimit,skillConfig.cd[1] or 0,
  440. skillConfig.cd[2] or 0, 0}
  441. end
  442. end
  443. end
  444. end
  445. end
  446. end
  447. function onFightEnd(human, result, combatType, cbParam, combatInfo)
  448. local atkHurt = 0
  449. for pos = 1, CombatDefine.COMBAT_HERO_CNT do
  450. local obj = combatInfo.objList and combatInfo.objList[pos]
  451. if obj then
  452. atkHurt = atkHurt + obj.result[1]
  453. end
  454. end
  455. -- 魔兽 造成伤害
  456. for _,pos in ipairs(CombatDefine.SIDE2HELPPOS[CombatDefine.ATTACK_SIDE]) do
  457. local pet = combatInfo.helpList and combatInfo.helpList[pos]
  458. if pet and pet.isPet then
  459. atkHurt = atkHurt + pet.result[1]
  460. end
  461. end
  462. human.db.dragonCopy = human.db.dragonCopy or {}
  463. local dragon = human.db.dragonCopy
  464. dragon.time = dragon.time or os.time()
  465. dragon.hurt = atkHurt
  466. dragon.dayHurt = dragon.dayHurt or 0
  467. local oldHurt = dragon.dayHurt
  468. local breakOk
  469. if atkHurt > dragon.dayHurt then
  470. dragon.dayHurt = atkHurt
  471. dragon.maxHurt = dragon.maxHurt or 0
  472. dragon.maxHurt = dragon.maxHurt < atkHurt and atkHurt or dragon.maxHurt
  473. BRoleLogic.updateData(BillboardDefine.TYPE_DRAGON, human.db)
  474. breakOk = true
  475. end
  476. local dayHurt = human.db.dragonCopy.dayHurt
  477. local msgRet = Msg.gc.GC_COPY_DRAGON_FIGHT_END
  478. msgRet.rank = BillboardDB.getRank(BillboardDefine.TYPE_DRAGON, human.db._id) or 0
  479. msgRet.hurt = atkHurt
  480. msgRet.dayHurt = dragon.dayHurt
  481. msgRet.nextHurt = 0
  482. for k, v in ipairs(CopyExcel.dragonReward) do
  483. if dayHurt < v.need then
  484. msgRet.nextHurt = v.need
  485. break
  486. end
  487. end
  488. if atkHurt> oldHurt then
  489. if human.db.dragonCopy.dayGet then return end
  490. human.db.dragonCopy.historyGet = human.db.dragonCopy.historyGet or {}
  491. human.db.dragonCopy.getDay = human.db.dragonCopy.getDay or {}
  492. local getCnt = 0
  493. local getList = {}
  494. for k, v in ipairs(CopyExcel.dragonReward) do
  495. if dayHurt >= v.need and not human.db.dragonCopy.getDay[k] then
  496. getCnt = getCnt + 1
  497. local cnt = 1
  498. if not human.db.dragonCopy.historyGet[k] then
  499. cnt = 3
  500. human.db.dragonCopy.historyGet[k] = 1
  501. end
  502. if cnt == 3 then
  503. combatInfo.double = 3
  504. end
  505. human.db.dragonCopy.getDay[k] = cnt
  506. for _, h in ipairs(v.reward) do
  507. getList[h[1]] = getList[h[1]] or 0
  508. getList[h[1]] = getList[h[1]] + h[2] * cnt
  509. end
  510. end
  511. end
  512. -- 没有奖励可以领取
  513. if getCnt > 0 then
  514. local itemList = {}
  515. local len = 0
  516. for itemID, itemCnt in pairs(getList) do
  517. len = len + 1
  518. itemList[len] = {}
  519. itemList[len][1] = itemID
  520. itemList[len][2] = itemCnt
  521. BagLogic.addItem(human, itemID, itemCnt, "dragonCopy")
  522. end
  523. combatInfo.rewardItem = Util.copyTable(itemList)
  524. end
  525. end
  526. CombatLogic.fontCombatFinish(msgRet.data, combatInfo)
  527. Msg.send(msgRet, human.fd)
  528. ChengjiuLogic.onCallback(human,ChengjiuDefine.CJ_TASK_TYPE_26,atkHurt)
  529. MengxinLogic.onCallBack(human,MengxinLogic.MX_TASK_TYPE_5,atkHurt)
  530. query(human, true)
  531. if breakOk then
  532. human.db.dragonCopy.maxCombatInfo = Util.copyTable(combatInfo)
  533. end
  534. end
  535. function isDot(human)
  536. if human.dragonfirstLogin == nil then
  537. return true
  538. end
  539. return false
  540. end
  541. FieldDragonBase = {dragonCopy=1}
  542. function lookVido(human, uuid)
  543. if not uuid or uuid == "" then return end
  544. local db = RoleDBLogic.getDb(uuid, FieldDragonBase)
  545. if db and db.dragonCopy and db.dragonCopy.maxCombatInfo then
  546. CombatLogic.repeatCombat(human, db.dragonCopy.maxCombatInfo)
  547. else
  548. return Broadcast.sendErr(human, Lang.COMBAT_ERR_NOT_VIDEO)
  549. end
  550. end