summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-08 12:30:42 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-08 12:30:42 +0000
commitefecaa7b0fb55f1a6df8f1463029c1603500d3ae (patch)
tree3bb97704f43cc7dbbe3be4822804b94530a234da /src/map/skill.c
parent8ce74b86162ebd3053996cc1ea5d949e339494fa (diff)
downloadhercules-efecaa7b0fb55f1a6df8f1463029c1603500d3ae.tar.gz
hercules-efecaa7b0fb55f1a6df8f1463029c1603500d3ae.tar.bz2
hercules-efecaa7b0fb55f1a6df8f1463029c1603500d3ae.tar.xz
hercules-efecaa7b0fb55f1a6df8f1463029c1603500d3ae.zip
* Added a configuration for whether damage of EarthQuake with single target can be reflected.
* Fixed Wizard Spirit can block reflected magical damage other than Kaite's.(bugreport:3161) * Fixed Kaite works against bosses.(follow up to r13857) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13860 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c64
1 files changed, 34 insertions, 30 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 56e90fd9e..880e03fd3 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1539,6 +1539,9 @@ static int skill_magic_reflect(struct block_list* src, struct block_list* bl, in
if( sd && sd->magic_damage_return && type && rand()%100 < sd->magic_damage_return )
return 1;
+ if( is_boss(src) )
+ return 0;
+
// status-based reflection
if( !sc || sc->count == 0 )
return 0;
@@ -1551,7 +1554,7 @@ static int skill_magic_reflect(struct block_list* src, struct block_list* bl, in
clif_specialeffect(bl, 438, AREA);
if( --sc->data[SC_KAITE]->val2 <= 0 )
status_change_end(bl, SC_KAITE, -1);
- return 1;
+ return 2;
}
return 0;
@@ -1630,40 +1633,41 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
}
}
- if( dmg.flag&BF_MAGIC && ( skillid != NPC_EARTHQUAKE || (flag&0xFFF) == 1 ) )
+ if( dmg.flag&BF_MAGIC && ( skillid != NPC_EARTHQUAKE || (battle_config.eq_single_target_reflectable && (flag&0xFFF) == 1) ) )
{ // Earthquake on multiple targets is not counted as a target skill. [Inkfish]
- if( (dmg.damage || dmg.damage2) && skill_magic_reflect(src, bl, src==dsrc) )
+ if( (dmg.damage || dmg.damage2) && (type = skill_magic_reflect(src, bl, src==dsrc)) )
{ //Magic reflection, switch caster/target
struct block_list *tbl = bl;
bl = src;
src = tbl;
- sd = BL_CAST(BL_PC, src);
- tsd = BL_CAST(BL_PC, bl);
- sc = status_get_sc(bl);
- if (sc && !sc->count)
- sc = NULL; //Don't need it.
- //Spirit of Wizard blocks bounced back spells.
- if (sc && sc->data[SC_SPIRIT] &&
- sc->data[SC_SPIRIT]->val2 == SL_WIZARD)
- {
- //It should only consume once per skill casted. Val3 is the skill
- //id and val4 is the ID of the damage src, this should account for
- //ground spells (and single target spells will be completed on
- //castend_id) [Skotlex]
- if (tsd && !(
- sc->data[SC_SPIRIT]->val3 == skillid &&
- sc->data[SC_SPIRIT]->val4 == dsrc->id)
- ) { //Check if you have stone to consume.
- type = pc_search_inventory (tsd, 7321);
- if (type >= 0)
- pc_delitem(tsd, type, 1, 0);
- } else
- type = 0;
- if (type >= 0) {
- dmg.damage = dmg.damage2 = 0;
- dmg.dmg_lv = ATK_MISS;
- sc->data[SC_SPIRIT]->val3 = skillid;
- sc->data[SC_SPIRIT]->val4 = dsrc->id;
+
+ if( type == 2 )
+ { // Kaite
+ sd = BL_CAST(BL_PC, src);
+ tsd = BL_CAST(BL_PC, bl);
+
+ sc = status_get_sc(bl);
+ if (sc && !sc->count)
+ sc = NULL; //Don't need it.
+
+ //Spirit of Wizard blocks Kaite's reflection
+ if( sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_WIZARD )
+ { //It should only consume once per skill casted. Val3 is the skill id and val4 is the ID of the damage src.
+ //This should account for ground spells (and single target spells will be completed on castend_id) [Skotlex]
+ if (tsd && !(sc->data[SC_SPIRIT]->val3 == skillid && sc->data[SC_SPIRIT]->val4 == dsrc->id) )
+ { //Check if you have stone to consume.
+ type = pc_search_inventory (tsd, 7321);
+ if (type >= 0)
+ pc_delitem(tsd, type, 1, 0);
+ } else
+ type = 0;
+
+ if (type >= 0) {
+ dmg.damage = dmg.damage2 = 0;
+ dmg.dmg_lv = ATK_MISS;
+ sc->data[SC_SPIRIT]->val3 = skillid;
+ sc->data[SC_SPIRIT]->val4 = dsrc->id;
+ }
}
}
}