Esempio n. 1
0
void BattlegroundDS::Update (uint32 diff)
{
    Battleground::Update(diff);

    if (GetStatus() == STATUS_IN_PROGRESS)
    {
        if (GetStartTime() >= 47 * MINUTE * IN_MILLISECONDS)          // after 47 minutes without one team losing, the arena closes with no winner and no rating change
        {
            UpdateArenaWorldState();
            CheckArenaAfterTimerConditions();
        }
    }

    if (getWaterFallTimer() < diff)
    {
        if (isWaterFallActive())
        {
            setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));
            for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                SpawnBGObject(i, getWaterFallTimer());
            setWaterFallActive(false);
        }
        else
        {
            setWaterFallTimer(BG_DS_WATERFALL_DURATION);
            for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                SpawnBGObject(i, RESPAWN_IMMEDIATELY);
            setWaterFallActive(true);
        }
    }
    else
        setWaterFallTimer(getWaterFallTimer() - diff);
}
Esempio n. 2
0
void BattlegroundDS::Update(uint32 diff)
{
    Battleground::Update(diff);

    if (GetStatus() == STATUS_IN_PROGRESS)
    {
        if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change
        {
            UpdateArenaWorldState();
            CheckArenaAfterTimerConditions();
        }
    }

    if (getWaterFallTimer() < diff)
    {
        if (GetBgMap(false))
            if (isWaterFallActive())
            {
                setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));
                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                    SpawnBGObject(i, getWaterFallTimer());
                setWaterFallActive(false);
            }
            else
            {
                setWaterFallTimer(BG_DS_WATERFALL_DURATION);
                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                    SpawnBGObject(i, RESPAWN_IMMEDIATELY);
                setWaterFallActive(true);
            }
    }
    else
        setWaterFallTimer(getWaterFallTimer() - diff);

    if (GetStatus() == STATUS_IN_PROGRESS)
    {
        if(m_knockback < diff && m_knockbackCheck)
        {
            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); itr++)
            {
                Player * plr = sObjectMgr->GetPlayer(itr->first);
                if (plr->GetTeam() == ALLIANCE && plr->GetDistance2d(1214, 765) <= 50 && plr->GetPositionZ() > 10)
                    KnockBackPlayer(plr, 6.15f, 50.00f, 7.00f);
                if (plr->GetTeam() == HORDE && plr->GetDistance2d(1369, 817) <= 50 && plr->GetPositionZ() > 10)
                    KnockBackPlayer(plr, 3.10f, 50.00f, 7.00f);
                plr->RemoveAurasDueToSpell(48018);
            }
            m_knockbackCheck = false;
        } else m_knockback -= diff;
    }
}
void BattlegroundDS::PostUpdateImpl(uint32 diff)
{
    if (getWaterFallTimer() < diff)
    {
        if (isWaterFallActive())
        {
            setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));
            for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                SpawnBGObject(i, getWaterFallTimer());
            setWaterFallActive(false);
        }
        else
        {
            setWaterFallTimer(BG_DS_WATERFALL_DURATION);
            for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                SpawnBGObject(i, RESPAWN_IMMEDIATELY);
            setWaterFallActive(true);
        }
    }
    else
        setWaterFallTimer(getWaterFallTimer() - diff);

    if (GetStatus() == STATUS_IN_PROGRESS)
    {
        if(m_knockback < diff && m_knockbackCheck)
        {
            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); itr++)
            {
                Player * plr = sObjectMgr->GetPlayerByLowGUID(itr->first);
                if(plr)
                {
                    if (plr->GetTeam() == ALLIANCE && plr->GetDistance2d(1214, 765) <= 50 && plr->GetPositionZ() > 10)
                        KnockBackPlayer(plr, 6.15f, 50.00f, 7.00f);
                    if (plr->GetTeam() == HORDE && plr->GetDistance2d(1369, 817) <= 50 && plr->GetPositionZ() > 10)
                        KnockBackPlayer(plr, 3.10f, 50.00f, 7.00f);

                    if(plr->HasAura(SPELL_DEMONIC_CIRCLE))
                        plr->RemoveAurasDueToSpell(SPELL_DEMONIC_CIRCLE);
                }
            }
            m_knockbackCheck = false;
        } else m_knockback -= diff;
    }
}
Esempio n. 4
0
void BattlegroundDS::PostUpdateImpl(uint32 diff)
{
        if (GetStartTime() >= 75*IN_MILLISECONDS)
        {
            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)
            {
                Player *plr = ObjectAccessor::FindPlayer(itr->first);
                if (plr && plr->isAlive() && plr->GetPositionX() < 1260 && plr->GetPositionY() >755 && plr->GetPositionY() < 775 && plr->GetPositionZ() > 13)
                {
                    KnockBackPlayer(plr, 6.15f, 50.00f, 5.00f);
                    plr->RemoveAurasDueToSpell(48018);
                } 
                if (plr && plr->isAlive() && plr->GetPositionX() > 1330 && plr->GetPositionY() >805 && plr->GetPositionY() < 825 && plr->GetPositionZ() > 13)
                {
                    KnockBackPlayer(plr, 3.10f, 50.00f, 5.00f);
                    plr->RemoveAurasDueToSpell(48018);
                }
            }
        }

        if (getWaterFallTimer() < diff)
        {
            if (isWaterFallActive())
            {
                setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));
                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                    SpawnBGObject(i, getWaterFallTimer());
                setWaterFallActive(false);
            }
            else
            {
                setWaterFallTimer(BG_DS_WATERFALL_DURATION);
                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                    SpawnBGObject(i, RESPAWN_IMMEDIATELY);
                setWaterFallActive(true);
            }
        }
        else
            setWaterFallTimer(getWaterFallTimer() - diff);
}
Esempio n. 5
0
void BattlegroundDS::PostUpdateImpl(uint32 diff)
{
    if (getWaterFallTimer() < diff)
    {
        if (isWaterFallActive())
        {
            setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));
            for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                SpawnBGObject(i, getWaterFallTimer());
            setWaterFallActive(false);
        }
        else
        {
            setWaterFallTimer(BG_DS_WATERFALL_DURATION);
            for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                SpawnBGObject(i, RESPAWN_IMMEDIATELY);
            setWaterFallActive(true);
        }
    }
    else
        setWaterFallTimer(getWaterFallTimer() - diff);
}