13
13
14
14
static bool stimeistime_enable,
15
15
stimeistime_announce;
16
- static float stimeistime_speed_rate;
16
+ static float stimeistime_speed_rate,
17
+ stimeistime_hour_offset;
18
+ static uint32 stimeistime_time_start;
17
19
18
20
class TimeIsTimeBeforeConfigLoad : public WorldScript {
19
21
public:
@@ -24,6 +26,8 @@ class TimeIsTimeBeforeConfigLoad : public WorldScript {
24
26
stimeistime_enable = sConfigMgr ->GetBoolDefault (" TimeIsTime.Enable" , true );
25
27
stimeistime_announce = sConfigMgr ->GetBoolDefault (" TimeIsTime.Announce" , true );
26
28
stimeistime_speed_rate = sConfigMgr ->GetFloatDefault (" TimeIsTime.SpeedRate" , 1.0 );
29
+ stimeistime_hour_offset = sConfigMgr ->GetFloatDefault (" TimeIsTime.HourOffset" , 1.0 );
30
+ stimeistime_time_start = sConfigMgr ->GetIntDefault (" TimeIsTime.TimeStart" , 1.0 );
27
31
}
28
32
};
29
33
@@ -41,10 +45,17 @@ class TimeIsTime : public PlayerScript {
41
45
if (!stimeistime_enable)
42
46
return ;
43
47
44
- uint32 speed_time = ((sWorld ->GetGameTime () - sWorld ->GetUptime ()) + (sWorld ->GetUptime () * stimeistime_speed_rate));
48
+ uint32 speed_time = ((sWorld ->GetGameTime () - sWorld ->GetUptime ()) + (sWorld ->GetUptime () * stimeistime_speed_rate));
49
+ float hour_offset = stimeistime_hour_offset * 3600 ;
50
+ uint32 time_start = stimeistime_time_start + hour_offset;
45
51
46
52
data.Initialize (SMSG_LOGIN_SETTIMESPEED, 4 + 4 + 4 );
47
- data.AppendPackedTime (speed_time);
53
+ if (stimeistime_time_start > 0 ) {
54
+ data.AppendPackedTime (time_start);
55
+ }
56
+ else {
57
+ data.AppendPackedTime (speed_time);
58
+ }
48
59
data << float (0 .01666667f ) * stimeistime_speed_rate;
49
60
data << uint32 (0 );
50
61
0 commit comments