Gm.lua 54 KB

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