Weather
Target value
Calculation
int32_t CalculateTarget(int32_t unixSeconds) {
// Get Eorzea hour for weather start
int32_t bell = unixSeconds / 175;
// For these calculations, 16:00 is 0, 00:00 is 8 and 08:00 is 16.
// This rotates the time accordingly and holds onto the leftover time
// to add back in later on.
uint32_t increment = ((uint32_t)(bell + 8 - (bell % 8))) % 24;
// Take Eorzea days since the unix epoch
uint32_t totalDays = (uint32_t)(unixSeconds / 4200);
uint32_t calcBase = (totalDays * 0x64) + increment;
uint32_t step1 = (calcBase << 0xB) ^ calcBase;
uint32_t step2 = (step1 >> 8) ^ step1;
return (int32_t)(step2 % 0x64);
}Weather lookup
Retrieving the weather for a zone by zone name
Remarks
Last updated
Was this helpful?