Gm.lua 54 KB

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