From 890c7e64e17b1303809787255b09a9818ff46c50 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Wed, 9 May 2012 22:40:59 +0200 Subject: Battleground/Strand of the Ancients: Fix Achievement: Not Even a Scratch --- src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp | 12 +++++++----- src/server/game/Battlegrounds/Zones/BattlegroundSA.h | 9 +++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 977897b8d48..d20efbddbbe 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -56,6 +56,8 @@ void BattlegroundSA::Reset() GateStatus[i] = BG_SA_GATE_OK; ShipsStarted = false; gateDestroyed = false; + _notEvenAScratch[BG_TEAM_ALLIANCE] = true; + _notEvenAScratch[BG_TEAM_HORDE] = true; Status = BG_SA_WARMUP; } @@ -553,13 +555,13 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui SendWarningToAll(LANG_BG_SA_IS_UNDER_ATTACK, go->GetGOInfo()->name.c_str()); } -void BattlegroundSA::HandleKillUnit(Creature* unit, Player* killer) +void BattlegroundSA::HandleKillUnit(Creature* creature, Player* killer) { - if (!unit) - return; - - if (unit->GetEntry() == NPC_DEMOLISHER_SA) + if (creature->GetEntry() == NPC_DEMOLISHER_SA) + { UpdatePlayerScore(killer, SCORE_DESTROYED_DEMOLISHER, 1); + _notEvenAScratch[Attackers] = false; + } } /* diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index c18806490f2..fd11cb2c5ea 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -456,7 +456,7 @@ class BattlegroundSA : public Battleground /// Called when a player deal damage to building (door) virtual void EventPlayerDamagedGO(Player* player, GameObject* go, uint32 eventType); /// Called when a player kill a unit in bg - virtual void HandleKillUnit(Creature* unit, Player* killer); + virtual void HandleKillUnit(Creature* creature, Player* killer); /// Return the nearest graveyard where player can respawn virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); /// Called when a player click on flag (graveyard flag) @@ -531,9 +531,12 @@ class BattlegroundSA : public Battleground /// Update score board void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true); - // Achievement Defense of the Ancients + // Achievement: Defense of the Ancients bool gateDestroyed; + // Achievement: Not Even a Scratch + bool notEvenAScratch(uint32 team) const { return _notEvenAScratch[GetTeamIndexByTeamId(team)]; } + /// Id of attacker team TeamId Attackers; @@ -615,5 +618,7 @@ class BattlegroundSA : public Battleground bool InitSecondRound; std::map DemoliserRespawnList; + // Achievement: Not Even a Scratch + bool _notEvenAScratch[BG_TEAMS_COUNT]; }; #endif -- cgit v1.2.3