diff options
author | markzd <markzd@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-20 01:03:42 +0000 |
---|---|---|
committer | markzd <markzd@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-20 01:03:42 +0000 |
commit | 300f20998ac8012373024b3a3d7d88b80de7e040 (patch) | |
tree | e9a1df823b3fe142cb158f64ee4d68b9f416915c /src/map/skill.c | |
parent | 6b5b18378c89aa875c98e8323082856ec49c127f (diff) | |
download | hercules-300f20998ac8012373024b3a3d7d88b80de7e040.tar.gz hercules-300f20998ac8012373024b3a3d7d88b80de7e040.tar.bz2 hercules-300f20998ac8012373024b3a3d7d88b80de7e040.tar.xz hercules-300f20998ac8012373024b3a3d7d88b80de7e040.zip |
* Follow up r16676
1. Fixed a behavior which allowed devotion to be bypassed when the caster was under Reflect Damage Buff.
2. Fixed the reflected magic damage to always hit the target and not the paladin when it's not reflected by kaite.
- Implemented bonus2 bMagicAtkEle which increases/decreases the caster magic damage based on its element.(bugreport:6943)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17030 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index c2a92cb73..2079ffd85 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2192,6 +2192,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds struct status_change *sc; struct map_session_data *sd, *tsd; int type,damage,rdamage=0; + int8 rmdamage=0;//magic reflected if(skillid > 0 && skilllv <= 0) return 0; @@ -2249,6 +2250,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds if( (dmg.damage || dmg.damage2) && (type = skill_magic_reflect(src, bl, src==dsrc)) ) { //Magic reflection, switch caster/target struct block_list *tbl = bl; + rmdamage = 1; bl = src; src = tbl; sd = BL_CAST(BL_PC, src); @@ -2271,6 +2273,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds sc->data[SC_SPIRIT]->val4 = dsrc->id; } } + /** * Official Magic Reflection Behavior : damage reflected depends on gears caster wears, not target **/ @@ -2701,29 +2704,16 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds (d_bl->type == BL_PC && ((TBL_PC*)d_bl)->devotion[sce->val2] == bl->id) ) && check_distance_bl(bl, d_bl, sce->val3) ) { - /** - * Check for devotion and change targetted dmg. - * [d_bl = paladin; bl = player; src = source of dmg] - **/ - bool devo_flag = false; /* false = paladin devoing; true = player */ - if ( src ) - { - struct status_change *tsc; - tsc = status_get_sc(src); - - /* Per official standards, following skills should reflect at the bl */ - if( (tsc->data[SC_KAITE] && attack_type == BF_MAGIC) || - (tsc->data[SC_REFLECTDAMAGE] && attack_type != BF_MAGIC) - ) - devo_flag = true; - } - - clif_damage( - ( (devo_flag) ? bl:d_bl), - ( (devo_flag) ? bl:d_bl), gettick(), 0, 0, damage, 0, 0, 0); - status_fix_damage( - ( (devo_flag) ? bl:NULL), - ( (devo_flag) ? bl:d_bl), damage, 0); + if(!rmdamage){ + clif_damage(d_bl,d_bl, gettick(), 0, 0, damage, 0, 0, 0); + status_fix_damage(NULL,d_bl, damage, 0); + } + else{//Reflected magics are done directly on the target not on paladin + //This check is only for magical skill. + //For BF_WEAPON skills types track var rdamage and function battle_calc_return_damage + clif_damage(bl,bl, gettick(), 0, 0, damage, 0, 0, 0); + status_fix_damage(bl,bl, damage, 0); + } } else { status_change_end(bl, SC_DEVOTION, INVALID_TIMER); |