From 8a6272097a75d0fa77a4878d0970382ac6d86bf7 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 22 Mar 2012 01:05:39 +0000 Subject: 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15744 54d463be-8e91-2dee-dedb-b68131a5f0ec --- conf/msg_athena.conf | 2 +- src/map/atcommand.c | 30 ++++++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/conf/msg_athena.conf b/conf/msg_athena.conf index b88614663..2f304ad07 100644 --- a/conf/msg_athena.conf +++ b/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. diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 81db5731c..7de68236c 100644 --- a/src/map/atcommand.c +++ b/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. } -- cgit v1.2.3-70-g09d2