【GM】添加批量添加英雄,道具的GM

dev_chengFeng
gaoxin 2021-01-09 13:53:48 +08:00
parent ecd9a16ed1
commit b4713efce8
1 changed files with 34 additions and 0 deletions

View File

@ -56,6 +56,10 @@ local moneyList = {"1#3#99999999", "1#4#99999999", "1#5#99999999", "1#14#9999999
--初始化组件(用于子类重写)
function GMPanel:InitComponent()
---
--- type 所属页签的类型 player 玩家页签 Function 功能类型 Battle 战斗相关
--- subType 类型 Server 直接向服务器请求的GM Func 回调某个方法的GM
---
_GMConfig = {
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "12#0#%s", btnTip = "改名", inputTip = {"输入名称"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "20#0#%s", btnTip = "完成", inputTip = {"输入任务ID"}, callBack = nil},
@ -67,10 +71,13 @@ function GMPanel:InitComponent()
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "10#4#%s", btnTip = "设置服务器时间", inputTip = {"例20170801190000"}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "10#%s#0", btnTip = "搜索地图", inputTip = {"输入地图Id"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "1#%s", btnTip = "生成道具", inputTip = {"道具ID#道具数量"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "批量生成道具", inputTip = {"道具ID#道具数量|..."}, callBack = this.GetManyItems},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "4#%s", btnTip = "生成英雄", inputTip = {"英雄ID#星级"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "批量生成英雄", inputTip = {"英雄ID#星级|..."}, callBack = this.GetManyHeros},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "9#%s#0", btnTip = "通关关卡", inputTip = {"关卡id"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "3#1#%s", btnTip = "发送邮件", inputTip = {"id,num|id,num..."}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "14#%s#0", btnTip = "跳转", inputTip = {"试炼副本层数"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "添加圣物", inputTip = {"输入圣物ID"}, callBack = this.AddHoly},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "8#1#1", btnTip = "通关所有关卡", inputTip = {}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "6#0#0", btnTip = "一键物品", inputTip = {""}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "22#0#0", btnTip = "一键异妖", inputTip = {""}, callBack = nil},
@ -135,6 +142,32 @@ function GMPanel:BindEvent()
end
end
function this.GetManyItems(text)
local list = string.split(text, "|")
local cor = coroutine.start(function()
for _, str in ipairs(list) do
local str = "1#" .. str
Log(str)
NetManager.GMEvent(str)
coroutine.wait(0.1)
end
LogGreen("物品批量生成完成")
end)
end
function this.GetManyHeros(text)
local list = string.split(text, "|")
Log(text)
local cor = coroutine.start(function()
for _, str in ipairs(list) do
str = "4#" .. str
Log(str)
NetManager.GMEvent(str)
coroutine.wait(0.1)
end
LogGreen("英雄批量生成完成")
end)
end
-- 设置孙龙积分
function this.SetSunLongScroe(text)
TreasureOfSomebodyManagerV2.SetCurrentLevel(tonumber(text))
@ -178,6 +211,7 @@ end
function this.AddHoly(text)
local command = "//addholy %s %s"
command = string.format(command, PlayerManager.uid, text)
Log(command)
ChatManager.RequestGMCommand(command)
end