This commit is contained in:
lenheart
2025-04-21 13:36:35 +08:00
parent eeb773e723
commit 2ef9cfef42
87 changed files with 2134 additions and 765 deletions

View File

@@ -0,0 +1,11 @@
{
"ProjectName": "整点在线奖励",
"ProjectDescribe": "可以设置某一个时间点 全服发放奖励",
"ProjectAuthor": "凌众",
"ProjectVersion": 1.2,
"ProjectConfig": "整点在线奖励_Lenheart.json",
"ProjectFiles": [
"整点在线奖励.nut"
],
"ProjectRunFunc": "_Dps_TimeReward_identifying_Main_"
}

View File

@@ -0,0 +1,29 @@
_TimeReward_identifying_Rindro_ <- 0;
function _Dps_TimeReward_identifying_Main_() {
Cb_timer_dispatch_Func.Time <- function() {
local Config = GlobalConfig.Get("整点在线奖励_Lenheart.json");
local DateObj = date();
local HourminTime = DateObj.hour + ":" + DateObj.min;
if (!(HourminTime in Config["奖励时间和内容"])) {
_TimeReward_identifying_Rindro_ = 0;
return;
}
if (_TimeReward_identifying_Rindro_ != 0) {
return;
}
_TimeReward_identifying_Rindro_ = 1;
local reward = Config["奖励时间和内容"][HourminTime];
local users = World.GetOnlinePlayer();
users.apply(function(SUser) {
foreach(itemR in reward) {
SUser.GiveItem(itemR[0], itemR[1]);
}
});
World.SendNotiPacketMessage(format(Config["公告"], HourminTime), 14);
};
}