From da190e09a33591aaabfd2c7735fd64ebb12f78e9 Mon Sep 17 00:00:00 2001 From: panikon Date: Fri, 11 Jul 2014 04:29:29 -0300 Subject: Mado behaviour changes - Corrected list of skills that can be used while using mado - Corrected list of supportive skills that can't be cast in users with mado - Fixed *setmadogear behaviour, it would set mado to any character Added SI_FALLENEMPIRE to SR_FALLENEMPIRE Added SI_SILENTBREEZE to MH_SILENTBREEZE Fixed MH_SILENTBREEZE entry in skill_db Special thanks to Rytech --- db/re/skill_db.txt | 2 +- src/map/pc.c | 24 ++++++++++---------- src/map/pc.h | 2 +- src/map/skill.c | 66 +++++++++++++++++++++--------------------------------- src/map/status.c | 7 +++--- src/map/unit.c | 1 + 6 files changed, 44 insertions(+), 58 deletions(-) diff --git a/db/re/skill_db.txt b/db/re/skill_db.txt index 8b5b8a414..c453d4eaf 100644 --- a/db/re/skill_db.txt +++ b/db/re/skill_db.txt @@ -1151,7 +1151,7 @@ 8023,0,6,4,0,0,0x1,5,1,no,0,0,0,none,0, MH_OVERED_BOOST,Overed Boost 8024,7,8,1,4:0:4:0:4,0,0,5,-6,yes,0,0,0,magic,0, MH_ERASER_CUTTER,Eraser Cutter 8025,7,8,2,4:0:4:0:4,0x2,2:2:3:3:4,5,-6,no,0,0,0,magic,0, MH_XENO_SLASHER,Xeno Slasher -8026,5:5:7:7:9,6,1,0,0x1,0,5,1,no,0,0,0,magic,0, MH_SILENT_BREEZE,Silent Breeze +8026,5:5:7:7:9,6,16,0,0x1,0,5,1,no,0,0,0,magic,0, MH_SILENT_BREEZE,Silent Breeze 8027,0,6,4,0,0x1,0,1,1,no,0,0,0,none,0, MH_STYLE_CHANGE,Style Change 8028,1,8,1,0,0,0,5,1,no,0,0,0,weapon,0, MH_SONIC_CRAW,Sonic Claw 8029,1,6,4,0,0,0,5,1,no,0,0x200,0,weapon,0, MH_SILVERVEIN_RUSH,Silver Bain Rush diff --git a/src/map/pc.c b/src/map/pc.c index 104a3cde0..fb1fae2c7 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -8118,19 +8118,18 @@ int pc_setriding(TBL_PC* sd, int flag) return 0; } -/*========================================== - * Give player a mado - *------------------------------------------*/ -int pc_setmadogear(TBL_PC* sd, int flag) -{ - if( flag ){ - if( pc->checkskill(sd,NC_MADOLICENCE) > 0 ) +/** + * Gives player a mado + * @param flag 1 Set mado + **/ +void pc_setmadogear( struct map_session_data *sd, int flag ) { + if( flag ) { + if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) pc->setoption(sd, sd->sc.option|OPTION_MADOGEAR); - } else if( pc_ismadogear(sd) ){ - pc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR); - } + } else if( pc_ismadogear(sd) ) + pc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR); - return 0; + return; } /** @@ -8154,7 +8153,8 @@ bool pc_can_attack( struct map_session_data *sd, int target_id ) { sd->sc.data[SC_TRICKDEAD] || (sd->sc.data[SC_SIREN] && sd->sc.data[SC_SIREN]->val2 == target_id) || sd->sc.data[SC_BLADESTOP] || - sd->sc.data[SC_DEEP_SLEEP] ) + sd->sc.data[SC_DEEP_SLEEP] /*|| + sd->sc.data[SC_FALLENEMPIRE]TODO*/) return false; return true; diff --git a/src/map/pc.h b/src/map/pc.h index f33127036..fb2d3dbb1 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -895,7 +895,7 @@ struct pc_interface { int (*setcart) (struct map_session_data* sd, int type); int (*setfalcon) (struct map_session_data* sd, int flag); int (*setriding) (struct map_session_data* sd, int flag); - int (*setmadogear) (struct map_session_data* sd, int flag); + void (*setmadogear) (struct map_session_data* sd, int flag); int (*changelook) (struct map_session_data *sd,int type,int val); int (*equiplookall) (struct map_session_data *sd); diff --git a/src/map/skill.c b/src/map/skill.c index 0aea718dc..0b012f3a6 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -543,23 +543,6 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd) return 1; } break; - case BS_GREED: - case WS_CARTBOOST: - case BS_HAMMERFALL: - case BS_ADRENALINE: - case MC_CARTREVOLUTION: - case MC_MAMMONITE: - case WS_MELTDOWN: - case MG_SIGHT: - case TF_HIDING: - /** - * These skills cannot be used while in mado gear (credits to Xantara) - **/ - if( pc_ismadogear(sd) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_MADOGEAR_RIDE,0); - return 1; - } - break; case SC_MANHOLE: case WM_SOUND_OF_DESTRUCTION: @@ -5039,6 +5022,21 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } } + // Supportive skills that can't be cast in users with mado + if( sd && dstsd && pc_ismadogear(dstsd) ) { + switch( skill_id ) { + case AL_HEAL: + case AL_INCAGI: + case AL_DECAGI: + case AB_RENOVATIO: + case AB_HIGHNESSHEAL: + clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0); + return 0; + default: + break; + } + } + tstatus = status->get_status_data(bl); sstatus = status->get_status_data(src); @@ -5057,10 +5055,6 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case AB_RENOVATIO: case AB_HIGHNESSHEAL: case AL_INCAGI: - if( sd && dstsd && pc_ismadogear(dstsd) ){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0); - return 0; - } case ALL_RESURRECTION: case PR_ASPERSIO: //Apparently only player casted skills can be offensive like this. @@ -9461,7 +9455,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin heal = 5 * status->get_lv(&hd->bl) + status->base_matk(&hd->battle_status, status->get_lv(&hd->bl)); status->heal(bl, heal, 0, 0); clif->skill_nodamage(src, src, skill_id, skill_lv, clif->skill_nodamage(src, bl, AL_HEAL, heal, 1)); - status->change_start(src, bl, SC_SILENCE, 100, skill_lv, 0,0,0, skill->get_time(skill_id, skill_lv),1|2|8); + status->change_start(src, src, type, 1000, skill_lv, 0, 0, 0, skill->get_time(skill_id,skill_lv), 1|2|8); + status->change_start(src, bl, type, 1000, skill_lv, 0, 0, 0, skill->get_time(skill_id,skill_lv), 1|2|8); } break; @@ -12706,28 +12701,17 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id } } + + // Check the skills that can be used whiled using mado if( pc_ismadogear(sd) ) { - switch( skill_id ) { //None Mado skills are unusable when Mado is equipped. [Jobbie] - case BS_REPAIRWEAPON: - case WS_MELTDOWN: - case BS_HAMMERFALL: - case WS_CARTBOOST: - case BS_ADRENALINE: - case WS_WEAPONREFINE: - case BS_WEAPONPERFECT: - case WS_CARTTERMINATION: - case BS_OVERTHRUST: - case WS_OVERTHRUSTMAX: - case BS_MAXIMIZE: - case BS_ADRENALINE2: - case BS_UNFAIRLYTRICK: - case BS_GREED: - clif->skill_fail(sd,skill_id,USESKILL_FAIL_MADOGEAR,0); - return 0; - default: //Only Mechanic exclusive skill can be used. - break; + if( !(skill_id > NC_MADOLICENCE && skill_id <= NC_DISJOINT) + && skill_id != NC_MAGMA_ERUPTION + && skill_id != BS_GREED ) { + clif->skill_fail(sd,skill_id,USESKILL_FAIL_MADOGEAR,0); + return 0; } } + if( skill_lv < 1 || skill_lv > MAX_SKILL_LEVEL ) return 0; diff --git a/src/map/status.c b/src/map/status.c index 0787e7cad..9c25aadc7 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -485,11 +485,11 @@ void initChangeTables(void) { add_sc(MH_POISON_MIST, SC_BLIND); set_sc(MH_PAIN_KILLER, SC_PAIN_KILLER, SI_PAIN_KILLER, SCB_ASPD); - add_sc(MH_STYLE_CHANGE , SC_STYLE_CHANGE); - set_sc( MH_TINDER_BREAKER , SC_RG_CCONFINE_S , SI_RG_CCONFINE_S , SCB_NONE ); + set_sc( MH_SILENT_BREEZE , SC_SILENCE , SI_SILENT_BREEZE , SCB_NONE ); + add_sc( MH_STYLE_CHANGE , SC_STYLE_CHANGE); + set_sc( MH_TINDER_BREAKER , SC_RG_CCONFINE_S , SI_RG_CCONFINE_S , SCB_NONE ); set_sc( MH_TINDER_BREAKER , SC_RG_CCONFINE_M , SI_RG_CCONFINE_M , SCB_FLEE ); - add_sc( MER_CRASH , SC_STUN ); set_sc( MER_PROVOKE , SC_PROVOKE , SI_PROVOKE , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK ); add_sc( MS_MAGNUM , SC_SUB_WEAPONPROPERTY ); @@ -636,6 +636,7 @@ void initChangeTables(void) { **/ add_sc( SR_DRAGONCOMBO , SC_STUN ); add_sc( SR_EARTHSHAKER , SC_STUN ); + set_sc( SR_FALLENEMPIRE , SC_STOP/*SC_FALLENEMPIRE*/ , SI_FALLENEMPIRE , SCB_NONE ); set_sc( SR_CRESCENTELBOW , SC_CRESCENTELBOW , SI_CRESCENTELBOW , SCB_NONE ); set_sc_with_vfx( SR_CURSEDCIRCLE , SC_CURSEDCIRCLE_TARGET, SI_CURSEDCIRCLE_TARGET , SCB_NONE ); set_sc( SR_LIGHTNINGWALK , SC_LIGHTNINGWALK , SI_LIGHTNINGWALK , SCB_NONE ); diff --git a/src/map/unit.c b/src/map/unit.c index e5c7c45c1..4290778e6 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -921,6 +921,7 @@ int unit_can_move(struct block_list *bl) { || (sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_SELF) // cannot move while gospel is in effect || (sc->data[SC_BASILICA] && sc->data[SC_BASILICA]->val4 == bl->id) // Basilica caster cannot move || sc->data[SC_STOP] + /*|| sc->data[SC_FALLENEMPIRE]TODO*/ || sc->data[SC_RG_CCONFINE_M] || sc->data[SC_RG_CCONFINE_S] || sc->data[SC_GS_MADNESSCANCEL] -- cgit v1.2.3-70-g09d2