summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--src/map/battle.c21
-rw-r--r--src/map/skill.c11
3 files changed, 25 insertions, 11 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index af763c428..d5424da32 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/04/03
+ * Moved skill_counter_additional_effect calls to trigger right after
+ skill_additional_effect (which means they trigger at the end of the attack
+ motion for physical attacks instead of at the beginning of the attack
+ animation) [Skotlex]
* Cleaned up (fixed?) a possible overflow in pc_isUseitem, thanks to
foobar. [Skotlex]
* When you have the wrong ammo-type equipped the skill-failed message is
diff --git a/src/map/battle.c b/src/map/battle.c
index 3b4d5d216..2851f0c88 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -125,8 +125,14 @@ int battle_delay_damage_sub (int tid, unsigned int tick, int id, int data)
target->m == dat->src->m && check_distance_bl(dat->src, target, dat->distance)) //Check to see if you haven't teleported. [Skotlex]
{
battle_damage(dat->src, target, dat->damage, dat->flag);
- if (!status_isdead(target) && (dat->dmg_lv == ATK_DEF || dat->damage > 0) && dat->attack_type)
- skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type, tick);
+ if ((dat->dmg_lv == ATK_DEF || dat->damage > 0) && dat->attack_type)
+ {
+ if (!status_isdead(target))
+ skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type, tick);
+
+ skill_counter_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
+ }
+
}
ers_free(delay_damage_ers, dat);
return 0;
@@ -140,8 +146,13 @@ int battle_delay_damage (unsigned int tick, struct block_list *src, struct block
if (!battle_config.delay_battle_damage) {
battle_damage(src, target, damage, flag);
- if (!status_isdead(target) && (damage > 0 || dmg_lv == ATK_DEF) && attack_type)
- skill_additional_effect(src, target, skill_id, skill_lv, attack_type, gettick());
+ if ((damage > 0 || dmg_lv == ATK_DEF) && attack_type)
+ {
+ if (!status_isdead(target))
+ skill_additional_effect(src, target, skill_id, skill_lv, attack_type, gettick());
+
+ skill_counter_additional_effect(src, target, skill_id, skill_lv, attack_type, gettick());
+ }
return 0;
}
dat = ers_alloc(delay_damage_ers, struct delay_damage);
@@ -3068,8 +3079,6 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
battle_delay_damage(tick+wd.amotion, src, target, BF_WEAPON, 0, 0, damage, wd.dmg_lv, 0);
- if (wd.dmg_lv == ATK_DEF || damage > 0) //Added counter effect [Skotlex]
- skill_counter_additional_effect(src, target, 0, 0, BF_WEAPON, tick);
if (!status_isdead(target) && damage > 0) {
if (sd) {
int boss = status_get_mode(target)&MD_BOSS;
diff --git a/src/map/skill.c b/src/map/skill.c
index fcb0547af..e97e4c2e0 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1981,8 +1981,12 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
}
if ((skillid || flag) && !(attack_type&BF_WEAPON)) { // do not really deal damage for ASC_BREAKER's 1st attack
battle_damage(src,bl,damage, 0); //Deal damage before knockback to allow stuff like firewall+storm gust combo.
- if (!status_isdead(bl) && (dmg.dmg_lv == ATK_DEF || damage > 0))
- skill_additional_effect(src,bl,skillid,skilllv,attack_type,tick);
+ if (dmg.dmg_lv == ATK_DEF || damage > 0) {
+ if (!status_isdead(bl))
+ skill_additional_effect(src,bl,skillid,skilllv,attack_type,tick);
+ //Counter status effects [Skotlex]
+ skill_counter_additional_effect(dsrc,bl,skillid,skilllv,attack_type,tick);
+ }
}
//Only knockback if it's still alive, otherwise a "ghost" is left behind. [Skotlex]
@@ -2002,9 +2006,6 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
skill_addtimerskill(src,tick + 800,bl->id,0,0,skillid,skilllv,0,flag);
}
- if (dmg.dmg_lv == ATK_DEF || damage > 0) //Counter status effects [Skotlex]
- skill_counter_additional_effect(dsrc,bl,skillid,skilllv,attack_type,tick);
-
if(sd && dmg.flag&BF_WEAPON && src != bl && src == dsrc && damage > 0) {
int hp = 0,sp = 0;
if(sd->right_weapon.hp_drain_rate && sd->right_weapon.hp_drain_per > 0 && dmg.damage > 0 && rand()%1000 < sd->right_weapon.hp_drain_rate) {