Gm.lua 54 KB

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