diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index 6e9eb4aaa..2a38069ab 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -331,6 +331,12 @@ public class Player { if (this.playerGameTime == gameTime) return; this.playerGameTime = gameTime; + // Trigger the script event for game time update. + var questManager = this.getQuestManager(); + questManager.queueEvent(QuestCond.QUEST_COND_IS_DAYTIME); + questManager.queueEvent(QuestCond.QUEST_COND_TIME_VAR_GT_EQ); + questManager.queueEvent(QuestCond.QUEST_COND_TIME_VAR_PASS_DAY); + this.save(); } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSkipPlayerGameTimeReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSkipPlayerGameTimeReq.java index 398a76583..acd209289 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSkipPlayerGameTimeReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSkipPlayerGameTimeReq.java @@ -14,7 +14,9 @@ public class HandlerSkipPlayerGameTimeReq extends PacketHandler { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { var req = SkipPlayerGameTimeReqOuterClass.SkipPlayerGameTimeReq.parseFrom(payload); var player = session.getPlayer(); - player.updatePlayerGameTime(req.getGameTime()); + + var newTime = req.getGameTime() * 1000L; + player.updatePlayerGameTime(newTime); player.getScene().broadcastPacket(new PacketPlayerGameTimeNotify(player)); player.sendPacket(new PacketSkipPlayerGameTimeRsp(req)); }