Gm.lua 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990
  1. local Config = require("Config")
  2. local Util = require("common.Util")
  3. local Log = require("common.Log")
  4. local Msg = require("core.Msg")
  5. local ObjHuman = require("core.ObjHuman")
  6. local BagLogic = require("bag.BagLogic")
  7. local Broadcast = require("broadcast.Broadcast")
  8. local Util = require("common.Util")
  9. local InnerMsg = require("core.InnerMsg")
  10. local CommonDB = require("common.CommonDB")
  11. local JjcDB = require("jjc.JjcDB")
  12. local VipLogic = require("vip.VipLogic")
  13. local VipExcel = require("excel.vip")
  14. local GMExcel = require("excel.gm")
  15. local RoleLogic = require("role.RoleLogic")
  16. local UnionDBLogic = require("union.UnionDBLogic")
  17. local CombatPosLogic = require("combat.CombatPosLogic")
  18. local CombatDefine = require("combat.CombatDefine")
  19. local ItemDefine = require("bag.ItemDefine")
  20. local MiddleConnect = require("middle.MiddleConnect")
  21. local BuyLogic = require("topup.BuyLogic")
  22. local WeekendLoopActManger = require("WeekendLoopActivity.WeekendLoopActManager")
  23. local RecommendLineup = require("drawCard.RecommendLineup")
  24. local NewFirstCharge = require("present.NewFirstChargeLogic")
  25. local ActPowerUp = require("present.OpenServerActPowerUp")
  26. local FestivalSevenDayCardLogic = require("absAct.FestivalSevenDayCardLogic")
  27. local TreasureChestLogic = require("treasurechest.TreasureChestLogic")
  28. local MaiDianLogic = require("MaiDian.MaiDianLogic")
  29. d3 = {}
  30. local function send(human, err)
  31. local mm = Msg.gc.GC_CHAT
  32. mm.item.msgType = 3
  33. mm.item.targetUuid = ""
  34. mm.item.sendTime = os.time()
  35. mm.item.msg = tostring(err)
  36. mm.item.vipLv = human.db.vipLv or 0
  37. mm.item.videoUuid = ""
  38. mm.item.isJson = 0
  39. mm.item.unionFrame = 0
  40. local union = {}
  41. if human.db.unionUuid ~= nil then
  42. union = UnionDBLogic.getUnion(human.db.unionUuid)
  43. end
  44. RoleLogic.getRoleBase(human,mm.item.roleBase)
  45. mm.item.label = human.db.throneLabel or 0
  46. Msg.send(mm, human.fd)
  47. end
  48. -- 直接调用gm命令
  49. function execGm(human, cmd,pos)
  50. print("直接调用gm命令",cmd,pos)
  51. --Log.write(Log.LOGID_OSS_GM_CODE, human.db._id, human.db.account, human.db.name, cmd, pos)
  52. Log.write(Log.LOGID_OSS_GM_CODE, human.db._id, human.db.newUniqueTag, human.db.name, cmd, pos)
  53. d3[cmd](human, tonumber(pos) or pos)
  54. return true
  55. end
  56. function checkGm(human, str)
  57. if not Config.IS_USE_GM_CMD and human.db.gm == nil then
  58. return
  59. end
  60. local pos = string.find(str, " ", 1, true)
  61. local cmd = string.sub(str, 1, pos and pos - 1)
  62. if not Config.IS_USE_GM_CMD then
  63. if human.db.gm == 1 and not GmControl[cmd] then -- 一级权限的gm只能使用部分gm命令
  64. send(human, "not permit for this gm cmd!")
  65. return true
  66. end
  67. if human.db.gm == 100 then -- 新手引导员不能使用gm命令
  68. return
  69. end
  70. end
  71. if not d3[cmd] then
  72. return
  73. end
  74. local arg = string.sub(str, #cmd + 2)
  75. --Log.write(Log.LOGID_OSS_GM_CODE, human.db._id, human.db.account, human.db.name, cmd, arg)
  76. Log.write(Log.LOGID_OSS_GM_CODE, human.db._id, human.db.newUniqueTag, human.db.name, cmd, arg)
  77. d3[cmd](human, tonumber(arg) or arg)
  78. return true
  79. end
  80. function d3.heroadd(human,val)
  81. if val == nil then return end
  82. local tb = Util.split(val, " ")
  83. local id = tonumber(tb[1])
  84. local cnt = tonumber(tb[2])
  85. local lv = tonumber(tb[3])
  86. local star = tonumber(tb[4])
  87. if not (id and cnt) then return end
  88. for i = 1, cnt do
  89. local heroGrid = require("hero.HeroGrid").createHeroGrid(id , star)
  90. if not heroGrid then break end
  91. local skinLogic = require("skin.SkinLogic")
  92. local skinOn = skinLogic.checkHeroSkinById(human,id)
  93. if skinOn then
  94. heroGrid.skinOn = skinOn
  95. end
  96. local attrConfig = require("hero.HeroDefine").getAttrConfig(id, heroGrid.star)
  97. if not attrConfig then return end
  98. local quality = require("hero.HeroGrid").getMaxQualityByLv(heroGrid.star, lv)
  99. local maxLv = require("hero.HeroGrid").getMaxLv(heroGrid.star, quality)
  100. heroGrid.lv = math.min(maxLv, lv or 0)
  101. heroGrid.quality = math.max(heroGrid.quality, quality or 0)
  102. require("hero.HeroLogic").addHeroByGrid(human, heroGrid, "gm")
  103. end
  104. end
  105. function d3.herodel(human,val)
  106. if val == nil then return end
  107. local pos = string.find(val, " ", 1, true)
  108. if pos == nil then return end
  109. local index = tonumber(string.sub(val, 1, pos - 1))
  110. local cnt= tonumber(string.sub(val,pos+1,#val))
  111. require("hero.HeroLogic").delHeroByIndex(human,index,"gm")
  112. end
  113. function d3.herodelAll(human,val)
  114. for index = 1, human.db.heroBag[0]do
  115. require("hero.HeroLogic").delHeroByIndex(human,index,"gm")
  116. end
  117. end
  118. function d3.itemadd(human,val)
  119. if val == nil then return end
  120. local pos = string.find(val, " ", 1, true)
  121. if pos == nil then return end
  122. local id = tonumber(string.sub(val, 1, pos - 1))
  123. if not id then
  124. local name = string.sub(val, 1, pos - 1)
  125. local ItemExcel = require("excel.item").item
  126. for k,v in pairs(ItemExcel) do
  127. if v.name == name then
  128. id = k
  129. break
  130. end
  131. end
  132. end
  133. if not id then
  134. local name = string.sub(val,1,pos - 1)
  135. local EquipExcel = require("excel.equip").equip
  136. for k,v in pairs(EquipExcel) do
  137. if v.name == name then
  138. id = k
  139. break
  140. end
  141. end
  142. end
  143. if not id then
  144. return
  145. end
  146. local EquipExcel = require("excel.equip").equip
  147. if EquipExcel[id] then
  148. local cnt= tonumber(string.sub(val,pos+1,pos + 2))
  149. local rare= tonumber(string.sub(val,pos+2,#val))
  150. require("bag.BagLogic").addItem(human, id, cnt, "gm", nil, rare)
  151. human.getEquip = nil
  152. else
  153. -- 分开是因为 常规道具 给不了
  154. local cnt= tonumber(string.sub(val,pos+1,#val))
  155. print("[itemadd] id, cnt = ", id, cnt)
  156. require("bag.BagLogic").addItem(human,id,cnt,"gm")
  157. end
  158. end
  159. -- 删除道具
  160. function d3.itemdel(human,val)
  161. if val == nil then return end
  162. local pos = string.find(val, " ", 1, true)
  163. if pos == nil then return end
  164. local id = tonumber(string.sub(val, 1, pos - 1))
  165. local cnt= tonumber(string.sub(val,pos+1,#val))
  166. require("bag.BagLogic").delItem(human,id,cnt,"gm")
  167. end
  168. function d3.qingbaoMax(human)
  169. require("bar.BarTaskLogic").addBarQingBao(human, 10000)
  170. end
  171. function d3.maxbattle(human, val)
  172. val = val + 0
  173. human.db.battleID = val
  174. human.db.guajiID = val - 1
  175. local BRoleLogic = require("billboard.BRoleLogic")
  176. local BillboardDefine = require("billboard.BillboardDefine")
  177. BRoleLogic.updateData(BillboardDefine.TYPE_BATTLE, human.db)
  178. end
  179. function d3.dbsave(human)
  180. ObjHuman.save(human)
  181. end
  182. -- 设置当前金币
  183. function d3.jinbi(human, val)
  184. val = val + 0
  185. ObjHuman.updateJinbi(human, val - human.db.jinbi, "gm")
  186. end
  187. -- 设置钻石
  188. function d3.zuanshi(human, val)
  189. val = val + 0
  190. if val > human.db.zuanshi then
  191. print("234234234",val)
  192. ObjHuman.addZuanshi(human, val - human.db.zuanshi, "gm")
  193. else
  194. ObjHuman.decZuanshi(human, val - human.db.zuanshi, "gm")
  195. end
  196. end
  197. --添加邮件
  198. function d3.mail(human,val)
  199. local param = Util.split(val, " ")
  200. local mailtype = tonumber(param[1])
  201. local title = param[2]
  202. local content = param[3]
  203. local max = #param
  204. local count = (type(param[max]) == "number") and param[max] or 1
  205. local items
  206. if param[4] then
  207. items = {}
  208. for i = 4,max-1 do
  209. items[#items + 1] = {tonumber(param[i]),math.floor(math.random(1,10))}
  210. end
  211. end
  212. if not (mailtype == 1 or mailtype == 2) or not title or not content then
  213. send(human, "参数错误 "..type.." "..title.." "..content.." "..#items)
  214. end
  215. local MailManager = require("mail.MailManager")
  216. for i= 1,count do
  217. MailManager.add(mailtype,human.db._id,title,content,items,mailtype == 2 and [[测试用户]])
  218. end
  219. end
  220. function d3.clbag(human)
  221. human.db.bag = {}
  222. local msgRet = Msg.gc.GC_BAG_LIST
  223. msgRet.list[0] = 0
  224. Msg.send(msgRet, human.fd)
  225. end
  226. function d3.clhero(human)
  227. local HeroLogic = require("hero.HeroLogic")
  228. for i = 1, human.db.heroBag[0] do
  229. HeroLogic.delHeroByIndex(human, i, "gm")
  230. end
  231. end
  232. function d3.god(human)
  233. local GMExcelConfig = GMExcel.god[1]
  234. BagLogic.addItemList(human, GMExcelConfig.addItem, "gm")
  235. for k, v in ipairs(GMExcelConfig.addHero) do
  236. local id = tonumber(v[1])
  237. local cnt = tonumber(v[2])
  238. local lv = tonumber(v[3])
  239. local star = tonumber(v[4])
  240. local quality = require("hero.HeroGrid").getMaxQualityByLv(star, lv)
  241. for i = 1, cnt do
  242. local heroGrid = require("hero.HeroGrid").createHeroGrid(id, star)
  243. if heroGrid then
  244. heroGrid.lv = math.max(heroGrid.lv, lv or 0)
  245. heroGrid.quality = math.max(heroGrid.quality, quality or 0)
  246. require("hero.HeroLogic").addHeroByGrid(human, heroGrid, "gm")
  247. end
  248. end
  249. end
  250. --d3.viplv(human, 13)
  251. --d3.lv(human, 1)
  252. --d3.noguide(human)
  253. end
  254. function d3.wudi(human)
  255. if wudi then
  256. wudi = false
  257. Broadcast.sendErr(human, "取消无敌状态")
  258. else
  259. wudi = true
  260. Broadcast.sendErr(human, "进入无敌状态")
  261. end
  262. end
  263. -- 清空副本次数和购买次数
  264. function d3.clcopy(human)
  265. human.db.copy = nil
  266. end
  267. -- 设置等级
  268. function d3.lv(human, val)
  269. val = val + 0
  270. local lvOld = human.db.lv
  271. local lvNew = val + 0
  272. human.db.lv = lvNew
  273. ObjHuman.onLvUpCB(human,lvOld , lvNew)
  274. end
  275. -- 加经验
  276. function d3.addexp(human, val)
  277. val = val + 0
  278. ObjHuman.addExp(human, val)
  279. end
  280. -- 设置vip等级
  281. function d3.viplv(human, val)
  282. val = val + 0
  283. local oldVipLv = VipLogic.getVipLv(human)
  284. human.db.vipExp = VipExcel.vip[val] and VipExcel.vip[val].exp or 0
  285. human.db.vipLv = val
  286. VipLogic.addExp(human, 0)
  287. end
  288. -- 增加vip经验
  289. function d3.vipexp(human, val)
  290. val = val + 0
  291. VipLogic.addExp(human, val)
  292. end
  293. function d3.it1(human, value)
  294. value = tonumber(value)
  295. if not value then return end
  296. local ItemExcel = require("excel.item").item
  297. local BagLogic = require("bag.BagLogic")
  298. for itemID, cf in pairs(ItemExcel) do
  299. if cf.subType == value then
  300. BagLogic.addItem(human, itemID, 1, "gm", true)
  301. end
  302. end
  303. BagLogic.sendBagList(human)
  304. end
  305. function d3.equip(human, value)
  306. value = tonumber(value)
  307. if not value then return end
  308. local BagLogic = require("bag.BagLogic")
  309. local EquipExcel = require("excel.equip").equip
  310. for itemID in pairs(EquipExcel) do
  311. BagLogic.addItem(human, itemID, 1, "gm", true)
  312. end
  313. BagLogic.sendBagList(human)
  314. end
  315. function d3.task(human, val)
  316. if val == nil then return end
  317. local task = string.find(val, " ", 1, true)
  318. if task == nil then return end
  319. local id = tonumber(string.sub(val, 1, task - 1))
  320. local cnt= tonumber(string.sub(val,task+1,#val))
  321. local DailyTaskLogic = require("dailyTask.DailyTaskLogic")
  322. DailyTaskLogic.recordDailyTaskFinishCnt(human, id, cnt, nil)
  323. end
  324. function d3.os(human, value)
  325. value = value and tonumber(value)
  326. if value == nil then
  327. local openSvrTime = CommonDB.getServerOpenTime()
  328. if openSvrTime == 0 then
  329. Broadcast.sendErr(human, "未设置开服时间")
  330. else
  331. local tb = os.date("%Y%m%d", openSvrTime)
  332. Broadcast.sendErr(human, "当前开服时间为" .. tb)
  333. end
  334. else
  335. local now = os.time()
  336. local temp = Util.getDayStartTime(now)
  337. temp = temp - (value - 1) * 24 * 3600
  338. CommonDB.setServerOpenTime(temp)
  339. local tb = os.date("%Y%m%d", temp)
  340. Broadcast.sendErr(human, "设置当前开服时间为" .. tb)
  341. --同步中心服开服时间
  342. --[[local msgRet = InnerMsg.lw.LW_OS
  343. msgRet.uuid = human.db._id
  344. msgRet.value = temp
  345. InnerMsg.sendMsg(0, msgRet)]]
  346. end
  347. end
  348. function d3.createtime(human, value)
  349. value = value and tonumber(value)
  350. if not value then return end
  351. local now = os.time()
  352. local temp = Util.getDayStartTime(now)
  353. temp = temp - (value - 1) * 24 * 3600
  354. human.db.createTime = temp
  355. local tb = os.date("%Y%m%d", temp)
  356. Broadcast.sendErr(human, "设置当前创角时间为" .. tb)
  357. end
  358. --设置中心服开服时间
  359. function d3.osw(human, value)
  360. value = value and tonumber(value)
  361. local msgRet = InnerMsg.lw.LW_OS
  362. msgRet.uuid = human.db._id
  363. msgRet.value = value
  364. InnerMsg.sendMsg(0, msgRet)
  365. end
  366. function d3.chengjiu(human,val)
  367. local param = Util.split(val, " ")
  368. local ChengjiuLogic = require("chengjiu.ChengjiuLogic")
  369. ChengjiuLogic.onCallback(human,3,3,4)
  370. end
  371. function d3.jjczero()
  372. local JjcLogic = require("jjc.JjcLogic")
  373. JjcLogic.onZero()
  374. end
  375. function d3.jjcreset()
  376. JjcDB.resetJJCDB()
  377. end
  378. function d3.jpSet(human,val)
  379. local point = tonumber(val)
  380. JjcDB.updatePlayerPoint(human.db._id, point, nil)
  381. end
  382. function d3.billboard(human)
  383. local BillboardDB = require("billboard.BillboardDB")
  384. BillboardDB.sort()
  385. end
  386. function d3.cldjs(human)
  387. human.db.jinbiExchange = nil
  388. end
  389. -- 激活钻石基金
  390. function d3.fund(human, val)
  391. local type = tonumber(val)
  392. local FundLogic = require("present.FundLogic")
  393. FundLogic.fundBuy(human, type)
  394. end
  395. -- 清空钻石基金购买和发放记录
  396. function d3.clfund(human)
  397. human.db.fundFlag = nil
  398. end
  399. function d3.clbuy(human)
  400. human.db.buy = {}
  401. end
  402. --增加好战者计数 仅限竞技场和试炼
  403. function d3.hzzadd(human, val)
  404. if val == nil then return end
  405. local pos = string.find(val, " ", 1, true)
  406. if pos == nil then return end
  407. local type = tonumber(string.sub(val, 1, pos - 1))
  408. local add= tonumber(string.sub(val,pos+1,#val))
  409. local MonthHzz = require("monthAct.MonthHzz")
  410. if type == MonthHzz.MONTHACT_HZZ_TYPE_1 then
  411. MonthHzz.addJjcFight(human, nil, add)
  412. elseif type == MonthHzz.MONTHACT_HZZ_TYPE_2 then
  413. MonthHzz.addTrialCnt(human, nil, add)
  414. end
  415. end
  416. function d3.ydjiuguan(human, val)
  417. if val == nil then return end
  418. local pos = string.find(val, " ", 1, true)
  419. if pos == nil then return end
  420. local star = tonumber(string.sub(val, 1, pos - 1))
  421. local add= tonumber(string.sub(val,pos+1,#val))
  422. local MonthDrunkery = require("monthAct.MonthDrunkery")
  423. MonthDrunkery.addDrunkCntEx(human, star, add)
  424. end
  425. function d3.ydhcjx(human, val)
  426. if val == nil then return end
  427. local param = Util.split(val, " ")
  428. local type = tonumber(param[1])
  429. local heroId= tonumber(param[2])
  430. local add = tonumber(param[3])
  431. local MonthHecJuex = require("monthAct.MonthHecJuex")
  432. MonthHecJuex.addCntByGm(human,type,heroId, add)
  433. end
  434. function d3.clboss(human)
  435. local DB = require("common.DB")
  436. local LuaMongo = _G.lua_mongo
  437. LuaMongo.remove(DB.db_boss)
  438. end
  439. function d3.clwish(human)
  440. human.db.wishCnt = nil
  441. human.db.wishActAlrCnt = nil
  442. end
  443. -- 设置高抽次数
  444. function d3.hsum(human,val)
  445. human.db.summonCnt = val
  446. end
  447. function d3.clhsum(human)
  448. human.db.summonCnt = nil
  449. human.db.sumWinScoCnt = nil
  450. end
  451. function d3.unionquery(human,val)
  452. local name = val
  453. local UnionLogic = require("union.UnionLogic")
  454. UnionLogic.createUnion(human,name)
  455. end
  456. function d3.uniondonate(human, value)
  457. local UnionDBLogic = require("union.UnionDBLogic")
  458. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  459. if union == nil then
  460. return
  461. end
  462. union.donate = union.donate or {}
  463. union.donate[1] = value
  464. union.donate[2] = os.time()
  465. UnionDBLogic.updateUnionData(union)
  466. end
  467. function d3.settower(human,val)
  468. local HuanjingTowerLogic = require("huanjingTower.HuanjingTowerLogic")
  469. HuanjingTowerLogic.setTowerByGm(human, val)
  470. end
  471. function d3.setbattle(human,val)
  472. local BattleLogic = require("battle.BattleLogic")
  473. local param = Util.split(val, " ")
  474. BattleLogic.setBattleByGm(human, param[1], param[2])
  475. end
  476. function d3.overmonth(human, val)
  477. val = math.max(tonumber(val) or 0, 10)
  478. human.db.actMonthEndTime = os.time() + val
  479. end
  480. function d3.zhuanpantime(human,val)
  481. local param = Util.split(val, " ")
  482. local ZhuanpanLogic = require("zhuanpan.ZhuanpanLogic")
  483. ZhuanpanLogic.zhuanpanByGm(human, tonumber(param[1]), tonumber(param[2]) )
  484. end
  485. function d3.signin(human,val)
  486. human.db.signInCnt = val
  487. for i =1,human.db.signInCnt do
  488. human.db.signIn[i] = 1
  489. end
  490. end
  491. function d3.unionLv(human, val)
  492. val = tonumber(val)
  493. if not val then return end
  494. local UnionDBLogic = require("union.UnionDBLogic")
  495. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  496. if not union then return end
  497. UnionDBLogic.upsetUnionData(union._id, "lv", val)
  498. UnionDBLogic.upsetUnionData(union._id, "exp", 0)
  499. end
  500. function d3.unionexp(human, val)
  501. val = tonumber(val)
  502. if not val then return end
  503. local UnionDBLogic = require("union.UnionDBLogic")
  504. local UnionLogic = require("union.UnionLogic")
  505. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  506. if not union then return end
  507. UnionLogic.addUnionExp(union, val)
  508. UnionDBLogic.updateUnionData(union)
  509. end
  510. function d3.gws(human,val)
  511. local LoginSignLogic = require("loginSign.LoginSignLogic")
  512. for i = 1,val do
  513. LoginSignLogic.getReward(human)
  514. end
  515. end
  516. function d3.tsht(human)
  517. local AdminLogic = require("AdminLogic")
  518. local JsonInput = {}
  519. JsonInput.accountName = human.db.account
  520. JsonInput.roleName = human.db.name
  521. AdminLogic.adminFunction.getuserstatus(JsonInput)
  522. end
  523. function d3.bs(human,val)
  524. local param = Util.split(val, " ")
  525. local AdminLogic = require("AdminLogic")
  526. local JsonInput = {}
  527. JsonInput.account = human.db.account
  528. JsonInput.minute = param[1]
  529. JsonInput.reason = param[2]
  530. AdminLogic.adminFunction.banSay(JsonInput)
  531. end
  532. function d3.bl(human,val)
  533. local AdminLogic = require("AdminLogic")
  534. local JsonInput = {}
  535. JsonInput.accountName = human.db.account
  536. JsonInput.minute = val
  537. AdminLogic.adminFunction.banAccount(JsonInput)
  538. end
  539. function d3.bl2(human,val)
  540. local AdminLogic = require("AdminLogic")
  541. local param = Util.split(val, " ")
  542. local JsonInput = {}
  543. JsonInput.accountName = param[1]
  544. JsonInput.minute = tonumber(param[2])
  545. AdminLogic.adminFunction.banAccount(JsonInput)
  546. end
  547. function d3.cbl(human,val)
  548. local param = Util.split(val, " ")
  549. local AdminLogic = require("AdminLogic")
  550. local JsonInput = {}
  551. JsonInput.accountName = param[1]
  552. JsonInput.cancelBanSay = param[2]
  553. AdminLogic.adminFunction.cancelBanAccount(JsonInput)
  554. end
  555. function d3.bip(human,val)
  556. local param = Util.split(val, " ")
  557. local AdminLogic = require("AdminLogic")
  558. local JsonInput = {}
  559. JsonInput.IP = param[1]
  560. JsonInput.banTime = param[2]
  561. AdminLogic.adminFunction.banIp(JsonInput)
  562. end
  563. function d3.ursc(human)
  564. human.db.ectypeCnt = nil
  565. human.db.ectypeFreeTime = nil
  566. end
  567. function d3.sue(human,val)
  568. local newLevel = tonumber(val)
  569. if not newLevel then return end
  570. local UnionDBLogic = require("union.UnionDBLogic")
  571. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  572. if not union then return end
  573. UnionDBLogic.updateBossLv(union,newLevel)
  574. end
  575. function d3.smtp(human,val)
  576. local param = Util.split(val, " ")
  577. local AdminLogic = require("AdminLogic")
  578. local JsonInput = {}
  579. JsonInput.recvType = 3
  580. JsonInput.title = param[1]
  581. JsonInput.content = param[2]
  582. JsonInput.fbAccount = param[3]
  583. JsonInput.senderName = "系统邮件"
  584. JsonInput.fbTime = os.time()
  585. JsonInput.fbContent = "反馈"
  586. JsonInput.startLv =0
  587. JsonInput.endLv = 51
  588. JsonInput.lastLoginTime = os.time() - 60*60
  589. AdminLogic.adminFunction.mail(JsonInput)
  590. end
  591. function d3.clmilltime(human)
  592. human.db.unionTaskGetTime = nil
  593. end
  594. function d3.tstx(human,val)
  595. local RoleHeadLogic = require("role.RoleHeadLogic")
  596. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_1, val)
  597. end
  598. function d3.tstxk(human,val)
  599. local RoleHeadLogic = require("role.RoleHeadLogic")
  600. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_2, val)
  601. end
  602. function d3.buy(human,val)
  603. local AdminLogic = require("AdminLogic")
  604. local PlatformHandler = require("platform.Handler")
  605. local ApiLogic = require("platform.ApiLogic")
  606. local BuyExcel = require("excel.buy")
  607. local buyConf = BuyExcel.buy[val]
  608. if not buyConf then return end
  609. local shopConf = BuyExcel.topup[val]
  610. if shopConf and shopConf.buyID == val then
  611. else
  612. shopConf = nil
  613. end
  614. local checkMoney = buyConf["CN"]
  615. local msg = {}
  616. msg.logintype = 2
  617. msg.openid = "oCD-L5RxAtfRe8-aiezdY-Ccla5U"
  618. msg.openkey = "VsBJf2DKah7QhzU5xuzLNA=="
  619. msg.yuanbao = shopConf and shopConf.cnt or buyConf.CN * 10
  620. msg.buyID = val
  621. msg.account = human.db.account
  622. msg.transaction_id = "transaction_id1"
  623. msg.pf = "android"
  624. msg.money = checkMoney
  625. ApiLogic.CHARGE_CODE_HIS = {}
  626. print("cccc:",val)
  627. local buyData = {buyID = val, price = checkMoney}
  628. BuyLogic.buy(human, buyData)
  629. --PlatformHandler.CG_TENCENT_BUY(human,msg)
  630. --AdminLogic.adminFunction.tencentPay(msg)
  631. end
  632. function d3.buyCharge(human, val)
  633. local BuyExcel = require("excel.buy")
  634. local buyConf = BuyExcel.buy[val]
  635. if not buyConf then
  636. return
  637. end
  638. local tOJsonInput = {}
  639. tOJsonInput.buyID = buyConf.id
  640. tOJsonInput.price = buyConf.CN
  641. tOJsonInput.money = buyConf.CN
  642. BuyLogic.charge(human, tOJsonInput)
  643. end
  644. function d3.gol(human)
  645. local AdminLogic = require("AdminLogic")
  646. AdminLogic.adminFunction.getonlinelist()
  647. end
  648. function d3.htm(human,val)
  649. local AdminLogic = require("AdminLogic")
  650. local oJsonInput = {}
  651. oJsonInput.recvType = val -- 邮件类型
  652. oJsonInput.title = "111" -- 邮件标题
  653. oJsonInput.content = "222" -- 邮件内容
  654. oJsonInput.items = nil -- 道具列表 可以为空
  655. oJsonInput.accounts = nil -- 指定玩家列表
  656. oJsonInput.startLv = 0
  657. oJsonInput.endLv = 200
  658. AdminLogic.adminFunction.mail(oJsonInput)
  659. end
  660. function d3.cluwar(human)
  661. require("union.UnionWarLogic").cleanUnionWar()
  662. local msg = InnerMsg.lw.LW_GM
  663. msg.gm = "cluwarmiddle"
  664. InnerMsg.sendMsg(0, msg)
  665. end
  666. function d3.cluniontime(human)
  667. human.db.unionJoinTime = nil
  668. end
  669. function d3.cluwarmiddle()
  670. local LuaMongo = _G.lua_mongo
  671. local DB = require("common.DB")
  672. LuaMongo.remove(DB.db_union_war)
  673. end
  674. function d3.uwarstart()
  675. -- 需要周1、3、5使用
  676. local UnionWarLogic = require("union.UnionWarLogic")
  677. UnionWarLogic.cleanUnionWar()
  678. local msg = InnerMsg.lw.LW_GM
  679. msg.gm = "cluwarmiddle"
  680. InnerMsg.sendMsg(0, msg)
  681. UnionWarLogic.onHour(0)
  682. UnionWarLogic.onHour(1)
  683. local msg = InnerMsg.lw.LW_GM
  684. msg.gm = "uwarstartmiddle"
  685. InnerMsg.sendMsg(0, msg)
  686. end
  687. function d3.warMaxtest(human, value)
  688. require("union.UnionWarLogic").auto(value)
  689. end
  690. function d3.uwar(human,state)
  691. local msg = InnerMsg.lw.LW_GM
  692. msg.gm = "muwar "..state
  693. InnerMsg.sendMsg(0, msg)
  694. if state == 1 then
  695. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  696. UnionWarDBLogic.onHour(0, true)
  697. end
  698. end
  699. function d3.uwarshop(human, lv)
  700. require("union.UnionWarLogic").upWarShopLv(human, tonumber(lv))
  701. end
  702. function d3.uwarBuff(human)
  703. local msg = InnerMsg.lw.LW_GM
  704. msg.gm = "muwarBuff ".. human.db.unionUuid
  705. InnerMsg.sendMsg(0, msg)
  706. end
  707. function d3.muwar(human,state)
  708. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  709. if state == 1 then
  710. UnionWarDBLogic.onHour(0, true)
  711. elseif state == 2 then
  712. UnionWarDBLogic.onHour(2, true)
  713. elseif state == 3 then
  714. UnionWarDBLogic.onHour(20, true)
  715. end
  716. end
  717. function d3.muwarBuff(human, unionUuid)
  718. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  719. UnionWarDBLogic.addBuffLvByGm(unionUuid)
  720. end
  721. function d3.uwartask(human, type)
  722. local UnionWarLogic = require("union.UnionWarLogic")
  723. UnionWarLogic.chegnjiuFinishGm(human, tonumber(type))
  724. end
  725. function d3.uwarstartmiddle()
  726. -- 匹配
  727. require("union.UnionWarMiddleLogic").matchUnionStart()
  728. end
  729. function d3.cljjc(human, val)
  730. val = tonumber(val)
  731. local msgRet = InnerMsg.lw.LW_CL_JJC
  732. msgRet.type = val
  733. InnerMsg.sendMsg(0, msgRet)
  734. end
  735. function d3.cluwar(human)
  736. require("union.UnionWarLogic").cleanUnionWar()
  737. local msg = InnerMsg.lw.LW_GM
  738. msg.gm = "cluwarmiddle"
  739. InnerMsg.sendMsg(0, msg)
  740. end
  741. function d3.cluwarmiddle()
  742. local LuaMongo = _G.lua_mongo
  743. local DB = require("common.DB")
  744. LuaMongo.remove(DB.db_union_war)
  745. end
  746. function d3.uwarstart()
  747. -- 需要周1、3、5使用
  748. require("union.UnionWarLogic").onHour(0)
  749. require("union.UnionWarLogic").onHour(1)
  750. local msg = InnerMsg.lw.LW_GM
  751. msg.gm = "uwarstartmiddle"
  752. InnerMsg.sendMsg(0, msg)
  753. end
  754. function d3.uwarstartmiddle()
  755. -- 匹配
  756. require("union.UnionWarMiddleLogic").matchUnionStart()
  757. end
  758. function d3.cxh(human)
  759. d3.tgod(human)
  760. d3.lv(human,200)
  761. end
  762. function d3.drop(human,val)
  763. local BattleLogic = require("battle.BattleLogic")
  764. local param = Util.split(val, " ")
  765. local cnt = tonumber(param[1])
  766. local battleID = tonumber(param[2])
  767. BattleLogic.clacItemCntGM(human,cnt,battleID)
  768. end
  769. function d3.uif(human,val)
  770. local jsonInput = {}
  771. jsonInput.unionName = val
  772. local AdminLogic = require("AdminLogic")
  773. AdminLogic.adminFunction.unionInfo(jsonInput)
  774. end
  775. function d3.ul(human,val)
  776. local jsonInput = {}
  777. jsonInput.start = tonumber(val)
  778. local AdminLogic = require("AdminLogic")
  779. AdminLogic.adminFunction.unionList(jsonInput)
  780. end
  781. function d3.monthgaochou(human, val)
  782. local MonthSummon = require("monthAct.MonthSummon")
  783. MonthSummon.onSummon(human, tonumber(val))
  784. end
  785. function d3.jhtq(human,val)
  786. local TequanLogic = require("qqTequan.TequanLogic")
  787. local param = Util.split(val, " ")
  788. local val1 = tonumber(param[1])
  789. local val2 = tonumber(param[2])
  790. local val3 = tonumber(param[3])
  791. local val4 = tonumber(param[4])
  792. TequanLogic.activateTequan(human,val1,val2,val3,val4)
  793. end
  794. function d3.unionTecLv(human,val)
  795. local UnionTecLogic = require("union.UnionTecLogic")
  796. UnionTecLogic.lvAllUpByGm(human)
  797. end
  798. function d3.auto(human,val)
  799. local param = Util.split(val, " ")
  800. local str = param[1]
  801. local val = param[2]
  802. if not str or not val then
  803. return
  804. end
  805. for i = 1, val do
  806. require("union.UnionWarLogic").auto(str .. string.format("%02d", i))
  807. end
  808. end
  809. function d3.lvAuto(human, val)
  810. val = val + 0
  811. local lvOld = human.db.lv
  812. local lvNew = val + 0
  813. human.db.lv = lvNew
  814. end
  815. function d3.cap(human)
  816. human.db.buyCapCnt = require("hero.HeroDefine").BUY_CAP_CNT
  817. require("hero.HeroLogic").sendHeroBagCap(human)
  818. end
  819. function d3.abscharge(human)
  820. AbsBillboardLogic.charge(human,1000)
  821. end
  822. function d3.jhpt(human)
  823. if human.pf_info.pf == "qqgame" then
  824. human.db.txHall = {}
  825. elseif human.pf_info.pf == "qzone" or human.pf_info.pf == "website" then
  826. human.db.qqZone = {}
  827. end
  828. end
  829. function d3.addfuwen(human)
  830. d3.itemadd(human,"80001 10")
  831. d3.itemadd(human,"80002 10")
  832. d3.itemadd(human,"80003 10")
  833. d3.itemadd(human,"80004 10")
  834. d3.itemadd(human,"80005 10")
  835. end
  836. function d3.addSmelt(human,val)
  837. local num = tonumber(val)
  838. human.db.smeltVal = human.db.smeltVal or 0
  839. human.db.smeltVal = human.db.smeltVal + num
  840. end
  841. function d3.zdfw(human,val)
  842. local param = Util.split(val, " ")
  843. local fuwenID = tonumber(param[1])
  844. local attr1 = tonumber(param[2])
  845. local val1 = tonumber(param[3])
  846. local attr2 = tonumber(param[4])
  847. local val2 = tonumber(param[5])
  848. local skill1 = tonumber(param[6])
  849. local skill2 = tonumber(param[7])
  850. local FuwenGrid = require("fuwen.FuwenGrid")
  851. local FuwenExcel = require("excel.fuwen").skill
  852. if (skill1 ~= nil and FuwenExcel[skill1] == nil) or (skill2 ~= nil and FuwenExcel[skill2] == nil) then
  853. print("fuck! add fuwen skill is notreal")
  854. return
  855. end
  856. FuwenGrid.setFuwenSkillAttrByGM(human,fuwenID,attr1,val1,attr2,val2,skill1,skill2)
  857. end
  858. function d3.t2(human)
  859. local input = [[{"method":"OnTokenReturnForBuy","tencent_ret":{"ret":0,"token":"fC283BD0141D50418B68200972FBEE6A13102","url_params":"\/v1\/r\/1110099166\/mobile_goods_info?token_id=BC283BD0141D50418B68200972FBEE6A13102&transaction_id=BC283BD0141D50418B68200972FBEE6A13102&out_trade_no=&new_cpay=1&offer_type=0","transaction_id":"BC283BD0141D50418B68200972FBEE6A13102","attach":""},"callback_general_param":{"name":"0-15D9C743A68D57FF8B22CC944BAEAD8C","account":"0-a"}}]]
  860. local ret = require("AdminLogic").handleAdminRequest(_, input)
  861. print(ret)
  862. end
  863. function d3.t1(human)
  864. local input = {}
  865. input.token = "fC283BD0141D50418B68200972FBEE6A13102"
  866. input.payitem = "39*60*1"
  867. input.billno = os.time()
  868. local ret = require("platform.QQApi").onDeliverReturnForBuy(input)
  869. print(ret.ret,ret.msg)
  870. end
  871. function d3.skin(human,val)
  872. local tb = Util.split(val, " ")
  873. local id = tonumber(tb[1])
  874. local cnt = tonumber(tb[2])
  875. print(id,tb[1],tb[2])
  876. if not id then
  877. human.db.skinBag = {[0] = 999}
  878. return
  879. end
  880. local SkinLogic = require("skin.SkinLogic")
  881. SkinLogic.addSkin(human,id,cnt)
  882. end
  883. function d3.ff(human,val)
  884. local FriendLogic = require("friend.FriendLogic")
  885. FriendLogic.addFriend(human, val)
  886. end
  887. function d3.chenghao(human,val)
  888. val = tonumber(val)
  889. if not val then
  890. return
  891. end
  892. local RoleHeadLogic = require("role.RoleHeadLogic")
  893. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_4, val)
  894. end
  895. function d3.unionBillboard(human,val)
  896. val = tonumber(val)
  897. if not val then
  898. return
  899. end
  900. local BRoleLogic = require("billboard.BRoleLogic")
  901. BRoleLogic.queryUnionBillboard(human,val)
  902. end
  903. function d3.herotest(human, val)
  904. local tb = Util.split(val, " ")
  905. local combatType = 1
  906. local HeroExcel = require("excel.hero")
  907. local HeroLogic = require("hero.HeroLogic")
  908. local flags = {}
  909. human.db.combatHero = human.db.combatHero or {}
  910. human.db.combatHero[combatType] = {}
  911. for pos = 1, 6 do
  912. local id = tonumber(tb[pos])
  913. local index = nil
  914. if id and HeroExcel.hero[id] then
  915. for i = 1, human.db.heroBag[0] do
  916. local heroGrid = human.db.heroBag[i]
  917. if heroGrid and (heroGrid.id == id) and
  918. (not flags[i]) then
  919. flags[i] = true
  920. index = i
  921. break
  922. end
  923. end
  924. if not index then
  925. index = HeroLogic.getEmptyIndex(human)
  926. d3.heroadd(human, id .. " 1")
  927. end
  928. end
  929. human.db.combatHero[combatType][pos] = index
  930. end
  931. local CombatHandler = require("combat.Handler")
  932. CombatHandler.CG_COMBAT_BEGIN(human,{type = combatType, param = ""})
  933. end
  934. function d3.combat(human, monsterOutID)
  935. local CombatLogic = require("combat.CombatLogic")
  936. local param = {}
  937. param.defender, _, param.defRBase, param.defFormation = CombatLogic.getMonsterObjList(monsterOutID)
  938. require("combat.CombatLogic").combatBegin(human, 1001, param, 1)
  939. end
  940. function d3.combat2(human,id)
  941. local id = tonumber(id)
  942. local combatConf = require("excel.combat").gm[id]
  943. if not combatConf then
  944. assert()
  945. end
  946. local HeroGrid = require("hero.HeroGrid")
  947. local HeroLogic = require("hero.HeroLogic")
  948. local CombatLogic = require("combat.CombatLogic")
  949. local fakeman1 = {}
  950. local account1 = "combatFakeman1"
  951. local fakeman2 = {}
  952. local account2 = "combatFakeman2"
  953. local RoleDBLogic = require("role.RoleDBLogic")
  954. local fakemanDB1 = RoleDBLogic.getDbByAccount(account1)
  955. if not fakemanDB1 then
  956. fakemanDB1 = RoleDBLogic.createDefaultRole(account1)
  957. end
  958. fakeman1.db = fakemanDB1
  959. local fakemanDB2 = RoleDBLogic.getDbByAccount(account2)
  960. if not fakemanDB2 then
  961. fakemanDB2 = RoleDBLogic.createDefaultRole(account2)
  962. end
  963. fakeman2.db = fakemanDB2
  964. local attacker = {}
  965. local defender = {}
  966. for i = 1, fakeman1.db.heroBag[0] do
  967. HeroLogic.delHeroByIndex(fakeman1, i, "gm")
  968. end
  969. for i = 1, fakeman2.db.heroBag[0] do
  970. HeroLogic.delHeroByIndex(fakeman2, i, "gm")
  971. end
  972. for k,v in ipairs(combatConf.atk) do
  973. local heroGrid = HeroGrid.createHeroGrid(v[1], v[4])
  974. heroGrid.lv = math.max(heroGrid.lv, v[3] or 0)
  975. heroGrid.quality = HeroGrid.getMaxQuality(heroGrid.star)
  976. local heroIndex = HeroLogic.addHeroByGrid(fakeman1, heroGrid, "gm")
  977. attacker[v[2]] = CombatLogic.createHumanObj(fakeman1, heroGrid.uuid)
  978. end
  979. for k,v in ipairs(combatConf.def) do
  980. local heroGrid = HeroGrid.createHeroGrid(v[1], v[4])
  981. heroGrid.lv = math.max(heroGrid.lv, v[3] or 0)
  982. heroGrid.quality = HeroGrid.getMaxQuality(heroGrid.star)
  983. local heroIndex = HeroLogic.addHeroByGrid(fakeman2, heroGrid, "gm")
  984. defender[v[2]] = CombatLogic.createHumanObj(fakeman2, heroGrid.uuid)
  985. end
  986. local atkPet = nil
  987. local defPet = nil
  988. CombatLogic.combatGm(human,1001,combatConf.atkF, attacker,combatConf.defF,defender,atkPet,defPet,{{101,1},{102,2},{103,3},{104,4}})
  989. end
  990. function d3.combatEnd(human)
  991. local CombatLogic = require("combat.CombatLogic")
  992. for i = CombatDefine.COMBAT_TYPE1, CombatDefine.COMBAT_TYPE_MAX do
  993. CombatLogic.clientFinish(human, i)
  994. end
  995. end
  996. -- it道具添加(支持中文)
  997. function d3.it(human,value)
  998. local tb = Util.split(value," ")
  999. local id = tonumber(tb[1])
  1000. local cnt = tonumber(tb[2])
  1001. if id == nil then id = tb[1] end
  1002. if type(id) == "string" then
  1003. id = ItemDefine.getIdByName(id)
  1004. end
  1005. if type(id) ~= "number" then
  1006. print("err id", tb[1], id, type(id))
  1007. return
  1008. end
  1009. cnt = cnt or 1000
  1010. BagLogic.addItem(human, id, cnt, "gm")
  1011. end
  1012. -- 清除酒馆
  1013. function d3.clbartask(human)
  1014. human.db.bar = nil
  1015. end
  1016. function d3.updaily(human)
  1017. ObjHuman.updateDaily(human, true)
  1018. end
  1019. function d3.clguide(human)
  1020. human.db.noguide = nil
  1021. human.db.guide = nil
  1022. human.guideLoginStep = nil
  1023. require("guide.GuideLogic").refreshGuide(human)
  1024. require("guide.GuideLogic").sendStep(human)
  1025. end
  1026. function d3.nextguide(human)
  1027. local GuideExcel = require("excel.guide")
  1028. local GuideLogic = require("guide.GuideLogic")
  1029. local id = GuideLogic.getGuideID(human)
  1030. local nextstep = GuideLogic.getGuideStep(human) + 1
  1031. local cf = id and GuideExcel.main_guide[id]
  1032. local sid = cf and cf.guideList[nextstep]
  1033. GuideLogic.stepFinish(human, sid)
  1034. end
  1035. function d3.guide(human, id)
  1036. human.db.noguide = nil
  1037. human.guideLoginStep = nil
  1038. local GuideLogic = require("guide.GuideLogic")
  1039. GuideLogic.setGuide(human, id, GuideLogic.STATE_DOING)
  1040. GuideLogic.sendStep(human)
  1041. end
  1042. -- 跳过指引
  1043. function d3.noguide(human)
  1044. human.db.noguide = true
  1045. human.guideLoginStep = nil
  1046. require("guide.GuideLogic").sendStep(human, true)
  1047. end
  1048. function d3.creatunion(human,value)
  1049. d3.lv(human,30)
  1050. d3.viplv(human,2)
  1051. d3.zuanshi(human, 1000)
  1052. local UnionLogic = require("union.UnionLogic")
  1053. UnionLogic.createUnion(human, value)
  1054. end
  1055. function d3.cldraw(human, value)
  1056. human.db.drawCard = {jifen=tonumber(value),list={[1]={},[2]={},[3]={},[4]={}}}
  1057. end
  1058. function d3.cldrill(human)
  1059. require("drill.DrillDB").reset()
  1060. end
  1061. function d3.zhengdian(_, hour)
  1062. hour = tonumber(hour) or 0
  1063. require("core.Timer").doZhengDian(hour)
  1064. end
  1065. function d3.tgod(human)
  1066. local HeroLogic = require("hero.HeroLogic")
  1067. local HeroGrid = require("hero.HeroGrid")
  1068. local HeroExcel = require("excel.hero")
  1069. for heroID, config in pairs(HeroExcel.tujian) do
  1070. local heroConfig = HeroExcel.hero[heroID]
  1071. if heroConfig then
  1072. local star = heroConfig.star
  1073. local maxQuality = HeroGrid.getMaxQuality(star)
  1074. local maxLv = HeroGrid.getMaxLv(star,maxQuality)
  1075. d3.heroadd(human, heroID .. " 1".." "..maxLv.." "..maxQuality)
  1076. end
  1077. end
  1078. end
  1079. function d3.tujian(human, camp)
  1080. local HeroExcel = require("excel.hero")
  1081. camp = tonumber(camp)
  1082. for heroID, config in pairs(HeroExcel.tujian) do
  1083. if config.camp == camp or not camp then
  1084. d3.heroadd(human, heroID .. " 1")
  1085. end
  1086. end
  1087. end
  1088. function d3.cljingcailibao(human)
  1089. human.db.dailyLeiChong = nil
  1090. human.db.leichongHaoli = nil
  1091. human.db.topupAcountDaily = nil
  1092. human.db.topupAccountMonth = nil
  1093. end
  1094. function d3.qijifen(human,value)
  1095. human.db.sevenDayGoal = human.db.sevenDayGoal or {}
  1096. human.db.sevenDayGoal[9] = human.db.sevenDayGoal[8] or {}
  1097. human.db.sevenDayGoal[9].jifen = value
  1098. end
  1099. function d3.clqirimubiao(human)
  1100. human.db.sevenDayGoal = nil
  1101. end
  1102. function d3.throne(human, str)
  1103. if str == nil then return end
  1104. local tb = Util.split(str, " ")
  1105. local id = tonumber(tb[1])
  1106. local lv = tonumber(tb[2])
  1107. if not id or not lv then return end
  1108. local TheStarsDBLogic = require("theStars.TheStarsDBLogic")
  1109. local list = TheStarsDBLogic.getThroneList()
  1110. local throne = list[id]
  1111. if not throne then return end
  1112. throne.lv = lv
  1113. TheStarsDBLogic.updateThroneDB(throne)
  1114. end
  1115. function d3.cltsts(human)
  1116. human.db.throneTime = human.db.throneTime - 14400
  1117. end
  1118. -- 删号
  1119. function d3.delaccount(human, account)
  1120. if not account then return end
  1121. local target = ObjHuman.onlineAccount[account]
  1122. if target then
  1123. return Broadcast.sendErr(human, "can't delete online")
  1124. end
  1125. local RoleDBLogic = require("role.RoleDBLogic")
  1126. if not RoleDBLogic.getDbByAccount(account) then
  1127. return Broadcast.sendErr(human, "account not exist")
  1128. end
  1129. local LuaMongo = _G.lua_mongo
  1130. local DB = require("common.DB")
  1131. local query = {}
  1132. query.account = tostring(account)
  1133. LuaMongo.remove(DB.db_char, query)
  1134. require("core.RoleDel").roleDel()
  1135. Broadcast.sendErr(human, "delete ok, account = " .. account)
  1136. end
  1137. -- 临时开指引
  1138. function d3.openguide()
  1139. require("Config").HAS_GUIDE = true
  1140. end
  1141. function d3.closeguide()
  1142. require("Config").HAS_GUIDE = false
  1143. end
  1144. -- 自动上阵
  1145. function d3.autoteam(human, combatType)
  1146. if tonumber(combatType) == nil then return end
  1147. local CombatPosLogic = require("combat.CombatPosLogic")
  1148. local str = ""
  1149. for i = 1, 6 do
  1150. if not human.db.heroBag[i] then
  1151. local heroID = require("hero.HeroDefine").getRandHeroByIsElite()
  1152. local lv = math.random(50, 100)
  1153. d3.heroadd(human, heroID .. " 1 " .. lv)
  1154. end
  1155. str = str .. i
  1156. if i % 6 == 0 then str = str .. ","
  1157. else str = str .. "|" end
  1158. end
  1159. CombatPosLogic.updatePos(human,combatType,str)
  1160. end
  1161. function d3.fcmstate(human, state)
  1162. human.fcmState = state
  1163. require("fcm.FcmLogic").checkFcm(human)
  1164. end
  1165. function d3.oltimeday(human, time)
  1166. time = tonumber(time)
  1167. if not time then return end
  1168. human.db.onlineTimeDay = time
  1169. require("fcm.FcmLogic").checkFcm(human)
  1170. end
  1171. function d3.dis(human, code)
  1172. ObjHuman.doDisconnect(human, code)
  1173. end
  1174. function d3.project(human)
  1175. local Lang = require("common.Lang")
  1176. Broadcast.sendErr(human, Lang.TEST_MULTY_PROJECT)
  1177. end
  1178. function d3.clextrabattle(human)
  1179. human.db.battleExtraReward = nil
  1180. end
  1181. function d3.clsharepf(human)
  1182. human.db.plShare = nil
  1183. end
  1184. function d3.clshareboard()
  1185. require("present.SharePlatformLogic").resetBoard()
  1186. end
  1187. function d3.sharepfall(human, cnt)
  1188. cnt = tonumber(cnt) or 15
  1189. for i = 1, cnt do
  1190. require("present.SharePlatformLogic").onShareOk(human.db.account, "account" .. i, true)
  1191. end
  1192. end
  1193. function d3.sharepf(human, accountB)
  1194. require("present.SharePlatformLogic").onShareOk(human.db.account, accountB)
  1195. end
  1196. function d3.sharepf2(human, accountA)
  1197. require("present.SharePlatformLogic").onShareOk(accountA, human.db.account)
  1198. end
  1199. function d3.sharegroup(human)
  1200. require("present.SharePlatformLogic").groupShareOK(human)
  1201. end
  1202. function d3.shareinvate(human)
  1203. require("present.SharePlatformLogic").shareInvate(human)
  1204. end
  1205. function d3.cltuisonglibao(human)
  1206. human.db.tuiSongLiBao = nil
  1207. end
  1208. function d3.clmoshou(human)
  1209. human.db.moshou = nil
  1210. end
  1211. function d3.moshoulv(human,lv)
  1212. local MoShouExcel = require("excel.moshou")
  1213. if not lv or lv <= 0 or lv > #MoShouExcel.moshouLv then return end
  1214. local MoshouLogic = require("moshou.MoshouLogic")
  1215. local isAllActive = MoshouLogic.isAllMoshouActive(human)
  1216. if not isAllActive then
  1217. local MoShouExcel = require("excel.moshou")
  1218. local config = MoShouExcel.moshouActive
  1219. for i=1,#config do
  1220. local activeTask = config[i].activeTask
  1221. for j=1,#activeTask do
  1222. human.db.moshou = human.db.moshou or {}
  1223. human.db.moshou[i] = human.db.moshou[i] or {}
  1224. human.db.moshou[i].taskGet = human.db.moshou[i].taskGet or {}
  1225. human.db.moshou[i].taskGet[j] = j
  1226. end
  1227. end
  1228. end
  1229. human.db.moshou.lv = lv
  1230. human.db.moshou.lvExp = MoShouExcel.moshouLv[lv].needJinDu
  1231. human.db.moshou.skillLV = human.db.moshou.skillLV or 1
  1232. MoshouLogic.calMoshouHero(human)
  1233. end
  1234. function d3.activemoshou(human,moshouID)
  1235. if not moshouID or moshouID <= 0 then return end
  1236. local MoShouExcel = require("excel.moshou")
  1237. local config = MoShouExcel.moshouActive
  1238. for i=1,moshouID do
  1239. local activeTask = config[i].activeTask
  1240. for j=1,#activeTask do
  1241. human.db.moshou = human.db.moshou or {}
  1242. human.db.moshou[i] = human.db.moshou[i] or {}
  1243. human.db.moshou[i].taskGet = human.db.moshou[i].taskGet or {}
  1244. human.db.moshou[i].taskGet[j] = j
  1245. end
  1246. end
  1247. if moshouID == #config then
  1248. d3.moshoulv(human,1)
  1249. end
  1250. local MoshouLogic = require("moshou.MoshouLogic")
  1251. MoshouLogic.calMoshouHero(human)
  1252. end
  1253. function d3.moshouupneed(human)
  1254. local MoShouExcel = require("excel.moshou")
  1255. local lvUpNeed1 = MoShouExcel.moshouLv[2].lvUpNeed[1][1]
  1256. local lvUpNeed2 = MoShouExcel.moshouLv[2].lvUpNeed[2][1]
  1257. d3.it(human,lvUpNeed1)
  1258. d3.it(human,lvUpNeed2)
  1259. local jingLianUp1 = MoShouExcel.moshouJingLian[2].lvUpNeed[1][1]
  1260. local jingLianUp2 = MoShouExcel.moshouJingLian[2].lvUpNeed[2][1]
  1261. d3.it(human,jingLianUp1)
  1262. d3.it(human,jingLianUp2)
  1263. local zhuhunUp = MoShouExcel.moshouZhuHun[1].costID
  1264. d3.it(human,zhuhunUp)
  1265. local skillup1 = MoShouExcel.moshouSkillLv[2].upCost[1][1]
  1266. local skillup2 = MoShouExcel.moshouSkillLv[2].upCost[2][1]
  1267. d3.it(human,skillup1)
  1268. d3.it(human,skillup2)
  1269. end
  1270. function d3.moshoujinglian(human,val)
  1271. if not human.db.moshou then return end
  1272. human.db.moshou.jingLian = val
  1273. end
  1274. function d3.clolinereward(human)
  1275. require("onlineReward.OnlineRewardLogic").initDB(human)
  1276. end
  1277. function d3.clonlinerewardget(human)
  1278. human.db.onlineReward.getId = 0
  1279. end
  1280. function d3.bartaskfinish(human)
  1281. local BarTaskLogic = require("bar.BarTaskLogic")
  1282. BarTaskLogic.initDB(human)
  1283. for taskID, taskData in pairs(human.db.bar) do
  1284. if type(taskID) == "number" then
  1285. human.db.bar[taskID].ts = 0
  1286. end
  1287. end
  1288. end
  1289. function d3.test(human)
  1290. local str = Util.format("aa{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}{16}",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
  1291. Broadcast.sendErr(human, str)
  1292. print(str)
  1293. end
  1294. function d3.clbattle()
  1295. local DB = require("common.DB")
  1296. local LuaMongo = _G.lua_mongo
  1297. LuaMongo.remove(DB.db_battle_shark)
  1298. end
  1299. -- 设置天梯争霸状态
  1300. function d3.jjcladderstart()
  1301. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1302. local JjcLadderExcel = require("excel.jjcLadder")
  1303. local JjcLadderDefine = JjcLadderExcel.define[1]
  1304. JjcLadderLogic.onActReady()
  1305. local week = Util.getWeekDay(os.time()) - 1
  1306. if week == 0 then
  1307. week = 7
  1308. end
  1309. JjcLadderLogic.TEMP_TIMER_STAMPTIME = nil
  1310. JjcLadderDefine.startTime.week = week
  1311. JjcLadderDefine.endTime.week = week + 1
  1312. JjcLadderLogic.onTimer()
  1313. local msg = InnerMsg.lw.LW_GM
  1314. msg.gm = "jjcladderstartmiddle"
  1315. InnerMsg.sendMsg(0, msg)
  1316. end
  1317. function d3.jjcladderstartmiddle()
  1318. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1319. local JjcLadderExcel = require("excel.jjcLadder")
  1320. local JjcLadderDefine = JjcLadderExcel.define[1]
  1321. JjcLadderLogic.onActReady()
  1322. local week = Util.getWeekDay(os.time()) - 1
  1323. if week == 0 then
  1324. week = 7
  1325. end
  1326. JjcLadderLogic.TEMP_TIMER_STAMPTIME = nil
  1327. JjcLadderDefine.startTime.week = week
  1328. JjcLadderDefine.endTime.week = week + 1
  1329. JjcLadderLogic.onTimer()
  1330. end
  1331. -- 天梯争霸报错
  1332. function d3.jjcladdersign(human)
  1333. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1334. if JjcLadderLogic.getState() == JjcLadderLogic.STATE_ACT_START then
  1335. local commonDB = JjcLadderLogic.getCommonDB()
  1336. commonDB.uuid2sign = commonDB.uuid2sign or {}
  1337. commonDB.uuid2sign[human.db._id] = os.time()
  1338. JjcLadderLogic.saveCommonDB(commonDB)
  1339. JjcLadderLogic.onUpdatePos(human)
  1340. end
  1341. end
  1342. -- 天梯争霸结束回调
  1343. function d3.jjcladderend()
  1344. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1345. JjcLadderLogic.onActEnd()
  1346. local msg = InnerMsg.lw.LW_GM
  1347. msg.gm = "jjcladderendmiddle"
  1348. InnerMsg.sendMsg(0, msg)
  1349. end
  1350. function d3.jjcladderendmiddle()
  1351. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1352. JjcLadderLogic.onActEnd()
  1353. end
  1354. -- 重置天梯争霸活动信息
  1355. function d3.cljjcladder()
  1356. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1357. JjcLadderLogic.saveCommonDB()
  1358. JjcLadderLogic.onActEnd()
  1359. local msg = InnerMsg.lw.LW_GM
  1360. msg.gm = "cljjcladdermiddle"
  1361. InnerMsg.sendMsg(0, msg)
  1362. end
  1363. function d3.cljjcladdermiddle()
  1364. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1365. JjcLadderLogic.saveCommonDB()
  1366. JjcLadderLogic.onActEnd()
  1367. end
  1368. function d3.clcombat(human,val)
  1369. human.db.combatHero[val] = nil
  1370. end
  1371. function d3.clshop(human,val)
  1372. human.db.shop[val] = nil
  1373. end
  1374. -- 重置日常礼包
  1375. function d3.clrichanglibao(human)
  1376. human.db.richangLibao = nil
  1377. end
  1378. -- 重置荣耀峡谷(龙族战场)
  1379. function d3.clvalley()
  1380. local ValleyLogic = require("valley.ValleyLogic")
  1381. ValleyLogic.cleanDB()
  1382. local msg = InnerMsg.lw.LW_GM
  1383. msg.gm = "clvalleymiddle"
  1384. InnerMsg.sendMsg(0, msg)
  1385. end
  1386. function d3.clvalleymiddle()
  1387. local ValleyLogic = require("valley.ValleyLogic")
  1388. ValleyLogic.cleanDB()
  1389. end
  1390. -- 重置荣耀峡谷(龙族战场)成就
  1391. function d3.clvalleytask(human)
  1392. human.db.valleyTask = nil
  1393. end
  1394. -- 增加荣耀峡谷(龙族战场)个人成就值
  1395. function d3.valleytask1(human, value)
  1396. require("valley.ValleyTask").updateValue(human.db._id, value, 0)
  1397. end
  1398. -- 增加荣耀峡谷(龙族战场)团队成就值
  1399. function d3.valleytask2(human, value)
  1400. require("valley.ValleyTask").updateValue(human.db._id, 0, value)
  1401. end
  1402. function d3.touchLv(human,val)
  1403. local liveness = val + 0
  1404. require("union.UnionLivenessLogic").touchLv(human, liveness)
  1405. end
  1406. function d3.clyj()
  1407. local DB = require("common.DB")
  1408. local LuaMongo = _G.lua_mongo
  1409. LuaMongo.remove(DB.db_yjTreasure)
  1410. local YjTreasureDBLogic = require("yjTreasure.YjTreasureDB")
  1411. YjTreasureDBLogic.YJ_TREASURE_DB = {}
  1412. end
  1413. function d3.yjlayer(human,val)
  1414. local YjTreasureLogic = require("yjTreasure.YjTreasureLogic")
  1415. local YjTreasureDBLogic = require("yjTreasure.YjTreasureDB")
  1416. local YjTreasureExcel = require("excel.yjTreasure")
  1417. local Lang = require("common.Lang")
  1418. local layerData = YjTreasureDBLogic.getLayerDataByUuid(human.db._id)
  1419. local layCnf = YjTreasureExcel.layer
  1420. local nowLayer = layerData.layer
  1421. if val > #layCnf then return Broadcast.sendErr(human,Lang.YJTREASURE_LAYER_ERR) end
  1422. local roleData = YjTreasureDBLogic.getRoleDataByUuid(human.db._id)
  1423. local layerMax = roleData.layerMax or 0
  1424. if layerMax < val then
  1425. roleData.layerMax = val
  1426. YjTreasureDBLogic.updateRoleDataByUuid(roleData,human.db._id)
  1427. end
  1428. YjTreasureDBLogic.creatLayerDataByUuid(human.db._id,val)
  1429. YjTreasureLogic.CG_YJTREASURE_QUERY(human)
  1430. end
  1431. function d3.towerKing(human)
  1432. local HuanJingTowerLogic = require("huanjingTower.HuanjingTowerLogic")
  1433. HuanJingTowerLogic.unlockTowerKing(human)
  1434. end
  1435. -- 设置炼狱最大通关层
  1436. function d3.lianyu(human, value)
  1437. value = tonumber(value)
  1438. if not value then return end
  1439. if value < 0 then return end
  1440. local LianyuExcel = require("excel.lianyu")
  1441. if value > 0 and not LianyuExcel.gamelevel[value] then
  1442. return
  1443. end
  1444. LianyuLogic = require("lianyu.LianyuLogic")
  1445. LianyuLogic.setMaxLv(human, value)
  1446. end
  1447. function d3.cllianyu(human)
  1448. human.db.lianyu = nil
  1449. end
  1450. function d3.cllianyuhelp()
  1451. local CommonDB = require("common.CommonDB")
  1452. CommonDB.updateValue(CommonDB.KEY_LIANYU, nil)
  1453. end
  1454. -- 清除特权商店相关信息
  1455. function cltequanshop(human)
  1456. human.db.tequanShop = nil
  1457. human.db.tequanMopup = nil
  1458. if human.db.bar then
  1459. human.db.bar.vip = nil
  1460. human.db.bar.surVip = nil
  1461. end
  1462. end
  1463. function d3.addbts(human)
  1464. local now = os.time()
  1465. require("battle.BattleLogic").initBattleOut(human, now)
  1466. human.db.battleOut.expTs1 = now - 7200
  1467. human.db.battleOut.itemTs1 = now - 7200
  1468. human.db.battleOut.expTs2 = now - 7200
  1469. human.db.battleOut.itemTs2 = now - 7200
  1470. end
  1471. function d3.addbsd(human)
  1472. human.db.mopupDoCnt = 0
  1473. human.db.mopupFreeCnt = 0
  1474. end
  1475. function d3.addYjYj(human,type)
  1476. local YjTreasureLogic = require("yjTreasure.YjTreasureLogic")
  1477. YjTreasureLogic.yjYaoJiAdd(human,10,type)
  1478. end
  1479. function d3.ajfc(human,val)
  1480. for i = 1,val do
  1481. human.db.jjcDailyFight = (human.db.jjcDailyFight or 0) + 1
  1482. require("jjc.JjcDB").updateTotalFight(human.db._id)
  1483. end
  1484. end
  1485. function d3.godWartest(human)
  1486. local JjcGodWarLogic = require("jjcGodWar.JjcGodWarLogic")
  1487. JjcGodWarLogic.jjcGodWarFinishGm(human)
  1488. end
  1489. function d3.closeMiddle(human)
  1490. MiddleConnect.stopConnectMiddle()
  1491. end
  1492. function d3.resetMiddle(human)
  1493. MiddleConnect.autoResetMiddle()
  1494. end
  1495. function d3.loginSign(human, value)
  1496. value = tonumber(value)
  1497. local LoginSignLogic = require("loginSign.LoginSignLogic")
  1498. LoginSignLogic.updateGM(human, value)
  1499. end
  1500. function d3.yuanjun(human, value)
  1501. human.db.combatBackup = 1
  1502. end
  1503. function d3.buyItem(human, value)
  1504. require("shop.ShopLogic").buy(human, 9, 405007, 1, 1)
  1505. end
  1506. function d3.test1(human)
  1507. require("absAct.MangHeLogic").draw(human, 1)
  1508. end
  1509. function d3.zbsj(human,val)
  1510. if human.db.zhanbu == nil then
  1511. return
  1512. end
  1513. human.db.zhanbu.money = val
  1514. end
  1515. function d3.tjm(human)
  1516. require("present.RelationGiftLogic").relationBind(human, "017772140001")
  1517. end
  1518. function d3.qcjz(human)
  1519. human.db.unionDonate = nil
  1520. end
  1521. function d3.unionCopyLv(human, val)
  1522. require("union.UnionEctypeLogic").toUnionBossLvGm(human, tonumber(val))
  1523. end
  1524. function d3.fff(human)
  1525. human.db.leaveUnionLimit = nil
  1526. end
  1527. function d3.hgw(args)
  1528. require("absAct.HeroGrowUp").actLoop()
  1529. end
  1530. function d3.hgwlv(human,val)
  1531. require("absAct.HeroGrowUp").addJifen(human,tonumber(val))
  1532. end
  1533. function d3.paoma(human, val)
  1534. require("chat.ChatPaoMaLogic").notice(val)
  1535. end
  1536. -- 设置合服时间
  1537. function d3.merge(human,value)
  1538. value = value and tonumber(value)
  1539. if value == nil then
  1540. local mergeSvrTime = CommonDB.getMergeServerTime()
  1541. if mergeSvrTime == 0 then
  1542. Broadcast.sendErr(human, "未设置合服时间")
  1543. else
  1544. local tb = os.date("%Y%m%d", mergeSvrTime)
  1545. Broadcast.sendErr(human, "当前合服时间为" .. tb)
  1546. end
  1547. else
  1548. local now = os.time()
  1549. local temp = Util.getDayStartTime(now)
  1550. temp = temp - (value - 1) * 24 * 3600
  1551. CommonDB.setMergeTime(temp)
  1552. local tb = os.date("%Y%m%d", temp)
  1553. Broadcast.sendErr(human, "设置当前合服时间为" .. tb)
  1554. --同步中心服开服时间
  1555. --[[local msgRet = InnerMsg.lw.LW_OS
  1556. msgRet.uuid = human.db._id
  1557. msgRet.value = temp
  1558. InnerMsg.sendMsg(0, msgRet)]]
  1559. end
  1560. end
  1561. -- 设置战斗界面挂机时间
  1562. function d3.guaji(human,value)
  1563. value = value and tonumber(value)
  1564. local gmFuc = require("battle.BattleLogic").gmSetHangTime
  1565. gmFuc(human, value)
  1566. end
  1567. function d3.resetweek(human)
  1568. WeekendLoopActManger.GMResetWeekAct(human)
  1569. end
  1570. function d3.savedb(human)
  1571. ObjHuman.GM_SaveDB(human)
  1572. end
  1573. ------种族试炼------------
  1574. ---开启某个种族的试炼,value为种族
  1575. function d3.zzkq(human, value)
  1576. local RacialTrialLogic = require("racialTrial.RacialTrialLogic")
  1577. RacialTrialLogic.GmOpenTrial(human, value)
  1578. end
  1579. --某个种族关卡的跳关
  1580. function d3.zztg(human, value)
  1581. local pos = string.find(value, " ", 1, true)
  1582. if pos == nil then return end
  1583. local camp = tonumber(string.sub(value, 1, pos - 1))
  1584. local levelCnt = tonumber(string.sub(value,pos+1,#value))
  1585. local RacialTrialLogic = require("racialTrial.RacialTrialLogic")
  1586. RacialTrialLogic.GmSetlevel(human, camp, levelCnt)
  1587. end
  1588. --z增加某个种族关卡的每日奖励次数
  1589. function d3.zzjl(human, value)
  1590. local pos = string.find(value, " ", 1, true)
  1591. if pos == nil then return end
  1592. local camp = tonumber(string.sub(value, 1, pos - 1))
  1593. local levelCnt = tonumber(string.sub(value,pos+1,#value))
  1594. local RacialTrialLogic = require("racialTrial.RacialTrialLogic")
  1595. RacialTrialLogic.GmAddDailyAwardCnt(human, camp, levelCnt)
  1596. end
  1597. ------------秘宝---------------------
  1598. --设置某个秘宝的等级
  1599. function d3.mblv(human, value)
  1600. local pos = string.find(value, " ", 1, true)
  1601. if pos == nil then return end
  1602. local id = tonumber(string.sub(value, 1, pos - 1))
  1603. local level = tonumber(string.sub(value,pos+1,#value))
  1604. local TalismanLogic = require("talisman.TalismanLogic")
  1605. TalismanLogic.GmSetlevel(human, id, level)
  1606. end
  1607. function d3.delZR(human)
  1608. RecommendLineup.RecommendLineup_GMClear()
  1609. end
  1610. function d3.clearnewcharge(human)
  1611. NewFirstCharge.NewFirstCharge_GMClear(human)
  1612. end
  1613. --战令增加进度
  1614. function d3.zljd(human, value)
  1615. local pos = string.find(value, " ", 1, true)
  1616. if pos == nil then return end
  1617. local orderType = tonumber(string.sub(value, 1, pos - 1))
  1618. local cnt = tonumber(string.sub(value,pos+1,#value))
  1619. local WarOrder = require("shop.WarOrder")
  1620. WarOrder.warOrderUnlock(human,orderType)
  1621. WarOrder.trigger(human, orderType, cnt)
  1622. end
  1623. -- 删除数据
  1624. function d3.delActPower(human)
  1625. ActPowerUp.ActPowerUp_GMClear(human)
  1626. end
  1627. function d3.delSevenDayCard(human, id)
  1628. FestivalSevenDayCardLogic.SEVENDAYCARD_GMCLEAR(human, id)
  1629. end
  1630. function d3.delTreasure(human)
  1631. TreasureChestLogic.TreasureChestLogic_GmClear(human)
  1632. end
  1633. --新商业活动——秘境翻牌, value > 0 表示该活动抽卡时使用GM模式
  1634. function d3.chouka(human, value)
  1635. value = tonumber(value)
  1636. local AbsLotteryCardLogic = require("absAct.AbsLotteryCardLogic")
  1637. AbsLotteryCardLogic.SetMode(value)
  1638. end
  1639. --事件GM,设置某个事件进度
  1640. function d3.czhl(human, value)
  1641. local pos = string.find(value, " ", 1, true)
  1642. if pos == nil then return end
  1643. local triggerId = tonumber(string.sub(value, 1, pos - 1))
  1644. local progress = tonumber(string.sub(value,pos+1,#value))
  1645. local AbsExcellentGiftLogic = require("absAct.AbsExcellentGiftLogic")
  1646. AbsExcellentGiftLogic.TriggerCbFunc(human, triggerId, progress, true)
  1647. end
  1648. -- 清空玩家加成时间
  1649. function d3.delBonusTime(human)
  1650. if not human or not human.db then
  1651. Log.write("GM_ERROR", "delBonusTime: invalid human object")
  1652. return
  1653. end
  1654. CommonDB.setFireWorkBonusTime(0)
  1655. end
  1656. function d3.writeLog(human)
  1657. MaiDianLogic.MaiDianLogic_GM()
  1658. end