Some SA fixes by gyullo.
Also added formating fix for BattleGroundSA::EventPlayerUsedGO. --HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -634,12 +634,10 @@ 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(Source->GetTeamId() == attackers)
|
||||
{
|
||||
|
||||
if(status == BG_SA_ROUND_ONE)
|
||||
{
|
||||
RoundScores[0].winner = attackers;
|
||||
@@ -653,17 +651,16 @@ void BattleGroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
|
||||
else if(status == BG_SA_ROUND_TWO)
|
||||
{
|
||||
RoundScores[1].winner = attackers;
|
||||
RoundScores[1].time = TotalTime;
|
||||
ToggleTimer();
|
||||
if(RoundScores[0].time < RoundScores[1].time)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user