Core/Achievements: Fixed some Alterac Valley achievements:
- Stormpike Perfection - Frostwolf Perfection - Everything Counts
This commit is contained in:
@@ -1491,3 +1491,62 @@ void BattlegroundAV::ResetBGSubclass()
|
||||
DelCreature(i);
|
||||
|
||||
}
|
||||
|
||||
bool BattlegroundAV::IsBothMinesControlledByTeam(uint32 team) const
|
||||
{
|
||||
for (uint8 mine = 0; mine < 2; mine++)
|
||||
if (m_Mine_Owner[mine] != team)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BattlegroundAV::IsAllTowersControlledAndCaptainAlive(uint32 team) const
|
||||
{
|
||||
if (team == ALLIANCE)
|
||||
{
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) // alliance towers controlled
|
||||
{
|
||||
if (m_Nodes[i].State == POINT_CONTROLED)
|
||||
{
|
||||
if (m_Nodes[i].Owner != ALLIANCE)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) // horde towers destroyed
|
||||
if (m_Nodes[i].State != POINT_DESTROYED)
|
||||
return false;
|
||||
|
||||
if (!m_CaptainAlive[0])
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (team == HORDE)
|
||||
{
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) // horde towers controlled
|
||||
{
|
||||
if (m_Nodes[i].State == POINT_CONTROLED)
|
||||
{
|
||||
if (m_Nodes[i].Owner != HORDE)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) // alliance towers destroyed
|
||||
if (m_Nodes[i].State != POINT_DESTROYED)
|
||||
return false;
|
||||
|
||||
if (!m_CaptainAlive[1])
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1563,6 +1563,10 @@ class BattlegroundAV : public Battleground
|
||||
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
|
||||
|
||||
/* achievement req. */
|
||||
bool IsBothMinesControlledByTeam(uint32 team) const;
|
||||
bool IsAllTowersControlledAndCaptainAlive(uint32 team) const;
|
||||
|
||||
private:
|
||||
virtual void PostUpdateImpl(uint32 diff);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "BattlegroundWS.h"
|
||||
#include "BattlegroundIC.h"
|
||||
#include "BattlegroundSA.h"
|
||||
#include "BattlegroundAV.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
class achievement_storm_glory : public AchievementCriteriaScript
|
||||
@@ -207,6 +208,48 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_everything_counts : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_everything_counts() : AchievementCriteriaScript("achievement_everything_counts") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
Battleground* bg = source->GetBattleground();
|
||||
if (!bg)
|
||||
return false;
|
||||
|
||||
if (source->GetBattlegroundTypeId() != BATTLEGROUND_AV)
|
||||
return false;
|
||||
|
||||
if (static_cast<BattlegroundAV*>(bg)->IsBothMinesControlledByTeam(source->GetTeam()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_bg_av_perfection : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_bg_av_perfection() : AchievementCriteriaScript("achievement_bg_av_perfection") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
Battleground* bg = source->GetBattleground();
|
||||
if (!bg)
|
||||
return false;
|
||||
|
||||
if (source->GetBattlegroundTypeId() != BATTLEGROUND_AV)
|
||||
return false;
|
||||
|
||||
if (static_cast<BattlegroundAV*>(bg)->IsAllTowersControlledAndCaptainAlive(source->GetTeam()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_wg_didnt_stand_a_chance : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
@@ -269,6 +312,8 @@ void AddSC_achievement_scripts()
|
||||
new achievement_bg_sa_artillery();
|
||||
new achievement_sickly_gazelle();
|
||||
new achievement_wg_didnt_stand_a_chance();
|
||||
new achievement_everything_counts();
|
||||
new achievement_bg_av_perfection();
|
||||
new achievement_arena_kills("achievement_arena_2v2_kills", ARENA_TYPE_2v2);
|
||||
new achievement_arena_kills("achievement_arena_3v3_kills", ARENA_TYPE_3v3);
|
||||
new achievement_arena_kills("achievement_arena_5v5_kills", ARENA_TYPE_5v5);
|
||||
|
||||
Reference in New Issue
Block a user