From 4b5f2988c895f083169bb828360730ebcb3aac87 Mon Sep 17 00:00:00 2001 From: MadCamel Date: Sat, 27 Jun 2009 14:31:40 -0400 Subject: Added @setup command --- src/map/atcommand.c | 39 +++++++++++++++++++++++++++++++++++++++ src/map/atcommand.h | 1 + 2 files changed, 40 insertions(+) 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 }, @@ -813,6 +815,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 "); + 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+ *------------------------------------------ diff --git a/src/map/atcommand.h b/src/map/atcommand.h index 3f247bc..af16b0c 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -7,6 +7,7 @@ enum AtCommandType { AtCommand_None = -1, AtCommand_Broadcast = 0, + AtCommand_Setup, AtCommand_LocalBroadcast, AtCommand_MapMove, AtCommand_ResetState, -- cgit v1.2.3-60-g2f50