diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-21 13:26:36 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-21 13:26:36 +0000 |
commit | bc4c4b9fac14f0426d1984ed135b445ef80c13c9 (patch) | |
tree | 089e5ff74a89040b39bae9cbfb99e10a3a4e999b /src/map | |
parent | 0be83b78ab44dc5f1e2f1e6f3a3928b174c792f2 (diff) | |
download | hercules-bc4c4b9fac14f0426d1984ed135b445ef80c13c9.tar.gz hercules-bc4c4b9fac14f0426d1984ed135b445ef80c13c9.tar.bz2 hercules-bc4c4b9fac14f0426d1984ed135b445ef80c13c9.tar.xz hercules-bc4c4b9fac14f0426d1984ed135b445ef80c13c9.zip |
* Corrected skill Charge Attack as described in bugreport:67
- cast time is between 100% and 300% (+ infinite waiting fixed)
- damage is also between 100% and 300% (doesn't increase past range 9)
- added knockback that's equal to the distance to target
- no longer causes teleportation on WoE grounds
- if target runs behind an obstacle, the skill will still teleport you, but will not perform the attack or do knockback
- this should be official behavior, so enjoy the weirdness!
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11256 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 6 | ||||
-rw-r--r-- | src/map/skill.c | 31 | ||||
-rw-r--r-- | src/map/unit.c | 7 |
3 files changed, 33 insertions, 11 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 2994dfa6a..58d9a216a 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1546,7 +1546,11 @@ static struct Damage battle_calc_weapon_attack( skillratio += 100*(skill_lv-1); break; case KN_CHARGEATK: - skillratio += 100*((wflag-1)/3); //+100% every 3 cells.of distance + { + int k = (wflag-1)/3; //+100% every 3 cells of distance + if( k > 2 ) k = 2; // ...but hard-limited to 300%. + skillratio += 100 * k; + } break; case HT_PHANTASMIC: skillratio += 50; diff --git a/src/map/skill.c b/src/map/skill.c index df7564629..d5462eef8 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2799,10 +2799,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int if (bl->prev == NULL) return 1; - if (src->type == BL_PC) - sd = (struct map_session_data *)src; - if (bl->type == BL_PC) - tsd = (struct map_session_data *)bl; + BL_CAST(BL_PC, src, sd); + BL_CAST(BL_PC, bl, tsd); if (status_isdead(bl)) return 1; @@ -2942,10 +2940,27 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int break; case KN_CHARGEATK: - flag = distance_bl(src, bl); - skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); - if (unit_movepos(src, bl->x, bl->y, 1, 1)) - clif_slide(src,bl->x,bl->y); + { + bool path = path_search_long(NULL, src->m, src->x, src->y, bl->x, bl->y); + unsigned int dist = distance_bl(src, bl); + unsigned int dir = map_calc_dir(bl, src->x, src->y); + + // teleport to target (if not on WoE grounds) + if( !map_flag_gvg(src->m) && unit_movepos(src, bl->x, bl->y, 0, 1) ) + clif_slide(src, bl->x, bl->y); + + // cause damage and knockback if the path to target was a straight one + if( path ) + { + skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, dist); + skill_blown(src, bl, dist, dir, 0); + //HACK: since knockback officially defaults to the left, the client also turns to the left... therefore, + // make the caster look in the direction of the target + unit_setdir(src, (dir+4)%8); + clif_changed_dir(src, AREA); + } + + } break; case TK_JUMPKICK: diff --git a/src/map/unit.c b/src/map/unit.c index 3befc3f2d..52856a19f 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -987,8 +987,11 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int casttime = 0; break; case KN_CHARGEATK: - //Taken from jA: Casttime is increased by dist/3*100% - casttime+= casttime * (distance_bl(src,target)-1)/3; + { + unsigned int k = (distance_bl(src,target)-1)/3; //+100% every 3 cells of distance + if( k > 2 ) k = 2; // ...but hard-limited to 300%. + casttime += casttime * k; + } break; } |