DragonNestLogic.lua 21 KB

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