Gm.lua 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300
  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