Gm.lua 63 KB

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