summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-15 01:16:28 -0200
committershennetsind <ind@henn.et>2013-02-15 01:16:28 -0200
commita244b61804209ec8a836d8d3f1b7220b2bfec990 (patch)
tree843c8a8f6809dc209fb443cf6212e2af99f9cf25 /src/map/battle.c
parent74c31098137aae3e0bfc962e4685a7050409df78 (diff)
downloadhercules-a244b61804209ec8a836d8d3f1b7220b2bfec990.tar.gz
hercules-a244b61804209ec8a836d8d3f1b7220b2bfec990.tar.bz2
hercules-a244b61804209ec8a836d8d3f1b7220b2bfec990.tar.xz
hercules-a244b61804209ec8a836d8d3f1b7220b2bfec990.zip
Fixed Bug #7039
Status effects no longer propagate with magical reflection (e.g. when frost diver is reflected there is no chance that target will be frozen) http://hercules.ws/board/tracker/issue-7039-frost-diver/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 5bc3df6f8..460826414 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -209,6 +209,7 @@ struct delay_damage {
uint16 skill_id;
enum damage_lv dmg_lv;
unsigned short attack_type;
+ bool additional_effects;
};
int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
@@ -231,7 +232,7 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
{
map_freeblock_lock();
status_fix_damage(src, target, dat->damage, dat->delay);
- if( dat->attack_type && !status_isdead(target) )
+ if( dat->attack_type && !status_isdead(target) && dat->additional_effects )
skill_additional_effect(src,target,dat->skill_id,dat->skill_lv,dat->attack_type,dat->dmg_lv,tick);
if( dat->dmg_lv > ATK_BLOCK && dat->attack_type )
skill_counter_additional_effect(src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
@@ -249,7 +250,7 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
return 0;
}
-int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int damage, enum damage_lv dmg_lv, int ddelay)
+int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int damage, enum damage_lv dmg_lv, int ddelay, bool additional_effects)
{
struct delay_damage *dat;
struct status_change *sc;
@@ -264,7 +265,7 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src,
if ( !battle_config.delay_battle_damage || amotion <= 1 ) {
map_freeblock_lock();
status_fix_damage(src, target, damage, ddelay); // We have to seperate here between reflect damage and others [icescope]
- if( attack_type && !status_isdead(target) )
+ if( attack_type && !status_isdead(target) && additional_effects )
skill_additional_effect(src, target, skill_id, skill_lv, attack_type, dmg_lv, gettick());
if( dmg_lv > ATK_BLOCK && attack_type )
skill_counter_additional_effect(src, target, skill_id, skill_lv, attack_type, gettick());
@@ -281,6 +282,7 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src,
dat->dmg_lv = dmg_lv;
dat->delay = ddelay;
dat->distance = distance_bl(src, target)+10; //Attack should connect regardless unless you teleported.
+ dat->additional_effects = additional_effects;
if (src->type != BL_PC && amotion > 1000)
amotion = 1000; //Aegis places a damage-delay cap of 1 sec to non player attacks. [Skotlex]
@@ -4690,7 +4692,7 @@ int battle_damage_area( struct block_list *bl, va_list ap) {
if( src->type == BL_PC )
battle_drain((TBL_PC*)src, bl, damage, damage, status_get_race(bl), is_boss(bl));
if( amotion )
- battle_delay_damage(tick, amotion,src,bl,0,CR_REFLECTSHIELD,0,damage,ATK_DEF,0);
+ battle_delay_damage(tick, amotion,src,bl,0,CR_REFLECTSHIELD,0,damage,ATK_DEF,0,true);
else
status_fix_damage(src,bl,damage,0);
clif_damage(bl,bl,tick,amotion,dmotion,damage,1,ATK_BLOCK,0);
@@ -4927,7 +4929,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
map_freeblock_lock();
- battle_delay_damage(tick, wd.amotion, src, target, wd.flag, 0, 0, damage, wd.dmg_lv, wd.dmotion);
+ battle_delay_damage(tick, wd.amotion, src, target, wd.flag, 0, 0, damage, wd.dmg_lv, wd.dmotion, true);
if( tsc ) {
if( tsc->data[SC_DEVOTION] ) {
struct status_change_entry *sce = tsc->data[SC_DEVOTION];
@@ -5055,7 +5057,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
if (rdamage > 0 && !(tsc && tsc->data[SC_REFLECTDAMAGE])) { //By sending attack type "none" skill_additional_effect won't be invoked. [Skotlex]
if(tsd && src != target)
battle_drain(tsd, src, rdamage, rdamage, sstatus->race, is_boss(src));
- battle_delay_damage(tick, wd.amotion, target, src, 0, CR_REFLECTSHIELD, 0, rdamage, ATK_DEF, rdelay);
+ battle_delay_damage(tick, wd.amotion, target, src, 0, CR_REFLECTSHIELD, 0, rdamage, ATK_DEF, rdelay, true);
}
if (tsc) {