MonsterHunt.lua 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. MonsterHunt = {}
  2. local this = {}
  3. local VAR = {
  4. --积分存储
  5. MONSTER_HUNT_INTEGRAL = "R$_MONSTER_HUNT_INTEGRAL",
  6. --时间记录
  7. MONSTER_HUNT_TIME_INFO = "R$_MONSTER_HUNT_TIME_INFO",
  8. --重置状态
  9. MONSTER_HUNT_STATE = "R$_MONSTER_HUNT_STATE",
  10. --通知刷新次数
  11. MONSTER_HUNT_NOTICE_COUNT = "G$MONSTER_HUNT_NOTICE_COUNT",
  12. }
  13. local GLOBAL_ID = {
  14. INTEGRAL_2_MEDAL = 27001,
  15. TIME = 27002,
  16. GET_EXTRA_HIGH_LIMIT = 27005,
  17. }
  18. --猎魔勋章的道具ID
  19. local MEDAL_ITEM_ID = 10230001
  20. local STATE_OK = 0
  21. local STATE_DENY = 1
  22. function this.getTimeInfo(actor)
  23. actor = this.getActor(actor)
  24. local timeInfo = getsysvar(actor,VAR.MONSTER_HUNT_TIME_INFO)
  25. if timeInfo == nil then
  26. return {
  27. settleTime = nil,
  28. resetTime = nil
  29. }
  30. else
  31. return timeInfo
  32. end
  33. end
  34. function this.setTimeInfo(timeInfo)
  35. setsysvar(VAR.MONSTER_HUNT_TIME_INFO, timeInfo)
  36. end
  37. function this.getState(actor)
  38. actor = this.getActor(actor)
  39. local state = getsysvar(actor,VAR.MONSTER_HUNT_STATE)
  40. return state or 0
  41. end
  42. function this.getNoticeCount()
  43. return getsysvar(VAR.MONSTER_HUNT_NOTICE_COUNT) or 0
  44. end
  45. function this.setNoticeCount(count)
  46. setsysvar(VAR.MONSTER_HUNT_NOTICE_COUNT, count)
  47. end
  48. function this.setState(state)
  49. setsysvar(VAR.MONSTER_HUNT_STATE, state)
  50. end
  51. function this.addIntegral(actor, integral)
  52. callonserial(actor, "monsterhurt_add_integral", integral)
  53. end
  54. function monsterhurt_add_integral(actor, integral)
  55. local allIntegralInfo = getsysvar(actor,VAR.MONSTER_HUNT_INTEGRAL)
  56. if allIntegralInfo == nil then
  57. allIntegralInfo = {}
  58. end
  59. local rid = tonumber(actor:toString())
  60. local actorInfo = allIntegralInfo[rid]
  61. if actorInfo == nil then
  62. actorInfo = {}
  63. allIntegralInfo[rid] = actorInfo
  64. end
  65. local oldIntegral = actorInfo["integral"] or 0
  66. oldIntegral = oldIntegral + tonumber(integral)
  67. actorInfo["integral"] = oldIntegral
  68. actorInfo["time"] = getbaseinfo("now")
  69. --保存
  70. setsysvar(actor,VAR.MONSTER_HUNT_INTEGRAL, allIntegralInfo)
  71. this.loginfo("击杀怪物获得积分", actor, integral, oldIntegral)
  72. end
  73. function this.getIntegralInfo(actor)
  74. actor = this.getActor(actor)
  75. local allIntegralInfo = getsysvar(actor,VAR.MONSTER_HUNT_INTEGRAL)
  76. if allIntegralInfo == nil then
  77. allIntegralInfo = {}
  78. end
  79. return allIntegralInfo
  80. end
  81. function this.setIntegralInfo(actor,intervalInfo)
  82. actor = this.getActor(actor)
  83. setsysvar(actor, VAR.MONSTER_HUNT_INTEGRAL, intervalInfo)
  84. end
  85. function this.clearIntegralInfo()
  86. callonserial("monsterhurt_clear_integral_info")
  87. end
  88. function monsterhurt_clear_integral_info()
  89. setsysvar(VAR.MONSTER_HUNT_INTEGRAL, nil)
  90. end
  91. function this.getActor(actor)
  92. if actor == nil then
  93. return getactor(0,0)
  94. else
  95. return actor
  96. end
  97. end
  98. function this.monsterDie(ownerId, monsterCfgId)
  99. local monsterHuntID = ConfigDataManager.getTableValue("cfg_monster", "monsterhunt", "id", monsterCfgId)
  100. if string.isNullOrEmpty(monsterHuntID) then
  101. return
  102. end
  103. local config = ConfigDataManager.getById("cfg_monsterHunt", tonumber(monsterHuntID))
  104. if config == nil then
  105. return
  106. end
  107. if ownerId == nil or tonumber(ownerId) <= 0 then
  108. this.logerror("怪物击杀者为空", ownerId, monsterCfgId)
  109. return
  110. end
  111. local actor = getactor(tonumber(ownerId))
  112. local state = this.getState(actor)
  113. if state == STATE_DENY then
  114. this.loginfo("重置之前不积累积分")
  115. return
  116. end
  117. local strLevel = config["level"]
  118. local strNum = config["number"]
  119. local selfLevel = getbaseinfo(actor, "level")
  120. local levelPair = string.split(strLevel, "|")
  121. local index = 0
  122. for i, levelStr in pairs(levelPair) do
  123. local lowHigh = string.split(levelStr, "#")
  124. local low = tonumber(lowHigh[1])
  125. local high = tonumber(lowHigh[2])
  126. if low <= selfLevel and selfLevel <= high then
  127. index = i
  128. break
  129. end
  130. end
  131. if index == 0 then
  132. return
  133. end
  134. local strNums = string.split(strNum, "#")
  135. local strNum = strNums[index]
  136. if strNum == nil then
  137. return
  138. end
  139. local num = tonumber(strNum)
  140. --增加积分
  141. this.addIntegral(actor, num)
  142. end
  143. --获得积分和勋章的转换比
  144. function this.medalScaleByIntegral(integral)
  145. local globalCfg = ConfigDataManager.getTableValue("cfg_global", "value", "id", GLOBAL_ID.INTEGRAL_2_MEDAL)
  146. if globalCfg == nil then
  147. return 0
  148. end
  149. local items = string.split(globalCfg, "|")
  150. local prevKv;
  151. local prevK = 0
  152. local prevV = 0
  153. local currK = 0
  154. local currV = 0
  155. for _, curr in pairs(items) do
  156. local currKv = string.split(curr, "#")
  157. if prevKv ~= nil then
  158. prevK = tonumber(prevKv[1])
  159. prevV = tonumber(prevKv[2])
  160. currK = tonumber(currKv[1])
  161. currV = tonumber(currKv[2])
  162. if integral >= prevK and integral <= currK then
  163. return prevV
  164. end
  165. end
  166. prevKv = currKv
  167. end
  168. return currV
  169. end
  170. function this.getTimeConfig()
  171. local timeCfg = ConfigDataManager.getTableValue("cfg_global", "value", "id", GLOBAL_ID.TIME)
  172. if string.isNullOrEmpty(timeCfg) then
  173. return nil
  174. end
  175. local items = string.split(timeCfg, "#")
  176. if table.isNullOrEmpty(items) then
  177. return nil
  178. end
  179. return tonumber(items[1]), tonumber(items[2])
  180. end
  181. function this.checkTimeInMinuteHeart(hour, settleHour, settleTime)
  182. if tonumber(hour) ~= tonumber(settleHour) then
  183. --不在刷新的时间点
  184. return false
  185. end
  186. if settleTime ~= nil and settleTime > 0 then
  187. local now = getbaseinfo("now")
  188. local diff = datediff(tonumber(settleTime), now, "day")
  189. if diff == 0 then
  190. --刷新过了
  191. return false
  192. end
  193. end
  194. return true
  195. end
  196. function this.getRankList(integralInfo)
  197. local medalTotal = 0
  198. local integralTotal = 0
  199. local rankList = {}
  200. local index = 0
  201. for id, roleIntegralInfo in pairs(integralInfo) do
  202. local integral = roleIntegralInfo["integral"] or 0
  203. local time = roleIntegralInfo["time"] or 0
  204. if integral > 0 then
  205. integralTotal = integralTotal + integral
  206. table.insert(rankList, { rid = id, integral = integral, time=time })
  207. end
  208. end
  209. --计算勋章总数
  210. local medalScale = this.medalScaleByIntegral(integralTotal) or 0
  211. medalTotal = math.floor(integralTotal * medalScale / 10000)
  212. --计算排名
  213. table.sort(rankList, function(a, b)
  214. if a.integral == b.integral then
  215. return a.time < b.time
  216. else
  217. return a.integral > b.integral
  218. end
  219. end)
  220. for _, rankItem in pairs(rankList) do
  221. index = index + 1
  222. rankItem["rank"] = index
  223. end
  224. local rewardPercentTotal = this.getSumRewardPercentByRankList(rankList)
  225. for _, rankItem in pairs(rankList) do
  226. local rankNum = rankItem.rank
  227. local percent, _ = this.getRewardPercentByRank(rankNum)
  228. local scale = percent / rewardPercentTotal
  229. local medalCount = math.floor( medalTotal * scale )
  230. rankItem["medalCount"] = medalCount
  231. --this.loginfo("id", rankItem.rid, "排名", rankNum, "瓜分比例", scale, "瓜分比率", percent, "总比率", rewardPercentTotal,"积分",rankItem.integral, "瓜分勋章数量", medalCount, "总勋章数量", medalTotal)
  232. end
  233. return rankList, medalTotal,integralTotal
  234. end
  235. function this.getSumRewardPercentByRankList(rankList)
  236. local total = 0
  237. for _, rankItem in pairs(rankList) do
  238. local rankNum = rankItem.rank
  239. local percent, _ = this.getRewardPercentByRank(rankNum)
  240. total = total + percent
  241. end
  242. return total
  243. end
  244. --是否能获得额外的积分
  245. function this.isGetExtra(selfIntegral)
  246. local highLimit = ConfigDataManager.getTableValue("cfg_global", "value", "id", GLOBAL_ID.GET_EXTRA_HIGH_LIMIT)
  247. if string.isNullOrEmpty(highLimit) then
  248. return false
  249. end
  250. return selfIntegral >= tonumber(highLimit)
  251. end
  252. --结算
  253. function this.Settle(hour, settleHour)
  254. if this.getState() == STATE_DENY then
  255. this.loginfo("未重置状态下不能结算")
  256. return
  257. end
  258. local timeInfo = this.getTimeInfo()
  259. local settleTime = timeInfo.settleTime
  260. local ok = this.checkTimeInMinuteHeart(hour, settleHour, settleTime)
  261. this.loginfo("是否可以结算", ok, timeInfo)
  262. if not ok then
  263. return
  264. end
  265. --先把状态改掉
  266. this.setState(STATE_DENY)
  267. --执行结算
  268. local integralInfo = this.getIntegralInfo(nil)
  269. local rankList, medalTotal,integralTotal = this.getRankList(integralInfo)
  270. this.loginfo("结算数据", medalTotal, rankList)
  271. if medalTotal == 0 then
  272. this.loginfo("可分配的勋章数量为0", medalTotal, rankList)
  273. return
  274. end
  275. local rankMap = {}
  276. for rankNum, rankItem in pairs(rankList) do
  277. local item = rankMap[rankNum]
  278. if item == nil then
  279. item = {}
  280. rankMap[rankNum] = item
  281. end
  282. table.insert(item, rankItem)
  283. end
  284. this.loginfo("rankMap", rankMap)
  285. for rankNum, idList in pairs(rankMap) do
  286. local percent, item, extraMedalCount = this.getRewardPercentByRank(rankNum)
  287. if percent >= 0 then
  288. for _, rankItem in pairs(idList) do
  289. local rid = rankItem.rid
  290. local integral = rankItem.integral
  291. local medalCount = rankItem.medalCount
  292. local rewardMap = {}
  293. if not string.isNullOrEmpty(extraMedalCount) and this.isGetExtra(integral) then
  294. medalCount = medalCount + tonumber(extraMedalCount)
  295. end
  296. rewardMap[MEDAL_ITEM_ID] = medalCount
  297. if not string.isNullOrEmpty(item) then
  298. local itemMap = string.toIntIntMap(item, "#", "|")
  299. if itemMap ~= nil then
  300. table.mergeTable(rewardMap, itemMap)
  301. else
  302. error("奖励配置格式格式错误", item)
  303. end
  304. end
  305. this.sendRewardToMail(getactor(rid),rid,rankItem.time,medalTotal,integralTotal , rankNum, integral, medalCount, rewardMap)
  306. end
  307. end
  308. end
  309. --设置结算时间
  310. local timeInfo = this.getTimeInfo()
  311. timeInfo.settleTime = getbaseinfo("now")
  312. this.setTimeInfo(timeInfo)
  313. end
  314. --重置
  315. function this.Reset(hour, resetHour)
  316. local timeInfo = this.getTimeInfo()
  317. local resetTime = timeInfo.resetTime
  318. local ok = this.checkTimeInMinuteHeart(hour, resetHour, resetTime)
  319. this.loginfo("是否可以重置", ok, timeInfo)
  320. if not ok then
  321. return
  322. end
  323. this.clearIntegralInfo()
  324. local timeInfo = this.getTimeInfo()
  325. timeInfo.resetTime = getbaseinfo("now")
  326. this.setTimeInfo(timeInfo)
  327. this.setState(STATE_OK)
  328. this.loginfo("重置完成,打印相关数据", this.getTimeInfo(), this.getIntegralInfo(nil), this.getState())
  329. end
  330. function this.sendRewardToMail(actor,rid,time,medalTotal, integralTotal, rank, integral, medalCount, rewardMap)
  331. local config = ConfigDataManager.getById("cfg_mail", MailConfig.MONSTER_HUNT_INTEGRAL)
  332. if config == nil then
  333. this.logerror(actor, "奖励邮件配置不存在", MailConfig.MONSTER_HUNT_INTEGRAL)
  334. this.loginfo("奖励入包", actor, rank, integral, medalCount, rewardMap)
  335. additemmaptobag(actor, rewardMap, 0, 9999, "猎魔积分")
  336. else
  337. -- local title = config["title"]
  338. -- local content = config["content"]
  339. -- content = string.format(content, integralTotal, medalTotal, rank, medalCount)
  340. -- sendmail(actor, title, content, rewardMap)
  341. sendconfigmailbyrid(actor, rid, MailConfig.MONSTER_HUNT_INTEGRAL, rewardMap,
  342. integralTotal .. "#" .. medalTotal .. "#" .. rank .. "#" .. medalCount)
  343. this.loginfo("发送奖励邮件", actor, rewardMap)
  344. end
  345. --记录日志
  346. gameDebug.debug(this.saveLog,actor,time,integral, medalCount, rank)
  347. end
  348. function this.saveLog(actor,time,integral,medalCount,rank)
  349. local roleName = getbaseinfo(actor, "rolename")
  350. local level = getbaseinfo(actor, "level")
  351. local lastLoginTime = getbaseinfo(actor, "logintime")
  352. local loginLong = getbaseinfo(actor, "loginlong") / 60
  353. local rechargeTotal = RechargeRecord.getTotalCount(actor)
  354. local lastGetIntegralTime = os.date('%Y-%m-%d %H:%M:%S', math.floor(time / 1000))
  355. logBody = {}
  356. logBody["角色名字"] = roleName
  357. logBody["等级"] = level
  358. logBody["最后登录时间"] = lastLoginTime
  359. logBody["登录时长"] = loginLong
  360. logBody["充值金额"] = rechargeTotal
  361. logBody["最后获得积分时间"] = lastGetIntegralTime
  362. logBody["杀怪积分"] = integral
  363. logBody["勋章数量"] = medalCount
  364. logBody["排名"] = rank
  365. local logContent = ""
  366. for k, v in pairs(logBody) do
  367. logContent = logContent .. k .. "=" .. v .. ","
  368. end
  369. logContent = string.sub(logContent,1, string.len(logContent) - 1)
  370. logop(actor, LogOpType.MONSTER_HUNT, logContent)
  371. end
  372. function this.getRewardPercentByRank(rank)
  373. local configList = ConfigDataManager.getTable("cfg_monsterHuntReward")
  374. local selfScale = 0
  375. local otherReward = nil
  376. local extraMedalCount = nil
  377. for _, config in pairs(configList) do
  378. local ranks = string.split(config.rank, "#")
  379. local rewardScale = tonumber(config.reward)
  380. local lowRank = tonumber(ranks[1])
  381. local highRank = tonumber(ranks[2])
  382. if lowRank <= rank and rank <= highRank then
  383. selfScale = rewardScale
  384. otherReward = config.item
  385. extraMedalCount = config.extra
  386. end
  387. end
  388. --this.loginfo("根据排名获得奖励比率", rank, selfScale, otherReward, extraMedalCount)
  389. return selfScale, otherReward,extraMedalCount
  390. end
  391. function this.checkSettleAndReset()
  392. local serverType = getbaseinfo("servertype")
  393. if serverType == 2 then
  394. --跨服不用结算
  395. return
  396. end
  397. local settleHour, resetHour = this.getTimeConfig()
  398. this.loginfo("检查结算和重置", settleHour, resetHour)
  399. if settleHour == nil or resetHour == nil then
  400. return
  401. end
  402. local hour = getbaseinfo("hour")
  403. this.Settle(hour, settleHour)
  404. this.Reset(hour, resetHour)
  405. end
  406. function this.buildOneRole(id)
  407. local actor = getactor(id)
  408. local role = {}
  409. role["career"] = getbaseinfo(actor, "getbasecareer")
  410. role["name"] = getbaseinfo(actor, "rolename")
  411. local serverId = getbaseinfo(actor, "originalserverid")
  412. role["serverid"] = serverId
  413. role["online"] = getbaseinfo(actor, "onlinestate")
  414. return role
  415. end
  416. function this.rankList(actor)
  417. local integralInfo = this.getIntegralInfo(actor)
  418. local rankList,medalTotal,integralTotal = this.getRankList(integralInfo)
  419. local resRankList = {}
  420. for _, rankItem in pairs(rankList) do
  421. local newItem = {
  422. rid = rankItem.rid,
  423. integral = rankItem.integral,
  424. medal= rankItem.medalCount,
  425. rank = rankItem.rank,
  426. roleInfo = this.buildOneRole(rankItem.rid)
  427. }
  428. table.insert(resRankList, newItem)
  429. end
  430. this.loginfo(actor, "总勋章数量", tostring(medalTotal),"总积分数量",integralTotal,"榜列表", resRankList)
  431. sendluamsg(actor, LuaMessageIdToClient.RES_MONSTER_HUNT_RANK, resRankList)
  432. end
  433. function this.notice()
  434. local serverType = getbaseinfo("servertype")
  435. if serverType == 2 then
  436. --跨服不用结算
  437. return
  438. end
  439. local count = this.getNoticeCount()
  440. count = count + 1
  441. this.setNoticeCount(count)
  442. if count % 5 == 0 then
  443. --每5分中发送通知
  444. this.sendNotice()
  445. end
  446. end
  447. function this.getNameByIndex(rankList, index)
  448. if table.isNullOrEmpty(rankList) then
  449. return ""
  450. end
  451. if #rankList >= index then
  452. local item = rankList[index]
  453. local rid = item.rid
  454. local actor = getactor(rid)
  455. local name = getbaseinfo(actor, "rolename")
  456. return name
  457. end
  458. return ""
  459. end
  460. function this.sendNotice()
  461. local integralInfo = this.getIntegralInfo(nil)
  462. local rankList = this.getRankList(integralInfo)
  463. local first = this.getNameByIndex(rankList, 1)
  464. local second = this.getNameByIndex(rankList, 2)
  465. local third = this.getNameByIndex(rankList, 3)
  466. local allplayer = getallplayer()
  467. for _, id in pairs(allplayer) do
  468. local actor = getactor(id)
  469. noticeTip.noticeinfo(actor, StringIdConst.TEXT27001, first, second, third)
  470. end
  471. end
  472. function this.info(actor)
  473. local settleHour, resetHour = this.getTimeConfig()
  474. local res
  475. if settleHour == nil or resetHour == nil then
  476. res = {
  477. settleSec= 0,
  478. resetSec= 0
  479. }
  480. else
  481. local timeInfo = this.getTimeInfo(actor)
  482. local settleSec = this.getTargetDateTimeSec(settleHour, timeInfo.settleTime)
  483. local resetSec = this.getTargetDateTimeSec(resetHour, timeInfo.resetTime)
  484. res = {
  485. settleSec= settleSec,
  486. resetSec= resetSec
  487. }
  488. end
  489. this.loginfo("信息", res)
  490. sendluamsg(actor, LuaMessageIdToClient.RES_MONSTER_HUNT_INFO, res)
  491. end
  492. --今天是否刷过了
  493. function this.todayIsRefresh(prevRefreshTimeMills)
  494. if prevRefreshTimeMills == nil or prevRefreshTimeMills <= 0 then
  495. return false
  496. end
  497. --this.loginfo("prevRefreshTimeMills", prevRefreshTimeMills, type(prevRefreshTimeMills))
  498. local now = getbaseinfo("now")
  499. local diffDays = datediff(now, prevRefreshTimeMills, "day")
  500. return diffDays == 0
  501. end
  502. function this.getTargetDateTimeSec(hour, prevRefreshTimeMills)
  503. local dateTimeFormat = "%s-%s-%s %s:%s:%s"
  504. local now = getbaseinfo("now")
  505. local target
  506. local todayIsRefresh = this.todayIsRefresh(prevRefreshTimeMills)
  507. if todayIsRefresh then
  508. --加一天
  509. target = dateadd(now, 1)
  510. else
  511. local y = year(now)
  512. local m = month(now)
  513. local d = day(now)
  514. local dateTimeString = string.format(dateTimeFormat, y, m, d, hour, 0, 0)
  515. local t = timestamp(dateTimeString)
  516. if t > now then
  517. this.loginfo("刷新间隔计算1", todayIsRefresh, dateTimeString, t, now )
  518. --今天刷
  519. --return datediff(t,now, "second")
  520. return math.round(t / 1000)
  521. else
  522. --明天刷
  523. target = dateadd(now, 1)
  524. end
  525. end
  526. local y = year(target)
  527. local m = month(target)
  528. local d = day(target)
  529. local dateTimeString = string.format(dateTimeFormat, y, m, d, hour, 0, 0)
  530. local t = timestamp(dateTimeString)
  531. this.loginfo("刷新间隔计算2", todayIsRefresh, dateTimeString, t, now )
  532. --return datediff(t,now, "second")
  533. return math.round(t / 1000)
  534. end
  535. function this.loginfo(...)
  536. info("[猎魔勋章]", ...)
  537. end
  538. function this.logerror(...)
  539. error("[猎魔勋章]", ...)
  540. end
  541. function MonsterHunt.GetMonsterHuntIntegralKey()
  542. return VAR.MONSTER_HUNT_INTEGRAL;
  543. end
  544. function MonsterHunt.CombineMonsterHuntIntegral(varData)
  545. if table.isNullOrEmpty(varData) then
  546. return
  547. end
  548. this.loginfo("猎魔积分合服数据", varData)
  549. local currIntegralInfo = this.getIntegralInfo(nil)
  550. for sid, integralInfo in pairs(varData) do
  551. table.merge(currIntegralInfo, integralInfo)
  552. end
  553. this.setIntegralInfo(nil, currIntegralInfo)
  554. end
  555. --怪物死亡触发
  556. function MonsterHunt.MonsterDie(ownerId, monsterCfgId)
  557. gameDebug.debug(this.monsterDie, ownerId, monsterCfgId)
  558. end
  559. --结算
  560. function MonsterHunt.CheckSettleAndReset()
  561. gameDebug.debug(this.checkSettleAndReset)
  562. end
  563. function MonsterHunt.Notice()
  564. gameDebug.debug(this.notice)
  565. end
  566. function MonsterHunt.RankList(actor)
  567. gameDebug.debug(this.rankList, actor)
  568. end
  569. --@lua monsterhuntinfo
  570. function MonsterHunt.Info(actor)
  571. gameDebug.debug(this.info, actor)
  572. end
  573. --打印排行榜列表
  574. --@lua monsterhuntranklist
  575. function monsterhuntranklist(actor)
  576. this.rankList(actor)
  577. end
  578. --@lua monsterhuntchecksettleandreset
  579. function monsterhuntchecksettleandreset()
  580. this.checkSettleAndReset()
  581. end
  582. --@lua monsterhuntsendnotice
  583. function monsterhuntsendnotice()
  584. this.sendNotice()
  585. end
  586. -- @lua monsterhuntinfo
  587. function monsterhuntinfo(actor)
  588. this.info(actor)
  589. end
  590. -- @createMonster 80006
  591. -- @lua monstercleartimeinfo
  592. function monstercleartimeinfo(actor)
  593. this.setTimeInfo(nil)
  594. this.setState(nil)
  595. end