|
|
@@ -50,6 +50,20 @@ local function WeekActHeroStar_GetHeroID(human)
|
|
|
return human.db.nWeekHeroID
|
|
|
end
|
|
|
|
|
|
+-- 重置选择的英雄最大星数
|
|
|
+local function WeekActHeroStar_RestHeroStar(human)
|
|
|
+ human.db.nWeekHeroStar = 0
|
|
|
+end
|
|
|
+
|
|
|
+-- 设置当前英雄最大星数
|
|
|
+local function WeekActHeroStar_SetHeroStar(human, nStar)
|
|
|
+ human.db.nWeekHeroStar = math.max(human.db.nWeekHeroStar, nStar)
|
|
|
+end
|
|
|
+
|
|
|
+local function WeekActHeroStar_GetHeroStar(human)
|
|
|
+ return human.db.nWeekHeroStar
|
|
|
+end
|
|
|
+
|
|
|
-- 设置英雄ID
|
|
|
local function WeekActHeroStar_SetHeroID(human, nHeroID)
|
|
|
if not human or not nHeroID then
|
|
|
@@ -58,6 +72,7 @@ local function WeekActHeroStar_SetHeroID(human, nHeroID)
|
|
|
end
|
|
|
|
|
|
human.db.nWeekHeroID = nHeroID
|
|
|
+ WeekActHeroStar_RestHeroStar(human)
|
|
|
end
|
|
|
|
|
|
-- 初始化奖励信息
|
|
|
@@ -176,6 +191,8 @@ function WeekActHeroStar_End(human)
|
|
|
local senderName = tMailConfig.senderName
|
|
|
MailManager.add(MailManager.SYSTEM, human.db._id, title, content, items, senderName)
|
|
|
|
|
|
+ WeekActHeroStar_RestHeroStar(human)
|
|
|
+
|
|
|
print("[WeekActHeroStar_End] 英雄升星 活动结束处理完成")
|
|
|
end
|
|
|
|
|
|
@@ -361,6 +378,27 @@ function WeekActHeroStar_HeroStarUp(human, nHeroID, nStar)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+ WeekActHeroStar_SetHeroStar(human, nStar)
|
|
|
WeekActHeroStar_Query(human)
|
|
|
WeekendLoopActManger.WeekLoopACT_SendActInfo(human)
|
|
|
+end
|
|
|
+
|
|
|
+function onLogin(human)
|
|
|
+ if not human.db.nWeekHeroID or not human.db.nWeekHeroStar or not human.db.tWeekHeroPrize then
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+ local tConfig = WeekActHeroStar_GetConfig()
|
|
|
+ local nNowStar = WeekActHeroStar_GetHeroStar()
|
|
|
+ if tConfig then
|
|
|
+ for nID, v in pairs(tConfig) do
|
|
|
+ if nNowStar >= nID then
|
|
|
+ local nStatus = WeekActHeroStar_GetPrizeStatus(human, nID)
|
|
|
+ if WeekLoopActDef.WEEKACT_STATE_NONE == nStatus then
|
|
|
+ WeekActHeroStar_SetPrizeStatus(human, nID, WeekLoopActDef.WEEKACT_STATE_CANGET)
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
end
|