summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorMichieru <Michieru@users.noreply.github.com>2014-10-10 09:47:11 +0200
committerMichieru <Michieru@users.noreply.github.com>2014-10-10 09:47:11 +0200
commit1b86f4b8f1605eb58fa9a68329d1fd5d0da8e776 (patch)
treea2ca3a2e75ea1e64d03e6297e3e6eda51e110a0e /src/map/skill.c
parent3d146235f9ea9b96d1d0eac4d7e2c0ed62b80562 (diff)
downloadhercules-1b86f4b8f1605eb58fa9a68329d1fd5d0da8e776.tar.gz
hercules-1b86f4b8f1605eb58fa9a68329d1fd5d0da8e776.tar.bz2
hercules-1b86f4b8f1605eb58fa9a68329d1fd5d0da8e776.tar.xz
hercules-1b86f4b8f1605eb58fa9a68329d1fd5d0da8e776.zip
Fix Kyougaku make client crash and update the formula to official (bug:7975)
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 9f447e2fa..6826e4c3e 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9441,17 +9441,16 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;
case KO_KYOUGAKU:
- {
- int rate = max(5, (45 + 5 * skill_lv - status_get_int(bl) / 10));
- if( sd && !map_flag_gvg2(src->m) ){
- clif->skill_fail(sd, skill_id, USESKILL_FAIL_SIZE, 0);
- break;
- }
- if( dstsd && tsc && !tsc->data[type] && rand()%100 < rate ){
- clif->skill_nodamage(src, bl, skill_id, skill_lv,
- sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
- }else if( sd )
- clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ if (!map_flag_vs(src->m) || !dstsd) {
+ if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_SIZE, 0);
+ break;
+ } else {
+ int time;
+ int rate = 45+ 5*skill_lv - status_get_int(bl)/10;
+ if (rate < 5) rate = 5;
+
+ time = skill->get_time(skill_id, skill_lv) - 1000*status_get_int(bl)/20;
+ sc_start(src,bl, type, rate, skill_lv, time);
}
break;