summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-17 16:23:44 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-17 16:23:44 +0000
commit6ed22f13e76053ac76e0c74a01b62330c7331b71 (patch)
tree32584f96e0b9396ddec2a5164d860756146955f3
parentc6928fbf500652f9bf894176acbe9cff93199442 (diff)
downloadhercules-6ed22f13e76053ac76e0c74a01b62330c7331b71.tar.gz
hercules-6ed22f13e76053ac76e0c74a01b62330c7331b71.tar.bz2
hercules-6ed22f13e76053ac76e0c74a01b62330c7331b71.tar.xz
hercules-6ed22f13e76053ac76e0c74a01b62330c7331b71.zip
Fixed bShortWeaponDamage to work against cart termination, bugreport:5328
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15593 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/battle.c15
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/skill.c6
3 files changed, 10 insertions, 13 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 6672a2b27..3292f55ee 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3674,8 +3674,7 @@ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct bl
}
//Calculates BF_WEAPON returned damage.
-int battle_calc_return_damage(struct block_list* bl, struct block_list *src, int *dmg, int flag)
-{
+int battle_calc_return_damage(struct block_list* bl, struct block_list *src, int *dmg, int flag, int skillid){
struct map_session_data* sd = NULL;
int rdamage = 0, damage = *dmg;
struct status_change* sc;
@@ -3688,17 +3687,16 @@ int battle_calc_return_damage(struct block_list* bl, struct block_list *src, int
rdamage = (*dmg) * sc->data[SC_REFLECTDAMAGE]->val2 / 100;
if( rdamage > max_damage ) rdamage = max_damage;
} else if (flag & BF_SHORT) {//Bounces back part of the damage.
- if (sd && sd->short_weapon_damage_return)
- {
+ if (sd && sd->short_weapon_damage_return){
rdamage += damage * sd->short_weapon_damage_return / 100;
if(rdamage < 1) rdamage = 1;
}
if( sc && sc->count ) {
- if (sc->data[SC_REFLECTSHIELD]) {
+ if ( sc->data[SC_REFLECTSHIELD] && skillid != WS_CARTTERMINATION ) {
rdamage += damage * sc->data[SC_REFLECTSHIELD]->val2 / 100;
if (rdamage < 1) rdamage = 1;
}
- if(sc->data[SC_DEATHBOUND] && !(src->type == BL_MOB && is_boss(src)) ) {
+ if(sc->data[SC_DEATHBOUND] && skillid != WS_CARTTERMINATION && !(src->type == BL_MOB && is_boss(src)) ) {
int dir = map_calc_dir(bl,src->x,src->y),
t_dir = unit_getdir(bl), rd1 = 0;
@@ -3713,8 +3711,7 @@ int battle_calc_return_damage(struct block_list* bl, struct block_list *src, int
}
}
} else {
- if (sd && sd->long_weapon_damage_return)
- {
+ if (sd && sd->long_weapon_damage_return) {
rdamage += damage * sd->long_weapon_damage_return / 100;
if (rdamage < 1) rdamage = 1;
}
@@ -3966,7 +3963,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
skill_attack(skill_get_type(skillid), src, src, target, skillid, sc->data[SC_DUPLELIGHT]->val1, tick, SD_LEVEL);
}
- rdamage = battle_calc_return_damage(target,src, &damage, wd.flag);
+ rdamage = battle_calc_return_damage(target,src, &damage, wd.flag, 0);
if( rdamage > 0 ) {
if( tsc && tsc->data[SC_REFLECTDAMAGE] ) {
if( src != target )// Don't reflect your own damage (Grand Cross)
diff --git a/src/map/battle.h b/src/map/battle.h
index 54b707f08..69728dd68 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -35,7 +35,7 @@ struct block_list;
struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int count);
-int battle_calc_return_damage(struct block_list *bl, struct block_list *src, int *, int flag);
+int battle_calc_return_damage(struct block_list *bl, struct block_list *src, int *, int flag, int skillid);
void battle_drain(struct map_session_data *sd, struct block_list *tbl, int rdamage, int ldamage, int race, int boss);
diff --git a/src/map/skill.c b/src/map/skill.c
index 79b2af129..31b4045ea 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2054,9 +2054,9 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
skillid == MER_INCAGI || skillid == MER_BLESSING) && tsd->sc.data[SC_CHANGEUNDEAD] )
damage = 1;
- if( damage > 0 && (( dmg.flag&BF_WEAPON && src != bl && ( src == dsrc || ( dsrc->type == BL_SKILL && ( skillid == SG_SUN_WARM || skillid == SG_MOON_WARM || skillid == SG_STAR_WARM ) ) )
- && skillid != WS_CARTTERMINATION) || (sc && sc->data[SC_REFLECTDAMAGE])) )
- rdamage = battle_calc_return_damage(bl,src, &damage, dmg.flag);
+ if( damage > 0 && (( dmg.flag&BF_WEAPON && src != bl && ( src == dsrc || ( dsrc->type == BL_SKILL && ( skillid == SG_SUN_WARM || skillid == SG_MOON_WARM || skillid == SG_STAR_WARM ) ) ))
+ || (sc && sc->data[SC_REFLECTDAMAGE])) )
+ rdamage = battle_calc_return_damage(bl,src, &damage, dmg.flag, skillid);
//Skill hit type
type=(skillid==0)?5:skill_get_hit(skillid);