summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-13 11:44:14 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-13 11:44:14 +0000
commit457e938b26c03a271c88ef768bd3d88d9f81e3fa (patch)
treeab3e23915f326f35f2bddd874e7fd6e1c528ecfc
parent45e87f58af948434abe3603f0bd314ccef79fd49 (diff)
downloadhercules-457e938b26c03a271c88ef768bd3d88d9f81e3fa.tar.gz
hercules-457e938b26c03a271c88ef768bd3d88d9f81e3fa.tar.bz2
hercules-457e938b26c03a271c88ef768bd3d88d9f81e3fa.tar.xz
hercules-457e938b26c03a271c88ef768bd3d88d9f81e3fa.zip
Fixed effects being applied improperly in some rare cases.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13768 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/battle.c12
-rw-r--r--src/map/skill.c3
2 files changed, 12 insertions, 3 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 28531f0c1..2153cea84 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -166,7 +166,10 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr data)
map_freeblock_lock();
status_fix_damage(dat->src, target, dat->damage, dat->delay);
if( dat->attack_type && (dat->damage > 0 || dat->attack_type&0xf000) && !status_isdead(target) )
+ {
+ if( dat->damage > 0 ) dat->attack_type &= ~0xf000;
skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
+ }
if( dat->damage > 0 && dat->attack_type )
skill_counter_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
map_freeblock_unlock();
@@ -185,7 +188,10 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src,
map_freeblock_lock();
status_fix_damage(src, target, damage, ddelay);
if( attack_type && (damage > 0 || attack_type&0xf000) && !status_isdead(target) )
+ {
+ if( damage > 0 ) attack_type &= ~0xf000;
skill_additional_effect(src, target, skill_id, skill_lv, attack_type, gettick());
+ }
if( damage > 0 && attack_type )
skill_counter_additional_effect(src, target, skill_id, skill_lv, attack_type, gettick());
map_freeblock_unlock();
@@ -303,7 +309,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
{
//First, sc_*'s that reduce damage to 0.
if( sc->data[SC_BASILICA] && !(status_get_mode(src)&MD_BOSS) && skill_num != PA_PRESSURE )
- return -1; // Trigger status effects.
+ return (damage > 0 ? -1 : 0); // Trigger status effects.
if( sc->data[SC_SAFETYWALL] && (flag&(BF_SHORT|BF_MAGIC))==BF_SHORT )
{
@@ -311,13 +317,13 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
if (group) {
if (--group->val2<=0)
skill_delunitgroup(NULL,group);
- return -1; // Trigger status effects.
+ return (damage > 0 ? -1 : 0); // Trigger status effects.
}
status_change_end(bl,SC_SAFETYWALL,-1);
}
if( sc->data[SC_PNEUMA] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG )
- return -1; // Trigger status effects.
+ return (damage > 0 ? -1 : 0); // Trigger status effects.
if( (sce=sc->data[SC_AUTOGUARD]) && flag&BF_WEAPON && !(skill_get_nk(skill_num)&NK_NO_CARDFIX_ATK) && rand()%100 < sce->val2 )
{
diff --git a/src/map/skill.c b/src/map/skill.c
index 2e7a8016a..9f448cd10 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1789,7 +1789,10 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
{ //Instant damage
status_fix_damage(src,bl,damage,dmg.dmotion); //Deal damage before knockback to allow stuff like firewall+storm gust combo.
if( (damage > 0 || attack_type&0xf000) && !status_isdead(bl) )
+ {
+ if( damage > 0 ) attack_type &= ~0xf000;
skill_additional_effect(src,bl,skillid,skilllv,attack_type,tick);
+ }
if( damage > 0 ) //Counter status effects [Skotlex]
skill_counter_additional_effect(dsrc,bl,skillid,skilllv,attack_type,tick);
}