diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index ab2738c..8778f25 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -30,6 +30,20 @@ function _M.hero(role, pms) return "成功" end +table.insert(helpDes, {"角色升级" , "herol", "角色类型", "增加等级"}) +function _M.herol(role, pms) + local heroType = tonum(pms.pm1) + local addLevel = tonum(pms.pm2) + local hero = role.heros[heroType] + if not hero or hero:getProperty("level") >= hero:getMaxLevel() then + return "失败" + end + addLevel = math.min(hero:getMaxLevel() - hero:getProperty("level"), addLevel) + hero:updateProperty({field = "level", delta = addLevel}) + role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) + return "成功" +end + table.insert(helpDes, {"获得装备" , "equip", "装备类型" , "装备等级", "装备个数"}) function _M.equip(role, pms) local typ = tonum(pms.pm1) -- libgit2 0.21.2