Changeset 50
- Timestamp:
- 11/19/08 13:29:16 (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/BattleGround.cpp
r44 r50 87 87 m_PrematureCountDown = false; 88 88 m_PrematureCountDown = 0; 89 m_HonorMode = BG_NORMAL; 89 90 } 90 91 … … 538 539 Source = plr; 539 540 RewardMark(plr,ITEM_WINNER_COUNT); 540 UpdatePlayerScore(plr, SCORE_BONUS_HONOR, 20);541 541 RewardQuest(plr); 542 542 } … … 1467 1467 return count; 1468 1468 } 1469 1470 void BattleGround::SetHoliday(bool is_holiday) 1471 { 1472 if(is_holiday) 1473 m_HonorMode = BG_HOLIDAY; 1474 else 1475 m_HonorMode = BG_NORMAL; 1476 } -
trunk/src/game/BattleGround.h
r44 r50 96 96 RESPAWN_ONE_DAY = 86400, // secs 97 97 RESPAWN_IMMEDIATELY = 0, // secs 98 BUFF_RESPAWN_TIME = 180, // secs 99 BG_HONOR_SCORE_TICKS = 330 // points 98 BUFF_RESPAWN_TIME = 180 // secs 100 99 }; 101 100 … … 240 239 }; 241 240 241 enum BGHonorMode 242 { 243 BG_NORMAL = 0, 244 BG_HOLIDAY, 245 BG_HONOR_MODE_NUM 246 }; 247 242 248 /* 243 249 This class is used to: … … 433 439 434 440 void HandleTriggerBuff(uint64 const& go_guid); 441 void SetHoliday(bool is_holiday); 435 442 436 443 // TODO: make this protected: … … 480 487 bool m_BuffChange; 481 488 489 BGHonorMode m_HonorMode; 482 490 private: 483 491 /* Battleground */ -
trunk/src/game/BattleGroundAB.cpp
r44 r50 30 30 #include "World.h" 31 31 #include "Util.h" 32 33 // these variables aren't used outside of this file, so declare them only here 34 uint32 BG_AB_HonorScoreTicks[BG_HONOR_MODE_NUM] = { 35 330, // normal honor 36 200 // holiday 37 }; 38 39 uint32 BG_AB_ReputationScoreTicks[BG_HONOR_MODE_NUM] = { 40 200, // normal honor 41 150 // holiday 42 }; 32 43 33 44 BattleGroundAB::BattleGroundAB() … … 187 198 m_HonorScoreTics[team] += BG_AB_TickPoints[points]; 188 199 m_ReputationScoreTics[team] += BG_AB_TickPoints[points]; 189 if( m_ReputationScoreTics[team] >= 200)200 if( m_ReputationScoreTics[team] >= BG_AB_ReputationScoreTicks[m_HonorMode] ) 190 201 { 191 202 (team == BG_TEAM_ALLIANCE) ? RewardReputationToTeam(509, 10, ALLIANCE) : RewardReputationToTeam(510, 10, HORDE); 192 m_ReputationScoreTics[team] -= 200;203 m_ReputationScoreTics[team] -= BG_AB_ReputationScoreTicks[m_HonorMode]; 193 204 } 194 if( m_HonorScoreTics[team] >= BG_ HONOR_SCORE_TICKS)205 if( m_HonorScoreTics[team] >= BG_AB_HonorScoreTicks[m_HonorMode] ) 195 206 { 196 207 (team == BG_TEAM_ALLIANCE) ? RewardHonorToTeam(20, ALLIANCE) : RewardHonorToTeam(20, HORDE); 197 m_HonorScoreTics[team] -= BG_ HONOR_SCORE_TICKS;208 m_HonorScoreTics[team] -= BG_AB_HonorScoreTicks[m_HonorMode]; 198 209 } 199 210 if( !m_IsInformedNearVictory && m_TeamScores[team] > 1800 ) -
trunk/src/game/BattleGroundEY.cpp
r44 r50 31 31 #include "Util.h" 32 32 33 // these variables aren't used outside of this file, so declare them only here 34 uint32 BG_EY_HonorScoreTicks[BG_HONOR_MODE_NUM] = { 35 330, // normal honor 36 200 // holiday 37 }; 38 33 39 BattleGroundEY::BattleGroundEY() 34 40 { … … 160 166 m_TeamScores[team_index] += Points; 161 167 m_HonorScoreTics[team_index] += Points; 162 if (m_HonorScoreTics[team_index] >= BG_ HONOR_SCORE_TICKS)168 if (m_HonorScoreTics[team_index] >= BG_EY_HonorScoreTicks[m_HonorMode]) 163 169 { 164 170 RewardHonorToTeam(20, Team); 165 m_HonorScoreTics[team_index] -= BG_ HONOR_SCORE_TICKS;171 m_HonorScoreTics[team_index] -= BG_EY_HonorScoreTicks[m_HonorMode]; 166 172 } 167 173 UpdateTeamScore(Team); -
trunk/src/game/BattleGroundMgr.cpp
r44 r50 1785 1785 sWorld.SendWorldText(LANG_ARENA_TESTING, m_ArenaTesting ? "on" : "off"); 1786 1786 } 1787 1788 void BattleGroundMgr::SetHolidayWeekends(uint32 mask) 1789 { 1790 for(uint32 bgtype = 1; bgtype <= 8; ++bgtype) 1791 { 1792 if(BattleGround * bg = GetBattleGroundTemplate(bgtype)) 1793 { 1794 bg->SetHoliday(mask & (1 << bgtype)); 1795 } 1796 } 1797 } -
trunk/src/game/BattleGroundMgr.h
r44 r50 235 235 const bool isArenaTesting() const { return m_ArenaTesting; } 236 236 237 void SetHolidayWeekends(uint32 mask); 238 237 239 private: 238 240 -
trunk/src/game/BattleGroundWS.cpp
r49 r50 30 30 #include "World.h" 31 31 32 // these variables aren't used outside of this file, so declare them only here 33 enum BG_WSG_Rewards 34 { 35 BG_WSG_WIN = 0, 36 BG_WSG_FLAG_CAP, 37 BG_WSG_MAP_COMPLETE, 38 BG_WSG_REWARD_NUM 39 }; 40 41 uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = { 42 {20,40,40}, // normal honor 43 {60,40,80} // holiday 44 }; 45 46 uint32 BG_WSG_Reputation[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = { 47 {0,35,0}, // normal honor 48 {0,45,0} // holiday 49 }; 50 32 51 BattleGroundWS::BattleGroundWS() 33 52 { … … 242 261 AddPoint(ALLIANCE, 1); 243 262 PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_ALLIANCE); 244 RewardReputationToTeam(890, 35, ALLIANCE); // +35 reputation245 RewardHonorToTeam( 40, ALLIANCE); // +40 bonushonor263 RewardReputationToTeam(890, BG_WSG_Reputation[m_HonorMode][BG_WSG_FLAG_CAP], ALLIANCE); // +35 reputation 264 RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_FLAG_CAP], ALLIANCE); // +40 bonushonor 246 265 } 247 266 else … … 259 278 AddPoint(HORDE, 1); 260 279 PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_HORDE); 261 RewardReputationToTeam(889, 35, HORDE); // +35 reputation262 RewardHonorToTeam( 40, HORDE); // +40 bonushonor280 RewardReputationToTeam(889, BG_WSG_Reputation[m_HonorMode][BG_WSG_FLAG_CAP], HORDE); // +35 reputation 281 RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_FLAG_CAP], HORDE); // +40 bonushonor 263 282 } 264 283 … … 288 307 UpdateWorldState(BG_WS_FLAG_STATE_HORDE, 1); 289 308 309 RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_WIN], winner); 290 310 EndBattleGround(winner); 291 311 } -
trunk/src/game/GameEvent.cpp
r44 r50 29 29 #include "GossipDef.h" 30 30 #include "Player.h" 31 #include "BattleGroundMgr.h" 31 32 32 33 INSTANTIATE_SINGLETON_1(GameEvent); … … 866 867 sLog.outString(); 867 868 sLog.outString( ">> Loaded %u npc gossip textids in game events", count ); 869 870 delete result; 871 } 872 873 // set all flags to 0 874 mGameEventBattleGroundHolidays.resize(mGameEvent.size(),0); 875 // load game event battleground flags 876 // 0 1 877 result = WorldDatabase.Query("SELECT event, bgflag FROM game_event_battleground_holiday"); 878 879 count = 0; 880 if( !result ) 881 { 882 barGoLink bar3(1); 883 bar3.step(); 884 885 sLog.outString(); 886 sLog.outString(">> Loaded %u battleground holidays in game events", count ); 887 } 888 else 889 { 890 891 barGoLink bar3( result->GetRowCount() ); 892 do 893 { 894 Field *fields = result->Fetch(); 895 896 bar3.step(); 897 898 uint16 event_id = fields[0].GetUInt16(); 899 900 if(event_id >= mGameEvent.size()) 901 { 902 sLog.outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`",event_id); 903 continue; 904 } 905 906 ++count; 907 908 mGameEventBattleGroundHolidays[event_id] = fields[1].GetUInt32(); 909 910 } while( result->NextRow() ); 911 sLog.outString(); 912 sLog.outString( ">> Loaded %u battleground holidays in game events", count ); 868 913 869 914 delete result; … … 992 1037 // remove vendor items 993 1038 UpdateEventNPCVendor(event_id, false); 1039 // update bg holiday 1040 UpdateBattleGroundSettings(); 994 1041 } 995 1042 … … 1020 1067 // add vendor items 1021 1068 UpdateEventNPCVendor(event_id, true); 1069 // update bg holiday 1070 UpdateBattleGroundSettings(); 1022 1071 } 1023 1072 … … 1046 1095 } 1047 1096 } 1097 } 1098 1099 void GameEvent::UpdateBattleGroundSettings() 1100 { 1101 uint32 mask = 0; 1102 for(ActiveEvents::const_iterator itr = m_ActiveEvents.begin(); itr != m_ActiveEvents.end(); ++itr ) 1103 mask |= mGameEventBattleGroundHolidays[*itr]; 1104 sBattleGroundMgr.SetHolidayWeekends(mask); 1048 1105 } 1049 1106 -
trunk/src/game/GameEvent.h
r44 r50 119 119 void UpdateEventNPCFlags(uint16 event_id); 120 120 void UpdateEventNPCVendor(uint16 event_id, bool activate); 121 void UpdateBattleGroundSettings(); 121 122 bool CheckOneGameEventConditions(uint16 event_id); 122 123 void SaveWorldEventStateToDB(uint16 event_id); … … 142 143 typedef std::pair<uint16 /*event id*/, uint32 /*gossip id*/> EventNPCGossipIdPair; 143 144 typedef std::map<uint32 /*guid*/, EventNPCGossipIdPair> GuidEventNpcGossipIdMap; 145 typedef std::vector<uint32> GameEventBitmask; 144 146 GameEventQuestMap mGameEventCreatureQuests; 145 147 GameEventQuestMap mGameEventGameObjectQuests; … … 149 151 GameEventGuidMap mGameEventGameobjectGuids; 150 152 GameEventDataMap mGameEvent; 153 GameEventBitmask mGameEventBattleGroundHolidays; 151 154 QuestIdToEventConditionMap mQuestToEventConditions; 152 155 GameEventNPCFlagMap mGameEventNPCFlags;