summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkzd <markzd@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-20 01:03:42 +0000
committermarkzd <markzd@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-20 01:03:42 +0000
commit300f20998ac8012373024b3a3d7d88b80de7e040 (patch)
treee9a1df823b3fe142cb158f64ee4d68b9f416915c /src
parent6b5b18378c89aa875c98e8323082856ec49c127f (diff)
downloadhercules-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')
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/map.h4
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/pc.h1
-rw-r--r--src/map/skill.c36
-rw-r--r--src/map/status.c1
6 files changed, 23 insertions, 26 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 22a3ba948..b148305f5 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -440,10 +440,11 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
cardfix=cardfix*(100+sd->magic_addele[tstatus->def_ele])/100;
cardfix=cardfix*(100+sd->magic_addsize[tstatus->size])/100;
cardfix=cardfix*(100+sd->magic_addrace[is_boss(target)?RC_BOSS:RC_NONBOSS])/100;
+ cardfix=cardfix*(100+sd->magic_atk_ele[s_ele])/100;
for(i=0; i< ARRAYLENGTH(sd->add_mdmg) && sd->add_mdmg[i].rate;i++) {
if(sd->add_mdmg[i].class_ == t_class) {
cardfix=cardfix*(100+sd->add_mdmg[i].rate)/100;
- continue;
+ break;
}
}
if (cardfix != 1000)
diff --git a/src/map/map.h b/src/map/map.h
index 89e52dea3..4f90b1f2f 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -405,8 +405,8 @@ enum _sp {
SP_INTRAVISION, SP_ADD_MONSTER_DROP_ITEMGROUP, SP_SP_LOSS_RATE, // 2038-2040
SP_ADD_SKILL_BLOW, SP_SP_VANISH_RATE, SP_MAGIC_SP_GAIN_VALUE, SP_MAGIC_HP_GAIN_VALUE, SP_ADD_CLASS_DROP_ITEM, //2041-2045
SP_EMATK, SP_SP_GAIN_RACE_ATTACK, SP_HP_GAIN_RACE_ATTACK, SP_SKILL_USE_SP_RATE, //2046-2049
- SP_SKILL_COOLDOWN,SP_SKILL_FIXEDCAST, SP_SKILL_VARIABLECAST, SP_FIXCASTRATE, SP_VARCASTRATE, //2051-2055
- SP_SKILL_USE_SP //2056
+ SP_SKILL_COOLDOWN,SP_SKILL_FIXEDCAST, SP_SKILL_VARIABLECAST, SP_FIXCASTRATE, SP_VARCASTRATE, //2050-2054
+ SP_SKILL_USE_SP,SP_MAGIC_ATK_ELE //2055-2056
};
enum _look {
diff --git a/src/map/pc.c b/src/map/pc.c
index a4796e347..cf62c7dc8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2700,6 +2700,10 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
if(sd->state.lr_flag != 2)
sd->magic_addsize[type2]+=val;
break;
+ case SP_MAGIC_ATK_ELE:
+ if(sd->state.lr_flag != 2)
+ sd->magic_atk_ele[type2]+=val;
+ break;
case SP_ADD_DAMAGE_CLASS:
switch (sd->state.lr_flag) {
case 0: //Right hand
diff --git a/src/map/pc.h b/src/map/pc.h
index a4bcb7723..9b7a3b964 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -244,6 +244,7 @@ struct map_session_data {
int magic_addele[ELE_MAX];
int magic_addrace[RC_MAX];
int magic_addsize[3];
+ int magic_atk_ele[ELE_MAX];
int critaddrace[RC_MAX];
int expaddrace[RC_MAX];
int ignore_mdef[RC_MAX];
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);
diff --git a/src/map/status.c b/src/map/status.c
index f73bd237e..2e208567b 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2347,6 +2347,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
+ sizeof(sd->magic_addele)
+ sizeof(sd->magic_addrace)
+ sizeof(sd->magic_addsize)
+ + sizeof(sd->magic_atk_ele)
+ sizeof(sd->critaddrace)
+ sizeof(sd->expaddrace)
+ sizeof(sd->ignore_mdef)