summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-16 00:20:56 -0300
committershennetsind <ind@henn.et>2013-04-16 00:20:56 -0300
commitf3e20da4be387c0e49da58a8be676c9878818ebb (patch)
tree6fcb047ca4d0e5cc39638d205e5260561a17d5b7 /src/map/battle.c
parent1e21ff7d621ca19f341318c67756d7b39baa7d7b (diff)
downloadhercules-f3e20da4be387c0e49da58a8be676c9878818ebb.tar.gz
hercules-f3e20da4be387c0e49da58a8be676c9878818ebb.tar.bz2
hercules-f3e20da4be387c0e49da58a8be676c9878818ebb.tar.xz
hercules-f3e20da4be387c0e49da58a8be676c9878818ebb.zip
Fixed Bug #7060
When using official magical reflection, the damage is no longer reduceable by mdef items or cards (elemental armors work), assumption doesnt reduce either when used in pre-re mode and energy coat is capable of reducing the damage. http://hercules.ws/board/tracker/issue-7060-bmagicdamagereturn/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index b6180328a..ac386f890 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -433,6 +433,8 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
switch(attack_type){
case BF_MAGIC:
+ if( battle->isMagicReflect )
+ nk |= NK_NO_CARDFIX_ATK;
if ( sd && !(nk&NK_NO_CARDFIX_ATK) ) {
cardfix=cardfix*(100+sd->magic_addrace[tstatus->race])/100;
if (!(nk&NK_NO_ELEFIX))
@@ -988,11 +990,10 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
status_change_end(bl,SC_VOICEOFSIREN,INVALID_TIMER);
}
-
//Finally damage reductions....
// Assumptio doubles the def & mdef on RE mode, otherwise gives a reduction on the final damage. [Igniz]
#ifndef RENEWAL
- if( sc->data[SC_ASSUMPTIO] ) {
+ if( sc->data[SC_ASSUMPTIO] && !battle->isMagicReflect ) {
if( map_flag_vs(bl->m) )
damage = damage*2/3; //Receive 66% damage
else
@@ -1037,9 +1038,9 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
damage -= damage * sc->data[SC_ARMOR]->val2 / 100;
#ifdef RENEWAL
- if(sc->data[SC_ENERGYCOAT] && (flag&BF_WEAPON || flag&BF_MAGIC) && skill_id != WS_CARTTERMINATION)
+ if(sc->data[SC_ENERGYCOAT] && (battle->isMagicReflect || ((flag&BF_WEAPON || flag&BF_MAGIC) && skill_id != WS_CARTTERMINATION)))
#else
- if(sc->data[SC_ENERGYCOAT] && flag&BF_WEAPON && skill_id != WS_CARTTERMINATION)
+ if(sc->data[SC_ENERGYCOAT] && (battle->isMagicReflect || (flag&BF_WEAPON && skill_id != WS_CARTTERMINATION)))
#endif
{
struct status_data *status = status_get_status_data(bl);
@@ -4078,7 +4079,8 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
if (!flag.imdef && (
sd->bonus.ignore_mdef_ele & ( 1 << tstatus->def_ele ) ||
sd->bonus.ignore_mdef_race & ( 1 << tstatus->race ) ||
- sd->bonus.ignore_mdef_race & ( is_boss(target) ? 1 << RC_BOSS : 1 << RC_NONBOSS )
+ sd->bonus.ignore_mdef_race & ( is_boss(target) ? 1 << RC_BOSS : 1 << RC_NONBOSS ) ||
+ battle->isMagicReflect
))
flag.imdef = 1;
}