示例#1
0
void OutdoorPvPTF::Update(uint32 diff)
{
    if (m_zoneLockTimer)
    {
        if (m_zoneLockTimer < diff)
        {
            UnlockZone();
            m_zoneLockTimer = 0;
        }
        else
        {
            // update timer - if OutdoorPvPMgr update timer interval needs to be lowered replace this line with the commented-out ones below
            UpdateTimerWorldState();

            /*if (m_zoneUpdateTimer < diff)
            {
                // update timer
                UpdateTimerWorldState();
                m_zoneUpdateTimer = TIMER_TF_UPDATE_TIME;
            }
            else
                m_zoneUpdateTimer -= diff;*/

            m_zoneLockTimer -= diff;
        }
    }
}
示例#2
0
void OutdoorPvPTF::FillInitialWorldStates(uint32 zoneId)
{
    if (m_zoneWorldState == WORLD_STATE_TF_TOWERS_CONTROLLED)
    {
        FillInitialWorldState(zoneId, WORLD_STATE_TF_TOWER_COUNT_H, m_towersHorde);
        FillInitialWorldState(zoneId, WORLD_STATE_TF_TOWER_COUNT_A, m_towersAlliance);
    }
    else
        UpdateTimerWorldState();
}
示例#3
0
void OutdoorPvPTF::ProcessCaptureEvent(GameObject* pGo, uint32 uiTowerId, Team team, uint32 uiNewWorldState)
{
    if (team != TEAM_NONE)
    {
        if (team == ALLIANCE)
        {
            SetBannerVisual(pGo, CAPTURE_ARTKIT_ALLIANCE, CAPTURE_ANIM_ALLIANCE);
            ++m_uiTowersAlliance;
        }
        else
        {
            SetBannerVisual(pGo, CAPTURE_ARTKIT_HORDE, CAPTURE_ANIM_HORDE);
            ++m_uiTowersHorde;
        }

        // if all towers are captured then process event
        if (m_uiTowersAlliance == MAX_TF_TOWERS || m_uiTowersHorde == MAX_TF_TOWERS)
        {
            SendUpdateWorldState(m_uiZoneWorldState, WORLD_STATE_REMOVE);
            m_uiZoneWorldState = team == ALLIANCE ? WORLD_STATE_TF_LOCKED_ALLIANCE : WORLD_STATE_TF_LOCKED_HORDE;
            SendUpdateWorldState(m_uiZoneWorldState, WORLD_STATE_ADD);

            m_uiZoneLockTimer = TIMER_TF_LOCK_TIME;
            UpdateTimerWorldState();

            m_zoneOwner = team;
            BuffTeam(team, SPELL_AUCHINDOUN_BLESSING);

            // lock the towers
            LockTowers(pGo);
        }
    }
    else
    {
        SetBannerVisual(pGo, CAPTURE_ARTKIT_NEUTRAL, CAPTURE_ANIM_NEUTRAL);

        if (m_capturePointOwner[uiTowerId] == ALLIANCE)
            --m_uiTowersAlliance;
        else
            --m_uiTowersHorde;
    }

    // update tower state
    SendUpdateWorldState(m_uiTowerWorldState[uiTowerId], WORLD_STATE_REMOVE);
    m_uiTowerWorldState[uiTowerId] = uiNewWorldState;
    SendUpdateWorldState(m_uiTowerWorldState[uiTowerId], WORLD_STATE_ADD);

    // update tower count
    SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_A, m_uiTowersAlliance);
    SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_H, m_uiTowersHorde);

    // update capture point owner
    m_capturePointOwner[uiTowerId] = team;

}
示例#4
0
void WorldPvPTF::Update(uint32 diff)
{
    if (m_uiZoneLockTimer)
    {
        if (m_uiZoneLockTimer < diff)
        {
            // remove buffs
            DoProcessTeamBuff(ALLIANCE, SPELL_AUCHINDOUN_BLESSING, true);
            DoProcessTeamBuff(HORDE, SPELL_AUCHINDOUN_BLESSING, true);

            // reset world states and towers
            UpdateWorldState(0);
            m_uiZoneController = NEUTRAL;
            m_uiControllerWorldState = WORLD_STATE_TF_TOWERS_CONTROLLED;
            m_uiTowersAlly = 0;
            m_uiTowersHorde = 0;
            m_uiTowerWorldState[0] = WORLD_STATE_TOWER_1_NEUTRAL;
            m_uiTowerWorldState[1] = WORLD_STATE_TOWER_2_NEUTRAL;
            m_uiTowerWorldState[2] = WORLD_STATE_TOWER_3_NEUTRAL;
            m_uiTowerWorldState[3] = WORLD_STATE_TOWER_4_NEUTRAL;
            m_uiTowerWorldState[4] = WORLD_STATE_TOWER_5_NEUTRAL;
            UpdateWorldState(1);

            // update towers count
            SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_A, m_uiTowersAlly);
            SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_H, m_uiTowersHorde);

            for (uint8 i = 0; i < MAX_TF_TOWERS; ++i)
            {
                SetBannerArtKit(m_TowerBannerGUID[i], GO_ARTKIT_BANNER_NEUTRAL);
                // if grid is unloaded the slider reset is enough
                ResetCapturePoint(aTerokkarTowers[i], CAPTURE_SLIDER_NEUTRAL);
                // if grid is not unloaded then reset the tower manually
                DoResetCapturePoints(m_TowerBannerGUID[i]);
                LockCapturePoint(aTerokkarTowers[i], false);
            }

            m_uiZoneLockTimer = 0;
        }
        else
        {
            if (m_uiZoneUpdateTimer < diff)
            {
                // update timer
                UpdateTimerWorldState();

                m_uiZoneUpdateTimer = TIMER_TF_UPDATE_TIME;
            }
            else
                m_uiZoneUpdateTimer -= diff;

            m_uiZoneLockTimer -= diff;
        }
    }
}
示例#5
0
void OutdoorPvPTF::Update(uint32 diff)
{
    if (m_uiZoneLockTimer)
    {
        if (m_uiZoneLockTimer < diff)
        {
            // remove buffs
            BuffTeam(m_zoneOwner, SPELL_AUCHINDOUN_BLESSING, true);

            // reset world states and towers
            UpdateWorldState(WORLD_STATE_REMOVE);
            m_zoneOwner = TEAM_NONE;
            m_uiZoneWorldState = WORLD_STATE_TF_TOWERS_CONTROLLED;
            m_uiTowersAlliance = 0;
            m_uiTowersHorde = 0;
            m_uiTowerWorldState[0] = WORLD_STATE_TOWER_1_NEUTRAL;
            m_uiTowerWorldState[1] = WORLD_STATE_TOWER_2_NEUTRAL;
            m_uiTowerWorldState[2] = WORLD_STATE_TOWER_3_NEUTRAL;
            m_uiTowerWorldState[3] = WORLD_STATE_TOWER_4_NEUTRAL;
            m_uiTowerWorldState[4] = WORLD_STATE_TOWER_5_NEUTRAL;
            UpdateWorldState(WORLD_STATE_ADD);

            // update tower count
            SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_A, m_uiTowersAlliance);
            SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_H, m_uiTowersHorde);

            for (PlayerSet::iterator itr = m_sZonePlayers.begin(); itr != m_sZonePlayers.end(); ++itr)
            {
                if ((*itr) && (*itr)->isAlive())
                {
                    ResetTowers((*itr));
                    break;
                }
            }

            m_uiZoneLockTimer = 0;
        }
        else
        {
            if (m_uiZoneUpdateTimer < diff)
            {
                // update timer
                UpdateTimerWorldState();

                m_uiZoneUpdateTimer = TIMER_TF_UPDATE_TIME;
            }
            else
                m_uiZoneUpdateTimer -= diff;

            m_uiZoneLockTimer -= diff;
        }
    }
}
示例#6
0
void OutdoorPvPTF::FillInitialWorldStates(WorldPacket& data, uint32& count)
{
    FillInitialWorldState(data, count, m_uiZoneWorldState, WORLD_STATE_ADD);
    if (m_uiZoneWorldState == WORLD_STATE_TF_TOWERS_CONTROLLED)
    {
        FillInitialWorldState(data, count, WORLD_STATE_TF_TOWER_COUNT_H, m_uiTowersHorde);
        FillInitialWorldState(data, count, WORLD_STATE_TF_TOWER_COUNT_A, m_uiTowersAlliance);
    }
    else
        UpdateTimerWorldState();

    for (uint8 i = 0; i < MAX_TF_TOWERS; ++i)
        FillInitialWorldState(data, count, m_uiTowerWorldState[i], WORLD_STATE_ADD);
}
示例#7
0
void WorldPvPTF::FillInitialWorldStates(WorldPacket& data, uint32& count)
{
    FillInitialWorldState(data, count, m_uiControllerWorldState, 1);
    if (m_uiControllerWorldState == WORLD_STATE_TF_TOWERS_CONTROLLED)
    {
        FillInitialWorldState(data, count, WORLD_STATE_TF_TOWER_COUNT_H, m_uiTowersHorde);
        FillInitialWorldState(data, count, WORLD_STATE_TF_TOWER_COUNT_A, m_uiTowersAlly);
    }
    else
        UpdateTimerWorldState();

    for (uint8 i = 0; i < MAX_TF_TOWERS; ++i)
        FillInitialWorldState(data, count, m_uiTowerWorldState[i], 1);
}
示例#8
0
// Handle the zone lock when the timer is activated
void OutdoorPvPTF::LockZone(GameObject* go, uint32 towerId, Team team, uint32 newWorldState)
{
    SendUpdateWorldState(m_zoneWorldState, WORLD_STATE_REMOVE);
    m_zoneWorldState = team == ALLIANCE ? WORLD_STATE_TF_LOCKED_ALLIANCE : WORLD_STATE_TF_LOCKED_HORDE;
    SendUpdateWorldState(m_zoneWorldState, WORLD_STATE_ADD);

    m_zoneLockTimer = TIMER_TF_LOCK_TIME;
    UpdateTimerWorldState();

    m_zoneOwner = team;
    BuffTeam(team, SPELL_AUCHINDOUN_BLESSING);

    // lock the towers
    LockTowers(go);

    sWorld.SendDefenseMessage(ZONE_ID_TEROKKAR_FOREST, team == ALLIANCE ? LANG_OPVP_TF_CAPTURE_ALL_TOWERS_A : LANG_OPVP_TF_CAPTURE_ALL_TOWERS_H);

    // remove tower states when zone has been captured and locked
    for (uint8 i = 0; i < MAX_TF_TOWERS; ++i)
        SendUpdateWorldState(m_towerWorldState[i], WORLD_STATE_REMOVE);

    m_towerWorldState[towerId] = newWorldState;
}
示例#9
0
void WorldPvPTF::ProcessCaptureEvent(uint32 uiCaptureType, uint32 uiTeam, uint32 uiNewWorldState, uint32 uiTower)
{
    for (uint8 i = 0; i < MAX_TF_TOWERS; ++i)
    {
        if (uiTower == i)
        {
            // remove old tower state
            SendUpdateWorldState(m_uiTowerWorldState[i], 0);

            if (uiCaptureType == PROGRESS)
            {
                SetBannerArtKit(m_TowerBannerGUID[i], uiTeam == ALLIANCE ? GO_ARTKIT_BANNER_ALLIANCE : GO_ARTKIT_BANNER_HORDE);
                if (uiTeam == ALLIANCE)
                    ++m_uiTowersAlly;
                else
                    ++m_uiTowersHorde;
            }
            else if (uiCaptureType == NEUTRAL)
            {
                SetBannerArtKit(m_TowerBannerGUID[i], GO_ARTKIT_BANNER_NEUTRAL);
                if (uiTeam == ALLIANCE)
                    --m_uiTowersHorde;
                else
                    --m_uiTowersAlly;
            }

            // send new tower state
            m_uiTowerWorldState[i] = uiNewWorldState;
            SendUpdateWorldState(m_uiTowerWorldState[i], 1);
        }
    }

    // update towers count
    SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_A, m_uiTowersAlly);
    SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_H, m_uiTowersHorde);

    // If all towers are captured then process event
    if (m_uiTowersAlly == MAX_TF_TOWERS)
    {
        SendUpdateWorldState(m_uiControllerWorldState, 0);
        m_uiControllerWorldState = WORLD_STATE_TF_LOCKED_ALLIANCE;
        SendUpdateWorldState(m_uiControllerWorldState, 1);

        m_uiZoneLockTimer = TIMER_TF_LOCK_TIME;
        UpdateTimerWorldState();

        m_uiZoneController = ALLIANCE;
        DoProcessTeamBuff(ALLIANCE, SPELL_AUCHINDOUN_BLESSING);

        // lock the towers
        for (uint8 i = 0; i < MAX_TF_TOWERS; i++)
            LockCapturePoint(aTerokkarTowers[i], true);
    }
    else if (m_uiTowersHorde == MAX_TF_TOWERS)
    {
        SendUpdateWorldState(m_uiControllerWorldState, 0);
        m_uiControllerWorldState = WORLD_STATE_TF_LOCKED_HORDE;
        SendUpdateWorldState(m_uiControllerWorldState, 1);

        m_uiZoneLockTimer = TIMER_TF_LOCK_TIME;
        UpdateTimerWorldState();

        m_uiZoneController = HORDE;
        DoProcessTeamBuff(HORDE, SPELL_AUCHINDOUN_BLESSING);

        // lock the towers
        for (uint8 i = 0; i < MAX_TF_TOWERS; i++)
            LockCapturePoint(aTerokkarTowers[i], true);
    }
}