diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 39 | ||||
-rw-r--r-- | src/map/atcommand.h | 1 | ||||
-rw-r--r-- | src/map/clif.c | 2 | ||||
-rw-r--r-- | src/map/magic.c | 2 |
4 files changed, 42 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index eb37561..39e62da 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+ *------------------------------------------ */ 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, diff --git a/src/map/clif.c b/src/map/clif.c index 14f2770..a53177d 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -6506,7 +6506,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c < if (tmw_CheckChatSpam(sd, RFIFOP(fd,4))) return; - if ((malformed)||(pc_isdead(sd))) { + if (malformed) { free(buf); return; } diff --git a/src/map/magic.c b/src/map/magic.c index fcf3ad6..327fa36 100644 --- a/src/map/magic.c +++ b/src/map/magic.c @@ -61,7 +61,7 @@ magic_message(character_t *caster, int power = caster->matk1; char *invocation_base = spell_ + 8; - char *source_invocation = strchr(invocation_base, ':'); + char *source_invocation = 1 + invocation_base + strlen(caster->status.name); spell_t *spell; char *parameter; char *spell_invocation; |