Просмотр исходного кода

git-svn-id: https://svn.code.sf.net/p/rathena/svn/athena@355 54d463be-8e91-2dee-dedb-b68131a5f0ec

mc_cameri 20 лет назад
Родитель
Сommit
1102e9d06b

+ 2 - 0
Changelog.txt

@@ -1,5 +1,7 @@
 Date	Added
 11/24
+	* @charstatsall is now #statsall [MC Cameri]
+	* @charsave is now #save [MC Cameri]
 	* Updated most of jA's 1067; battle.c and skill.c might need more updates! [Codemaster]
 	* Fixed char-txt crashing when closing, Codemaster free()'s. [MC Cameri]
         * Skill Updates: - Updated guild skills (60%) [celest]

+ 3 - 26
conf-tmpl/atcommand_athena.conf

@@ -2,7 +2,7 @@
 // Translated by Peter Kieser <pfak@telus.net>
 
 // Set here the symbol that you want to use for your commands
-// Only 1 character is get (default is '@'). You can set any character,
+// Only 1 character is get (default is character_savecharacter_save'@'). You can set any character,
 // except control-character (0x00-0x1f), '%' (party chat speaking) and '/' (standard ragnarok GM commands)
 // With default character, all commands begin by a '@': <example> @revive
 command_symbol: @
@@ -40,6 +40,8 @@ command_symbol: @
 // 0: normal player commands
 
 // Give server time. (6 same commands)
+uptime: 0
+changesex: 0
 time: 0
 date: 0
 server_date: 0
@@ -119,9 +121,6 @@ mountpeco: 20
 who: 20
 whois: 20
 
-// Returns list of top 50 logged in characters and their zeny based on zeny sorted from highest amount to lowest.
-whozeny: 20
-
 // Returns list of logged in characters with their job.
 who2: 20
 
@@ -172,12 +171,6 @@ kamib: 40
 // Enables you to go to a certain map, at (x,y) coordinates. (@mapmove + /mm or /mapmove)
 mapmove: 40
 
-// Enables you to view other characters stats.
-charstats: 40
-
-// Shows Stats Of All Characters Online
-charstatsall: 40
-
 // Enables GVG on a map (2 same commands).
 gvgon: 40
 gpvpon: 40
@@ -294,9 +287,6 @@ useskill: 40
 // make another player killable
 charkillable: 40
 
-// makes everyone on server do a random emote
-happyhappyjoyjoy:40
-
 //---------------------
 // 50: Sub-GM+ commands
 
@@ -313,19 +303,12 @@ spawn: 50
 monster: 50
 summon: 50
 
-// Spawns monster in small or big size.
-monstersmall: 50
-monsterbig: 50
-
 // Spawns a monster with parameters not in same order of @spawn.
 monster2: 50
 
 // To get a peco to (un)ride for another player.
 charmountpeco: 50
 
-// Enables to give possibility to a player to rename his/her pet.
-charpetrename: 50
-
 
 //----------------
 // 60: GM commands
@@ -361,12 +344,6 @@ chardelitem: 60
 // Sets another persons job level.
 charjlvl: 60
 
-// Sets the job of another character (2 same commands).
-charjob: 60
-charjobchange: 60
-
-// Set options on another character.
-charoption: 60
 
 // Gives another character status points
 charstpoint: 60

+ 7 - 3
conf-tmpl/charcommand_athena.conf

@@ -1,14 +1,18 @@
 // Athena charcommand Configuration file.
-// Created by MC Cameri for eAthena
+// Translated by Peter Kieser <pfak@telus.net>
 
 // Set here the symbol that you want to use for your commands
 // Only 1 character is get (default is '#'). You can set any character,
 // except control-character (0x00-0x1f), '%' (party chat speaking) and '/' (standard ragnarok GM commands)
-// With default character, all commands begin by a '#', example: #revive
+// and '@' (Standard GM Commands)
+// With default character, all commands begin by a '#', example: #save SomePlayer
 command_symbol: #
 
 job: 60
 jobchange: 60
 petrename: 50
 petfriendly: 50
-stats: 40
+stats: 40
+option: 60
+save: 60
+statsall: 40

+ 0 - 100
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 },
@@ -4055,51 +4051,6 @@ int atcommand_revive(
 	return 0;
 }
 
-/*==========================================
- *
- *------------------------------------------
- */
-//** 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>)
  *------------------------------------------
@@ -4320,57 +4271,6 @@ int atcommand_char_unban(
 	return 0;
 }
 
-/*==========================================
- *
- *------------------------------------------
- */
-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;
-}
-
 /*==========================================
  *
  *------------------------------------------

+ 1 - 1
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,

+ 100 - 0
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;
+}

+ 2 - 0
src/map/charcommand.h

@@ -8,6 +8,8 @@ enum CharCommandType {
 	CharCommandPetFriendly,
 	CharCommandStats,
 	CharCommandOption,
+	CharCommandSave,
+	CharCommandStatsAll,
 
 #ifdef TXT_ONLY
 /* TXT_ONLY */