[10342] Cleanup achievement code and add new commands.

* .achievement - let see achievement state and list criteria with progress data.
                 It provide criteria ids/shift-links for other commands.
* .achievement add - let complete achivement (set all criteria progress to max) with related events.
* .achievement remove - let reset achievement  criteria progress and undo complete state for achievement.
                 Command also partly remove rewards (title part).
* .achievement criteria add - let increase criteria progress at specific amount or to complete state
* .achievement criteria remove - let reset/descrease criteria progress and undo criteria and related achivement complete state if need.
This commit is contained in:
VladimirMangos 2010-08-11 05:14:03 +04:00
parent 5c2fc55fe4
commit 4c838a1c31
14 changed files with 701 additions and 184 deletions

View file

@ -39,6 +39,7 @@
// Supported shift-links (client generated and server side)
// |color|Hachievement:achievement_id:player_guid_hex:completed_0_1:mm:dd:yy_from_2000:criteriaMask1:criteriaMask2:criteriaMask3:criteriaMask4|h[name]|h|r
// - client, item icon shift click, not used in server currently
// |color|Hachievement_criteria:criteria_id|h[name]|h|r
// |color|Harea:area_id|h[name]|h|r
// |color|Hareatrigger:id|h[name]|h|r
// |color|Hareatrigger_target:id|h[name]|h|r
@ -87,6 +88,22 @@ ChatCommand * ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand achievementCreateriaCommandTable[] =
{
{ "add", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAchievementCriteriaAddCommand, "", NULL },
{ "remove", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAchievementCriteriaRemoveCommand,"", NULL },
{ NULL, 0, true, NULL, "", NULL }
};
static ChatCommand achievementCommandTable[] =
{
{ "createria", SEC_ADMINISTRATOR, true, NULL, "", achievementCreateriaCommandTable },
{ "add", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAchievementAddCommand, "", NULL },
{ "remove", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAchievementRemoveCommand, "", NULL },
{ "", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAchievementCommand, "", NULL },
{ NULL, 0, true, NULL, "", NULL }
};
static ChatCommand auctionCommandTable[] =
{
{ "alliance", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAuctionAllianceCommand, "", NULL },
@ -642,6 +659,7 @@ ChatCommand * ChatHandler::getCommandTable()
static ChatCommand commandTable[] =
{
{ "account", SEC_PLAYER, true, NULL, "", accountCommandTable },
{ "achievement", SEC_ADMINISTRATOR, true, NULL, "", achievementCommandTable },
{ "auction", SEC_ADMINISTRATOR, false, NULL, "", auctionCommandTable },
{ "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable },
{ "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable},