From e34faf2b5aadc6b7c5d96e865f1aa40fca04bd67 Mon Sep 17 00:00:00 2001 From: mc_cameri Date: Wed, 24 Nov 2004 23:13:58 +0000 Subject: git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@356 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 41 +---------------------------------------- src/map/atcommand.h | 5 +++-- src/map/charcommand.c | 41 +++++++++++++++++++++++++++++++++++++++++ src/map/charcommand.h | 1 + 4 files changed, 46 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index fa0e7f7bd..b2830d41c 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5,7 +5,6 @@ #include #include - #include "../common/socket.h" #include "../common/timer.h" #include "../common/nullpo.h" @@ -364,7 +363,6 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_ReloadScript, "@reloadscript", 99, atcommand_reloadscript }, // admin command #endif /* TXT_ONLY */ { AtCommand_ReloadGMDB, "@reloadgmdb", 99, atcommand_reloadgmdb }, // admin command - { AtCommand_CharReset, "@charreset", 60, atcommand_charreset }, { AtCommand_CharModel, "@charmodel", 50, atcommand_charmodel }, { AtCommand_CharSKPoint, "@charskpoint", 60, atcommand_charskpoint }, { AtCommand_CharSTPoint, "@charstpoint", 60, atcommand_charstpoint }, @@ -480,6 +478,7 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_SendMail, "@sendmail", 1, atcommand_sendmail }, // [Valaris] { AtCommand_SendPriorityMail, "@sendprioritymail",80, atcommand_sendmail }, // [Valaris] { AtCommand_RefreshOnline, "@refreshonline", 99, atcommand_refreshonline }, // [Valaris] + #endif /* TXT_ONLY */ // add new commands before this line @@ -5089,44 +5088,6 @@ int atcommand_charstreset( return 0; } -/*========================================== - * Character Reset - *------------------------------------------ - */ -int atcommand_charreset( - const int fd, struct map_session_data* sd, - const char* command, const char* message) -{ - char character[100]; - char output[200]; - struct map_session_data *pl_sd; - - memset(character, '\0', sizeof(character)); - memset(output, '\0', sizeof(output)); - - if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) { - clif_displaymessage(fd, "Please, enter a player name (usage: @charreset )."); - return -1; - } - - if ((pl_sd = map_nick2sd(character)) != NULL) { - if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can reset a character only for lower or same GM level - pc_resetstate(pl_sd); - pc_resetskill(pl_sd); - sprintf(output, msg_table[208], character); // '%s' skill and stats points reseted! - clif_displaymessage(fd, output); - } else { - clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player. - return -1; - } - } else { - clif_displaymessage(fd, msg_table[3]); // Character not found. - return -1; - } - - return 0; -} - /*========================================== * Character Model by chbrules *------------------------------------------ diff --git a/src/map/atcommand.h b/src/map/atcommand.h index 7db9de481..ee715bc4d 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -82,7 +82,7 @@ enum AtCommandType { AtCommand_Recall, // AtCommand_CharacterJob, // Now #jobchange AtCommand_Revive, - AtCommand_CharacterStats, +// AtCommand_CharacterStats, // Now #stats AtCommand_CharacterStatsAll, // AtCommand_CharacterOption, // Now #option // AtCommand_CharacterSave, // Now #save @@ -111,7 +111,6 @@ enum AtCommandType { AtCommand_IDSearch, AtCommand_CharSkReset, AtCommand_CharStReset, - AtCommand_CharReset, //by chbrules AtCommand_CharModel, AtCommand_CharSKPoint, @@ -250,7 +249,9 @@ int atcommand_config_read(const char *cfgName); int msg_config_read(const char *cfgName); char *str_lower(char *str); + char * job_name(int class); +int e_mail_check(unsigned char *email); #endif diff --git a/src/map/charcommand.c b/src/map/charcommand.c index 763ae2ba2..27dbd260f 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -41,6 +41,7 @@ CCMD_FUNC(stats); CCMD_FUNC(option); CCMD_FUNC(save); CCMD_FUNC(stats_all); +CCMD_FUNC(reset); #ifdef TXT_ONLY /* TXT_ONLY */ @@ -66,6 +67,7 @@ static CharCommandInfo charcommand_info[] = { { CharCommandPetFriendly, "#petfriendly", 50, charcommand_petfriendly }, { CharCommandStats, "#stats", 40, charcommand_stats }, { CharCommandOption, "#option", 60, charcommand_option }, + { CharCommandReset, "#reset", 60, charcommand_reset }, { CharCommandSave, "#save", 60, charcommand_save }, { CharCommandStatsAll, "#statsall", 40, charcommand_stats_all }, @@ -494,6 +496,44 @@ int charcommand_stats( return 0; } +/*========================================== + * Character Reset + *------------------------------------------ + */ +int charcommand_reset( + const int fd, struct map_session_data* sd, + const char* command, const char* message) +{ + char character[100]; + char output[200]; + struct map_session_data *pl_sd; + + memset(character, '\0', sizeof(character)); + memset(output, '\0', sizeof(output)); + + if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) { + clif_displaymessage(fd, "Please, enter a player name (usage: #reset )."); + return -1; + } + + if ((pl_sd = map_nick2sd(character)) != NULL) { + if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can reset a character only for lower or same GM level + pc_resetstate(pl_sd); + pc_resetskill(pl_sd); + sprintf(output, msg_table[208], character); // '%s' skill and stats points reseted! + clif_displaymessage(fd, output); + } else { + clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player. + return -1; + } + } else { + clif_displaymessage(fd, msg_table[3]); // Character not found. + return -1; + } + + return 0; +} + /*========================================== * *------------------------------------------ @@ -660,3 +700,4 @@ int charcommand_stats_all(const int fd, struct map_session_data* sd, const char* return 0; } + diff --git a/src/map/charcommand.h b/src/map/charcommand.h index fb9345a44..8fb17fb64 100644 --- a/src/map/charcommand.h +++ b/src/map/charcommand.h @@ -6,6 +6,7 @@ enum CharCommandType { CharCommandJobChange, CharCommandPetRename, CharCommandPetFriendly, + CharCommandReset, CharCommandStats, CharCommandOption, CharCommandSave, -- cgit v1.2.3-70-g09d2