diff options
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 182 |
1 files changed, 104 insertions, 78 deletions
diff --git a/src/map/status.c b/src/map/status.c index a8a0f066d..66f7db3fa 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -643,7 +643,7 @@ void initChangeTables(void) { set_sc( SR_RAISINGDRAGON , SC_RAISINGDRAGON , SI_RAISINGDRAGON , SCB_REGEN|SCB_MAXHP|SCB_MAXSP ); set_sc( SR_GENTLETOUCH_ENERGYGAIN, SC_GENTLETOUCH_ENERGYGAIN , SI_GENTLETOUCH_ENERGYGAIN, SCB_NONE ); set_sc( SR_GENTLETOUCH_CHANGE , SC_GENTLETOUCH_CHANGE , SI_GENTLETOUCH_CHANGE , SCB_ASPD|SCB_MDEF|SCB_MAXHP ); - set_sc( SR_GENTLETOUCH_REVITALIZE, SC_GENTLETOUCH_REVITALIZE , SI_GENTLETOUCH_REVITALIZE, SCB_MAXHP|SCB_REGEN ); + set_sc( SR_GENTLETOUCH_REVITALIZE, SC_GENTLETOUCH_REVITALIZE , SI_GENTLETOUCH_REVITALIZE, SCB_MAXHP|SCB_DEF2|SCB_REGEN ); set_sc( SR_FLASHCOMBO , SC_FLASHCOMBO , SI_FLASHCOMBO , SCB_WATK ); /** * Wanderer / Minstrel @@ -935,13 +935,16 @@ void initChangeTables(void) { status->ChangeFlagTable[SC_INCHITRATE] |= SCB_HIT; status->ChangeFlagTable[SC_INCFLEE] |= SCB_FLEE; status->ChangeFlagTable[SC_INCFLEERATE] |= SCB_FLEE; + status->ChangeFlagTable[SC_MTF_HITFLEE] |= SCB_HIT|SCB_FLEE; status->ChangeFlagTable[SC_CRITICALPERCENT] |= SCB_CRI; status->ChangeFlagTable[SC_INCASPDRATE] |= SCB_ASPD; status->ChangeFlagTable[SC_PLUSAVOIDVALUE] |= SCB_FLEE2; status->ChangeFlagTable[SC_INCMHPRATE] |= SCB_MAXHP; status->ChangeFlagTable[SC_INCMSPRATE] |= SCB_MAXSP; status->ChangeFlagTable[SC_INCMHP] |= SCB_MAXHP; + status->ChangeFlagTable[SC_MTF_MHP] |= SCB_MAXHP; status->ChangeFlagTable[SC_INCMSP] |= SCB_MAXSP; + status->ChangeFlagTable[SC_MTF_MSP] |= SCB_MAXSP; status->ChangeFlagTable[SC_INCATKRATE] |= SCB_BATK|SCB_WATK; status->ChangeFlagTable[SC_INCMATKRATE] |= SCB_MATK; status->ChangeFlagTable[SC_INCDEFRATE] |= SCB_DEF; @@ -1795,9 +1798,9 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin //If targeting, cloak+hide protect you, otherwise only hiding does. hide_flag = flag?OPTION_HIDE:(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK); - // There is no NF for ground skills, but every earth type skill out there - // affects hidding except Stone Curse - if( skill->get_ele(skill_id,1) == ELE_EARTH && skill_id != MG_STONECURSE) + // Applies even if the target hides + if ((skill->get_ele(skill_id,1) == ELE_EARTH && skill_id != MG_STONECURSE) // Ground type + || (flag&1 && skill->get_nk(skill_id)&NK_NO_DAMAGE && skill_id != ALL_RESURRECTION)) // Buff/debuff skills started before hiding hide_flag &= ~OPTION_HIDE; switch( target->type ) { @@ -1809,7 +1812,6 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin return 0; if( tsc ) { if (tsc->option&hide_flag && !is_boss && - !(flag&1 && skill->get_nk(skill_id)&NK_NO_DAMAGE) && // Buff/debuff skills that started casting before hiding still applies ((sd->special_state.perfect_hiding || !is_detect) || (tsc->data[SC_CLOAKINGEXCEED] && is_detect))) return 0; @@ -2485,13 +2487,14 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { bstatus->mode = MD_MASK&~(MD_BOSS|MD_PLANT|MD_DETECTOR|MD_ANGRY|MD_TARGETWEAK); bstatus->size = (sd->class_&JOBL_BABY)?SZ_SMALL:SZ_MEDIUM; - if (battle_config.character_size && (pc_isriding(sd) || pc_isridingdragon(sd)) ) { //[Lupus] + if (battle_config.character_size && (pc_isridingpeco(sd) || pc_isridingdragon(sd))) { //[Lupus] if (sd->class_&JOBL_BABY) { if (battle_config.character_size&SZ_BIG) bstatus->size++; - } else + } else { if(battle_config.character_size&SZ_MEDIUM) bstatus->size++; + } } bstatus->aspd_rate = 1000; bstatus->ele_lv = 1; @@ -2780,9 +2783,10 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { sd->left_weapon.atkmods[1] = status->atkmods[1][sd->weapontype2]; sd->left_weapon.atkmods[2] = status->atkmods[2][sd->weapontype2]; - if( (pc_isriding(sd) || pc_isridingdragon(sd)) && - (sd->status.weapon==W_1HSPEAR || sd->status.weapon==W_2HSPEAR)) - { //When Riding with spear, damage modifier to mid-class becomes + if ((pc_isridingpeco(sd) || pc_isridingdragon(sd)) + && (sd->status.weapon==W_1HSPEAR || sd->status.weapon==W_2HSPEAR) + ) { + //When Riding with spear, damage modifier to mid-class becomes //same as versus large size. sd->right_weapon.atkmods[1] = sd->right_weapon.atkmods[2]; sd->left_weapon.atkmods[1] = sd->left_weapon.atkmods[2]; @@ -3062,9 +3066,9 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { if((skill_lv=pc->checkskill(sd,GS_SINGLEACTION))>0 && (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE)) bstatus->aspd_rate -= ((skill_lv+1)/2) * 10; - if(pc_isriding(sd)) + if (pc_isridingpeco(sd)) bstatus->aspd_rate += 500-100*pc->checkskill(sd,KN_CAVALIERMASTERY); - else if(pc_isridingdragon(sd)) + else if (pc_isridingdragon(sd)) bstatus->aspd_rate += 250-50*pc->checkskill(sd,RK_DRAGONTRAINING); #else // needs more info if((skill_lv=pc->checkskill(sd,SA_ADVANCEDBOOK))>0 && sd->status.weapon == W_BOOK) @@ -3074,9 +3078,9 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { if((skill_lv=pc->checkskill(sd,GS_SINGLEACTION))>0 && (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE)) bstatus->aspd_rate += ((skill_lv+1)/2) * 10; - if(pc_isriding(sd)) + if (pc_isridingpeco(sd)) bstatus->aspd_rate -= 500-100*pc->checkskill(sd,KN_CAVALIERMASTERY); - else if(pc_isridingdragon(sd)) + else if (pc_isridingdragon(sd)) bstatus->aspd_rate -= 250-50*pc->checkskill(sd,RK_DRAGONTRAINING); #endif bstatus->adelay = 2*bstatus->amotion; @@ -3094,7 +3098,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { // Weight if((skill_lv=pc->checkskill(sd,MC_INCCARRY))>0) sd->max_weight += 2000*skill_lv; - if(pc_isriding(sd) && pc->checkskill(sd,KN_RIDING)>0) + if (pc_isridingpeco(sd) && pc->checkskill(sd,KN_RIDING) > 0) sd->max_weight += 10000; else if(pc_isridingdragon(sd)) sd->max_weight += 5000+2000*pc->checkskill(sd,RK_DRAGONTRAINING); @@ -3603,8 +3607,7 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str regen->flag&=~sce->val4; //Remove regen as specified by val4 } if(sc->data[SC_GENTLETOUCH_REVITALIZE]) { - regen->hp = cap_value(regen->hp*sc->data[SC_GENTLETOUCH_REVITALIZE]->val3/100, 1, SHRT_MAX); - regen->state.walk= 1; + regen->hp += regen->hp * ( 30 * sc->data[SC_GENTLETOUCH_REVITALIZE]->val1 + 50 ) / 100; } if ((sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 1) //if insignia lvl 1 || (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 1) @@ -4232,7 +4235,7 @@ unsigned short status_calc_str(struct block_list *bl, struct status_change *sc, if(sc->data[SC_STOMACHACHE]) str -= sc->data[SC_STOMACHACHE]->val1; if(sc->data[SC_KYOUGAKU]) - str -= sc->data[SC_KYOUGAKU]->val2; + str -= sc->data[SC_KYOUGAKU]->val3; if(sc->data[SC_FULL_THROTTLE]) str += str * 20 / 100; @@ -4287,7 +4290,7 @@ unsigned short status_calc_agi(struct block_list *bl, struct status_change *sc, if(sc->data[SC_STOMACHACHE]) agi -= sc->data[SC_STOMACHACHE]->val1; if(sc->data[SC_KYOUGAKU]) - agi -= sc->data[SC_KYOUGAKU]->val2; + agi -= sc->data[SC_KYOUGAKU]->val3; if(sc->data[SC_MARSHOFABYSS]) agi -= agi * sc->data[SC_MARSHOFABYSS]->val2 / 100; @@ -4335,7 +4338,7 @@ unsigned short status_calc_vit(struct block_list *bl, struct status_change *sc, if(sc->data[SC_STOMACHACHE]) vit -= sc->data[SC_STOMACHACHE]->val1; if(sc->data[SC_KYOUGAKU]) - vit -= sc->data[SC_KYOUGAKU]->val2; + vit -= sc->data[SC_KYOUGAKU]->val3; if(sc->data[SC_NOEQUIPARMOR]) vit -= vit * sc->data[SC_NOEQUIPARMOR]->val2/100; @@ -4393,7 +4396,7 @@ unsigned short status_calc_int(struct block_list *bl, struct status_change *sc, if(sc->data[SC_STOMACHACHE]) int_ -= sc->data[SC_STOMACHACHE]->val1; if(sc->data[SC_KYOUGAKU]) - int_ -= sc->data[SC_KYOUGAKU]->val2; + int_ -= sc->data[SC_KYOUGAKU]->val3; if(bl->type != BL_PC){ if(sc->data[SC_NOEQUIPHELM]) @@ -4455,7 +4458,7 @@ unsigned short status_calc_dex(struct block_list *bl, struct status_change *sc, if(sc->data[SC_STOMACHACHE]) dex -= sc->data[SC_STOMACHACHE]->val1; if(sc->data[SC_KYOUGAKU]) - dex -= sc->data[SC_KYOUGAKU]->val2; + dex -= sc->data[SC_KYOUGAKU]->val3; if(sc->data[SC_MARSHOFABYSS]) dex -= dex * sc->data[SC_MARSHOFABYSS]->val2 / 100; @@ -4503,7 +4506,7 @@ unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc, if(sc->data[SC_STOMACHACHE]) luk -= sc->data[SC_STOMACHACHE]->val1; if(sc->data[SC_KYOUGAKU]) - luk -= sc->data[SC_KYOUGAKU]->val2; + luk -= sc->data[SC_KYOUGAKU]->val3; if(sc->data[SC_LAUDARAMUS]) luk += 4 + sc->data[SC_LAUDARAMUS]->val1; @@ -4712,6 +4715,8 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, if( !viewable ){ /* some statuses that are hidden in the status window */ + if (sc->data[SC_MINDBREAKER]) + matk += matk * sc->data[SC_MINDBREAKER]->val2/100; return (unsigned short)cap_value(matk,0,USHRT_MAX); } @@ -4736,8 +4741,6 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, if (sc->data[SC_IZAYOI]) matk += 25 * sc->data[SC_IZAYOI]->val1; #endif - if (sc->data[SC_MINDBREAKER]) - matk += matk * sc->data[SC_MINDBREAKER]->val2/100; if( sc->data[SC_ZANGETSU] ) matk += sc->data[SC_ZANGETSU]->val3; if (sc->data[SC_MAGICPOWER] && sc->data[SC_MAGICPOWER]->val4) @@ -4804,6 +4807,8 @@ signed short status_calc_hit(struct block_list *bl, struct status_change *sc, in if(sc->data[SC_INCHIT]) hit += sc->data[SC_INCHIT]->val1; + if(sc->data[SC_MTF_HITFLEE]) + hit += sc->data[SC_MTF_HITFLEE]->val1; if(sc->data[SC_FOOD_BASICHIT]) hit += sc->data[SC_FOOD_BASICHIT]->val1; if(sc->data[SC_TRUESIGHT]) @@ -4855,6 +4860,8 @@ signed short status_calc_flee(struct block_list *bl, struct status_change *sc, i if(sc->data[SC_INCFLEE]) flee += sc->data[SC_INCFLEE]->val1; + if(sc->data[SC_MTF_HITFLEE]) + flee += sc->data[SC_MTF_HITFLEE]->val2; if(sc->data[SC_FOOD_BASICAVOIDANCE]) flee += sc->data[SC_FOOD_BASICAVOIDANCE]->val1; if(sc->data[SC_WHISTLE]) @@ -4955,8 +4962,6 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def def -= def * 50 / 100; if( sc->data[SC_NEUTRALBARRIER] ) def += def * (10 + 5*sc->data[SC_NEUTRALBARRIER]->val1) / 100; - if( sc && sc->data[SC_GENTLETOUCH_REVITALIZE] && sc->data[SC_GENTLETOUCH_REVITALIZE]->val4 ) - def += 2 * sc->data[SC_GENTLETOUCH_REVITALIZE]->val4; if( sc->data[SC_FORCEOFVANGUARD] ) def += def * 2 * sc->data[SC_FORCEOFVANGUARD]->val1 / 100; if(sc->data[SC_DEFSET]) @@ -5060,6 +5065,8 @@ signed short status_calc_def2(struct block_list *bl, struct status_change *sc, i #endif if( sc && sc->data[SC_CAMOUFLAGE] ) def2 -= def2 * 5 * (10-sc->data[SC_CAMOUFLAGE]->val4) / 100; + if(sc->data[SC_GENTLETOUCH_REVITALIZE]) + def2 += sc->data[SC_GENTLETOUCH_REVITALIZE]->val2; if(sc->data[SC_DEFSET]) return sc->data[SC_DEFSET]->val1; #ifdef RENEWAL @@ -5232,16 +5239,16 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc { int val = 0; - if( sc->data[SC_FUSION] ) + if(sc->data[SC_FUSION]) { val = 25; - else if( sd ) { - if( pc_isriding(sd) || sd->sc.option&(OPTION_DRAGON) || sd->sc.data[SC_ALL_RIDING] ) + } else if (sd) { + if (pc_isridingpeco(sd) || pc_isridingdragon(sd) || sd->sc.data[SC_ALL_RIDING]) val = 25;//Same bonus - else if( pc_isridingwug(sd) ) + else if (pc_isridingwug(sd)) val = 15 + 5 * pc->checkskill(sd, RA_WUGRIDER); - else if( pc_ismadogear(sd) ) { + else if (pc_ismadogear(sd)) { val = (- 10 * (5 - pc->checkskill(sd,NC_MADOLICENCE))); - if( sc->data[SC_ACCELERATION] ) + if (sc->data[SC_ACCELERATION]) val += 25; } } @@ -5699,6 +5706,8 @@ unsigned int status_calc_maxhp(struct block_list *bl, struct status_change *sc, maxhp += maxhp * sc->data[SC_INCMHPRATE]->val1/100; if(sc->data[SC_INCMHP]) maxhp += (sc->data[SC_INCMHP]->val1); + if(sc->data[SC_MTF_MHP]) + maxhp += (sc->data[SC_MTF_MHP]->val1); if(sc->data[SC_APPLEIDUN]) maxhp += maxhp * sc->data[SC_APPLEIDUN]->val2/100; if(sc->data[SC_DELUGE]) @@ -5766,6 +5775,8 @@ unsigned int status_calc_maxsp(struct block_list *bl, struct status_change *sc, maxsp += maxsp * sc->data[SC_INCMSPRATE]->val1/100; if(sc->data[SC_INCMSP]) maxsp += (sc->data[SC_INCMSP]->val1); + if(sc->data[SC_MTF_MSP]) + maxsp += (sc->data[SC_MTF_MSP]->val1); if(sc->data[SC_SERVICEFORYOU]) maxsp += maxsp * sc->data[SC_SERVICEFORYOU]->val2/100; if(sc->data[SC_MER_SP]) @@ -6014,7 +6025,9 @@ int status_get_party_id(struct block_list *bl) { return ((TBL_MER*)bl)->master->status.party_id; break; case BL_SKILL: - return ((TBL_SKILL*)bl)->group->party_id; + if (((TBL_SKILL*)bl)->group) + return ((TBL_SKILL*)bl)->group->party_id; + break; case BL_ELEM: if (((TBL_ELEM*)bl)->master) return ((TBL_ELEM*)bl)->master->status.party_id; @@ -6057,7 +6070,9 @@ int status_get_guild_id(struct block_list *bl) { return ((TBL_NPC*)bl)->u.scr.guild_id; break; case BL_SKILL: - return ((TBL_SKILL*)bl)->group->guild_id; + if (((TBL_SKILL*)bl)->group) + return ((TBL_SKILL*)bl)->group->guild_id; + break; case BL_ELEM: if (((TBL_ELEM*)bl)->master) return ((TBL_ELEM*)bl)->master->status.guild_id; @@ -6179,7 +6194,7 @@ void status_set_viewdata(struct block_list *bl, int class_) { TBL_PC* sd = (TBL_PC*)bl; if (pcdb_checkid(class_)) { - if (sd->sc.option&OPTION_RIDING) { + if (pc_isridingpeco(sd)) { switch (class_) { //Adapt class to a Mounted one. case JOB_KNIGHT: class_ = JOB_KNIGHT2; @@ -6559,9 +6574,6 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ case SC_SIREN: tick_def2 = (status->get_lv(bl) * 100) + ((bl->type == BL_PC)?((TBL_PC*)bl)->status.job_level : 0); break; - case SC_KYOUGAKU: - tick_def2 = st->int_ * 50; - break; case SC_NEEDLE_OF_PARALYZE: tick_def2 = (st->vit + st->luk) * 50; break; @@ -6876,7 +6888,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t ) return 0; case SC_VACUUM_EXTREME: - if(sc->data[SC_HALLUCINATIONWALK] || sc->data[SC_HOVERING]) + if(sc->data[SC_HALLUCINATIONWALK]) return 0; break; case SC_STONE: @@ -7885,8 +7897,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_RUWACH: case SC_WZ_SIGHTBLASTER: val3 = skill->get_splash(val2, val1); //Val2 should bring the skill-id. - val2 = tick/250; - tick_time = 10; // [GodLesZ] tick time + val2 = tick/20; + tick_time = 20; // [GodLesZ] tick time break; //Permanent effects. @@ -8585,14 +8597,22 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t val2 = 20 + 10 * val1; //ASPD. Need to confirm if Movement Speed reduction is the same. [Jobbie] val3 = 20 * val1; //HIT if( sd ) { // Removes Animals - if( pc_isriding(sd) ) pc->setriding(sd, 0); - if( pc_isridingdragon(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_DRAGON); - if( pc_iswug(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_WUG); - if( pc_isridingwug(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_WUGRIDER); - if( pc_isfalcon(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_FALCON); - if( sd->status.pet_id > 0 ) pet->menu(sd, 3); - if( homun_alive(sd->hd) ) homun->vaporize(sd,HOM_ST_REST); - if( sd->md ) mercenary->delete(sd->md,3); + if (pc_isridingpeco(sd)) + pc->setridingpeco(sd, false); + if (pc_isridingdragon(sd)) + pc->setridingdragon(sd, 0); + if (pc_iswug(sd)) + pc->setoption(sd, sd->sc.option&~OPTION_WUG); + if (pc_isridingwug(sd)) + pc->setridingwug(sd, false); + if (pc_isfalcon(sd)) + pc->setfalcon(sd, false); + if (sd->status.pet_id > 0) + pet->menu(sd, 3); + if (homun_alive(sd->hd)) + homun->vaporize(sd,HOM_ST_REST); + if (sd->md) + mercenary->delete(sd->md,3); } break; case SC__LAZINESS: @@ -8689,8 +8709,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t if ( !val3 ) val3 = 50; if( sd ) { - if( pc_isriding(sd) ) pc->setriding(sd, 0); - if( pc_isridingdragon(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_DRAGON); + if (pc_isridingpeco(sd)) + pc->setridingpeco(sd, false); + if (pc_isridingdragon(sd)) + pc->setridingdragon(sd, false); } } break; @@ -8786,18 +8808,16 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t struct block_list * src2; val3 = st->agi * val1 / 60; // ASPD increase: [(Target AGI x Skill Level) / 60] % if( (src2 = map->id2bl(val2)) ){ - val4 = ( 200/status_get_int(src2)?status_get_int(src2):1 ) * val1;// MDEF decrease: MDEF [(200 / Caster INT) x Skill Level] + val4 = ( 200/(status_get_int(src2)?status_get_int(src2):1) ) * val1;// MDEF decrease: MDEF [(200 / Caster INT) x Skill Level] val2 = ( status_get_dex(src2)/4 + status_get_str(src2)/2 ) * val1 / 5; // ATK increase: ATK [{(Caster DEX / 4) + (Caster STR / 2)} x Skill Level / 5] } } break; case SC_GENTLETOUCH_REVITALIZE: - {// take note there is no vit,aspd,speed increase as skill desc says. [malufett] - struct block_list * src2; - val3 = val1 * 30 + 150; // Natural HP recovery increase: [(Skill Level x 30) + 50] % - if( (src2 = map->id2bl(val2)) ) // the stat def is not shown in the status window and it is process differently - val4 = ( status_get_vit(src2)/4 ) * val1; // STAT DEF increase: [(Caster VIT / 4) x Skill Level] - } + if(val2 < 0) + val2 = 0; + else + val2 = val2 / 4 * val1; // STAT DEF increase: [(Caster VIT / 4) x Skill Level] break; case SC_PYROTECHNIC_OPTION: val2 = 60; @@ -8910,9 +8930,13 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t val4 = tick / 10000; tick_time = 10000; // [GodLesZ] tick time break; - case SC_KYOUGAKU: - val2 = 2*val1 + rand()%(3 * val1); - clif->status_change(bl, SI_ACTIVE_MONSTER_TRANSFORM, 1, 0, 1002, 0, 0); // Poring in disguise + case SC_KYOUGAKU: { + int min = val1*2; + int max = val1*3; + val3 = rnd()%(max-min)+min; + val2 = val1; + val1 = 1002; // Monster ID + } break; case SC_KAGEMUSYA: val3 = val1 * 2; @@ -9059,9 +9083,6 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_KAAHI: val4 = INVALID_TIMER; break; - case SC_KYOUGAKU: - clif->status_change(bl, SI_ACTIVE_MONSTER_TRANSFORM, 1, 0, 1002, 0, 0); // Poring in disguise - break; } } @@ -9182,6 +9203,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_WATER_BARRIER: val_flag |= 1|2|4; break; + case SC_KYOUGAKU: + val_flag |= 1; + break; case SC_CASH_PLUSEXP: case SC_CASH_PLUSONLYJOBEXP: case SC_MONSTER_TRANSFORM: @@ -9240,7 +9264,6 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_CURSEDCIRCLE_TARGET: case SC_FEAR: case SC_MEIKYOUSISUI: - case SC_KYOUGAKU: case SC_NEEDLE_OF_PARALYZE: case SC_DEATHBOUND: unit->stop_walking(bl,1); @@ -10133,9 +10156,6 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const } } break; - case SC_KYOUGAKU: - clif->sc_end(&sd->bl,sd->bl.id,AREA,SI_ACTIVE_MONSTER_TRANSFORM); - break; case SC_CLAIRVOYANCE: calc_flag = SCB_ALL;/* required for overlapping */ break; @@ -10516,14 +10536,17 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { case SC_SIGHT: case SC_RUWACH: case SC_WZ_SIGHTBLASTER: - if(type == SC_WZ_SIGHTBLASTER) + if(type == SC_WZ_SIGHTBLASTER) { + //Restore trap immunity + if(sce->val4%2) + sce->val4--; map->foreachinrange(status->change_timer_sub, bl, sce->val3, BL_CHAR|BL_SKILL, bl, sce, type, tick); - else + } else map->foreachinrange(status->change_timer_sub, bl, sce->val3, BL_CHAR, bl, sce, type, tick); if( --(sce->val2)>0 ){ - sce->val4 += 250; // use for Shadow Form 2 seconds checking. - sc_timer_next(250+tick, status->change_timer, bl->id, data); + sce->val4 += 20; // use for Shadow Form 2 seconds checking. + sc_timer_next(20+tick, status->change_timer, bl->id, data); return 0; } break; @@ -11318,10 +11341,13 @@ int status_change_timer_sub(struct block_list* bl, va_list ap) { if (battle->check_target( src, bl, BCT_ENEMY ) > 0 && status->check_skilluse(src, bl, WZ_SIGHTBLASTER, 2) ) { - if (sce && !(bl->type&BL_SKILL) //The hit is not counted if it's against a trap - && skill->attack(BF_MAGIC,src,src,bl,WZ_SIGHTBLASTER,1,tick,0) - ){ - sce->val2 = 0; //This signals it to end. + struct skill_unit *su = (struct skill_unit *)bl; + if (sce && skill->attack(BF_MAGIC,src,src,bl,WZ_SIGHTBLASTER,sce->val1,tick,0x4000) + && (!su || !su->group || !(skill->get_inf2(su->group->skill_id)&INF2_TRAP))) { // The hit is not counted if it's against a trap + sce->val2 = 0; // This signals it to end. + } else if ((bl->type&BL_SKILL) && sce && sce->val4%2 == 0) { + //Remove trap immunity temporarily so it triggers if you still stand on it + sce->val4++; } } break; @@ -11368,7 +11394,7 @@ int status_get_weapon_atk(struct block_list *bl, struct weapon_atk *watk, int fl if( !(flag&1) ){ if( max > min ) - max = min + rnd()%(max - min); + max = min + rnd()%(max - min + 1); else max = min; } |