Changeset 9 for trunk/src/game/Player.cpp
- Timestamp:
- 11/19/08 13:22:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Player.cpp
r6 r9 347 347 for (int j=0; j < PLAYER_MAX_BATTLEGROUND_QUEUES; j++) 348 348 { 349 m_bgBattleGroundQueueID[j].bg Type = 0;350 m_bgBattleGroundQueueID[j].invited = false;349 m_bgBattleGroundQueueID[j].bgQueueType = 0; 350 m_bgBattleGroundQueueID[j].invitedToInstance = 0; 351 351 } 352 352 m_bgTeam = 0; … … 1440 1440 1441 1441 // 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()) 1443 1444 return false; 1444 1445 … … 3453 3454 if(guild) 3454 3455 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); 3455 3479 } 3456 3480 … … 5884 5908 UpdateHonorFields(); 5885 5909 5910 // do not reward honor in arenas, but return true to enable onkill spellproc 5911 if(InBattleGround() && GetBattleGround() && GetBattleGround()->isArena()) 5912 return true; 5913 5886 5914 if(honor <= 0) 5887 5915 { … … 6047 6075 uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type) 6048 6076 { 6049 // need fix it!6050 6077 QueryResult *result = CharacterDatabase.PQuery("SELECT arenateamid FROM arena_team_member WHERE guid='%u'", GUID_LOPART(guid)); 6051 6078 if(result) 6052 6079 { 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(); 6055 6083 do 6056 6084 { … … 6063 6091 { 6064 6092 // if the type matches, we've found the id 6065 id = (*result)[0].GetUInt32();6093 found = true; 6066 6094 break; 6067 6095 } … … 6069 6097 } while(result->NextRow()); 6070 6098 delete result; 6071 return id;6099 if(found) return id; 6072 6100 } 6073 6101 // no arenateam for the specified guid, return 0 … … 7710 7738 break; 7711 7739 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 } 7715 7748 break; 7716 7749 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 } 7720 7758 break; 7721 7759 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 } 7725 7768 break; 7726 7769 case 3703: // Shattrath City … … 14711 14754 UpdateHonorFields(); 14712 14755 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()) 14715 14760 return; 14716 14761 … … 17461 17506 bool Player::GetBGAccessByLevel(uint32 bgTypeId) const 17462 17507 { 17463 BattleGround *bg = sBattleGroundMgr.GetBattleGround(bgTypeId); 17508 // get a template bg instead of running one 17509 BattleGround *bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId); 17464 17510 if(!bg) 17465 17511 return false;