summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2009-06-27 14:31:40 -0400
committerTAW Dev <tawdev@taw>2009-06-27 14:33:03 -0400
commit4b5f2988c895f083169bb828360730ebcb3aac87 (patch)
tree922a1dd503d91a472ed7f3a934203b1bed2abb75 /src/map/atcommand.c
parent418fdcf1f04ba78b282e18843d1cc0cff855c0ff (diff)
downloadtmwa-4b5f2988c895f083169bb828360730ebcb3aac87.tar.gz
tmwa-4b5f2988c895f083169bb828360730ebcb3aac87.tar.bz2
tmwa-4b5f2988c895f083169bb828360730ebcb3aac87.tar.xz
tmwa-4b5f2988c895f083169bb828360730ebcb3aac87.zip
Added @setup command
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 6536e00..0f44460 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -40,6 +40,7 @@ static char command_symbol = '@'; // first char of the commands (by [Yor])
static char msg_table[1000][1024]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
#define ATCOMMAND_FUNC(x) int atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message)
+ATCOMMAND_FUNC(setup);
ATCOMMAND_FUNC(broadcast);
ATCOMMAND_FUNC(localbroadcast);
ATCOMMAND_FUNC(charwarp);
@@ -212,6 +213,7 @@ ATCOMMAND_FUNC(wgm);
// First char of commands is configured in atcommand_athena.conf. Leave @ in this list for default value.
// to set default level, read atcommand_athena.conf first please.
static AtCommandInfo atcommand_info[] = {
+ { AtCommand_Setup, "@setup", 40, atcommand_setup },
{ AtCommand_CharWarp, "@charwarp", 60, atcommand_charwarp },
{ AtCommand_Warp, "@warp", 40, atcommand_warp },
{ AtCommand_Where, "@where", 1, atcommand_where },
@@ -814,6 +816,43 @@ int atcommand_config_read(const char *cfgName) {
*/
/*==========================================
+ * @setup - Safely set a chars levels and warp them to a special place
+ * TAW Specific
+ *------------------------------------------
+ */
+int atcommand_setup(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ char buf[256];
+ char character[100];
+ int level = 1;
+
+ memset(character, '\0', sizeof(character));
+
+ if (!message || !*message || sscanf(message, "%d %99[^\n]", &level, character) < 2) {
+ clif_displaymessage(fd, "Usage: @setup <level> <char name>");
+ return -1;
+ }
+ level--;
+
+ snprintf(buf, 255, "-255 %s", character);
+ atcommand_character_baselevel(fd, sd, "@charbaselvl", buf);
+
+ snprintf(buf, 255, "%d %s", level, character);
+ atcommand_character_baselevel(fd, sd, "@charbaselvl", buf);
+
+ snprintf(buf, 255, "+10 %s", character);
+ atcommand_character_joblevel(fd, sd, "@charjoblvl", buf);
+
+ snprintf(buf, 255, "018-1.gat 24 98 %s", character);
+ atcommand_charwarp(fd, sd, "@charwarp", buf);
+
+ return(0);
+
+}
+
+/*==========================================
* @rura+
*------------------------------------------
*/