Core/Achievements: Some achievements can now be obtained in random chosen battlegrounds too (not only in specific battlegrounds). Removed unneeded script for Storm Glory achievement.
Signed-off-by: horn <[email protected]>
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
DELETE FROM achievement_criteria_data WHERE criteria_id = 3693;
|
||||||
|
INSERT INTO achievement_criteria_data VALUES
|
||||||
|
(3693, 11, 0, 0, 'achievement_bg_control_all_nodes');
|
||||||
@@ -24,24 +24,6 @@
|
|||||||
#include "BattlegroundAV.h"
|
#include "BattlegroundAV.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
|
|
||||||
class achievement_storm_glory : public AchievementCriteriaScript
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
achievement_storm_glory() : AchievementCriteriaScript("achievement_storm_glory") { }
|
|
||||||
|
|
||||||
bool OnCheck(Player* source, Unit* /*target*/)
|
|
||||||
{
|
|
||||||
if (source->GetBattlegroundTypeId() != BATTLEGROUND_EY)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Battleground* pEotS = source->GetBattleground();
|
|
||||||
if (!pEotS)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return pEotS->IsAllNodesConrolledByTeam(source->GetTeam());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class achievement_resilient_victory : public AchievementCriteriaScript
|
class achievement_resilient_victory : public AchievementCriteriaScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -93,11 +75,14 @@ class achievement_save_the_day : public AchievementCriteriaScript
|
|||||||
|
|
||||||
if (Player const* player = target->ToPlayer())
|
if (Player const* player = target->ToPlayer())
|
||||||
{
|
{
|
||||||
if (source->GetBattlegroundTypeId() != BATTLEGROUND_WS || !source->GetBattleground())
|
Battleground* bg = source->GetBattleground();
|
||||||
|
if (!bg)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
BattlegroundWS* pWSG = static_cast<BattlegroundWS*>(source->GetBattleground());
|
if (bg->GetTypeID(true) != BATTLEGROUND_WS)
|
||||||
if (pWSG->GetFlagState(player->GetTeam()) == BG_WS_FLAG_STATE_ON_BASE)
|
return false;
|
||||||
|
|
||||||
|
if (static_cast<BattlegroundWS*>(bg)->GetFlagState(player->GetTeam()) == BG_WS_FLAG_STATE_ON_BASE)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -219,7 +204,7 @@ class achievement_everything_counts : public AchievementCriteriaScript
|
|||||||
if (!bg)
|
if (!bg)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (source->GetBattlegroundTypeId() != BATTLEGROUND_AV)
|
if (bg->GetTypeID(true) != BATTLEGROUND_AV)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (static_cast<BattlegroundAV*>(bg)->IsBothMinesControlledByTeam(source->GetTeam()))
|
if (static_cast<BattlegroundAV*>(bg)->IsBothMinesControlledByTeam(source->GetTeam()))
|
||||||
@@ -240,7 +225,7 @@ class achievement_bg_av_perfection : public AchievementCriteriaScript
|
|||||||
if (!bg)
|
if (!bg)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (source->GetBattlegroundTypeId() != BATTLEGROUND_AV)
|
if (bg->GetTypeID(true) != BATTLEGROUND_AV)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (static_cast<BattlegroundAV*>(bg)->IsAllTowersControlledAndCaptainAlive(source->GetTeam()))
|
if (static_cast<BattlegroundAV*>(bg)->IsAllTowersControlledAndCaptainAlive(source->GetTeam()))
|
||||||
@@ -302,7 +287,6 @@ class achievement_bg_sa_defense_of_ancients : public AchievementCriteriaScript
|
|||||||
|
|
||||||
void AddSC_achievement_scripts()
|
void AddSC_achievement_scripts()
|
||||||
{
|
{
|
||||||
new achievement_storm_glory();
|
|
||||||
new achievement_resilient_victory();
|
new achievement_resilient_victory();
|
||||||
new achievement_bg_control_all_nodes();
|
new achievement_bg_control_all_nodes();
|
||||||
new achievement_save_the_day();
|
new achievement_save_the_day();
|
||||||
|
|||||||
Reference in New Issue
Block a user