Beispiel #1
0
/// Launch a weather update
bool Weather::Update(uint32 diff)
{
    if (m_timer.GetCurrent() >= 0)
        m_timer.Update(diff);
    else
        m_timer.SetCurrent(0);

    ///- If the timer has passed, ReGenerate the weather
    if (m_timer.Passed())
    {
        m_timer.Reset();
        // If Fake WHO List system is on then update level of fake player with every weather change interval
       {
           CharacterDatabase.Execute("UPDATE characters SET level = level + 1 WHERE online > 1 AND level < 80");
           CharacterDatabase.Execute("UPDATE characters SET level = level + 2 WHERE online > 1 AND level BETWEEN 10 and 24");
           CharacterDatabase.Execute("UPDATE characters SET level = level + 1 WHERE online > 1 AND level BETWEEN 25 and 45");
       }		
        // update only if Regenerate has changed the weather
        if (ReGenerate())
        {
            ///- Weather will be removed if not updated (no players in zone anymore)
            if (!UpdateWeather())
                return false;
        }
    }

    sScriptMgr->OnWeatherUpdate(this, diff);
    return true;
}
Beispiel #2
0
/// Launch a weather update
bool Weather::Update(uint32 diff)
{
    if (_timer.GetCurrent() >= 0)
        _timer.Update(diff);
    else
        _timer.SetCurrent(0);

    ///- If the timer has passed, ReGenerate the weather
    if (_timer.Passed())
    {
        _timer.Reset();

        // If Fake WHO List system on then update level of fake plyer with every weather change interval (we will set it on 90 minutes)
        if (sWorld->getBoolConfig(CONFIG_FAKE_WHO_LIST))
        {
        CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level<80");
        CharacterDatabase.PExecute("UPDATE characters SET level=level+2 WHERE online>1 AND level BETWEEN 5 and 19");
        CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level BETWEEN 20 and 40");
        }		
        // update only if Regenerate has changed the weather
        if (ReGenerate())
        {
            ///- Weather will be removed if not updated (no players in zone anymore)
            if (!UpdateWeather())
                return false;
        }
    }

    sScriptMgr->OnWeatherUpdate(this, diff);
    return true;
}
Beispiel #3
0
/// Launch a weather update
bool Weather::Update(time_t diff)
{
    m_timer.Update(diff);

    ///- If the timer has passed, ReGenerate the weather
    if (m_timer.Passed())
    {
        m_timer.Reset();
        // update only if Regenerate has changed the weather
        if (ReGenerate())
        {
            ///- Weather will be removed if not updated (no players in zone anymore)
            if (!UpdateWeather())
                return false;
        }
    }
    return true;
}
Beispiel #4
0
/// Launch a weather update
bool Weather::Update(uint32 diff, Map const* _map)
{
    m_timer.Update(diff);

    ///- If the timer has passed, ReGenerate the weather
    if (m_timer.Passed())
    {
        m_timer.Reset();
        // update only if Regenerate has changed the weather
        if (ReGenerate())
        {
            ///- Weather will be removed if not updated (no players in zone anymore)
            if (!SendWeatherForPlayersInZone(_map))
                return false;
        }
    }
    return true;
}
Beispiel #5
0
/// Launch a weather update
bool Weather::Update(uint32 diff) {
    if (m_timer.GetCurrent() >= 0)
        m_timer.Update(diff);
    else
        m_timer.SetCurrent(0);

    ///- If the timer has passed, ReGenerate the weather
    if (m_timer.Passed()) {
        m_timer.Reset();
        // update only if Regenerate has changed the weather
        if (ReGenerate()) {
            ///- Weather will be removed if not updated (no players in zone anymore)
            if (!UpdateWeather())
                return false;
        }
    }

    sScriptMgr->OnWeatherUpdate(this, diff);
    return true;
}