mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Achievements: Fixed Children's Week achievements
This commit is contained in:
@@ -1779,13 +1779,23 @@ UPDATE `outdoorpvp_template` SET `ScriptName`='outdoorpvp_si' WHERE `TypeId`=5;
|
||||
UPDATE `outdoorpvp_template` SET `ScriptName`='outdoorpvp_ep' WHERE `TypeId`=6;
|
||||
|
||||
/* ACHIEVEMENTS */
|
||||
DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (3693,6641,6642,6643,6644,3804,3805,3806,3807,3808,3809,3810,3811,3812,3813,1234,1239,5605,5606,12778,13036,13035,13037,12977,12967,12986,12982,12993,12780,13012,13011,13013,12062,12063,12064,12065,12183,12068,12060,12061,12822,12996,12972,12989,10062,10063,10054,10055,10046,10047,10048,10049,10050,10051,10044,10045,6446,7625,7628) AND `type` IN (0,11);
|
||||
DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (3693,6641,6642,6643,6644,12398,6651,6652,6653,6654,6655,6656,6657,6659,10391,3804,3805,3806,3807,3808,3809,3810,3811,3812,3813,1234,1239,5605,5606,12778,13036,13035,13037,12977,12967,12986,12982,12993,12780,13012,13011,13013,12062,12063,12064,12065,12183,12068,12060,12061,12822,12996,12972,12989,10062,10063,10054,10055,10046,10047,10048,10049,10050,10051,10044,10045,6446,7625,7628) AND `type` IN (0,11);
|
||||
INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES
|
||||
(3693,11,0,0, 'achievement_storm_glory'),
|
||||
(6641,11,0,0, 'achievement_school_of_hard_knocks'),
|
||||
(6642,11,0,0, 'achievement_school_of_hard_knocks'),
|
||||
(6643,11,0,0, 'achievement_school_of_hard_knocks'),
|
||||
(6644,11,0,0, 'achievement_school_of_hard_knocks'),
|
||||
(6641,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6642,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6643,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6644,11,0,0, 'achievement_has_orphan_out'),
|
||||
(12398,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6651,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6652,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6653,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6654,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6655,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6656,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6657,11,0,0, 'achievement_has_orphan_out'),
|
||||
(6659,11,0,0, 'achievement_has_orphan_out'),
|
||||
(10391,11,0,0, 'achievement_has_orphan_out'),
|
||||
(3804,11,0,0, 'achievement_resilient_victory'),
|
||||
(3805,11,0,0, 'achievement_resilient_victory'),
|
||||
(3806,11,0,0, 'achievement_resilient_victory'),
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
UPDATE `achievement_criteria_data` SET `ScriptName`='achievement_has_orphan_out' WHERE `ScriptName`='achievement_school_of_hard_knocks';
|
||||
DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (6641,6642,6643,6644,6651,6652,6653,6654,6655,6656,6657,6659,10391,12398);
|
||||
INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES
|
||||
(6641,16,201,0,''), -- School of Hard Knocks
|
||||
(6642,16,201,0,''), -- School of Hard Knocks
|
||||
(6643,16,201,0,''), -- School of Hard Knocks
|
||||
(6644,16,201,0,''), -- School of Hard Knocks
|
||||
(6651,11,0,0, 'achievement_has_orphan_out'), -- Bad Example
|
||||
(6651,16,201,0,''), -- Bad Example
|
||||
(6652,11,0,0, 'achievement_has_orphan_out'), -- Bad Example
|
||||
(6652,16,201,0,''), -- Bad Example
|
||||
(6653,11,0,0, 'achievement_has_orphan_out'), -- Bad Example
|
||||
(6653,16,201,0,''), -- Bad Example
|
||||
(6654,11,0,0, 'achievement_has_orphan_out'), -- Bad Example
|
||||
(6654,16,201,0,''), -- Bad Example
|
||||
(6655,11,0,0, 'achievement_has_orphan_out'), -- Bad Example
|
||||
(6655,16,201,0,''), -- Bad Example
|
||||
(6656,11,0,0, 'achievement_has_orphan_out'), -- Bad Example
|
||||
(6656,16,201,0,''), -- Bad Example
|
||||
(6657,11,0,0, 'achievement_has_orphan_out'), -- Bad Example
|
||||
(6657,16,201,0,''), -- Bad Example
|
||||
(6659,11,0,0, 'achievement_has_orphan_out'), -- Hail To The King, Baby
|
||||
(6659,16,201,0,''), -- Hail To The King, Baby
|
||||
(10391,11,0,0, 'achievement_has_orphan_out'), -- Home Alone
|
||||
(10391,16,201,0,''), -- Home Alone
|
||||
(12398,11,0,0, 'achievement_has_orphan_out'), -- Daily Chores
|
||||
(12398,16,201,0,''); -- Daily Chores
|
||||
|
||||
DELETE FROM `disables` WHERE `entry` IN (6641,6642,6643,6644,6651,6652,6653,6654,6655,6656,6657,6659,10391,12398) AND `sourceType`=4;
|
||||
@@ -82,7 +82,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: // only hardcoded list
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: // only hardcoded list
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE:
|
||||
@@ -97,6 +97,8 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST: // only Children's Week achievements
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: // only Children's Week achievements
|
||||
break;
|
||||
default:
|
||||
sLog->outErrorDb("Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType);
|
||||
@@ -741,7 +743,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
switch (type)
|
||||
{
|
||||
// std. case: increment at 1
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION:
|
||||
@@ -787,7 +788,22 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
break;
|
||||
|
||||
// specialized cases
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST:
|
||||
{
|
||||
// AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
|
||||
if (!miscValue1)
|
||||
continue;
|
||||
|
||||
if (achievement->categoryId == CATEGORY_CHILDRENS_WEEK)
|
||||
{
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(), NULL))
|
||||
continue;
|
||||
}
|
||||
|
||||
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
|
||||
break;
|
||||
}
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG:
|
||||
{
|
||||
// AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
|
||||
@@ -1153,8 +1169,18 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
// AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
|
||||
if (!miscValue1)
|
||||
continue;
|
||||
|
||||
if (achievementCriteria->use_item.itemID != miscValue1)
|
||||
continue;
|
||||
|
||||
// Children's Week achievements have extra requirements
|
||||
if (achievement->categoryId == CATEGORY_CHILDRENS_WEEK)
|
||||
{
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(), NULL))
|
||||
continue;
|
||||
}
|
||||
|
||||
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM:
|
||||
@@ -2246,7 +2272,6 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
|
||||
case 1276:
|
||||
case 1277:
|
||||
case 1282:
|
||||
case 1789:
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
@@ -2290,6 +2315,16 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
|
||||
break; // any cases
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: // any cases
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: // only Children's Week achievements
|
||||
{
|
||||
AchievementEntry const* achievement = sAchievementStore.LookupEntry(criteria->referredAchievement);
|
||||
if (!achievement)
|
||||
continue;
|
||||
if (achievement->categoryId != CATEGORY_CHILDRENS_WEEK)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
default: // type not use DB data, ignore
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -225,6 +225,11 @@ enum AchievementCriteriaTypes
|
||||
ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 124,
|
||||
};
|
||||
|
||||
enum AchievementCategory
|
||||
{
|
||||
CATEGORY_CHILDRENS_WEEK = 163,
|
||||
};
|
||||
|
||||
enum AreaFlags
|
||||
{
|
||||
AREA_FLAG_SNOW = 0x00000001, // snow (only Dun Morogh, Naxxramas, Razorfen Downs and Winterspring)
|
||||
|
||||
@@ -22,23 +22,25 @@
|
||||
#include "BattlegroundIC.h"
|
||||
#include "BattlegroundSA.h"
|
||||
|
||||
class achievement_school_of_hard_knocks : public AchievementCriteriaScript
|
||||
class achievement_has_orphan_out : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_school_of_hard_knocks() : AchievementCriteriaScript("achievement_school_of_hard_knocks") { }
|
||||
achievement_has_orphan_out() : AchievementCriteriaScript("achievement_has_orphan_out") { }
|
||||
|
||||
static uint32 const OrphanEntries[6];
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
static uint32 const orphanEntries[6] = {14305, 14444, 22818, 22817, 33533, 33532};
|
||||
uint32 currentPet = GUID_ENPART(source->GetCritterGUID());
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
if (currentPet == orphanEntries[i])
|
||||
if (currentPet == OrphanEntries[i])
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
uint32 const achievement_has_orphan_out::OrphanEntries[6] = {14305, 14444, 22818, 22817, 33533, 33532};
|
||||
|
||||
class achievement_storm_glory : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
@@ -186,7 +188,7 @@ class achievement_bg_sa_artillery : public AchievementCriteriaScript
|
||||
|
||||
void AddSC_achievement_scripts()
|
||||
{
|
||||
new achievement_school_of_hard_knocks();
|
||||
new achievement_has_orphan_out();
|
||||
new achievement_storm_glory();
|
||||
new achievement_resilient_victory();
|
||||
new achievement_bg_control_all_nodes();
|
||||
|
||||
Reference in New Issue
Block a user