Gm.lua 55 KB

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