EdenServer / community

35 stars 16 forks source link

Odqan spawn position and weather #820

Closed rujind closed 3 years ago

rujind commented 5 years ago

Don't think Odqan spawns in more than 1 spot. He should have multiple spawn areas. I've also seen him up during thunder weather which I don't think is supposed to be possible (he should despawn when fog despawns and I'm pretty sure the game considers fog to be a type of weather, meaning it can't be up at the same time as any other weather).

slassen commented 5 years ago

Thanks! I believe he is a unique weather NM in regards that he only spawns during fog but can stay up after. Do you remember if you saw him despawn in retail? Multiple spawn spots are problably not coded so I’ll do that.

Elysien commented 5 years ago

As with all the clusters in the area (minus riverine), they will despawn if there is no fog present. This of course includes Odqan. If Odqan despawns as a result of no weather, it will respawn on the next 100%---it's timer shall not reset. (Incidentally, but also not all that important, the normal clusters in the area are always up regards of weather; should spawn during fog only, and despawn in the absence of it).

It would also seem fog weather is too much of a common occurrence, while it wasn't too rare, it did not happen almost every morning as appears to be the case on Eden currently.

rujind commented 5 years ago

Here's the weather and fog code for DSP. It seems to be written that fog can only occur between 2-7, is this normal?

void CZone::UpdateWeather() { uint32 CurrentVanaDate = CVanaTime::getInstance()->getDate(); // Current Vanadiel timestamp in minutes uint32 StartFogVanaDate = (CurrentVanaDate - (CurrentVanaDate % VTIME_DAY)) + (VTIME_HOUR 2); // Vanadiel timestamp of 2 AM in minutes uint32 EndFogVanaDate = StartFogVanaDate + (VTIME_HOUR 5); // Vanadiel timestamp of 7 AM in minutes uint32 WeatherNextUpdate = 0; uint32 WeatherDay = 0; uint8 WeatherChance = 0;

// Random time between 3 minutes and 30 minutes for the next weather change
WeatherNextUpdate = (dsprand::GetRandomNumber(180, 1801));

// Find the timestamp since the start of vanadiel
WeatherDay = CVanaTime::getInstance()->getVanaTime();

// Calculate what day we are on since the start of vanadiel time
// 1 Vana'diel Day = 57 minutes 36 seconds or 3456 seconds
WeatherDay = WeatherDay / 3456;

// The weather starts over again every 2160 days
WeatherDay = WeatherDay % WEATHER_CYCLE;

// Get a random number to determine which weather effect we will use
WeatherChance = dsprand::GetRandomNumber(100);

zoneWeather_t&& weatherType = zoneWeather_t(0, 0, 0);

for (auto& weather : m_WeatherVector)
{
    if (weather.first > WeatherDay)
    {
        break;
    }
    weatherType = weather.second;
}

uint8 Weather = 0;

// 15% chance for rare weather, 35% chance for common weather, 50% chance for normal weather
// * Percentages were generated from a 6 hour sample and rounded down to closest multiple of 5*
if (WeatherChance < 15) //15% chance to have the weather_rare
{
    Weather = weatherType.rare;
}
else if (WeatherChance < 50) // 35% chance to have weather_common
{
    Weather = weatherType.common;
}
else
{
    Weather = weatherType.normal;
}

// Fog in the morning between the hours of 2 and 7 if there is not a specific elemental weather to override it
if ((CurrentVanaDate >= StartFogVanaDate) && (CurrentVanaDate < EndFogVanaDate) && (Weather < WEATHER_HOT_SPELL) && (GetType() > ZONETYPE_CITY))
{
    Weather = WEATHER_FOG;
    //Force the weather to change by 7 am
    //  2.4 vanadiel minutes = 1 earth second
    WeatherNextUpdate = (uint32)((EndFogVanaDate - CurrentVanaDate) * 2.4);
}

SetWeather((WEATHER)Weather);
luautils::OnZoneWeatherChange(GetID(), Weather);

//ShowDebug(CL_YELLOW"Zone::zone_update_weather: Weather of %s updated to %u\n" CL_RESET, PZone->GetName(), Weather);

CTaskMgr::getInstance()->AddTask(new CTaskMgr::CTask("zone_update_weather",
    server_clock::now() + std::chrono::seconds(WeatherNextUpdate), this, CTaskMgr::TASK_ONCE, zone_update_weather));

}

Elysien commented 5 years ago

That is correct, fog only occurs in the morning timeframe. Additionally, fog has a very high chance of occurring after a gloom (dark weather), which should only happen at night, and fade by morning. Dark weather should be a bit of a rarity though.

Mozzy4Ever commented 5 years ago

Just wanted to follow up on this:

According to https://ffxiclopedia.fandom.com/wiki/Odqan and https://ffxiclopedia.fandom.com/wiki/Category%3AWeather , fog weather isn't -restricted- to 2-7. It's just much more likely to be during that timeframe.

FFXI wiki shows him as having 3 different spawn locations, but that's obviously incorrect per http://www.ffxidb.com/zones/25/odqan (which pulls directly from the game itself via addon, not user-created entries). Currently still only spawns in 1 position from what I've seen.

rude-jerk commented 3 years ago

Resolved in patch on February 1, 2021.