diff options
author | mc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-24 22:44:30 +0000 |
---|---|---|
committer | mc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-24 22:44:30 +0000 |
commit | 6963a6654e0a33340497e7d12e9c7c6c4a0bdd6a (patch) | |
tree | df362d05f8a1bc852382c0d2e414dcf5f28b22fc /src/map | |
parent | a093dbfa6658df2636c83afb833508cc08ecb018 (diff) | |
download | hercules-6963a6654e0a33340497e7d12e9c7c6c4a0bdd6a.tar.gz hercules-6963a6654e0a33340497e7d12e9c7c6c4a0bdd6a.tar.bz2 hercules-6963a6654e0a33340497e7d12e9c7c6c4a0bdd6a.tar.xz hercules-6963a6654e0a33340497e7d12e9c7c6c4a0bdd6a.zip |
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@355 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 100 | ||||
-rw-r--r-- | src/map/atcommand.h | 2 | ||||
-rw-r--r-- | src/map/charcommand.c | 100 | ||||
-rw-r--r-- | src/map/charcommand.h | 2 |
4 files changed, 103 insertions, 101 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index adeed29c6..fa0e7f7bd 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -107,9 +107,7 @@ ATCOMMAND_FUNC(petrename); ATCOMMAND_FUNC(recall); ATCOMMAND_FUNC(recallall); ATCOMMAND_FUNC(revive); -ATCOMMAND_FUNC(character_stats); ATCOMMAND_FUNC(character_stats_all); -ATCOMMAND_FUNC(character_option); ATCOMMAND_FUNC(character_save); ATCOMMAND_FUNC(night); ATCOMMAND_FUNC(day); @@ -326,8 +324,6 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_PetRename, "@petrename", 1, atcommand_petrename }, { AtCommand_Recall, "@recall", 60, atcommand_recall }, // + /recall { AtCommand_Revive, "@revive", 60, atcommand_revive }, - { AtCommand_CharacterStatsAll, "@charstatsall", 40, atcommand_character_stats_all }, - { AtCommand_CharacterSave, "@charsave", 60, atcommand_character_save }, { AtCommand_Night, "@night", 80, atcommand_night }, { AtCommand_Day, "@day", 80, atcommand_day }, { AtCommand_Doom, "@doom", 80, atcommand_doom }, @@ -4056,51 +4052,6 @@ int atcommand_revive( } /*========================================== - * - *------------------------------------------ - */ -//** Character Stats All by fritz -int atcommand_character_stats_all(const int fd, struct map_session_data* sd, const char* command, const char* message) -{ - char output[1024], gmlevel[1024]; - int i; - int count; - struct map_session_data *pl_sd; - - memset(output, '\0', sizeof(output)); - memset(gmlevel, '\0', sizeof(gmlevel)); - - count = 0; - for(i = 0; i < fd_max; i++) { - if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) { - - if (pc_isGM(pl_sd) > 0) - sprintf(gmlevel, "| GM Lvl: %d", pc_isGM(pl_sd)); - else - sprintf(gmlevel, " "); - - sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d) | HP: %d/%d | SP: %d/%d", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class), pl_sd->status.job_level, pl_sd->status.hp, pl_sd->status.max_hp, pl_sd->status.sp, pl_sd->status.max_sp); - clif_displaymessage(fd, output); - sprintf(output, "STR: %d | AGI: %d | VIT: %d | INT: %d | DEX: %d | LUK: %d | Zeny: %d %s", pl_sd->status.str, pl_sd->status.agi, pl_sd->status.vit, pl_sd->status.int_, pl_sd->status.dex, pl_sd->status.luk, pl_sd->status.zeny, gmlevel); - clif_displaymessage(fd, output); - clif_displaymessage(fd, "--------"); - count++; - } - } - - if (count == 0) - clif_displaymessage(fd, msg_table[28]); // No player found. - else if (count == 1) - clif_displaymessage(fd, msg_table[29]); // 1 player found. - else { - sprintf(output, msg_table[30], count); // %d players found. - clif_displaymessage(fd, output); - } - - return 0; -} - -/*========================================== * charchangesex command (usage: charchangesex <player_name>) *------------------------------------------ */ @@ -4324,57 +4275,6 @@ int atcommand_char_unban( * *------------------------------------------ */ -int atcommand_character_save( - const int fd, struct map_session_data* sd, - const char* command, const char* message) -{ - char map_name[100]; - char character[100]; - struct map_session_data* pl_sd; - int x = 0, y = 0; - int m; - - memset(map_name, '\0', sizeof(map_name)); - memset(character, '\0', sizeof(character)); - - if (!message || !*message || sscanf(message, "%99s %d %d %99[^\n]", map_name, &x, &y, character) < 4 || x < 0 || y < 0) { - clif_displaymessage(fd, "Please, enter a valid save point and a player name (usage: @charsave <map> <x> <y> <charname>)."); - return -1; - } - - if (strstr(map_name, ".gat") == NULL && strstr(map_name, ".afm") == NULL && strlen(map_name) < 13) // 16 - 4 (.gat) - strcat(map_name, ".gat"); - - if ((pl_sd = map_nick2sd(character)) != NULL) { - if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can change save point only to lower or same gm level - m = map_mapname2mapid(map_name); - if (m < 0) { - clif_displaymessage(fd, msg_table[1]); // Map not found. - return -1; - } else { - if (m >= 0 && map[m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) { - clif_displaymessage(fd, "You are not authorised to set this map as a save map."); - return -1; - } - pc_setsavepoint(pl_sd, map_name, x, y); - clif_displaymessage(fd, msg_table[57]); // Character's respawn point changed. - } - } 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; -} - -/*========================================== - * - *------------------------------------------ - */ int atcommand_night( const int fd, struct map_session_data* sd, const char* command, const char* message) diff --git a/src/map/atcommand.h b/src/map/atcommand.h index f5e4fb11f..7db9de481 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -85,7 +85,7 @@ enum AtCommandType { AtCommand_CharacterStats, AtCommand_CharacterStatsAll, // AtCommand_CharacterOption, // Now #option - AtCommand_CharacterSave, +// AtCommand_CharacterSave, // Now #save AtCommand_CharacterLoad, AtCommand_Night, AtCommand_Day, diff --git a/src/map/charcommand.c b/src/map/charcommand.c index e2aa67424..763ae2ba2 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -39,6 +39,8 @@ CCMD_FUNC(petrename); CCMD_FUNC(petfriendly);
CCMD_FUNC(stats);
CCMD_FUNC(option);
+CCMD_FUNC(save);
+CCMD_FUNC(stats_all);
#ifdef TXT_ONLY
/* TXT_ONLY */
@@ -64,6 +66,8 @@ static CharCommandInfo charcommand_info[] = { { CharCommandPetFriendly, "#petfriendly", 50, charcommand_petfriendly },
{ CharCommandStats, "#stats", 40, charcommand_stats },
{ CharCommandOption, "#option", 60, charcommand_option },
+ { CharCommandSave, "#save", 60, charcommand_save },
+ { CharCommandStatsAll, "#statsall", 40, charcommand_stats_all },
#ifdef TXT_ONLY
/* TXT_ONLY */
@@ -560,3 +564,99 @@ int charcommand_option( return 0;
}
+
+/*==========================================
+ *
+ *------------------------------------------
+ */
+int charcommand_save(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ char map_name[100];
+ char character[100];
+ struct map_session_data* pl_sd;
+ int x = 0, y = 0;
+ int m;
+
+ memset(map_name, '\0', sizeof(map_name));
+ memset(character, '\0', sizeof(character));
+
+ if (!message || !*message || sscanf(message, "%99s %d %d %99[^\n]", map_name, &x, &y, character) < 4 || x < 0 || y < 0) {
+ clif_displaymessage(fd, "Please, enter a valid save point and a player name (usage: #save <map> <x> <y> <charname>).");
+ return -1;
+ }
+
+ if (strstr(map_name, ".gat") == NULL && strstr(map_name, ".afm") == NULL && strlen(map_name) < 13) // 16 - 4 (.gat)
+ strcat(map_name, ".gat");
+
+ if ((pl_sd = map_nick2sd(character)) != NULL) {
+ if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can change save point only to lower or same gm level
+ m = map_mapname2mapid(map_name);
+ if (m < 0) {
+ clif_displaymessage(fd, msg_table[1]); // Map not found.
+ return -1;
+ } else {
+ if (m >= 0 && map[m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
+ clif_displaymessage(fd, "You are not authorised to set this map as a save map.");
+ return -1;
+ }
+ pc_setsavepoint(pl_sd, map_name, x, y);
+ clif_displaymessage(fd, msg_table[57]); // Character's respawn point changed.
+ }
+ } 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 Stats All by fritz
+int charcommand_stats_all(const int fd, struct map_session_data* sd, const char* command, const char* message)
+{
+ char output[1024], gmlevel[1024];
+ int i;
+ int count;
+ struct map_session_data *pl_sd;
+
+ memset(output, '\0', sizeof(output));
+ memset(gmlevel, '\0', sizeof(gmlevel));
+
+ count = 0;
+ for(i = 0; i < fd_max; i++) {
+ if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+
+ if (pc_isGM(pl_sd) > 0)
+ sprintf(gmlevel, "| GM Lvl: %d", pc_isGM(pl_sd));
+ else
+ sprintf(gmlevel, " ");
+
+ sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d) | HP: %d/%d | SP: %d/%d", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class), pl_sd->status.job_level, pl_sd->status.hp, pl_sd->status.max_hp, pl_sd->status.sp, pl_sd->status.max_sp);
+ clif_displaymessage(fd, output);
+ sprintf(output, "STR: %d | AGI: %d | VIT: %d | INT: %d | DEX: %d | LUK: %d | Zeny: %d %s", pl_sd->status.str, pl_sd->status.agi, pl_sd->status.vit, pl_sd->status.int_, pl_sd->status.dex, pl_sd->status.luk, pl_sd->status.zeny, gmlevel);
+ clif_displaymessage(fd, output);
+ clif_displaymessage(fd, "--------");
+ count++;
+ }
+ }
+
+ if (count == 0)
+ clif_displaymessage(fd, msg_table[28]); // No player found.
+ else if (count == 1)
+ clif_displaymessage(fd, msg_table[29]); // 1 player found.
+ else {
+ sprintf(output, msg_table[30], count); // %d players found.
+ clif_displaymessage(fd, output);
+ }
+
+ return 0;
+}
diff --git a/src/map/charcommand.h b/src/map/charcommand.h index 65efb8b96..fb9345a44 100644 --- a/src/map/charcommand.h +++ b/src/map/charcommand.h @@ -8,6 +8,8 @@ enum CharCommandType { CharCommandPetFriendly,
CharCommandStats,
CharCommandOption,
+ CharCommandSave,
+ CharCommandStatsAll,
#ifdef TXT_ONLY
/* TXT_ONLY */
|