Gm.lua 52 KB

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