Explorar o código

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

mc_cameri %!s(int64=20) %!d(string=hai) anos
pai
achega
2e0c62e875
Modificáronse 5 ficheiros con 58 adicións e 21 borrados
  1. 3 1
      Changelog.txt
  2. 13 0
      conf-tmpl/charcommand_athena.conf
  3. 4 2
      src/map/atcommand.c
  4. 27 18
      src/map/charcommand.c
  5. 11 0
      src/map/clif.c

+ 3 - 1
Changelog.txt

@@ -1,6 +1,8 @@
 Date	Added
 11/22
 	* Added the old effect list # into effect_list.txt of spira's. [shadow]
+	* Added new flag (#3) to clif_specialeffect [MC Cameri]
+	* @doom,@die,@doommap now display the Dark Cross effect on you. [MC Cameri]
 11/21
 	* Display IP when wdata is expanded [Wizputer]
 	* Added bClassChange,%; Has random chance to turn monster into another monster. [Valaris]
@@ -13,7 +15,7 @@ Date	Added
           - Fixed a typo with Blade Stop that was causing crashes, sorry. ^^;
           - Reverted changes to Cloaking, ours is already more updated! ^_^
           - Added temporary code for guild skills to stop crashing
-	* @alive, @raisemap, @raise now display the resurrection skill animation [MC Cameri]
+	* @alive, @raisemap, @raise, @revive now display the resurrection skill animation [MC Cameri]
 	* @charpetrename(AtCommand) is now #petrename(CharCommand) [MC Cameri]
 	* @charjob/(AtCommand) is now #jobchange(CharCommand) [MC Cameri]
 	* Removed japanese interserver packets, should fix various problems (jumpto, where, charposreq). [Valaris]

+ 13 - 0
conf-tmpl/charcommand_athena.conf

@@ -0,0 +1,13 @@
+// Athena charcommand Configuration file.
+// 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
+command_symbol: #
+
+job: 60
+jobchange: 60
+petrename: 50
+petfriendly: 50

+ 4 - 2
src/map/atcommand.c

@@ -1974,6 +1974,7 @@ int atcommand_die(
 	const int fd, struct map_session_data* sd,
 	const char* command, const char* message)
 {
+	clif_specialeffect(&sd->bl,450,1);
 	pc_damage(NULL, sd, sd->status.hp + 1);
 	clif_displaymessage(fd, msg_table[13]); // A pity! You've died.
 
@@ -4571,7 +4572,7 @@ int atcommand_doom(
 {
 	struct map_session_data *pl_sd;
 	int i;
-
+	clif_specialeffect(&sd->bl,450,2);
 	for(i = 0; i < fd_max; i++) {
 		if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && i != fd &&
 		    pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can doom only lower or same gm level
@@ -4594,11 +4595,12 @@ int atcommand_doommap(
 {
 	struct map_session_data *pl_sd;
 	int i;
-
+	clif_specialeffect(&sd->bl,450,3);
 	for (i = 0; i < fd_max; i++) {
 		if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && i != fd && sd->bl.m == pl_sd->bl.m &&
 		    pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can doom only lower or same gm level
 			pc_damage(NULL, pl_sd, pl_sd->status.hp + 1);
+//			clif_specialeffect(&pl_sd->bl,450,1);
 			clif_displaymessage(pl_sd->fd, msg_table[61]); // The holy messenger has given judgement.
 		}
 	}

+ 27 - 18
src/map/charcommand.c

@@ -391,41 +391,50 @@ int charcommand_petfriendly(
 {
 	int friendly = 0;
 	int t = 0;
+	char character[100];
+	struct map_session_data *pl_sd;
 
-	if (!message || !*message || (friendly = atoi(message)) < 0) {
+	memset(character, '\0', sizeof(character));
+	if (!message || !*message || sscanf(message,"%d %s",&friendly,character) < 2) {
 		clif_displaymessage(fd, "Please, enter a valid value (usage: "
 			"#petfriendly <0-1000> <player>).");
 		return 0;
 	}
 
-	if (sd->status.pet_id > 0 && sd->pd) {
-		if (friendly >= 0 && friendly <= 1000) {
-			if (friendly != sd->pet.intimate) {
-				t = sd->pet.intimate;
-				sd->pet.intimate = friendly;
-				clif_send_petstatus(sd);
-				if (battle_config.pet_status_support) {
-					if ((sd->pet.intimate > 0 && t <= 0) ||
-					    (sd->pet.intimate <= 0 && t > 0)) {
-						if (sd->bl.prev != NULL)
-							pc_calcstatus(sd, 0);
-						else
-							pc_calcstatus(sd, 2);
+	if (((pl_sd = map_nick2sd(character)) != NULL) && pc_isGM(sd)>pc_isGM(pl_sd)) {
+		if (pl_sd->status.pet_id > 0 && pl_sd->pd) {
+			if (friendly >= 0 && friendly <= 1000) {
+				if (friendly != pl_sd->pet.intimate) {
+					t = pl_sd->pet.intimate;
+					pl_sd->pet.intimate = friendly;
+					clif_send_petstatus(pl_sd);
+					if (battle_config.pet_status_support) {
+						if ((pl_sd->pet.intimate > 0 && t <= 0) ||
+						    (pl_sd->pet.intimate <= 0 && t > 0)) {
+							if (pl_sd->bl.prev != NULL)
+								pc_calcstatus(pl_sd, 0);
+							else
+								pc_calcstatus(pl_sd, 2);
+						}
 					}
+					clif_displaymessage(pl_sd->fd, msg_table[182]); // Pet friendly value changed!
+					clif_displaymessage(sd->fd, msg_table[182]); // Pet friendly value changed!
+				} else {
+					clif_displaymessage(fd, msg_table[183]); // Pet friendly is already the good value.
+					return -1;
 				}
-				clif_displaymessage(fd, msg_table[182]); // Pet friendly value changed!
 			} else {
-				clif_displaymessage(fd, msg_table[183]); // Pet friendly is already the good value.
+				clif_displaymessage(fd, msg_table[37]); // An invalid number was specified.
 				return -1;
 			}
 		} else {
-			clif_displaymessage(fd, msg_table[37]); // An invalid number was specified.
 			return -1;
 		}
 	} else {
-		clif_displaymessage(fd, msg_table[184]); // Sorry, but you have no pet.
+		clif_displaymessage(fd, msg_table[3]); // Character not found.
 		return -1;
 	}
 
 	return 0;
 }
+

+ 11 - 0
src/map/clif.c

@@ -7051,6 +7051,17 @@ int clif_specialeffect(struct block_list *bl, int type, int flag) {
 	WBUFL(buf,2) = bl->id;
 	WBUFL(buf,6) = type;
 
+	if (flag == 3) {
+//		struct map_session_data *sd;
+		struct map_session_data *pl_sd;
+		int i;
+		for(i = 0; i < fd_max; i++) {
+			if (session[i] && (pl_sd = session[i]->session_data) != NULL && 
+				pl_sd->state.auth && 
+				(pc_isGM((struct map_session_data *)&bl) > pc_isGM((struct map_session_data *)&pl_sd->bl)))
+				clif_specialeffect(&pl_sd->bl, type, 1);
+		}
+	}
 	if (flag == 2) {
 		struct map_session_data *sd;
 		int i;