Gm.lua 59 KB

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