示例#1
0
void WorldPvPNA::ProcessCaptureEvent(uint32 uiCaptureType, uint32 uiTeam)
{
    if (uiCaptureType == WIN)
    {
        if (m_uiZoneController != NEUTRAL)
        {
            DoSetGraveyard((Team)uiTeam, true);
            DoProcessTeamBuff((Team)m_uiZoneController, SPELL_STRENGTH_HALAANI, true);
            sWorld.SendZoneText(ZONE_ID_NAGRAND, sObjectMgr.GetMangosStringForDBCLocale(uiTeam == ALLIANCE ? LANG_OPVP_NA_LOOSE_H: LANG_OPVP_NA_LOOSE_A));
        }

        UpdateWorldState(0);
        m_uiZoneController = uiTeam;
        DoRespawnSoldiers(uiTeam);
        DoSetGraveyard((Team)uiTeam);
        m_uiControllerWorldState = uiTeam == ALLIANCE ? WORLD_STATE_NA_GUARDS_ALLIANCE : WORLD_STATE_NA_GUARDS_HORDE;
        m_uiControllerMapState = uiTeam == ALLIANCE ? WORLD_STATE_NA_HALAA_ALLIANCE : WORLD_STATE_NA_HALAA_HORDE;

        SetBannerArtKit(uiTeam == ALLIANCE ? GO_ARTKIT_BANNER_ALLIANCE : GO_ARTKIT_BANNER_HORDE);
        DoHandleFactionObjects(uiTeam);
        UpdateWorldState(1);

        DoProcessTeamBuff((Team)m_uiZoneController, SPELL_STRENGTH_HALAANI);
        sWorld.SendZoneText(ZONE_ID_NAGRAND, sObjectMgr.GetMangosStringForDBCLocale(uiTeam == ALLIANCE ? LANG_OPVP_NA_CAPTURE_A: LANG_OPVP_NA_CAPTURE_H));
    }
}
示例#2
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;
        }
    }
}
示例#3
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);
    }
}