Gm.lua 62 KB

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