aboutsummaryrefslogtreecommitdiff
path: root/src/game/BattleGroundWS.cpp
diff options
context:
space:
mode:
authorw12x <none@none>2008-10-17 16:36:07 -0500
committerw12x <none@none>2008-10-17 16:36:07 -0500
commitab9eb277b4f001332ef2d0b623f72cfe176130d9 (patch)
treec39e35d77fd89997dc1091910746fd84899fa7a4 /src/game/BattleGroundWS.cpp
parent62409ac2a44b4af071aad765fd60e8281593aad7 (diff)
[svn] Enabled game events to change the honor and reputation gaining speed in battlegrounds. This is done by a new table in the world database, game_event_battleground_holiday. Structure is the following:
event - id of the game event bgflag - bitmask, used to set which battleground(s) give extra honor/reputation when the event is active. To add extra honor on a battleground, use 2 ^ bgTypeId as mask. Multiple battlegrounds can be set by logical 'or' ('|') operation. You will need database data for the table, please check trinitydatabase.org. --HG-- branch : trunk
Diffstat (limited to 'src/game/BattleGroundWS.cpp')
-rw-r--r--src/game/BattleGroundWS.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp
index 12b778a5e47..bbfcf0f5596 100644
--- a/src/game/BattleGroundWS.cpp
+++ b/src/game/BattleGroundWS.cpp
@@ -29,6 +29,25 @@
#include "Language.h"
#include "World.h"
+// these variables aren't used outside of this file, so declare them only here
+enum BG_WSG_Rewards
+{
+ BG_WSG_WIN = 0,
+ BG_WSG_FLAG_CAP,
+ BG_WSG_MAP_COMPLETE,
+ BG_WSG_REWARD_NUM
+};
+
+uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = {
+ {20,40,40}, // normal honor
+ {60,40,80} // holiday
+};
+
+uint32 BG_WSG_Reputation[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = {
+ {0,35,0}, // normal honor
+ {0,45,0} // holiday
+};
+
BattleGroundWS::BattleGroundWS()
{
m_BgObjects.resize(BG_WS_OBJECT_MAX);
@@ -241,8 +260,8 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
if(GetTeamScore(ALLIANCE) < BG_WS_MAX_TEAM_SCORE)
AddPoint(ALLIANCE, 1);
PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_ALLIANCE);
- RewardReputationToTeam(890, 35, ALLIANCE); // +35 reputation
- RewardHonorToTeam(40, ALLIANCE); // +40 bonushonor
+ RewardReputationToTeam(890, BG_WSG_Reputation[m_HonorMode][BG_WSG_FLAG_CAP], ALLIANCE); // +35 reputation
+ RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_FLAG_CAP], ALLIANCE); // +40 bonushonor
}
else
{
@@ -258,8 +277,8 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
if(GetTeamScore(HORDE) < BG_WS_MAX_TEAM_SCORE)
AddPoint(HORDE, 1);
PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_HORDE);
- RewardReputationToTeam(889, 35, HORDE); // +35 reputation
- RewardHonorToTeam(40, HORDE); // +40 bonushonor
+ RewardReputationToTeam(889, BG_WSG_Reputation[m_HonorMode][BG_WSG_FLAG_CAP], HORDE); // +35 reputation
+ RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_FLAG_CAP], HORDE); // +40 bonushonor
}
SpawnBGObject(BG_WS_OBJECT_H_FLAG, BG_WS_FLAG_RESPAWN_TIME);
@@ -287,6 +306,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
UpdateWorldState(BG_WS_FLAG_STATE_ALLIANCE, 1);
UpdateWorldState(BG_WS_FLAG_STATE_HORDE, 1);
+ RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_WIN], winner);
EndBattleGround(winner);
}
else