# This patch file was generated by NetBeans IDE # It uses platform neutral UTF-8 encoding and \n newlines. --- Base (BASE) +++ Locally Modified (Based On LOCAL) @@ -14108,12 +14108,23 @@ fixcast_r = max(fixcast_r, sd->bonus.fixcastrate) + min(sd->bonus.fixcastrate,0); } - if( varcast_r < 0 ) // now compute overall factors - time = time * (1 - (float)varcast_r / 100); - if( !(skill_get_castnodex(skill_id, skill_lv)&1) )// reduction from status point - time = (1 - sqrt( ((float)(status_get_dex(bl)*2 + status_get_int(bl)) / battle_config.vcast_stat_scale) )) * time; +// if( varcast_r < 0 ) // now compute overall factors +// time = time * (1 - (float)varcast_r / 100); +// if( !(skill_get_castnodex(skill_id, skill_lv)&1) )// reduction from status point +// time = (1 - sqrt( ((float)(status_get_dex(bl)*2 + status_get_int(bl)) / battle_config.vcast_stat_scale) )) * time; // underflow checking/capping - time = max(time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * max(fixed,0); +// time = max(time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * max(fixed,0); + // calculate base cast time (reduced by dex) + if( !(skill_get_castnodex(skill_id, skill_lv)&1) ) { + int scale = battle_config.castrate_dex_scale - status_get_dex(bl); + if( scale > 0 ) { // not instant cast + time = time * (1 - (float)varcast_r / 100); //applpy variable cast reduction + time = max(time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * max(fixed,0); //add fixed and apply fixed reduction + time = time * scale / battle_config.castrate_dex_scale; //apply dex / castrate reduction + } + else + return 0; // instant cast + } return (int)time; }