aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/BattleGround.cpp6
-rw-r--r--src/game/BattleGround.h6
-rw-r--r--src/game/BattleGroundSA.cpp67
-rw-r--r--src/game/BattleGroundSA.h2
4 files changed, 53 insertions, 28 deletions
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index e2d6ac01778..bde132835c0 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -872,6 +872,9 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
case BATTLEGROUND_EY:
mark = ITEM_EY_MARK_OF_HONOR;
break;
+ case BATTLEGROUND_SA:
+ mark = ITEM_SA_MARK_OF_HONOR;
+ break;
default:
return;
}
@@ -977,6 +980,9 @@ void BattleGround::RewardQuestComplete(Player *plr)
case BATTLEGROUND_EY:
quest = SPELL_EY_QUEST_REWARD;
break;
+ case BATTLEGROUND_SA:
+ quest = SPELL_SA_QUEST_REWARD;
+ break;
default:
return;
}
diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h
index b82884771d5..02783a582a9 100644
--- a/src/game/BattleGround.h
+++ b/src/game/BattleGround.h
@@ -50,6 +50,7 @@ enum BattleGroundQuests
SPELL_AV_QUEST_REWARD = 43475,
SPELL_AV_QUEST_KILLED_BOSS = 23658,
SPELL_EY_QUEST_REWARD = 43477,
+ SPELL_SA_QUEST_REWARD = 61213,
SPELL_AB_QUEST_REWARD_4_BASES = 24061,
SPELL_AB_QUEST_REWARD_5_BASES = 24064
};
@@ -62,10 +63,13 @@ enum BattleGroundMarks
SPELL_AB_MARK_WINNER = 24953,
SPELL_AV_MARK_LOSER = 24954,
SPELL_AV_MARK_WINNER = 24955,
+ SPELL_SA_MARK_WINNER = 61160,
+ SPELL_SA_MARK_LOSER = 61159,
ITEM_AV_MARK_OF_HONOR = 20560,
ITEM_WS_MARK_OF_HONOR = 20558,
ITEM_AB_MARK_OF_HONOR = 20559,
- ITEM_EY_MARK_OF_HONOR = 29024
+ ITEM_EY_MARK_OF_HONOR = 29024,
+ ITEM_SA_MARK_OF_HONOR = 42425
};
enum BattleGroundMarksCount
diff --git a/src/game/BattleGroundSA.cpp b/src/game/BattleGroundSA.cpp
index f1ba5157f8e..782de247398 100644
--- a/src/game/BattleGroundSA.cpp
+++ b/src/game/BattleGroundSA.cpp
@@ -634,36 +634,33 @@ void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i)
void BattleGroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
{
-
- if(object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC])
+ if(object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC])
{
- if(Source->GetTeamId() == attackers)
- {
-
- if(status == BG_SA_ROUND_ONE)
- {
- RoundScores[0].winner = attackers;
- RoundScores[0].time = TotalTime;
- attackers = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
- status = BG_SA_SECOND_WARMUP;
- TotalTime = 0;
- ToggleTimer();
- ResetObjs();
- }
- else if(status == BG_SA_ROUND_TWO)
- {
- RoundScores[1].winner = attackers;
- RoundScores[1].time = TotalTime;
- ToggleTimer();
- if(RoundScores[0].time < RoundScores[1].time)
- EndBattleGround(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
- else
- EndBattleGround(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
-
+ if(Source->GetTeamId() == attackers)
+ {
+ if(status == BG_SA_ROUND_ONE)
+ {
+ RoundScores[0].winner = attackers;
+ RoundScores[0].time = TotalTime;
+ attackers = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
+ status = BG_SA_SECOND_WARMUP;
+ TotalTime = 0;
+ ToggleTimer();
+ ResetObjs();
+ }
+ else if(status == BG_SA_ROUND_TWO)
+ {
+ RoundScores[1].winner = attackers;
+ RoundScores[1].time = TotalTime;ToggleTimer();
+ if(RoundScores[0].time == RoundScores[1].time)
+ EndBattleGround(NULL);
+ else if(RoundScores[0].time < RoundScores[1].time)
+ EndBattleGround(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
+ else
+ EndBattleGround(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
+ }
}
- }
}
-
}
void BattleGroundSA::ToggleTimer()
@@ -673,3 +670,19 @@ void BattleGroundSA::ToggleTimer()
UpdateWorldState(BG_SA_ENABLE_TIMER, (TimerEnabled) ? 1 : 0);
}
+
+void BattleGroundSA::EndBattleGround(uint32 winner)
+{
+ //win reward
+ if (winner == ALLIANCE)
+ RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), ALLIANCE);
+ else if (winner == HORDE)
+ RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), HORDE);
+
+ //complete map_end rewards (even if no team wins)
+ RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), ALLIANCE);
+ RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), HORDE);
+
+ BattleGround::EndBattleGround(winner);
+}
+
diff --git a/src/game/BattleGroundSA.h b/src/game/BattleGroundSA.h
index 17b30c51240..4d1df418b9f 100644
--- a/src/game/BattleGroundSA.h
+++ b/src/game/BattleGroundSA.h
@@ -309,6 +309,8 @@ class BattleGroundSA : public BattleGround
virtual void EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj);
virtual void EventPlayerUsedGO(Player* Source, GameObject* object);
+ void EndBattleGround(uint32 winner);
+
void RemovePlayer(Player *plr,uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);