Last active
August 29, 2015 14:01
-
-
Save Demonid/f40540c7258e0430dfd5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "AchievementMgr.h" | |
#define ARRAY_SIZE(x) sizeof(x) / sizeof(x[0]) | |
const uint32 achievement_ids[] = { | |
// Trial of the Crusader | |
3917, // Call of the Crusade (10 player) | |
3916, // Call of the Crusade (25 player) | |
3918, // Call of the Grand Crusade (10 player) | |
3812, // Call of the Grand Crusade (25 player) | |
3810, // A Tribute to Insanity (10 player) | |
3819, // A Tribute to Insanity (25 player) | |
3809, // A Tribute to Mad Skill (10 player) | |
3818, // A Tribute to Mad Skill (25 player) | |
3808, // A Tribute to Skill (10 player) | |
3817, // A Tribute to Skill (25 player) | |
4156, // A Tribute to Immortality | |
4079, // A Tribute to Immortality | |
4080, // A Tribute to Dedicated Insanity | |
// Icecrown Citadel | |
4531, // Storming the Citadel (10 player) | |
4604, // Storming the Citadel (25 player) | |
4628, // Heroic: Storming the Citadel (10 player) | |
4632, // Heroic: Storming the Citadel (25 player) | |
4528, // The Plagueworks (10 player) | |
4605, // The Plagueworks (25 player) | |
4629, // Heroic: The Plagueworks (10 player) | |
4633, // Heroic: The Plagueworks (25 player) | |
4529, // The Crimson Hall (10 player) | |
4606, // The Crimson Hall (25 player) | |
4630, // Heroic: The Crimson Hall (10 player) | |
4634, // Heroic: The Crimson Hall (25 player) | |
4527, // The Frostwing Halls (10 player) | |
4607, // The Frostwing Halls (25 player) | |
4631, // Heroic: The Frostwing Halls (10 player) | |
4635, // Heroic: The Frostwing Halls (25 player) | |
4532, // Fall of the Lich King (10 player) | |
4608, // Fall of the Lich King (25 player) | |
4636, // Heroic: Fall of the Lich King (10 player) | |
4637, // Heroic: Fall of the Lich King (25 player) | |
4530, // The Frozen Throne (10 player) | |
4597, // The Frozen Throne (25 player) | |
4583, // Bane of the Fallen King | |
4584, // The Light of Dawn | |
// Ruby Sanctum | |
4817, // The Twilight Destroyer (10 player) | |
4815, // The Twilight Destroyer (25 player) | |
4818, // Heroic: The Twilight Destroyer (10 player) | |
4816, // Heroic: The Twilight Destroyer (25 player) | |
// Realm First! | |
1402, // Realm First! Conqueror of Naxxramas | |
456, // Realm First! Obsidian Slayer | |
1400, // Realm First! Magic Seeker | |
3117, // Realm First! Death's Demise | |
3259, // Realm First! Celestial Defender | |
4078, // Realm First! Grand Crusader | |
4576 // Realm First! Fall of the Lich King | |
}; | |
class criteriaRemoval : public WorldScript | |
{ | |
public: | |
criteriaRemoval() : WorldScript("criteriaRemoval") {} | |
void OnStartup() | |
{ | |
TC_LOG_INFO("server.loading", "Resetting %u achievements and their criterias", ARRAY_SIZE(achievement_ids)); | |
uint32 progress_count = 0; | |
uint32 achievement_count = 0; | |
for (int i = 0; i < ARRAY_SIZE(achievement_ids); ++i) | |
{ | |
AchievementCriteriaEntryList const* entryList = sAchievementMgr->GetAchievementCriteriaByAchievement(achievement_ids[0]); | |
if (!entryList) | |
continue; | |
for (AchievementCriteriaEntryList::const_iterator itr = entryList->begin(); itr != entryList->end(); ++itr) | |
{ | |
CharacterDatabase.PExecute("DELETE FROM `character_achievement_progress` WHERE criteria = %u", (*itr)->ID); | |
++progress_count; | |
} | |
CharacterDatabase.PExecute("DELETE FROM `character_achievement` WHERE achievement = %u", achievement_ids[0]); | |
++achievement_count; | |
} | |
TC_LOG_INFO("server.loading", "Reset %u achievements and %u criterias", achievement_count, progress_count); | |
} | |
}; | |
void AddSC_criteria_remove() | |
{ | |
new criteriaRemoval; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment