CopyLogic.lua 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. local Lang = require("common.Lang")
  2. local Msg = require("core.Msg")
  3. local ObjHuman = require("core.ObjHuman")
  4. local Util = require("common.Util")
  5. local CopyExcel = require("excel.copy")
  6. local Grid = require("bag.Grid")
  7. local RoleDefine = require("role.RoleDefine")
  8. local BagLogic = require("bag.BagLogic")
  9. local CombatDefine = require("combat.CombatDefine")
  10. local CombatLogic = require("combat.CombatLogic")
  11. local DailyTaskLogic = require("dailyTask.DailyTaskLogic")
  12. local ItemDefine = require("bag.ItemDefine")
  13. local Broadcast = require("broadcast.Broadcast")
  14. local Log = require("common.Log")
  15. local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
  16. local ChengjiuLogic = require("chengjiu.ChengjiuLogic")
  17. local VipLogic = require("vip.VipLogic")
  18. local CombatPosLogic = require("combat.CombatPosLogic")
  19. local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
  20. local DragonNestLogic = require("copy.DragonNestLogic")
  21. local MengxinLogic = require("present.MengxinLogic")
  22. local YunYingLogic = require("yunying.YunYingLogic")
  23. local TalismanLogic = require("talisman.TalismanLogic")
  24. COPY_TYPE_JINBI = 1 --金币挑战
  25. COPY_TYPE_EXP = 2 --经验挑战
  26. COPY_TYPE_SUIPIAN = 3 --英雄挑战
  27. COPY_TYPE_MOSHENG = 4 --魔神挑战
  28. COPY_TYPE_FUWEN = 5 --符文挑战
  29. COPY_TYPE_MAX = 5
  30. COPY_SAODANG_CAN = 1 --可扫荡
  31. function updateDaily(human)
  32. DragonNestLogic.updateDaily(human)
  33. if not human.db.copy then return end
  34. for i = COPY_TYPE_JINBI , COPY_TYPE_MAX do
  35. if human.db.copy[i] then
  36. human.db.copy[i].cnt = 0
  37. human.db.copy[i].buyCnt = 0
  38. end
  39. end
  40. end
  41. -- 挑战查询
  42. function isOpenByType(human,copyType,noSend)
  43. local copyConfig = CopyExcel.richang[copyType]
  44. if not copyConfig then return end
  45. if human.db.lv < copyConfig.lv then
  46. return
  47. end
  48. return true
  49. end
  50. function getMinZDLByType(copyType)
  51. for _,config in ipairs(CopyExcel.copy ) do
  52. if config.type == copyType then
  53. return config.zhandouliNeed
  54. end
  55. end
  56. return 0
  57. end
  58. local function isDotByType(human,copyType)
  59. if not isOpenByType(human, copyType, true) then
  60. return
  61. end
  62. local copyConfig = CopyExcel.copy[copyType]
  63. local zhandouli = CombatPosLogic.getCombatHeroZDL(human, CombatDefine.COMBAT_TYPE1)
  64. local minZDL = getMinZDLByType(copyType)
  65. if zhandouli < minZDL then
  66. return
  67. end
  68. local leftCnt = getLeftCnt(human, copyType)
  69. if leftCnt > 0 then
  70. return true
  71. end
  72. end
  73. local function getMaxID(human, copyType)
  74. local copyDB = human.db.copy
  75. if not copyDB then return 0 end
  76. return copyDB[copyType] and copyDB[copyType].maxID or 0
  77. end
  78. local function canSaoDang(human,copyType, id)
  79. return getMaxID(human, copyType) >= id and COPY_SAODANG_CAN or 0
  80. end
  81. -- 根据副本类型和等级获取copyID
  82. local TYPE_2_COPYLIST = nil
  83. local function getCopyIDByLv(copyType, level)
  84. if not TYPE_2_COPYLIST then
  85. TYPE_2_COPYLIST = {}
  86. for copyID, config in pairs(CopyExcel.copy) do
  87. if not TYPE_2_COPYLIST[config.type] then
  88. TYPE_2_COPYLIST[config.type] = {}
  89. end
  90. TYPE_2_COPYLIST[config.type][config.level] = copyID
  91. end
  92. end
  93. if not TYPE_2_COPYLIST[copyType] then
  94. return
  95. end
  96. return TYPE_2_COPYLIST[copyType][level]
  97. end
  98. function challengeQuery(human, copyType)
  99. local config = CopyExcel.richang[copyType]
  100. if not config then return end
  101. ObjHuman.updateDaily(human)
  102. local msgRet = Msg.gc.GC_COPY_CHALLENGE_QUERY
  103. msgRet.copyType = copyType
  104. msgRet.leftCnt = getLeftCnt(human, copyType)
  105. msgRet.maxCnt = getCurMaxCnt(human, copyType)
  106. msgRet.vipBuy = getCanBuyCnt(human, copyType)
  107. msgRet.vipNeed = config.zuanshi
  108. msgRet.vipBuyUpLv = VipLogic.getUpPowerNeedLv(human, VipLogic.VIP_POWER13) or 0
  109. msgRet.redList[0] = #CopyExcel.richang
  110. msgRet.copyList[0] = #CopyExcel.richang
  111. for i=1,#CopyExcel.richang do
  112. msgRet.redList[i] = isDotByType(human,i) and 1 or 0
  113. msgRet.copyList[i] = CopyExcel.richang[i].lv
  114. end
  115. local now = os.time()
  116. local ts1 = Util.getDayStartTime(now)
  117. msgRet.nextRefreshTime = 24 * 60 * 60 - (now - ts1)
  118. --秘宝加成
  119. local talismanAdd_jinbi = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.NW_JB) or 0) / 100
  120. local talismanAdd_hero_exp = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.NW_HERO_EXP) or 0) / 100
  121. local j = 0 -- 存储相同副本类型的数量
  122. for i=1, #CopyExcel.copy do
  123. local copyConfig = CopyExcel.copy[i]
  124. if copyConfig and copyType == copyConfig.type then
  125. j = j + 1
  126. msgRet.list[j].id = i
  127. msgRet.list[j].level = copyConfig.level
  128. msgRet.list[j].lvNeed = copyConfig.lvNeed
  129. msgRet.list[j].zhandouliNeed = copyConfig.zhandouliNeed
  130. msgRet.list[j].reward[0] = #copyConfig.reward
  131. msgRet.list[j].saodang = canSaoDang(human,copyType,i) or 0
  132. for key,value in ipairs (copyConfig.reward) do
  133. local itemID = value[1]
  134. local itemCnt = value[2]
  135. if itemID == ItemDefine.ITEM_JINBI_ID and talismanAdd_jinbi > 0 then
  136. itemCnt = itemCnt + math.ceil(itemCnt * talismanAdd_jinbi)
  137. elseif itemID == ItemDefine.ITEM_GREEN_EXP_ID and talismanAdd_hero_exp > 0 then
  138. itemCnt = itemCnt + math.ceil(itemCnt * talismanAdd_hero_exp)
  139. end
  140. Grid.makeItem(msgRet.list[j].reward[key], itemID, itemCnt)
  141. end
  142. end
  143. end
  144. msgRet.list[0] = j
  145. Msg.send(msgRet, human.fd)
  146. --Msg.trace(msgRet)
  147. end
  148. -- 挑战
  149. function fight(human, args)
  150. local isok, id, copyConfig = checkCombatPos(human, args)
  151. if not isok then return end
  152. -- 调用战斗接口
  153. CombatLogic.combatBegin(human, copyConfig.mapID, args, CombatDefine.COMBAT_TYPE7, id)
  154. end
  155. -- 获取当前地图ID
  156. function getMapID(human, args)
  157. local isok, id, copyConfig = checkCombatPos(human, args)
  158. if not isok then return end
  159. return copyConfig.mapID
  160. end
  161. function doFightEnd(human,copyID,combatInfo, touch)
  162. local copyConfig = CopyExcel.copy[copyID]
  163. if not copyConfig then return end
  164. ObjHuman.updateDaily(human)
  165. local copyType = copyConfig.type
  166. touch = tonumber(touch or 0)
  167. -- 金币挑战
  168. if copyType == COPY_TYPE_JINBI then
  169. Log.write(Log.LOGID_OSS_BATTLE_GOLD, human.db._id, human.db.account, human.db.name, human.db.lv)
  170. end
  171. -- 经验挑战
  172. if copyType == COPY_TYPE_EXP then
  173. Log.write(Log.LOGID_OSS_BATTLE_EXP, human.db._id, human.db.account, human.db.name, human.db.lv)
  174. end
  175. -- 碎片挑战
  176. if copyType == COPY_TYPE_SUIPIAN then
  177. Log.write(Log.LOGID_OSS_BATTLE_HERO, human.db._id, human.db.account, human.db.name, human.db.lv)
  178. end
  179. local leftCnt = getLeftCnt(human, copyType)
  180. local canBuy = getCanBuyCnt(human, copyType)
  181. local fightCnt = touch == 0 and 1 or leftCnt
  182. -- 改db
  183. human.db.copy = human.db.copy or {}
  184. human.db.copy[copyType] = human.db.copy[copyType] or {}
  185. local cnt = human.db.copy[copyType].cnt or 0
  186. human.db.copy[copyType].cnt = cnt + fightCnt
  187. local maxCopy = human.db.copy[copyType].maxID or 0
  188. if copyID > maxCopy then
  189. human.db.copy[copyType].maxID = copyID --实现成功挑战一次可扫荡逻辑
  190. end
  191. local double = RoleSystemLogic.isDouble(human, RoleSystemDefine.ROLE_SYS_ID_1206)
  192. --秘宝加成
  193. local talismanAdd_jinbi = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.NW_JB) or 0) / 100
  194. local talismanAdd_hero_exp = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.NW_HERO_EXP) or 0) / 100
  195. -- 给奖励
  196. local rewardRate = double and 2 or 1
  197. local itemList = {}
  198. for i = 1, #copyConfig.reward do
  199. local itemID = copyConfig.reward[i][1]
  200. local itemCnt = copyConfig.reward[i][2]
  201. local finalCnt = itemCnt * rewardRate * fightCnt
  202. if itemID == ItemDefine.ITEM_JINBI_ID and talismanAdd_jinbi > 0 then
  203. finalCnt = finalCnt + math.ceil(finalCnt * talismanAdd_jinbi)
  204. elseif itemID == ItemDefine.ITEM_GREEN_EXP_ID and talismanAdd_hero_exp > 0 then
  205. finalCnt = finalCnt + math.ceil(finalCnt * talismanAdd_hero_exp)
  206. end
  207. BagLogic.addItem(human, itemID, finalCnt, "copy_win")
  208. local index = #itemList+1
  209. itemList[index] = {}
  210. itemList[index][1] = itemID
  211. itemList[index][2] = finalCnt
  212. if combatInfo and combatInfo.rewardItem then --为nil时是扫荡调用这个方法
  213. for j = 1, rewardRate do
  214. local nowTotalCnt = #combatInfo.rewardItem
  215. combatInfo.rewardItem[nowTotalCnt + 1] = {}
  216. combatInfo.rewardItem[nowTotalCnt + 1][1] = itemID
  217. if itemID == ItemDefine.ITEM_JINBI_ID or itemID == ItemDefine.ITEM_GREEN_EXP_ID then
  218. combatInfo.rewardItem[nowTotalCnt + 1][2] = finalCnt
  219. else
  220. combatInfo.rewardItem[nowTotalCnt + 1][2] = itemCnt * rewardRate * fightCnt
  221. end
  222. end
  223. combatInfo.double = double and 2 or 0
  224. end
  225. end
  226. DailyTaskLogic.recordDailyTaskFinishCnt(human, DailyTaskLogic.DAILY_TASK_ID_10, fightCnt)
  227. MengxinLogic.onCallBack(human,MengxinLogic.MX_TASK_TYPE_9,1)
  228. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1206)
  229. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1201)
  230. YunYingLogic.onCallBack(human, "onCopyFight", fightCnt)
  231. YunYingLogic.onCallBack(human, "onCopyChallenge",fightCnt)
  232. return itemList
  233. end
  234. -- 挑战结束
  235. function onFightEnd(human, result, combatType, copyID, combatInfo)
  236. local copyConfig = CopyExcel.copy[copyID]
  237. if not copyConfig then return end
  238. -- todo 太难打了,先改成必定打赢,晚点改回去
  239. if CombatDefine.RESULT_WIN == result then
  240. doFightEnd(human,copyID,combatInfo)
  241. end
  242. local copyTypeConfig = CopyExcel.richang[copyConfig.type]
  243. if copyTypeConfig then
  244. combatInfo.defender.name = copyTypeConfig.name
  245. combatInfo.panelID = copyTypeConfig.panelID
  246. end
  247. YunYingLogic.onCallBack(human, "onCopyChallenge",1)
  248. end
  249. -- 查询购买次数
  250. function buyChallengeQuery(human, copyType)
  251. do return end
  252. --[[
  253. local vipLv = VipLogic.getVipLv(human)
  254. if vipLv < 1 then
  255. return Broadcast.sendErr(human, Lang.COPY_BUY_CNT_ERR_VIP)
  256. end
  257. -- 次数判断
  258. local leftBuyCnt = getMaxBuyCnt(human) - getCurBuyCnt(human, copyType)
  259. if leftBuyCnt < 1 then
  260. return Broadcast.sendErr(human, Lang.COPY_BUY_CNT_ERR_CNT)
  261. end
  262. local msgRet = Msg.gc.GC_COPY_BUY_CHALLENGE_QUERY
  263. msgRet.copyType = copyType
  264. msgRet.needItemID = ItemDefine.ITEM_ZUANSHI_ID
  265. msgRet.needItemCnt = CopyExcel.richangDefine[1].zuanshi
  266. msgRet.curBuyCnt = getCurBuyCnt(human, copyType)
  267. msgRet.maxBuyCnt = getMaxBuyCnt(human)
  268. Msg.send(msgRet, human.fd)
  269. ]]
  270. end
  271. -- 购买挑战次数
  272. function buyChallengeCnt(human, copyType, buyCnt)
  273. do return end
  274. --[[
  275. if buyCnt < 1 then return end
  276. ObjHuman.updateDaily(human)
  277. -- 条件判断
  278. local maxBuyCnt = getMaxBuyCnt(human)
  279. local curBuyCnt = getCurBuyCnt(human, copyType)
  280. -- 最大购买次数判断
  281. if maxBuyCnt - curBuyCnt < buyCnt then
  282. return Broadcast.sendErr(human, Lang.COPY_BUY_CNT_ERR_CNT)
  283. end
  284. -- 钻石判断
  285. local needZuanshi = buyCnt * CopyExcel.richangDefine[1].zuanshi
  286. if not ObjHuman.checkRMB(human, needZuanshi) then
  287. return
  288. end
  289. local oldRed = isDotByType(human,copyType)
  290. -- 扣钻石
  291. ObjHuman.decZuanshi(human, -needZuanshi, "buy_challenge_cnt")
  292. -- 改db
  293. human.db.copy = human.db.copy or {}
  294. human.db.copy[copyType] = human.db.copy[copyType] or {}
  295. human.db.copy[copyType].buyCnt = curBuyCnt + buyCnt
  296. -- 通知客户端
  297. local msgRet = Msg.gc.GC_COPY_BUY_CHALLENGE_CNT
  298. msgRet.copyType = copyType
  299. msgRet.leftCnt = getLeftCnt(human, copyType)
  300. msgRet.maxCnt = getMaxCnt(human, copyType)
  301. Msg.send(msgRet, human.fd)
  302. local nowRed = isDotByType(human,copyType)
  303. if oldRed ~= nowRed then
  304. refreshRed(human,copyType,nowRed)
  305. end
  306. ]]
  307. end
  308. function getLeftCnt(human, copyType)
  309. local maxCnt = getMaxCnt(human, copyType)
  310. local nowCnt = 0
  311. if human.db.copy and human.db.copy[copyType] then
  312. nowCnt = human.db.copy[copyType].cnt or 0
  313. end
  314. return maxCnt - nowCnt
  315. end
  316. function getCurMaxCnt(human, copyType)
  317. local challengeCnt = CopyExcel.richang[copyType].challengeCnt
  318. local buyCnt = getMaxBuyCnt(human, copyType)
  319. local nowCnt = 0
  320. if human.db.copy and human.db.copy[copyType] then
  321. nowCnt = human.db.copy[copyType].cnt or 0
  322. end
  323. return buyCnt + challengeCnt - nowCnt
  324. end
  325. function getMaxCnt(human, copyType)
  326. local curBuyCnt = getCurBuyCnt(human, copyType)
  327. local challengeCnt = CopyExcel.richang[copyType].challengeCnt
  328. return challengeCnt + curBuyCnt
  329. end
  330. function getCanBuyCnt(human, copyType)
  331. return getMaxBuyCnt(human, copyType) - getCurBuyCnt(human, copyType)
  332. end
  333. function getCurBuyCnt(human, copyType)
  334. if human.db.copy == nil or human.db.copy[copyType] == nil or
  335. human.db.copy[copyType].buyCnt == nil then
  336. return 0
  337. end
  338. return human.db.copy[copyType].buyCnt
  339. end
  340. function getMaxBuyCnt(human, copyType)
  341. return VipLogic.getPowerArgs(human, VipLogic.VIP_POWER13) or 0
  342. end
  343. -- 副本列表日常副本红点
  344. function isDot(human)
  345. for i=1,#CopyExcel.richang do
  346. if isOpenByType(human,i,true) and isDotByType(human, i) then
  347. return true
  348. end
  349. end
  350. end
  351. function CG_COPY_CHALLENGE_SAODANG(human,copyID,touch)
  352. local copyConfig = CopyExcel.copy[copyID]
  353. if not copyConfig then return end
  354. local copyType = copyConfig.type
  355. if not canSaoDang(human,copyType,copyID) then return end
  356. local oldRed = isDotByType(human,copyType)
  357. if touch ~= 0 then
  358. if human.db.lv < 110 then return end
  359. end
  360. local args = {}
  361. args[1] = copyID
  362. args[2] = touch or 0
  363. local isok, id, copyConfig = checkCombatPos(human, args)
  364. if not isok then return end
  365. local itemList = doFightEnd(human,copyID, nil, args[2])
  366. local double = RoleSystemLogic.isDouble(human, RoleSystemDefine.ROLE_SYS_ID_1206)
  367. local msgRet = Msg.gc.GC_COPY_CHALLENGE_SAODANG
  368. msgRet.copyType = copyType
  369. msgRet.copyID = copyID
  370. msgRet.double = double and 1 or 0
  371. msgRet.leftCnt = getLeftCnt(human, copyType)
  372. Msg.send(msgRet,human.fd)
  373. BagLogic.sendItemGetList(human,itemList, "copy_win")
  374. local nowRed = isDotByType(human,copyType)
  375. if oldRed ~= nowRed then
  376. refreshRed(human,copyType,nowRed)
  377. end
  378. challengeQuery(human, copyType)
  379. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1206)
  380. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1201)
  381. end
  382. function refreshRed(human,copyType,nowRed)
  383. local msgRet = Msg.gc.GC_COPY_CHALLENGE_RED
  384. msgRet.copyType = copyType
  385. msgRet.isRed = nowRed and 1 or 0
  386. Msg.send(msgRet,human.fd)
  387. end
  388. --------------------------------------------- combat ----------------------------------------------
  389. function getCombatMonsterOutID(human, side, args)
  390. if side ~= CombatDefine.DEFEND_SIDE then return end
  391. local id = tonumber(args[1] or 0)
  392. local copyConfig = CopyExcel.copy[id]
  393. if not copyConfig then return end
  394. return copyConfig.monsterOutID
  395. end
  396. function checkCombatPos(human, args)
  397. local id = tonumber(args[1] or 0)
  398. local touch = tonumber(args[2] or 0)
  399. local copyConfig = CopyExcel.copy[id]
  400. if not copyConfig then return end
  401. -- 等级判断
  402. if human.db.lv < copyConfig.lvNeed then
  403. return Broadcast.sendErr(human, Util.format(Lang.COMMON_SYSTEM_OPENTIP, copyConfig.lvNeed))
  404. end
  405. --获取全身 最高战力 6人组
  406. if human.db.zhandouli < copyConfig.zhandouliNeed then
  407. return Broadcast.sendErr(human, Util.format(Lang.COMMON_SYSTEM_OPENZHANLI, copyConfig.zhandouliNeed))
  408. end
  409. -- 前置副本要先打过
  410. local preCopyID = getCopyIDByLv(copyConfig.type, copyConfig.level - 1)
  411. if preCopyID and getMaxID(human, copyConfig.type) < preCopyID then
  412. return Broadcast.sendErr(human, Lang.COPY_FIGHT_ERR_PREID)
  413. end
  414. ObjHuman.updateDaily(human)
  415. local copyType = copyConfig.type
  416. local leftCnt = getLeftCnt(human, copyType)
  417. if touch == 0 then
  418. if leftCnt < 1 then
  419. local canBuy = getCanBuyCnt(human, copyType)
  420. if canBuy < 1 then
  421. return Broadcast.sendErr(human, Lang.COPY_FIGHT_ERR_NO_CNT)
  422. end
  423. -- 钻石判断
  424. local needZuanshi = CopyExcel.richang[copyType].zuanshi
  425. if not ObjHuman.checkRMB(human, needZuanshi) then
  426. return Broadcast.sendErr(human, Lang.COMMON_NO_ZUANSHI)
  427. end
  428. -- 扣钻石
  429. ObjHuman.decZuanshi(human, -needZuanshi, "buy_challenge_cnt")
  430. -- 改db
  431. human.db.copy = human.db.copy or {}
  432. human.db.copy[copyType] = human.db.copy[copyType] or {}
  433. human.db.copy[copyType].buyCnt = human.db.copy[copyType].buyCnt or 0
  434. human.db.copy[copyType].buyCnt = human.db.copy[copyType].buyCnt + 1
  435. end
  436. else
  437. local canBuy = getCanBuyCnt(human, copyType)
  438. if canBuy < 1 then
  439. return Broadcast.sendErr(human, Lang.COPY_FIGHT_ERR_NO_CNT)
  440. end
  441. -- 钻石判断
  442. local needZuanshi = CopyExcel.richang[copyType].zuanshi * canBuy
  443. if not ObjHuman.checkRMB(human, needZuanshi) then
  444. return Broadcast.sendErr(human, Lang.COMMON_NO_ZUANSHI)
  445. end
  446. -- 扣钻石
  447. ObjHuman.decZuanshi(human, -needZuanshi, "buy_challenge_cnt")
  448. -- 改db
  449. human.db.copy = human.db.copy or {}
  450. human.db.copy[copyType] = human.db.copy[copyType] or {}
  451. human.db.copy[copyType].buyCnt = human.db.copy[copyType].buyCnt or 0
  452. human.db.copy[copyType].buyCnt = human.db.copy[copyType].buyCnt + canBuy
  453. end
  454. return true, id, copyConfig
  455. end
  456. function onUpdatePos(human)
  457. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1206)
  458. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1201)
  459. end