Jelajahi Sumber

Fixed bug in @mount allowing you to mount dragon/mado while in disguise (BADABOOM CRASH).
Adjusted @mount for dragons to require your class to be a rune knight (so @allskill gms mount their correct job)
Added Wug riding support for @mount

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

shennetsind 13 tahun lalu
induk
melakukan
3b6c3eee25
2 mengubah file dengan 21 tambahan dan 11 penghapusan
  1. 1 1
      conf/msg_athena.conf
  2. 20 10
      src/map/atcommand.c

+ 1 - 1
conf/msg_athena.conf

@@ -225,7 +225,7 @@
 209: Character's skill points changed.
 210: Character's status points changed.
 211: Character's current zeny changed.
-212: Cannot mount a Peco Peco while in disguise.
+212: Cannot mount while in disguise.
 213: You can not mount a Peco Peco with your current job.
 214: You have released your Peco Peco.
 215: This player cannot mount a Peco Peco while in disguise.

+ 20 - 10
src/map/atcommand.c

@@ -4128,7 +4128,13 @@ ACMD_FUNC(mapinfo)
 ACMD_FUNC(mount_peco)
 {
 	nullpo_retr(-1, sd);
-	if( pc_checkskill(sd,RK_DRAGONTRAINING) > 0 ) {
+
+	if (sd->disguise) {
+		clif_displaymessage(fd, msg_txt(212)); // Cannot mount while in disguise.
+		return -1;
+	}
+
+	if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && pc_checkskill(sd,RK_DRAGONTRAINING) > 0 ) {
 		if( !(sd->sc.option&OPTION_DRAGON1) ) {
 			clif_displaymessage(sd->fd,"You have mounted your Dragon");
 			pc_setoption(sd, sd->sc.option|OPTION_DRAGON1);
@@ -4138,6 +4144,16 @@ ACMD_FUNC(mount_peco)
 		}
 		return 0;
 	}
+	if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && pc_checkskill(sd,RA_WUGRIDER) > 0 ) {
+		if( !pc_isridingwug(sd) ) {
+			clif_displaymessage(sd->fd,"You have mounted your Wug");
+			pc_setoption(sd, sd->sc.option|OPTION_WUGRIDER);
+		} else {
+			clif_displaymessage(sd->fd,"You have released your Wug");
+			pc_setoption(sd, sd->sc.option&~OPTION_WUGRIDER);
+		}
+		return 0;
+	}
 	if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) {
 		if( !(sd->sc.option&OPTION_MADOGEAR) ) {
 			clif_displaymessage(sd->fd,"You have mounted your Mado Gear");
@@ -4149,21 +4165,15 @@ ACMD_FUNC(mount_peco)
 		return 0;
 	}
 	if (!pc_isriding(sd)) { // if actually no peco
-		if (!pc_checkskill(sd, KN_RIDING))
-		{
-			clif_displaymessage(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job.
-			return -1;
-		}
 
-		if (sd->disguise)
-		{
-			clif_displaymessage(fd, msg_txt(212)); // Cannot mount a Peco Peco while in disguise.
+		if (!pc_checkskill(sd, KN_RIDING)) {
+			clif_displaymessage(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job.
 			return -1;
 		}
 
 		pc_setoption(sd, sd->sc.option | OPTION_RIDING);
 		clif_displaymessage(fd, msg_txt(102)); // You have mounted a Peco Peco.
-	} else {	//Dismount
+	} else {//Dismount
 		pc_setoption(sd, sd->sc.option & ~OPTION_RIDING);
 		clif_displaymessage(fd, msg_txt(214)); // You have released your Peco Peco.
 	}