mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 20:02:25 +01:00
Core/Achievements: Fixed some Alterac Valley achievements:
- Stormpike Perfection - Frostwolf Perfection - Everything Counts
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
DELETE FROM `disables` WHERE `entry` IN (1242, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1825, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1826, 3386, 3387, 3388, 3389) AND `sourceType` = 4;
|
||||
|
||||
DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (1242, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1825, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1826, 3386, 3387, 3388, 3389);
|
||||
INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES
|
||||
(1242, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1803, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1804, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1805, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1806, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1807, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1808, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1809, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1810, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1825, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1811, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1812, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1813, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1814, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1815, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1816, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1817, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1818, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1819, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(1826, 11, 0, 0, 'achievement_bg_av_perfection'),
|
||||
(3386, 11, 0, 0, 'achievement_everything_counts'),
|
||||
(3387, 11, 0, 0, 'achievement_everything_counts'),
|
||||
(3388, 11, 0, 0, 'achievement_everything_counts'),
|
||||
(3389, 11, 0, 0, 'achievement_everything_counts');
|
||||
@@ -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