Gm.lua 61 KB

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