Skip to content
Permalink
Browse files

[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.
  • Loading branch information...
VladimirMangos
VladimirMangos committed Aug 11, 2010
1 parent a493013 commit cf1345718ab9a0f765e66c2643ceec8de3b0f572
@@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0',
`required_10331_02_mangos_command` bit(1) default NULL
`required_10342_02_mangos_command` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';

--
@@ -497,6 +497,11 @@ INSERT INTO `command` VALUES
('account set addon',3,'Syntax: .account set addon [#accountId|$accountName] #addon\r\n\r\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'),
('account set gmlevel',4,'Syntax: .account set gmlevel [#accountId|$accountName] #level\r\n\r\nSet the security level for targeted player (can''t be used at self) or for #accountId or $accountName to a level of #level.\r\n\r\n#level may range from 0 to 3.'),
('account set password',4,'Syntax: .account set password (#accountId|$accountName) $password $password\r\n\r\nSet password for account.'),
('achievement',3,'Syntax: .achievement $playername #achivementid\r\n\r\nShow state achievment #achivmentid (can be shift link) and list of achievement criteria with progress data for selected player in game or by player name.'),
('achievement add',3,'Syntax: .achievement add $playername #achivementid\r\n\r\nComplete achievement and all it\'s criteria for selected player in game or by player name. Command can\'t be used for counter achievements.'),
('achievement remove',3,'Syntax: .achievement remove $playername #achivementid\r\n\r\nRemove complete state for achievement #achivmentid and reset all achievement\'s criteria for selected player in game or by player name. Also command can be used for reset counter achievements.'),
('achievement criteria add',3,'Syntax: .achievement criteria add $playername #criteriaid #change\r\n\r\nIncrease progress for non-completed criteria at #change for selected player in game or by player name. If #chnage not provided then non-counter criteria progress set to completed state. For counter criteria increased at 1.'),
('achievement criteria remove',3,'Syntax: .achievement criteria remove $playername #criteriaid #change\r\n\r\necrease progress for criteria at #change for selected player in game or by player name. If #chnage not provided then criteria progress reset to 0.'),
('additem',3,'Syntax: .additem #itemid/[#itemname]/#shift-click-item-link #itemcount\r\n\r\nAdds the specified number of items of id #itemid (or exact (!) name $itemname in brackets, or link created by shift-click at item in inventory or recipe) to your or selected character inventory. If #itemcount is omitted, only one item will be added.\r\n.'),
('additemset',3,'Syntax: .additemset #itemsetid\r\n\r\nAdd items from itemset of id #itemsetid to your or selected character inventory. Will add by one example each item from itemset.'),
('announce',1,'Syntax: .announce $MessageToBroadcast\r\n\r\nSend a global message to all players online in chat log.'),
@@ -3728,6 +3733,10 @@ INSERT INTO `mangos_string` VALUES
(1158,'You modify for %s hex field:%u %s %x = %x (hex)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1159,'Modify %s float field:%u to sum with:%f = %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1160,'You modify for %s float field:%u to sum with:%f = %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1161,'Criteria:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1162,' [counter]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1163,'Achievement %u doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1164,'Achievement criteria %u doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1200,'You try to view cinemitic %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1201,'You try to view movie %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `mangos_string` ENABLE KEYS */;
@@ -0,0 +1,9 @@
ALTER TABLE db_version CHANGE COLUMN required_10331_02_mangos_command required_10342_01_mangos_mangos_string bit;

DELETE FROM mangos_string WHERE entry IN (1161,1162,1163,1164);

INSERT INTO mangos_string VALUES
(1161,'Criteria:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1162,' [counter]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1163,'Achievement %u doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1164,'Achievement criteria %u doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
@@ -0,0 +1,13 @@
ALTER TABLE db_version CHANGE COLUMN required_10342_01_mangos_mangos_string required_10342_02_mangos_command bit;

DELETE FROM command WHERE name IN (
'achievement','achievement add','achievement remove','achievement criteria add','achievement criteria remove'
);

INSERT INTO command (name, security, help) VALUES
('achievement',3,'Syntax: .achievement $playername #achivementid\r\n\r\nShow state achievment #achivmentid (can be shift link) and list of achievement criteria with progress data for selected player in game or by player name.'),
('achievement add',3,'Syntax: .achievement add $playername #achivementid\r\n\r\nComplete achievement and all it\'s criteria for selected player in game or by player name. Command can\'t be used for counter achievements.'),
('achievement remove',3,'Syntax: .achievement remove $playername #achivementid\r\n\r\nRemove complete state for achievement #achivmentid and reset all achievement\'s criteria for selected player in game or by player name. Also command can be used for reset counter achievements.'),
('achievement criteria add',3,'Syntax: .achievement criteria add $playername #criteriaid #change\r\n\r\nIncrease progress for non-completed criteria at #change for selected player in game or by player name. If #chnage not provided then non-counter criteria progress set to completed state. For counter criteria increased at 1.'),
('achievement criteria remove',3,'Syntax: .achievement criteria remove $playername #criteriaid #change\r\n\r\necrease progress for criteria at #change for selected player in game or by player name. If #chnage not provided then criteria progress reset to 0.');

@@ -74,6 +74,8 @@ pkgdata_DATA = \
10331_02_mangos_command.sql \
10332_01_characters_character_aura.sql \
10332_02_characters_pet_aura.sql \
10342_01_mangos_mangos_string.sql \
10342_02_mangos_command.sql \
README

## Additional files to include when running 'make dist'
@@ -128,4 +130,6 @@ EXTRA_DIST = \
10331_02_mangos_command.sql \
10332_01_characters_character_aura.sql \
10332_02_characters_pet_aura.sql \
10342_01_mangos_mangos_string.sql \
10342_02_mangos_command.sql \
README
Oops, something went wrong.

7 comments on commit cf13457

@Saeba

This comment has been minimized.

Copy link

replied Aug 11, 2010

typo ? LANG_COMMAND_ACHIEVEMENT_CREATERIA or not ?
Sorry if not.

@porteyoplait

This comment has been minimized.

Copy link

replied Aug 11, 2010

yes typo ^^
anyway, great commit, very useful commands
little question : why SEC_ADMINISTRATOR for this? Shouldn't game masters be able to use them?

@gmltA

This comment has been minimized.

Copy link

replied Aug 11, 2010

Great! Thanx!

@VladimirMangos

This comment has been minimized.

Copy link

replied Aug 11, 2010

Typo fixed in [10344]. Thank you :)

@VladimirMangos

This comment has been minimized.

Copy link

replied Aug 11, 2010

why SEC_ADMINISTRATOR for this? Shouldn't game masters be able to use them?

maybe. But you can change this in table.

@Saeba

This comment has been minimized.

Copy link

replied Aug 11, 2010

I am sorry for my incomplete report of typo, because there is same mistake on other lines (

  • static ChatCommand achievementCreateriaCommandTable[] = ) ( + { "createria" ) ( "", achievementCreateriaCommandTable }, )
@VladimirMangos

This comment has been minimized.

Copy link

replied Aug 11, 2010

My bad mostly, when fix typo need do search for similar cases always :) I fix last cases in [10346]. Thank you one more time ^^

Please sign in to comment.
You can’t perform that action at this time.