|
@@ -351,6 +351,23 @@ function d3.vipexp(human, val)
|
|
|
VipLogic.addExp(human, val)
|
|
VipLogic.addExp(human, val)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+-- 设置玩家年龄(测试充值限额):1=8岁以下 2=8~16岁 3=16~18岁 4=18岁以上
|
|
|
|
|
+function d3.age(human, val)
|
|
|
|
|
+ local ageType = tonumber(val)
|
|
|
|
|
+ if not ageType or ageType < 1 or ageType > 4 then
|
|
|
|
|
+ return Broadcast.sendErr(human, "参数错误:1=8岁以下 2=8~16岁 3=16~18岁 4=18岁以上")
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ local ageMap = {[1] = 7, [2] = 10, [3] = 17, [4] = 18}
|
|
|
|
|
+ human.db.age = ageMap[ageType]
|
|
|
|
|
+
|
|
|
|
|
+ local AgeLimitLogic = require("topup.AgeLimitLogic")
|
|
|
|
|
+ if human.fd then
|
|
|
|
|
+ AgeLimitLogic.query(human)
|
|
|
|
|
+ end
|
|
|
|
|
+ Broadcast.sendErr(human, "年龄已设置为" .. human.db.age .. "岁")
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
function d3.it1(human, value)
|
|
function d3.it1(human, value)
|
|
|
value = tonumber(value)
|
|
value = tonumber(value)
|
|
|
if not value then return end
|
|
if not value then return end
|
|
@@ -1239,6 +1256,33 @@ function d3.updaily(human)
|
|
|
ObjHuman.updateDaily(human, true)
|
|
ObjHuman.updateDaily(human, true)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+-- 模拟跨月,重置月累充等跨月数据
|
|
|
|
|
+function d3.kuayue(human)
|
|
|
|
|
+ local oldMonthTopup = human.db.topupAccountMonth or 0
|
|
|
|
|
+
|
|
|
|
|
+ local t = os.date("*t")
|
|
|
|
|
+ t.month = t.month - 1
|
|
|
|
|
+ if t.month <= 0 then
|
|
|
|
|
+ t.month = 12
|
|
|
|
|
+ t.year = t.year - 1
|
|
|
|
|
+ end
|
|
|
|
|
+ human.db.update_daily_time = os.time(t)
|
|
|
|
|
+
|
|
|
|
|
+ -- 跨月重置月累充,与 ObjHuman.updateDaily 保持一致
|
|
|
|
|
+ if human.db.update_daily_time and Util.isSameMonth(human.db.update_daily_time) ~= true then
|
|
|
|
|
+ human.db.topupAccountMonth = nil
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ ObjHuman.updateDaily(human, true)
|
|
|
|
|
+
|
|
|
|
|
+ local AgeLimitLogic = require("topup.AgeLimitLogic")
|
|
|
|
|
+ if human.fd then
|
|
|
|
|
+ AgeLimitLogic.query(human)
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ send(human, string.format("跨月成功,月累充 %d -> %d", oldMonthTopup, human.db.topupAccountMonth or 0))
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
function d3.clguide(human)
|
|
function d3.clguide(human)
|
|
|
human.db.noguide = nil
|
|
human.db.noguide = nil
|
|
|
human.db.guide = nil
|
|
human.db.guide = nil
|
|
@@ -2135,6 +2179,68 @@ function d3.dayaddHuoYue(human, nNum)
|
|
|
day.Gm_AddHuoYue(human, nNum)
|
|
day.Gm_AddHuoYue(human, nNum)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+-- 批量获取英雄:getAllHero [星级] [等级] [grade] [camp]
|
|
|
|
|
+-- 星级/等级/camp 未填时使用默认值;grade 未填时增加 grade>=4 的英雄,填写时按 grade 精确匹配
|
|
|
|
|
+function d3.getAllHero(human, val)
|
|
|
|
|
+ val = val or ""
|
|
|
|
|
+ local tb = Util.split(val, " ")
|
|
|
|
|
+ local HeroLogic = require("hero.HeroLogic")
|
|
|
|
|
+ local HERO_MAX_STAR = 20
|
|
|
|
|
+ local DEFAULT_MAX_LV = 9999
|
|
|
|
|
+
|
|
|
|
|
+ local star
|
|
|
|
|
+ if tb[1] == nil or tb[1] == "" then
|
|
|
|
|
+ star = HERO_MAX_STAR
|
|
|
|
|
+ else
|
|
|
|
|
+ star = tonumber(tb[1])
|
|
|
|
|
+ if not star or star <= 0 then
|
|
|
|
|
+ return Broadcast.sendErr(human, "星级参数错误,必须大于0")
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ local lv
|
|
|
|
|
+ if tb[2] == nil or tb[2] == "" then
|
|
|
|
|
+ lv = DEFAULT_MAX_LV
|
|
|
|
|
+ else
|
|
|
|
|
+ lv = tonumber(tb[2])
|
|
|
|
|
+ if not lv or lv <= 0 then
|
|
|
|
|
+ return Broadcast.sendErr(human, "等级参数错误,必须大于0")
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ local useDefaultGrade = (tb[3] == nil or tb[3] == "")
|
|
|
|
|
+ local grade
|
|
|
|
|
+ if not useDefaultGrade then
|
|
|
|
|
+ grade = tonumber(tb[3])
|
|
|
|
|
+ if not grade or grade <= 0 or grade > 5 then
|
|
|
|
|
+ return Broadcast.sendErr(human, "grade参数错误,必须在1~5之间")
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ local camp
|
|
|
|
|
+ if tb[4] ~= nil and tb[4] ~= "" then
|
|
|
|
|
+ camp = tonumber(tb[4])
|
|
|
|
|
+ if not camp or camp < 1 or camp > 5 then
|
|
|
|
|
+ return Broadcast.sendErr(human, "种族参数错误,必须在1~5之间")
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ local addCnt = 0
|
|
|
|
|
+ for id, hero in pairs(HeroTable) do
|
|
|
|
|
+ local gradeMatch
|
|
|
|
|
+ if useDefaultGrade then
|
|
|
|
|
+ gradeMatch = hero.grade >= 4
|
|
|
|
|
+ else
|
|
|
|
|
+ gradeMatch = hero.grade == grade
|
|
|
|
|
+ end
|
|
|
|
|
+ local campMatch = not camp or hero.camp == camp
|
|
|
|
|
+ if gradeMatch and campMatch then
|
|
|
|
|
+ d3.heroadd(human, string.format("%d %d %d %d", id, 1, lv, star))
|
|
|
|
|
+ addCnt = addCnt + 1
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
local allHeroIds= {}
|
|
local allHeroIds= {}
|
|
|
-- 一键获取所有资源--
|
|
-- 一键获取所有资源--
|
|
|
function d3.getAll(human)
|
|
function d3.getAll(human)
|
|
@@ -2148,6 +2254,7 @@ function d3.getAll(human)
|
|
|
d3.heroadd(human, val)
|
|
d3.heroadd(human, val)
|
|
|
end
|
|
end
|
|
|
local items = {
|
|
local items = {
|
|
|
|
|
+ {31,999999},
|
|
|
{101, 1000000000},
|
|
{101, 1000000000},
|
|
|
{111, 1000000000},
|
|
{111, 1000000000},
|
|
|
{112, 1000000},
|
|
{112, 1000000},
|