Gm.lua 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179
  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.clattr(human)
  483. local BattleLogic = require("battle.BattleLogic")
  484. BattleLogic.GM_ClearNowModelAttrData(human)
  485. end
  486. function d3.overmonth(human, val)
  487. val = math.max(tonumber(val) or 0, 10)
  488. human.db.actMonthEndTime = os.time() + val
  489. end
  490. function d3.zhuanpantime(human,val)
  491. local param = Util.split(val, " ")
  492. local ZhuanpanLogic = require("zhuanpan.ZhuanpanLogic")
  493. ZhuanpanLogic.zhuanpanByGm(human, tonumber(param[1]), tonumber(param[2]) )
  494. end
  495. function d3.signin(human,val)
  496. human.db.signInCnt = val
  497. for i =1,human.db.signInCnt do
  498. human.db.signIn[i] = 1
  499. end
  500. end
  501. function d3.unionLv(human, val)
  502. val = tonumber(val)
  503. if not val then return end
  504. local UnionDBLogic = require("union.UnionDBLogic")
  505. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  506. if not union then return end
  507. UnionDBLogic.upsetUnionData(union._id, "lv", val)
  508. UnionDBLogic.upsetUnionData(union._id, "exp", 0)
  509. end
  510. function d3.unionexp(human, val)
  511. val = tonumber(val)
  512. if not val then return end
  513. local UnionDBLogic = require("union.UnionDBLogic")
  514. local UnionLogic = require("union.UnionLogic")
  515. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  516. if not union then return end
  517. UnionLogic.addUnionExp(union, val)
  518. UnionDBLogic.updateUnionData(union)
  519. end
  520. function d3.gws(human,val)
  521. local LoginSignLogic = require("loginSign.LoginSignLogic")
  522. for i = 1,val do
  523. LoginSignLogic.getReward(human)
  524. end
  525. end
  526. function d3.tsht(human)
  527. local AdminLogic = require("AdminLogic")
  528. local JsonInput = {}
  529. JsonInput.accountName = human.db.account
  530. JsonInput.roleName = human.db.name
  531. AdminLogic.adminFunction.getuserstatus(JsonInput)
  532. end
  533. function d3.bs(human,val)
  534. local param = Util.split(val, " ")
  535. local AdminLogic = require("AdminLogic")
  536. local JsonInput = {}
  537. JsonInput.account = human.db.account
  538. JsonInput.minute = param[1]
  539. JsonInput.reason = param[2]
  540. AdminLogic.adminFunction.banSay(JsonInput)
  541. end
  542. function d3.bl(human,val)
  543. local AdminLogic = require("AdminLogic")
  544. local JsonInput = {}
  545. JsonInput.accountName = human.db.account
  546. JsonInput.minute = val
  547. AdminLogic.adminFunction.banAccount(JsonInput)
  548. end
  549. function d3.bl2(human,val)
  550. local AdminLogic = require("AdminLogic")
  551. local param = Util.split(val, " ")
  552. local JsonInput = {}
  553. JsonInput.accountName = param[1]
  554. JsonInput.minute = tonumber(param[2])
  555. AdminLogic.adminFunction.banAccount(JsonInput)
  556. end
  557. function d3.cbl(human,val)
  558. local param = Util.split(val, " ")
  559. local AdminLogic = require("AdminLogic")
  560. local JsonInput = {}
  561. JsonInput.accountName = param[1]
  562. JsonInput.cancelBanSay = param[2]
  563. AdminLogic.adminFunction.cancelBanAccount(JsonInput)
  564. end
  565. function d3.bip(human,val)
  566. local param = Util.split(val, " ")
  567. local AdminLogic = require("AdminLogic")
  568. local JsonInput = {}
  569. JsonInput.IP = param[1]
  570. JsonInput.banTime = param[2]
  571. AdminLogic.adminFunction.banIp(JsonInput)
  572. end
  573. function d3.ursc(human)
  574. human.db.ectypeCnt = nil
  575. human.db.ectypeFreeTime = nil
  576. end
  577. function d3.sue(human,val)
  578. local newLevel = tonumber(val)
  579. if not newLevel then return end
  580. local UnionDBLogic = require("union.UnionDBLogic")
  581. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  582. if not union then return end
  583. UnionDBLogic.updateBossLv(union,newLevel)
  584. end
  585. function d3.smtp(human,val)
  586. local param = Util.split(val, " ")
  587. local AdminLogic = require("AdminLogic")
  588. local JsonInput = {}
  589. JsonInput.recvType = 3
  590. JsonInput.title = param[1]
  591. JsonInput.content = param[2]
  592. JsonInput.fbAccount = param[3]
  593. JsonInput.senderName = "系统邮件"
  594. JsonInput.fbTime = os.time()
  595. JsonInput.fbContent = "反馈"
  596. JsonInput.startLv =0
  597. JsonInput.endLv = 51
  598. JsonInput.lastLoginTime = os.time() - 60*60
  599. AdminLogic.adminFunction.mail(JsonInput)
  600. end
  601. function d3.clmilltime(human)
  602. human.db.unionTaskGetTime = nil
  603. end
  604. function d3.tstx(human,val)
  605. local RoleHeadLogic = require("role.RoleHeadLogic")
  606. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_1, val)
  607. end
  608. function d3.tstxk(human,val)
  609. local RoleHeadLogic = require("role.RoleHeadLogic")
  610. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_2, val)
  611. end
  612. function d3.buy(human,val)
  613. local AdminLogic = require("AdminLogic")
  614. local PlatformHandler = require("platform.Handler")
  615. local ApiLogic = require("platform.ApiLogic")
  616. local BuyExcel = require("excel.buy")
  617. local buyConf = BuyExcel.buy[val]
  618. if not buyConf then return end
  619. local shopConf = BuyExcel.topup[val]
  620. if shopConf and shopConf.buyID == val then
  621. else
  622. shopConf = nil
  623. end
  624. local checkMoney = buyConf["CN"]
  625. local msg = {}
  626. msg.logintype = 2
  627. msg.openid = "oCD-L5RxAtfRe8-aiezdY-Ccla5U"
  628. msg.openkey = "VsBJf2DKah7QhzU5xuzLNA=="
  629. msg.yuanbao = shopConf and shopConf.cnt or buyConf.CN * 10
  630. msg.buyID = val
  631. msg.account = human.db.account
  632. msg.transaction_id = "transaction_id1"
  633. msg.pf = "android"
  634. msg.money = checkMoney
  635. ApiLogic.CHARGE_CODE_HIS = {}
  636. print("cccc:",val)
  637. local buyData = {buyID = val, price = checkMoney}
  638. BuyLogic.buy(human, buyData)
  639. --PlatformHandler.CG_TENCENT_BUY(human,msg)
  640. --AdminLogic.adminFunction.tencentPay(msg)
  641. end
  642. function d3.buyCharge(human, val)
  643. local BuyExcel = require("excel.buy")
  644. local buyConf = BuyExcel.buy[val]
  645. if not buyConf then
  646. return
  647. end
  648. local tOJsonInput = {}
  649. tOJsonInput.buyID = buyConf.id
  650. tOJsonInput.price = buyConf.CN
  651. tOJsonInput.money = buyConf.CN
  652. BuyLogic.charge(human, tOJsonInput)
  653. end
  654. function d3.gol(human)
  655. local AdminLogic = require("AdminLogic")
  656. AdminLogic.adminFunction.getonlinelist()
  657. end
  658. function d3.htm(human,val)
  659. local AdminLogic = require("AdminLogic")
  660. local oJsonInput = {}
  661. oJsonInput.recvType = val -- 邮件类型
  662. oJsonInput.title = "111" -- 邮件标题
  663. oJsonInput.content = "222" -- 邮件内容
  664. oJsonInput.items = nil -- 道具列表 可以为空
  665. oJsonInput.accounts = nil -- 指定玩家列表
  666. oJsonInput.startLv = 0
  667. oJsonInput.endLv = 200
  668. AdminLogic.adminFunction.mail(oJsonInput)
  669. end
  670. function d3.cluwar(human)
  671. require("union.UnionWarLogic").cleanUnionWar()
  672. local msg = InnerMsg.lw.LW_GM
  673. msg.gm = "cluwarmiddle"
  674. InnerMsg.sendMsg(0, msg)
  675. end
  676. function d3.cluniontime(human)
  677. human.db.unionJoinTime = nil
  678. end
  679. function d3.cluwarmiddle()
  680. local LuaMongo = _G.lua_mongo
  681. local DB = require("common.DB")
  682. LuaMongo.remove(DB.db_union_war)
  683. end
  684. function d3.uwarstart()
  685. -- 需要周1、3、5使用
  686. local UnionWarLogic = require("union.UnionWarLogic")
  687. UnionWarLogic.cleanUnionWar()
  688. local msg = InnerMsg.lw.LW_GM
  689. msg.gm = "cluwarmiddle"
  690. InnerMsg.sendMsg(0, msg)
  691. UnionWarLogic.onHour(0)
  692. UnionWarLogic.onHour(1)
  693. local msg = InnerMsg.lw.LW_GM
  694. msg.gm = "uwarstartmiddle"
  695. InnerMsg.sendMsg(0, msg)
  696. end
  697. function d3.warMaxtest(human, value)
  698. require("union.UnionWarLogic").auto(value)
  699. end
  700. function d3.uwar(human,state)
  701. local msg = InnerMsg.lw.LW_GM
  702. msg.gm = "muwar "..state
  703. InnerMsg.sendMsg(0, msg)
  704. if state == 1 then
  705. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  706. UnionWarDBLogic.onHour(0, true)
  707. end
  708. end
  709. function d3.uwarshop(human, lv)
  710. require("union.UnionWarLogic").upWarShopLv(human, tonumber(lv))
  711. end
  712. function d3.uwarBuff(human)
  713. local msg = InnerMsg.lw.LW_GM
  714. msg.gm = "muwarBuff ".. human.db.unionUuid
  715. InnerMsg.sendMsg(0, msg)
  716. end
  717. function d3.muwar(human,state)
  718. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  719. if state == 1 then
  720. UnionWarDBLogic.onHour(0, true)
  721. elseif state == 2 then
  722. UnionWarDBLogic.onHour(2, true)
  723. elseif state == 3 then
  724. UnionWarDBLogic.onHour(20, true)
  725. end
  726. end
  727. function d3.muwarBuff(human, unionUuid)
  728. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  729. UnionWarDBLogic.addBuffLvByGm(unionUuid)
  730. end
  731. function d3.uwartask(human, type)
  732. local UnionWarLogic = require("union.UnionWarLogic")
  733. UnionWarLogic.chegnjiuFinishGm(human, tonumber(type))
  734. end
  735. function d3.uwarstartmiddle()
  736. -- 匹配
  737. require("union.UnionWarMiddleLogic").matchUnionStart()
  738. end
  739. function d3.cljjc(human, val)
  740. val = tonumber(val)
  741. local msgRet = InnerMsg.lw.LW_CL_JJC
  742. msgRet.type = val
  743. InnerMsg.sendMsg(0, msgRet)
  744. end
  745. function d3.cluwar(human)
  746. require("union.UnionWarLogic").cleanUnionWar()
  747. local msg = InnerMsg.lw.LW_GM
  748. msg.gm = "cluwarmiddle"
  749. InnerMsg.sendMsg(0, msg)
  750. end
  751. function d3.cluwarmiddle()
  752. local LuaMongo = _G.lua_mongo
  753. local DB = require("common.DB")
  754. LuaMongo.remove(DB.db_union_war)
  755. end
  756. function d3.uwarstart()
  757. -- 需要周1、3、5使用
  758. require("union.UnionWarLogic").onHour(0)
  759. require("union.UnionWarLogic").onHour(1)
  760. local msg = InnerMsg.lw.LW_GM
  761. msg.gm = "uwarstartmiddle"
  762. InnerMsg.sendMsg(0, msg)
  763. end
  764. function d3.uwarstartmiddle()
  765. -- 匹配
  766. require("union.UnionWarMiddleLogic").matchUnionStart()
  767. end
  768. function d3.cxh(human)
  769. d3.tgod(human)
  770. d3.lv(human,200)
  771. end
  772. function d3.drop(human,val)
  773. local BattleLogic = require("battle.BattleLogic")
  774. local param = Util.split(val, " ")
  775. local cnt = tonumber(param[1])
  776. local battleID = tonumber(param[2])
  777. BattleLogic.clacItemCntGM(human,cnt,battleID)
  778. end
  779. function d3.uif(human,val)
  780. local jsonInput = {}
  781. jsonInput.unionName = val
  782. local AdminLogic = require("AdminLogic")
  783. AdminLogic.adminFunction.unionInfo(jsonInput)
  784. end
  785. function d3.ul(human,val)
  786. local jsonInput = {}
  787. jsonInput.start = tonumber(val)
  788. local AdminLogic = require("AdminLogic")
  789. AdminLogic.adminFunction.unionList(jsonInput)
  790. end
  791. function d3.monthgaochou(human, val)
  792. local MonthSummon = require("monthAct.MonthSummon")
  793. MonthSummon.onSummon(human, tonumber(val))
  794. end
  795. function d3.jhtq(human,val)
  796. local TequanLogic = require("qqTequan.TequanLogic")
  797. local param = Util.split(val, " ")
  798. local val1 = tonumber(param[1])
  799. local val2 = tonumber(param[2])
  800. local val3 = tonumber(param[3])
  801. local val4 = tonumber(param[4])
  802. TequanLogic.activateTequan(human,val1,val2,val3,val4)
  803. end
  804. function d3.unionTecLv(human,val)
  805. local UnionTecLogic = require("union.UnionTecLogic")
  806. UnionTecLogic.lvAllUpByGm(human)
  807. end
  808. function d3.auto(human,val)
  809. local param = Util.split(val, " ")
  810. local str = param[1]
  811. local val = param[2]
  812. if not str or not val then
  813. return
  814. end
  815. for i = 1, val do
  816. require("union.UnionWarLogic").auto(str .. string.format("%02d", i))
  817. end
  818. end
  819. function d3.lvAuto(human, val)
  820. val = val + 0
  821. local lvOld = human.db.lv
  822. local lvNew = val + 0
  823. human.db.lv = lvNew
  824. end
  825. function d3.cap(human)
  826. human.db.buyCapCnt = require("hero.HeroDefine").BUY_CAP_CNT
  827. require("hero.HeroLogic").sendHeroBagCap(human)
  828. end
  829. function d3.abscharge(human)
  830. AbsBillboardLogic.charge(human,1000)
  831. end
  832. function d3.jhpt(human)
  833. if human.pf_info.pf == "qqgame" then
  834. human.db.txHall = {}
  835. elseif human.pf_info.pf == "qzone" or human.pf_info.pf == "website" then
  836. human.db.qqZone = {}
  837. end
  838. end
  839. function d3.addfuwen(human)
  840. d3.itemadd(human,"80001 10")
  841. d3.itemadd(human,"80002 10")
  842. d3.itemadd(human,"80003 10")
  843. d3.itemadd(human,"80004 10")
  844. d3.itemadd(human,"80005 10")
  845. end
  846. function d3.addSmelt(human,val)
  847. local num = tonumber(val)
  848. human.db.smeltVal = human.db.smeltVal or 0
  849. human.db.smeltVal = human.db.smeltVal + num
  850. end
  851. function d3.zdfw(human,val)
  852. local param = Util.split(val, " ")
  853. local fuwenID = tonumber(param[1])
  854. local attr1 = tonumber(param[2])
  855. local val1 = tonumber(param[3])
  856. local attr2 = tonumber(param[4])
  857. local val2 = tonumber(param[5])
  858. local skill1 = tonumber(param[6])
  859. local skill2 = tonumber(param[7])
  860. local FuwenGrid = require("fuwen.FuwenGrid")
  861. local FuwenExcel = require("excel.fuwen").skill
  862. if (skill1 ~= nil and FuwenExcel[skill1] == nil) or (skill2 ~= nil and FuwenExcel[skill2] == nil) then
  863. print("fuck! add fuwen skill is notreal")
  864. return
  865. end
  866. FuwenGrid.setFuwenSkillAttrByGM(human,fuwenID,attr1,val1,attr2,val2,skill1,skill2)
  867. end
  868. function d3.t2(human)
  869. 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"}}]]
  870. local ret = require("AdminLogic").handleAdminRequest(_, input)
  871. print(ret)
  872. end
  873. function d3.t1(human)
  874. local input = {}
  875. input.token = "fC283BD0141D50418B68200972FBEE6A13102"
  876. input.payitem = "39*60*1"
  877. input.billno = os.time()
  878. local ret = require("platform.QQApi").onDeliverReturnForBuy(input)
  879. print(ret.ret,ret.msg)
  880. end
  881. function d3.skin(human,val)
  882. local tb = Util.split(val, " ")
  883. local id = tonumber(tb[1])
  884. local cnt = tonumber(tb[2])
  885. print(id,tb[1],tb[2])
  886. if not id then
  887. human.db.skinBag = {[0] = 999}
  888. return
  889. end
  890. local SkinLogic = require("skin.SkinLogic")
  891. SkinLogic.addSkin(human,id,cnt)
  892. end
  893. function d3.ff(human,val)
  894. local FriendLogic = require("friend.FriendLogic")
  895. FriendLogic.addFriend(human, val)
  896. end
  897. function d3.chenghao(human,val)
  898. val = tonumber(val)
  899. if not val then
  900. return
  901. end
  902. local RoleHeadLogic = require("role.RoleHeadLogic")
  903. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_4, val)
  904. end
  905. function d3.unionBillboard(human,val)
  906. val = tonumber(val)
  907. if not val then
  908. return
  909. end
  910. local BRoleLogic = require("billboard.BRoleLogic")
  911. BRoleLogic.queryUnionBillboard(human,val)
  912. end
  913. function d3.herotest(human, val)
  914. local tb = Util.split(val, " ")
  915. local combatType = 1
  916. local HeroExcel = require("excel.hero")
  917. local HeroLogic = require("hero.HeroLogic")
  918. local flags = {}
  919. human.db.combatHero = human.db.combatHero or {}
  920. human.db.combatHero[combatType] = {}
  921. for pos = 1, 6 do
  922. local id = tonumber(tb[pos])
  923. local index = nil
  924. if id and HeroExcel.hero[id] then
  925. for i = 1, human.db.heroBag[0] do
  926. local heroGrid = human.db.heroBag[i]
  927. if heroGrid and (heroGrid.id == id) and
  928. (not flags[i]) then
  929. flags[i] = true
  930. index = i
  931. break
  932. end
  933. end
  934. if not index then
  935. index = HeroLogic.getEmptyIndex(human)
  936. d3.heroadd(human, id .. " 1")
  937. end
  938. end
  939. human.db.combatHero[combatType][pos] = index
  940. end
  941. local CombatHandler = require("combat.Handler")
  942. CombatHandler.CG_COMBAT_BEGIN(human,{type = combatType, param = ""})
  943. end
  944. function d3.combat(human, monsterOutID)
  945. local CombatLogic = require("combat.CombatLogic")
  946. local param = {}
  947. param.defender, _, param.defRBase, param.defFormation = CombatLogic.getMonsterObjList(monsterOutID)
  948. require("combat.CombatLogic").combatBegin(human, 1001, param, 1)
  949. end
  950. function d3.combat2(human,id)
  951. local id = tonumber(id)
  952. local combatConf = require("excel.combat").gm[id]
  953. if not combatConf then
  954. assert()
  955. end
  956. local HeroGrid = require("hero.HeroGrid")
  957. local HeroLogic = require("hero.HeroLogic")
  958. local CombatLogic = require("combat.CombatLogic")
  959. local fakeman1 = {}
  960. local account1 = "combatFakeman1"
  961. local fakeman2 = {}
  962. local account2 = "combatFakeman2"
  963. local RoleDBLogic = require("role.RoleDBLogic")
  964. local fakemanDB1 = RoleDBLogic.getDbByAccount(account1)
  965. if not fakemanDB1 then
  966. fakemanDB1 = RoleDBLogic.createDefaultRole(account1)
  967. end
  968. fakeman1.db = fakemanDB1
  969. local fakemanDB2 = RoleDBLogic.getDbByAccount(account2)
  970. if not fakemanDB2 then
  971. fakemanDB2 = RoleDBLogic.createDefaultRole(account2)
  972. end
  973. fakeman2.db = fakemanDB2
  974. local attacker = {}
  975. local defender = {}
  976. for i = 1, fakeman1.db.heroBag[0] do
  977. HeroLogic.delHeroByIndex(fakeman1, i, "gm")
  978. end
  979. for i = 1, fakeman2.db.heroBag[0] do
  980. HeroLogic.delHeroByIndex(fakeman2, i, "gm")
  981. end
  982. for k,v in ipairs(combatConf.atk) do
  983. local heroGrid = HeroGrid.createHeroGrid(v[1], v[4])
  984. heroGrid.lv = math.max(heroGrid.lv, v[3] or 0)
  985. heroGrid.quality = HeroGrid.getMaxQuality(heroGrid.star)
  986. local heroIndex = HeroLogic.addHeroByGrid(fakeman1, heroGrid, "gm")
  987. attacker[v[2]] = CombatLogic.createHumanObj(fakeman1, heroGrid.uuid)
  988. end
  989. for k,v in ipairs(combatConf.def) do
  990. local heroGrid = HeroGrid.createHeroGrid(v[1], v[4])
  991. heroGrid.lv = math.max(heroGrid.lv, v[3] or 0)
  992. heroGrid.quality = HeroGrid.getMaxQuality(heroGrid.star)
  993. local heroIndex = HeroLogic.addHeroByGrid(fakeman2, heroGrid, "gm")
  994. defender[v[2]] = CombatLogic.createHumanObj(fakeman2, heroGrid.uuid)
  995. end
  996. local atkPet = nil
  997. local defPet = nil
  998. CombatLogic.combatGm(human,1001,combatConf.atkF, attacker,combatConf.defF,defender,atkPet,defPet,{{101,1},{102,2},{103,3},{104,4}})
  999. end
  1000. function d3.combatEnd(human)
  1001. local CombatLogic = require("combat.CombatLogic")
  1002. for i = CombatDefine.COMBAT_TYPE1, CombatDefine.COMBAT_TYPE_MAX do
  1003. CombatLogic.clientFinish(human, i)
  1004. end
  1005. end
  1006. -- it道具添加(支持中文)
  1007. function d3.it(human,value)
  1008. local tb = Util.split(value," ")
  1009. local id = tonumber(tb[1])
  1010. local cnt = tonumber(tb[2])
  1011. if id == nil then id = tb[1] end
  1012. if type(id) == "string" then
  1013. id = ItemDefine.getIdByName(id)
  1014. end
  1015. if type(id) ~= "number" then
  1016. print("err id", tb[1], id, type(id))
  1017. return
  1018. end
  1019. cnt = cnt or 1000
  1020. BagLogic.addItem(human, id, cnt, "gm")
  1021. end
  1022. -- 清除酒馆
  1023. function d3.clbartask(human)
  1024. human.db.bar = nil
  1025. end
  1026. function d3.updaily(human)
  1027. ObjHuman.updateDaily(human, true)
  1028. end
  1029. function d3.clguide(human)
  1030. human.db.noguide = nil
  1031. human.db.guide = nil
  1032. human.guideLoginStep = nil
  1033. require("guide.GuideLogic").refreshGuide(human)
  1034. require("guide.GuideLogic").sendStep(human)
  1035. end
  1036. function d3.nextguide(human)
  1037. local GuideExcel = require("excel.guide")
  1038. local GuideLogic = require("guide.GuideLogic")
  1039. local id = GuideLogic.getGuideID(human)
  1040. local nextstep = GuideLogic.getGuideStep(human) + 1
  1041. local cf = id and GuideExcel.main_guide[id]
  1042. local sid = cf and cf.guideList[nextstep]
  1043. GuideLogic.stepFinish(human, sid)
  1044. end
  1045. function d3.guide(human, id)
  1046. human.db.noguide = nil
  1047. human.guideLoginStep = nil
  1048. local GuideLogic = require("guide.GuideLogic")
  1049. GuideLogic.setGuide(human, id, GuideLogic.STATE_DOING)
  1050. GuideLogic.sendStep(human)
  1051. end
  1052. -- 跳过指引
  1053. function d3.noguide(human)
  1054. human.db.noguide = true
  1055. human.guideLoginStep = nil
  1056. require("guide.GuideLogic").sendStep(human, true)
  1057. end
  1058. function d3.creatunion(human,value)
  1059. d3.lv(human,30)
  1060. d3.viplv(human,2)
  1061. d3.zuanshi(human, 1000)
  1062. local UnionLogic = require("union.UnionLogic")
  1063. UnionLogic.createUnion(human, value)
  1064. end
  1065. function d3.cldraw(human, value)
  1066. human.db.drawCard = {jifen=tonumber(value),list={[1]={},[2]={},[3]={},[4]={}}}
  1067. end
  1068. function d3.cldrill(human)
  1069. require("drill.DrillDB").reset()
  1070. end
  1071. function d3.zhengdian(_, hour)
  1072. hour = tonumber(hour) or 0
  1073. require("core.Timer").doZhengDian(hour)
  1074. end
  1075. function d3.tgod(human)
  1076. local HeroLogic = require("hero.HeroLogic")
  1077. local HeroGrid = require("hero.HeroGrid")
  1078. local HeroExcel = require("excel.hero")
  1079. for heroID, config in pairs(HeroExcel.tujian) do
  1080. local heroConfig = HeroExcel.hero[heroID]
  1081. if heroConfig then
  1082. local star = heroConfig.star
  1083. local maxQuality = HeroGrid.getMaxQuality(star)
  1084. local maxLv = HeroGrid.getMaxLv(star,maxQuality)
  1085. d3.heroadd(human, heroID .. " 1".." "..maxLv.." "..maxQuality)
  1086. end
  1087. end
  1088. end
  1089. function d3.tujian(human, camp)
  1090. local HeroExcel = require("excel.hero")
  1091. camp = tonumber(camp)
  1092. for heroID, config in pairs(HeroExcel.tujian) do
  1093. if config.camp == camp or not camp then
  1094. d3.heroadd(human, heroID .. " 1")
  1095. end
  1096. end
  1097. end
  1098. function d3.cljingcailibao(human)
  1099. human.db.dailyLeiChong = nil
  1100. human.db.leichongHaoli = nil
  1101. human.db.topupAcountDaily = nil
  1102. human.db.topupAccountMonth = nil
  1103. end
  1104. function d3.qijifen(human,value)
  1105. human.db.sevenDayGoal = human.db.sevenDayGoal or {}
  1106. human.db.sevenDayGoal[9] = human.db.sevenDayGoal[8] or {}
  1107. human.db.sevenDayGoal[9].jifen = value
  1108. end
  1109. function d3.clqirimubiao(human)
  1110. human.db.sevenDayGoal = nil
  1111. end
  1112. function d3.throne(human, str)
  1113. if str == nil then return end
  1114. local tb = Util.split(str, " ")
  1115. local id = tonumber(tb[1])
  1116. local lv = tonumber(tb[2])
  1117. if not id or not lv then return end
  1118. local TheStarsDBLogic = require("theStars.TheStarsDBLogic")
  1119. local list = TheStarsDBLogic.getThroneList()
  1120. local throne = list[id]
  1121. if not throne then return end
  1122. throne.lv = lv
  1123. TheStarsDBLogic.updateThroneDB(throne)
  1124. end
  1125. function d3.cltsts(human)
  1126. human.db.throneTime = human.db.throneTime - 14400
  1127. end
  1128. -- 删号
  1129. function d3.delaccount(human, account)
  1130. if not account then return end
  1131. local target = ObjHuman.onlineAccount[account]
  1132. if target then
  1133. return Broadcast.sendErr(human, "can't delete online")
  1134. end
  1135. local RoleDBLogic = require("role.RoleDBLogic")
  1136. if not RoleDBLogic.getDbByAccount(account) then
  1137. return Broadcast.sendErr(human, "account not exist")
  1138. end
  1139. local LuaMongo = _G.lua_mongo
  1140. local DB = require("common.DB")
  1141. local query = {}
  1142. query.account = tostring(account)
  1143. LuaMongo.remove(DB.db_char, query)
  1144. require("core.RoleDel").roleDel()
  1145. Broadcast.sendErr(human, "delete ok, account = " .. account)
  1146. end
  1147. -- 临时开指引
  1148. function d3.openguide()
  1149. require("Config").HAS_GUIDE = true
  1150. end
  1151. function d3.closeguide()
  1152. require("Config").HAS_GUIDE = false
  1153. end
  1154. -- 自动上阵
  1155. function d3.autoteam(human, combatType)
  1156. if tonumber(combatType) == nil then return end
  1157. local CombatPosLogic = require("combat.CombatPosLogic")
  1158. local str = ""
  1159. for i = 1, 6 do
  1160. if not human.db.heroBag[i] then
  1161. local heroID = require("hero.HeroDefine").getRandHeroByIsElite()
  1162. local lv = math.random(50, 100)
  1163. d3.heroadd(human, heroID .. " 1 " .. lv)
  1164. end
  1165. str = str .. i
  1166. if i % 6 == 0 then str = str .. ","
  1167. else str = str .. "|" end
  1168. end
  1169. CombatPosLogic.updatePos(human,combatType,str)
  1170. end
  1171. function d3.fcmstate(human, state)
  1172. human.fcmState = state
  1173. require("fcm.FcmLogic").checkFcm(human)
  1174. end
  1175. function d3.oltimeday(human, time)
  1176. time = tonumber(time)
  1177. if not time then return end
  1178. human.db.onlineTimeDay = time
  1179. require("fcm.FcmLogic").checkFcm(human)
  1180. end
  1181. function d3.dis(human, code)
  1182. ObjHuman.doDisconnect(human, code)
  1183. end
  1184. function d3.project(human)
  1185. local Lang = require("common.Lang")
  1186. Broadcast.sendErr(human, Lang.TEST_MULTY_PROJECT)
  1187. end
  1188. function d3.clextrabattle(human)
  1189. human.db.battleExtraReward = nil
  1190. end
  1191. function d3.clsharepf(human)
  1192. human.db.plShare = nil
  1193. end
  1194. function d3.clshareboard()
  1195. require("present.SharePlatformLogic").resetBoard()
  1196. end
  1197. function d3.sharepfall(human, cnt)
  1198. cnt = tonumber(cnt) or 15
  1199. for i = 1, cnt do
  1200. require("present.SharePlatformLogic").onShareOk(human.db.account, "account" .. i, true)
  1201. end
  1202. end
  1203. function d3.sharepf(human, accountB)
  1204. require("present.SharePlatformLogic").onShareOk(human.db.account, accountB)
  1205. end
  1206. function d3.sharepf2(human, accountA)
  1207. require("present.SharePlatformLogic").onShareOk(accountA, human.db.account)
  1208. end
  1209. function d3.sharegroup(human)
  1210. require("present.SharePlatformLogic").groupShareOK(human)
  1211. end
  1212. function d3.shareinvate(human)
  1213. require("present.SharePlatformLogic").shareInvate(human)
  1214. end
  1215. function d3.cltuisonglibao(human)
  1216. human.db.tuiSongLiBao = nil
  1217. end
  1218. function d3.clmoshou(human)
  1219. human.db.moshou = nil
  1220. end
  1221. function d3.moshoulv(human,lv)
  1222. local MoShouExcel = require("excel.moshou")
  1223. if not lv or lv <= 0 or lv > #MoShouExcel.moshouLv then return end
  1224. local MoshouLogic = require("moshou.MoshouLogic")
  1225. local isAllActive = MoshouLogic.isAllMoshouActive(human)
  1226. if not isAllActive then
  1227. local MoShouExcel = require("excel.moshou")
  1228. local config = MoShouExcel.moshouActive
  1229. for i=1,#config do
  1230. local activeTask = config[i].activeTask
  1231. for j=1,#activeTask do
  1232. human.db.moshou = human.db.moshou or {}
  1233. human.db.moshou[i] = human.db.moshou[i] or {}
  1234. human.db.moshou[i].taskGet = human.db.moshou[i].taskGet or {}
  1235. human.db.moshou[i].taskGet[j] = j
  1236. end
  1237. end
  1238. end
  1239. human.db.moshou.lv = lv
  1240. human.db.moshou.lvExp = MoShouExcel.moshouLv[lv].needJinDu
  1241. human.db.moshou.skillLV = human.db.moshou.skillLV or 1
  1242. MoshouLogic.calMoshouHero(human)
  1243. end
  1244. function d3.activemoshou(human,moshouID)
  1245. if not moshouID or moshouID <= 0 then return end
  1246. local MoShouExcel = require("excel.moshou")
  1247. local config = MoShouExcel.moshouActive
  1248. for i=1,moshouID do
  1249. local activeTask = config[i].activeTask
  1250. for j=1,#activeTask do
  1251. human.db.moshou = human.db.moshou or {}
  1252. human.db.moshou[i] = human.db.moshou[i] or {}
  1253. human.db.moshou[i].taskGet = human.db.moshou[i].taskGet or {}
  1254. human.db.moshou[i].taskGet[j] = j
  1255. end
  1256. end
  1257. if moshouID == #config then
  1258. d3.moshoulv(human,1)
  1259. end
  1260. local MoshouLogic = require("moshou.MoshouLogic")
  1261. MoshouLogic.calMoshouHero(human)
  1262. end
  1263. function d3.moshouupneed(human)
  1264. local MoShouExcel = require("excel.moshou")
  1265. local lvUpNeed1 = MoShouExcel.moshouLv[2].lvUpNeed[1][1]
  1266. local lvUpNeed2 = MoShouExcel.moshouLv[2].lvUpNeed[2][1]
  1267. d3.it(human,lvUpNeed1)
  1268. d3.it(human,lvUpNeed2)
  1269. local jingLianUp1 = MoShouExcel.moshouJingLian[2].lvUpNeed[1][1]
  1270. local jingLianUp2 = MoShouExcel.moshouJingLian[2].lvUpNeed[2][1]
  1271. d3.it(human,jingLianUp1)
  1272. d3.it(human,jingLianUp2)
  1273. local zhuhunUp = MoShouExcel.moshouZhuHun[1].costID
  1274. d3.it(human,zhuhunUp)
  1275. local skillup1 = MoShouExcel.moshouSkillLv[2].upCost[1][1]
  1276. local skillup2 = MoShouExcel.moshouSkillLv[2].upCost[2][1]
  1277. d3.it(human,skillup1)
  1278. d3.it(human,skillup2)
  1279. end
  1280. function d3.moshoujinglian(human,val)
  1281. if not human.db.moshou then return end
  1282. human.db.moshou.jingLian = val
  1283. end
  1284. function d3.clolinereward(human)
  1285. require("onlineReward.OnlineRewardLogic").initDB(human)
  1286. end
  1287. function d3.clonlinerewardget(human)
  1288. human.db.onlineReward.getId = 0
  1289. end
  1290. function d3.bartaskfinish(human)
  1291. local BarTaskLogic = require("bar.BarTaskLogic")
  1292. BarTaskLogic.initDB(human)
  1293. for taskID, taskData in pairs(human.db.bar) do
  1294. if type(taskID) == "number" then
  1295. human.db.bar[taskID].ts = 0
  1296. end
  1297. end
  1298. end
  1299. function d3.test(human)
  1300. 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)
  1301. Broadcast.sendErr(human, str)
  1302. print(str)
  1303. end
  1304. function d3.clbattle()
  1305. local DB = require("common.DB")
  1306. local LuaMongo = _G.lua_mongo
  1307. LuaMongo.remove(DB.db_battle_shark)
  1308. end
  1309. -- 设置天梯争霸状态
  1310. function d3.jjcladderstart()
  1311. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1312. local JjcLadderExcel = require("excel.jjcLadder")
  1313. local JjcLadderDefine = JjcLadderExcel.define[1]
  1314. JjcLadderLogic.onActReady()
  1315. local week = Util.getWeekDay(os.time()) - 1
  1316. if week == 0 then
  1317. week = 7
  1318. end
  1319. JjcLadderLogic.TEMP_TIMER_STAMPTIME = nil
  1320. JjcLadderDefine.startTime.week = week
  1321. JjcLadderDefine.endTime.week = week + 1
  1322. JjcLadderLogic.onTimer()
  1323. local msg = InnerMsg.lw.LW_GM
  1324. msg.gm = "jjcladderstartmiddle"
  1325. InnerMsg.sendMsg(0, msg)
  1326. end
  1327. function d3.jjcladderstartmiddle()
  1328. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1329. local JjcLadderExcel = require("excel.jjcLadder")
  1330. local JjcLadderDefine = JjcLadderExcel.define[1]
  1331. JjcLadderLogic.onActReady()
  1332. local week = Util.getWeekDay(os.time()) - 1
  1333. if week == 0 then
  1334. week = 7
  1335. end
  1336. JjcLadderLogic.TEMP_TIMER_STAMPTIME = nil
  1337. JjcLadderDefine.startTime.week = week
  1338. JjcLadderDefine.endTime.week = week + 1
  1339. JjcLadderLogic.onTimer()
  1340. end
  1341. -- 天梯争霸报错
  1342. function d3.jjcladdersign(human)
  1343. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1344. if JjcLadderLogic.getState() == JjcLadderLogic.STATE_ACT_START then
  1345. local commonDB = JjcLadderLogic.getCommonDB()
  1346. commonDB.uuid2sign = commonDB.uuid2sign or {}
  1347. commonDB.uuid2sign[human.db._id] = os.time()
  1348. JjcLadderLogic.saveCommonDB(commonDB)
  1349. JjcLadderLogic.onUpdatePos(human)
  1350. end
  1351. end
  1352. -- 天梯争霸结束回调
  1353. function d3.jjcladderend()
  1354. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1355. JjcLadderLogic.onActEnd()
  1356. local msg = InnerMsg.lw.LW_GM
  1357. msg.gm = "jjcladderendmiddle"
  1358. InnerMsg.sendMsg(0, msg)
  1359. end
  1360. function d3.jjcladderendmiddle()
  1361. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1362. JjcLadderLogic.onActEnd()
  1363. end
  1364. -- 重置天梯争霸活动信息
  1365. function d3.cljjcladder()
  1366. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1367. JjcLadderLogic.saveCommonDB()
  1368. JjcLadderLogic.onActEnd()
  1369. local msg = InnerMsg.lw.LW_GM
  1370. msg.gm = "cljjcladdermiddle"
  1371. InnerMsg.sendMsg(0, msg)
  1372. end
  1373. function d3.cljjcladdermiddle()
  1374. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1375. JjcLadderLogic.saveCommonDB()
  1376. JjcLadderLogic.onActEnd()
  1377. end
  1378. function d3.clcombat(human,val)
  1379. human.db.combatHero[val] = nil
  1380. end
  1381. function d3.clshop(human,val)
  1382. human.db.shop[val] = nil
  1383. end
  1384. -- 重置日常礼包
  1385. function d3.clrichanglibao(human)
  1386. human.db.richangLibao = nil
  1387. end
  1388. -- 重置荣耀峡谷(龙族战场)
  1389. function d3.clvalley()
  1390. local ValleyLogic = require("valley.ValleyLogic")
  1391. ValleyLogic.cleanDB()
  1392. local msg = InnerMsg.lw.LW_GM
  1393. msg.gm = "clvalleymiddle"
  1394. InnerMsg.sendMsg(0, msg)
  1395. end
  1396. function d3.clvalleymiddle()
  1397. local ValleyLogic = require("valley.ValleyLogic")
  1398. ValleyLogic.cleanDB()
  1399. end
  1400. -- 重置荣耀峡谷(龙族战场)成就
  1401. function d3.clvalleytask(human)
  1402. human.db.valleyTask = nil
  1403. end
  1404. -- 增加荣耀峡谷(龙族战场)个人成就值
  1405. function d3.valleytask1(human, value)
  1406. require("valley.ValleyTask").updateValue(human.db._id, value, 0)
  1407. end
  1408. -- 增加荣耀峡谷(龙族战场)团队成就值
  1409. function d3.valleytask2(human, value)
  1410. require("valley.ValleyTask").updateValue(human.db._id, 0, value)
  1411. end
  1412. function d3.touchLv(human,val)
  1413. local liveness = val + 0
  1414. require("union.UnionLivenessLogic").touchLv(human, liveness)
  1415. end
  1416. function d3.clyj()
  1417. local DB = require("common.DB")
  1418. local LuaMongo = _G.lua_mongo
  1419. LuaMongo.remove(DB.db_yjTreasure)
  1420. local YjTreasureDBLogic = require("yjTreasure.YjTreasureDB")
  1421. YjTreasureDBLogic.YJ_TREASURE_DB = {}
  1422. end
  1423. function d3.yjlayer(human,val)
  1424. local YjTreasureLogic = require("yjTreasure.YjTreasureLogic")
  1425. local YjTreasureDBLogic = require("yjTreasure.YjTreasureDB")
  1426. local YjTreasureExcel = require("excel.yjTreasure")
  1427. local Lang = require("common.Lang")
  1428. local layerData = YjTreasureDBLogic.getLayerDataByUuid(human.db._id)
  1429. local layCnf = YjTreasureExcel.layer
  1430. local nowLayer = layerData.layer
  1431. if val > #layCnf then return Broadcast.sendErr(human,Lang.YJTREASURE_LAYER_ERR) end
  1432. local roleData = YjTreasureDBLogic.getRoleDataByUuid(human.db._id)
  1433. local layerMax = roleData.layerMax or 0
  1434. if layerMax < val then
  1435. roleData.layerMax = val
  1436. YjTreasureDBLogic.updateRoleDataByUuid(roleData,human.db._id)
  1437. end
  1438. YjTreasureDBLogic.creatLayerDataByUuid(human.db._id,val)
  1439. YjTreasureLogic.CG_YJTREASURE_QUERY(human)
  1440. end
  1441. function d3.towerKing(human)
  1442. local HuanJingTowerLogic = require("huanjingTower.HuanjingTowerLogic")
  1443. HuanJingTowerLogic.unlockTowerKing(human)
  1444. end
  1445. -- 设置炼狱最大通关层
  1446. function d3.lianyu(human, value)
  1447. value = tonumber(value)
  1448. if not value then return end
  1449. if value < 0 then return end
  1450. local LianyuExcel = require("excel.lianyu")
  1451. if value > 0 and not LianyuExcel.gamelevel[value] then
  1452. return
  1453. end
  1454. LianyuLogic = require("lianyu.LianyuLogic")
  1455. LianyuLogic.setMaxLv(human, value)
  1456. end
  1457. function d3.cllianyu(human)
  1458. human.db.lianyu = nil
  1459. end
  1460. function d3.cllianyuhelp()
  1461. local CommonDB = require("common.CommonDB")
  1462. CommonDB.updateValue(CommonDB.KEY_LIANYU, nil)
  1463. end
  1464. -- 清除特权商店相关信息
  1465. function cltequanshop(human)
  1466. human.db.tequanShop = nil
  1467. human.db.tequanMopup = nil
  1468. if human.db.bar then
  1469. human.db.bar.vip = nil
  1470. human.db.bar.surVip = nil
  1471. end
  1472. end
  1473. function d3.addbts(human)
  1474. local now = os.time()
  1475. require("battle.BattleLogic").initBattleOut(human, now)
  1476. human.db.battleOut.expTs1 = now - 7200
  1477. human.db.battleOut.itemTs1 = now - 7200
  1478. human.db.battleOut.expTs2 = now - 7200
  1479. human.db.battleOut.itemTs2 = now - 7200
  1480. end
  1481. function d3.addbsd(human)
  1482. human.db.mopupDoCnt = 0
  1483. human.db.mopupFreeCnt = 0
  1484. end
  1485. function d3.addYjYj(human,type)
  1486. local YjTreasureLogic = require("yjTreasure.YjTreasureLogic")
  1487. YjTreasureLogic.yjYaoJiAdd(human,10,type)
  1488. end
  1489. function d3.ajfc(human,val)
  1490. for i = 1,val do
  1491. human.db.jjcDailyFight = (human.db.jjcDailyFight or 0) + 1
  1492. require("jjc.JjcDB").updateTotalFight(human.db._id)
  1493. end
  1494. end
  1495. function d3.godWartest(human)
  1496. local JjcGodWarLogic = require("jjcGodWar.JjcGodWarLogic")
  1497. JjcGodWarLogic.jjcGodWarFinishGm(human)
  1498. end
  1499. function d3.closeMiddle(human)
  1500. MiddleConnect.stopConnectMiddle()
  1501. end
  1502. function d3.resetMiddle(human)
  1503. MiddleConnect.autoResetMiddle()
  1504. end
  1505. function d3.loginSign(human, value)
  1506. value = tonumber(value)
  1507. local LoginSignLogic = require("loginSign.LoginSignLogic")
  1508. LoginSignLogic.updateGM(human, value)
  1509. end
  1510. function d3.yuanjun(human, value)
  1511. human.db.combatBackup = 1
  1512. end
  1513. function d3.buyItem(human, value)
  1514. require("shop.ShopLogic").buy(human, 9, 405007, 1, 1)
  1515. end
  1516. function d3.test1(human)
  1517. require("absAct.MangHeLogic").draw(human, 1)
  1518. end
  1519. function d3.zbsj(human,val)
  1520. if human.db.zhanbu == nil then
  1521. return
  1522. end
  1523. human.db.zhanbu.money = val
  1524. end
  1525. function d3.tjm(human)
  1526. require("present.RelationGiftLogic").relationBind(human, "017772140001")
  1527. end
  1528. function d3.qcjz(human)
  1529. human.db.unionDonate = nil
  1530. end
  1531. function d3.unionCopyLv(human, val)
  1532. require("union.UnionEctypeLogic").toUnionBossLvGm(human, tonumber(val))
  1533. end
  1534. function d3.fff(human)
  1535. human.db.leaveUnionLimit = nil
  1536. end
  1537. function d3.hgw(args)
  1538. require("absAct.HeroGrowUp").actLoop()
  1539. end
  1540. function d3.hgwlv(human,val)
  1541. require("absAct.HeroGrowUp").addJifen(human,tonumber(val))
  1542. end
  1543. function d3.paoma(human, val)
  1544. require("chat.ChatPaoMaLogic").notice(val)
  1545. end
  1546. -- 设置合服时间
  1547. function d3.merge(human,value)
  1548. value = value and tonumber(value)
  1549. if value == nil then
  1550. local mergeSvrTime = CommonDB.getMergeServerTime()
  1551. if mergeSvrTime == 0 then
  1552. Broadcast.sendErr(human, "未设置合服时间")
  1553. else
  1554. local tb = os.date("%Y%m%d", mergeSvrTime)
  1555. Broadcast.sendErr(human, "当前合服时间为" .. tb)
  1556. end
  1557. else
  1558. local now = os.time()
  1559. local temp = Util.getDayStartTime(now)
  1560. temp = temp - (value - 1) * 24 * 3600
  1561. CommonDB.setMergeTime(temp)
  1562. local tb = os.date("%Y%m%d", temp)
  1563. Broadcast.sendErr(human, "设置当前合服时间为" .. tb)
  1564. --同步中心服开服时间
  1565. --[[local msgRet = InnerMsg.lw.LW_OS
  1566. msgRet.uuid = human.db._id
  1567. msgRet.value = temp
  1568. InnerMsg.sendMsg(0, msgRet)]]
  1569. end
  1570. end
  1571. -- 设置战斗界面挂机时间
  1572. function d3.guaji(human,value)
  1573. value = value and tonumber(value)
  1574. local gmFuc = require("battle.BattleLogic").gmSetHangTime
  1575. gmFuc(human, value)
  1576. end
  1577. function d3.resetweek(human)
  1578. WeekendLoopActManger.GMResetWeekAct(human)
  1579. end
  1580. function d3.savedb(human)
  1581. ObjHuman.GM_SaveDB(human)
  1582. end
  1583. ------种族试炼------------
  1584. ---开启某个种族的试炼,value为种族
  1585. function d3.zzkq(human, value)
  1586. local RacialTrialLogic = require("racialTrial.RacialTrialLogic")
  1587. RacialTrialLogic.GmOpenTrial(human, value)
  1588. end
  1589. --某个种族关卡的跳关
  1590. function d3.zztg(human, value)
  1591. local pos = string.find(value, " ", 1, true)
  1592. if pos == nil then return end
  1593. local camp = tonumber(string.sub(value, 1, pos - 1))
  1594. local levelCnt = tonumber(string.sub(value,pos+1,#value))
  1595. local RacialTrialLogic = require("racialTrial.RacialTrialLogic")
  1596. RacialTrialLogic.GmSetlevel(human, camp, levelCnt)
  1597. end
  1598. --z增加某个种族关卡的每日奖励次数
  1599. function d3.zzjl(human, value)
  1600. local pos = string.find(value, " ", 1, true)
  1601. if pos == nil then return end
  1602. local camp = tonumber(string.sub(value, 1, pos - 1))
  1603. local levelCnt = tonumber(string.sub(value,pos+1,#value))
  1604. local RacialTrialLogic = require("racialTrial.RacialTrialLogic")
  1605. RacialTrialLogic.GmAddDailyAwardCnt(human, camp, levelCnt)
  1606. end
  1607. ------------秘宝---------------------
  1608. --设置某个秘宝的等级
  1609. function d3.mblv(human, value)
  1610. local pos = string.find(value, " ", 1, true)
  1611. if pos == nil then return end
  1612. local id = tonumber(string.sub(value, 1, pos - 1))
  1613. local level = tonumber(string.sub(value,pos+1,#value))
  1614. local TalismanLogic = require("talisman.TalismanLogic")
  1615. TalismanLogic.GmSetlevel(human, id, level)
  1616. end
  1617. function d3.delZR(human)
  1618. RecommendLineup.RecommendLineup_GMClear()
  1619. end
  1620. function d3.clearnewcharge(human)
  1621. NewFirstCharge.NewFirstCharge_GMClear(human)
  1622. end
  1623. --战令增加进度
  1624. function d3.zljd(human, value)
  1625. local pos = string.find(value, " ", 1, true)
  1626. if pos == nil then return end
  1627. local orderType = tonumber(string.sub(value, 1, pos - 1))
  1628. local cnt = tonumber(string.sub(value,pos+1,#value))
  1629. local WarOrder = require("shop.WarOrder")
  1630. WarOrder.warOrderUnlock(human,orderType)
  1631. WarOrder.trigger(human, orderType, cnt)
  1632. end
  1633. -- 删除数据
  1634. function d3.delActPower(human)
  1635. ActPowerUp.ActPowerUp_GMClear(human)
  1636. end
  1637. function d3.delSevenDayCard(human, id)
  1638. FestivalSevenDayCardLogic.SEVENDAYCARD_GMCLEAR(human, id)
  1639. end
  1640. function d3.delTreasure(human)
  1641. TreasureChestLogic.TreasureChestLogic_GmClear(human)
  1642. end
  1643. --新商业活动——秘境翻牌, value > 0 表示该活动抽卡时使用GM模式
  1644. function d3.chouka(human, value)
  1645. value = tonumber(value)
  1646. local AbsLotteryCardLogic = require("absAct.AbsLotteryCardLogic")
  1647. AbsLotteryCardLogic.SetMode(value)
  1648. end
  1649. --事件GM,设置某个事件进度
  1650. function d3.czhl(human, value)
  1651. local pos = string.find(value, " ", 1, true)
  1652. if pos == nil then return end
  1653. local triggerId = tonumber(string.sub(value, 1, pos - 1))
  1654. local progress = tonumber(string.sub(value,pos+1,#value))
  1655. local AbsExcellentGiftLogic = require("absAct.AbsExcellentGiftLogic")
  1656. AbsExcellentGiftLogic.TriggerCbFunc(human, triggerId, progress, true)
  1657. end
  1658. -- 清空玩家加成时间
  1659. function d3.delBonusTime(human)
  1660. if not human or not human.db then
  1661. Log.write("GM_ERROR", "delBonusTime: invalid human object")
  1662. return
  1663. end
  1664. CommonDB.setFireWorkBonusTime(0)
  1665. end
  1666. function d3.writeLog(human)
  1667. MaiDianLogic.MaiDianLogic_GM()
  1668. end
  1669. ------专属武器--------------
  1670. function d3.wlv(human, value)
  1671. local pos = string.find(value, " ", 1, true)
  1672. if pos == nil then return end
  1673. local heroId = tonumber(string.sub(value, 1, pos - 1))
  1674. local level = tonumber(string.sub(value,pos+1, #value))
  1675. local HeroExclusiveWeapon = require("hero.HeroExclusiveWeapon")
  1676. HeroExclusiveWeapon.GmSetHeroWeaponLv(human, heroId, level)
  1677. end
  1678. -- 清理跨服商业活动个人数据
  1679. function d3.ClearCommerce(human)
  1680. CommerceManger.CommerveManager_GMClear(human)
  1681. end
  1682. function d3.CSAHumanPoint(human, nAddNum)
  1683. CommerceManger.CommerveManager_GMAddHumanPoint(human, nAddNum)
  1684. end
  1685. function d3.CSAServerPoint(human, nAddNum)
  1686. CommerceManger.CommerveManager_AddServerPoint(nAddNum)
  1687. end
  1688. function d3.CSSendMail(human)
  1689. CommerceManger.CommerveManager_SendMail()
  1690. end
  1691. function d3.CSARest(human)
  1692. CommerceManger.CommerveManager_GMRest(human)
  1693. end
  1694. function d3.CSARestCommon(human)
  1695. CommerceManger.CommerveManager_GMRestCommonDB()
  1696. end
  1697. function d3.CSAClearMiddleMail(human)
  1698. CommerceManger.CommerveManager_GMClearMiddleMail()
  1699. end
  1700. function d3.clearRelic(human)
  1701. for i = 1, human.db.heroBag[0] do
  1702. local heroGrid = human.db.heroBag[i]
  1703. if heroGrid and heroGrid.relic and heroGrid.relic.relicID then
  1704. heroGrid.relic = {}
  1705. end
  1706. end
  1707. human.db.relicListData = {}
  1708. end
  1709. function d3.equipRelic(human, heroID, heroIdx, relicId, operate)
  1710. -- 参数校验
  1711. if not heroID then
  1712. return Broadcast.sendErr(human, "参数错误,格式:/gm equipRelic [英雄ID] ")
  1713. end
  1714. if not heroIdx then
  1715. return Broadcast.sendErr(human, "参数错误,格式:/gm equipRelic [英雄索引] ")
  1716. end
  1717. if not relicId then
  1718. return Broadcast.sendErr(human, "参数错误,格式:/gm equipRelic [遗物ID] ")
  1719. end
  1720. if not operate then
  1721. return Broadcast.sendErr(human, "参数错误,格式:/gm equipRelic [0=卸下|1=装备] ")
  1722. end
  1723. -- 模拟客户端协议结构
  1724. local tMsgData = {
  1725. heroID = heroID,
  1726. heroIdx = heroIdx,
  1727. relicId = relicId,
  1728. operate = operate
  1729. }
  1730. -- 调用原有处理逻辑(假设你已有处理函数)
  1731. local oldData, newData = winner.EquipeandRemove(human, tMsgData.heroID, tMsgData.heroIdx, tMsgData.relicId, tMsgData.operate)
  1732. end
  1733. --周任务和荣耀历程访问接口---
  1734. function d3.weekTask(human)
  1735. local d= week.WeekTaskQuery(human)
  1736. end
  1737. function d3.weekHonorJourney(human)
  1738. local d= honor.HonorJourneyTaskQuery(human)
  1739. end
  1740. function d3.honorclear(human)
  1741. honor.HonorJourney_GMClear(human)
  1742. end
  1743. function d3.weekreward(human)
  1744. local d= week.weekTaskGetReward(human)
  1745. end
  1746. function d3.weekhuoyue(human)
  1747. local d= week.CG_WEEKTASK_GET_HUOYUEBOX(human)
  1748. end
  1749. function d3.dayhuoyue(human)
  1750. local d= day.CG_DAILYTASK_GET_HUOYUEBOX(human)
  1751. end
  1752. function d3.honorcaddpoint(human, nAddNum)
  1753. honor.HonorJourney_GMAddPoint(human, nAddNum)
  1754. end
  1755. function d3.dayreward(human)
  1756. local d= day.dailyTaskGetReward(human)
  1757. end
  1758. local allHeroIds= {}
  1759. -- 一键获取所有资源--
  1760. function d3.getAll(human)
  1761. for id, hero in pairs(HeroTable) do
  1762. if hero.grade == 4 or hero.grade == 5 then
  1763. table.insert(allHeroIds, id)
  1764. end
  1765. end
  1766. for _, id in ipairs(allHeroIds) do
  1767. local val = string.format("%d %d %d %d", id, 1, 400, 15)
  1768. d3.heroadd(human, val)
  1769. end
  1770. local items = {
  1771. {101, 1000000000},
  1772. {111, 1000000000},
  1773. {112, 1000000},
  1774. {114, 10000},
  1775. {118, 10000},
  1776. {124, 10000},
  1777. {120, 10000},
  1778. {135, 10000},
  1779. {80005, 10},
  1780. {80006, 10},
  1781. {1009, 10000},
  1782. {1011, 900000},
  1783. {1023, 99},
  1784. {1024, 99},
  1785. {1025, 99},
  1786. {1014, 99},
  1787. {1015, 99},
  1788. {1016, 99},
  1789. {1017, 99},
  1790. {1031, 99},
  1791. {1032, 99},
  1792. {1033, 99},
  1793. }
  1794. for _, item in ipairs(items) do
  1795. local cmd = string.format("%d %d", item[1], item[2])
  1796. d3.itemadd(human, cmd)
  1797. end
  1798. end
  1799. --清空周任务数据
  1800. function d3.clearWeek(human)
  1801. human.db.weekTask ={}
  1802. end
  1803. function d3.setWeekhuoyue(human,num)
  1804. human.db.weekTask.nowHuoYue = num
  1805. end
  1806. function d3.CSASendHuma(human)
  1807. CommerceManger.CommerveManager_GMSendHumanMail(human)
  1808. end