summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-22 14:35:28 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-22 14:35:28 +0000
commit7ec5611976e5b04a947cca187bbd33431d2df52c (patch)
tree6ca0264fb9236c3c4c2b1063c539b06c4f2ff2fb
parent932c76a02329e9c1b40f2b3d134ef22c55c19243 (diff)
downloadhercules-7ec5611976e5b04a947cca187bbd33431d2df52c.tar.gz
hercules-7ec5611976e5b04a947cca187bbd33431d2df52c.tar.bz2
hercules-7ec5611976e5b04a947cca187bbd33431d2df52c.tar.xz
hercules-7ec5611976e5b04a947cca187bbd33431d2df52c.zip
- Reverted the battle_calc_return_damage code as the previous one was correct, ninja self-targetted skills CAN be reflected.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9689 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/map/battle.c7
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/skill.c4
4 files changed, 9 insertions, 7 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 1586c7fb3..1c1b098af 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,9 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2007/01/22
+ * Reverted the battle_calc_return_damage code as the previous one was
+ correct, ninja self-targetted skills CAN be reflected. [Skotlex]
2007/01/21
* Fixed while statements not "reserving" the curly before parsing the test
expression. [FlavioJS]
diff --git a/src/map/battle.c b/src/map/battle.c
index b6dba1939..951dbcc5c 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2790,7 +2790,7 @@ struct Damage battle_calc_attack( int attack_type,
return d;
}
-int battle_calc_return_damage(struct block_list *bl, int skill, int *damage, int flag) {
+int battle_calc_return_damage(struct block_list *bl, int *damage, int flag) {
struct map_session_data *sd=NULL;
struct status_change *sc;
int rdamage = 0;
@@ -2798,7 +2798,7 @@ int battle_calc_return_damage(struct block_list *bl, int skill, int *damage, int
BL_CAST(BL_PC, bl, sd);
sc = status_get_sc(bl);
- if(flag&BF_WEAPON && skill != WS_CARTTERMINATION) { // FIXME(?): Quick and dirty check, but HSCR does bypass Shield Reflect... so I make it bypass the whole reflect thing [DracoRPG]
+ if(flag&BF_WEAPON) {
//Bounces back part of the damage.
if (flag & BF_SHORT) {
if (sd && sd->short_weapon_damage_return)
@@ -2823,7 +2823,6 @@ int battle_calc_return_damage(struct block_list *bl, int skill, int *damage, int
if(flag&BF_MAGIC)
{
if(sd && sd->magic_damage_return &&
- !(skill_get_inf(skill)&(INF_GROUND_SKILL|INF_SELF_SKILL)) &&
rand()%100 < sd->magic_damage_return)
{ //Bounces back full damage, you take none.
rdamage = *damage;
@@ -3011,7 +3010,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
damage = wd.damage + wd.damage2;
if (damage > 0 && src != target) {
- rdamage = battle_calc_return_damage(target, 0, &damage, wd.flag);
+ rdamage = battle_calc_return_damage(target, &damage, wd.flag);
if (rdamage > 0) {
rdelay = clif_damage(src, src, tick, wd.amotion, sstatus->dmotion, rdamage, 1, 4, 0);
//Use Reflect Shield to signal this kind of skill trigger. [Skotlex]
diff --git a/src/map/battle.h b/src/map/battle.h
index 9ae06005e..c38e9b20b 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -25,7 +25,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 flag);
-int battle_calc_return_damage(struct block_list *bl, int skill, int *damage, int flag);
+int battle_calc_return_damage(struct block_list *bl, int *damage, int flag);
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 4ead739b4..d79d9b4ae 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1930,8 +1930,8 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
damage = dmg.damage + dmg.damage2;
- if (damage > 0 && src != bl && src == dsrc)
- rdamage = battle_calc_return_damage(bl, skillid, &damage, dmg.flag);
+ if (damage > 0 && src != bl && src == dsrc && skillid != WS_CARTTERMINATION) // FIXME(?): Quick and dirty check, but HSCR does bypass Shield Reflect... so I make it bypass the whole reflect thing [DracoRPG]
+ rdamage = battle_calc_return_damage(bl, &damage, dmg.flag);
//Skill hit type
type=(skillid==0)?5:skill_get_hit(skillid);