コード例 #1
0
void outdoor_pvp_eastern_plaguelands::OnPlayerEnterZone(Player* pPlayer, uint32 uiZoneId, uint32 uiAreaId)
{
    //if(pPlayer->GetTeam() == m_uiLastControllerFaction)
    //    pPlayer->CastSpell(pPlayer, SPELL_CENARION_FAVOR, false);

    // add to the player set
    sPlaguelandsPlayers.insert(pPlayer->GetGUID());

    // send actual world states
    SendPlayerWorldState(pPlayer);
}
コード例 #2
0
void worldmap_eastern_kingdoms::OnPlayerEnterZone(Player* pPlayer, uint32 uiZoneId)
{
    if (uiZoneId == ZONE_ID_EASTERN_PLAGUELANDS)
    {
        // cast buff the the player which enters the zone
        switch(pPlayer->GetTeam())
        {
            case ALLIANCE:
                for (uint8 i = 0; i < 4; i++)
                {
                    if (m_uiTowersAlly == m_aPlaguelandsTowerBuffs[i].uiTowers)
                        pPlayer->CastSpell(pPlayer, m_aPlaguelandsTowerBuffs[i].uiSpellIdAlly, false);
                }
                break;
            case HORDE:
                for (uint8 i = 0; i < 4; i++)
                {
                    if (m_uiTowersHorde == m_aPlaguelandsTowerBuffs[i].uiTowers)
                        pPlayer->CastSpell(pPlayer, m_aPlaguelandsTowerBuffs[i].uiSpellIdHorde, false);
                }
                break;
        }

        // add to the player set
        m_suiPlaguelandsPlayers.insert(pPlayer->GetGUID());

        // send actual world states
        SendPlayerWorldState(pPlayer);
    }
    else
    {
        // remove the buff from the player
        for (uint8 i = 0; i < 4; i++)
        {
            if (pPlayer->HasAura(pPlayer->GetTeam() == ALLIANCE ? m_aPlaguelandsTowerBuffs[i].uiSpellIdAlly : m_aPlaguelandsTowerBuffs[i].uiSpellIdHorde))
                pPlayer->RemoveAurasDueToSpell(pPlayer->GetTeam() == ALLIANCE ? m_aPlaguelandsTowerBuffs[i].uiSpellIdAlly : m_aPlaguelandsTowerBuffs[i].uiSpellIdHorde);
        }

        // remove from the player set
        if (m_suiPlaguelandsPlayers.find(pPlayer->GetGUID()) != m_suiPlaguelandsPlayers.end())
            m_suiPlaguelandsPlayers.erase(pPlayer->GetGUID());
    }
}