Gm.lua 54 KB

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