Show
Ignore:
Timestamp:
11/19/08 13:22:41 (17 years ago)
Author:
yumileroy
Message:

[svn] -enabled instantiated battlegrounds
-enabled arena matches
-rewritten battleground queuing to support joining as group
-removed queue announcements

Original author: w12x
Date: 2008-10-05 08:48:32-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Player.cpp

    r6 r9  
    347347    for (int j=0; j < PLAYER_MAX_BATTLEGROUND_QUEUES; j++) 
    348348    { 
    349         m_bgBattleGroundQueueID[j].bgType  = 0; 
    350         m_bgBattleGroundQueueID[j].invited = false; 
     349        m_bgBattleGroundQueueID[j].bgQueueType  = 0; 
     350        m_bgBattleGroundQueueID[j].invitedToInstance = 0; 
    351351    } 
    352352    m_bgTeam = 0; 
     
    14401440 
    14411441    // don't let enter battlegrounds without assigned battleground id (for example through areatrigger)... 
    1442     if(!InBattleGround() && mEntry->IsBattleGround() && !GetSession()->GetSecurity()) 
     1442    // don't let gm level > 1 either 
     1443    if(!InBattleGround() && mEntry->IsBattleGroundOrArena()) 
    14431444        return false; 
    14441445 
     
    34533454        if(guild) 
    34543455            guild->DelMember(guid); 
     3456    } 
     3457 
     3458    // remove from arena teams 
     3459    uint32 at_id = GetArenaTeamIdFromDB(playerguid,ARENA_TEAM_2v2); 
     3460    if(at_id != 0) 
     3461    { 
     3462        ArenaTeam * at = objmgr.GetArenaTeamById(at_id); 
     3463        if(at) 
     3464            at->DelMember(playerguid); 
     3465    } 
     3466    at_id = GetArenaTeamIdFromDB(playerguid,ARENA_TEAM_3v3); 
     3467    if(at_id != 0) 
     3468    { 
     3469        ArenaTeam * at = objmgr.GetArenaTeamById(at_id); 
     3470        if(at) 
     3471            at->DelMember(playerguid); 
     3472    } 
     3473    at_id = GetArenaTeamIdFromDB(playerguid,ARENA_TEAM_5v5); 
     3474    if(at_id != 0) 
     3475    { 
     3476        ArenaTeam * at = objmgr.GetArenaTeamById(at_id); 
     3477        if(at) 
     3478            at->DelMember(playerguid); 
    34553479    } 
    34563480 
     
    58845908    UpdateHonorFields(); 
    58855909 
     5910    // do not reward honor in arenas, but return true to enable onkill spellproc 
     5911    if(InBattleGround() && GetBattleGround() && GetBattleGround()->isArena()) 
     5912        return true; 
     5913 
    58865914    if(honor <= 0) 
    58875915    { 
     
    60476075uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type) 
    60486076{ 
    6049     // need fix it! 
    60506077    QueryResult *result = CharacterDatabase.PQuery("SELECT arenateamid FROM arena_team_member WHERE guid='%u'", GUID_LOPART(guid)); 
    60516078    if(result) 
    60526079    { 
    6053         // init id to 0, check the arena type before assigning a value to id 
    6054         uint32 id = 0; 
     6080        bool found = false; 
     6081        // init id to find the type of the arenateam 
     6082        uint32 id = (*result)[0].GetUInt32(); 
    60556083        do 
    60566084        { 
     
    60636091                { 
    60646092                    // if the type matches, we've found the id 
    6065                     id = (*result)[0].GetUInt32(); 
     6093                    found = true; 
    60666094                    break; 
    60676095                } 
     
    60696097        } while(result->NextRow()); 
    60706098        delete result; 
    6071         return id; 
     6099        if(found) return id; 
    60726100    } 
    60736101    // no arenateam for the specified guid, return 0 
     
    77107738            break; 
    77117739        case 3698:                                          // Nagrand Arena 
    7712             data << uint32(0xa0f) << uint32(0x0);           // 7 
    7713             data << uint32(0xa10) << uint32(0x0);           // 8 
    7714             data << uint32(0xa11) << uint32(0x0);           // 9 
     7740            if (bg && bg->GetTypeID() == BATTLEGROUND_NA) 
     7741                bg->FillInitialWorldStates(data); 
     7742            else 
     7743            { 
     7744                data << uint32(0xa0f) << uint32(0x0);           // 7 
     7745                data << uint32(0xa10) << uint32(0x0);           // 8 
     7746                data << uint32(0xa11) << uint32(0x0);           // 9 show 
     7747            } 
    77157748            break; 
    77167749        case 3702:                                          // Blade's Edge Arena 
    7717             data << uint32(0x9f0) << uint32(0x0);           // 7 
    7718             data << uint32(0x9f1) << uint32(0x0);           // 8 
    7719             data << uint32(0x9f3) << uint32(0x0);           // 9 
     7750            if (bg && bg->GetTypeID() == BATTLEGROUND_BE) 
     7751                bg->FillInitialWorldStates(data); 
     7752            else 
     7753            { 
     7754                data << uint32(0x9f0) << uint32(0x0);           // 7 gold 
     7755                data << uint32(0x9f1) << uint32(0x0);           // 8 green 
     7756                data << uint32(0x9f3) << uint32(0x0);           // 9 show 
     7757            } 
    77207758            break; 
    77217759        case 3968:                                          // Ruins of Lordaeron 
    7722             data << uint32(0xbb8) << uint32(0x0);           // 7 
    7723             data << uint32(0xbb9) << uint32(0x0);           // 8 
    7724             data << uint32(0xbba) << uint32(0x0);           // 9 
     7760            if (bg && bg->GetTypeID() == BATTLEGROUND_RL) 
     7761                bg->FillInitialWorldStates(data); 
     7762            else 
     7763            { 
     7764                data << uint32(0xbb8) << uint32(0x0);           // 7 gold  
     7765                data << uint32(0xbb9) << uint32(0x0);           // 8 green 
     7766                data << uint32(0xbba) << uint32(0x0);           // 9 show 
     7767            } 
    77257768            break; 
    77267769        case 3703:                                          // Shattrath City 
     
    1471114754    UpdateHonorFields(); 
    1471214755 
    14713     // Must saved before enter into BattleGround 
    14714     if(InBattleGround()) 
     14756    // players aren't saved on battleground maps 
     14757    uint32 mapid = IsBeingTeleported() ? GetTeleportDest().mapid : GetMapId(); 
     14758    const MapEntry * me = sMapStore.LookupEntry(mapid); 
     14759    if(!me || me->IsBattleGroundOrArena()) 
    1471514760        return; 
    1471614761 
     
    1746117506bool Player::GetBGAccessByLevel(uint32 bgTypeId) const 
    1746217507{ 
    17463     BattleGround *bg = sBattleGroundMgr.GetBattleGround(bgTypeId); 
     17508    // get a template bg instead of running one 
     17509    BattleGround *bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId); 
    1746417510    if(!bg) 
    1746517511        return false;