Gm.lua 53 KB

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