summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/map/mob.c2
-rw-r--r--src/map/skill.c28
-rw-r--r--src/map/skill.h2
4 files changed, 19 insertions, 16 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 9bd05d8a3..65bcc769f 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,9 @@ 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.
2007/10/12
+ * Further updates to skill_delayfix function [Playtester]
+ - aftercast delay can never be lower than amotion
+ - please report if this broke any skills
* Fixed wrong index calculation in TXT char creation code (ref: r11410)
* Fixed SQL itemdb loading crash on NULL column (ref: 11398) [ultramage]
* Updated the skill_delayfix function to behave as recently discovered by
diff --git a/src/map/mob.c b/src/map/mob.c
index a21659466..d66307a78 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3008,7 +3008,7 @@ int mob_clone_spawn(struct map_session_data *sd, int m, int x, int y, const char
ms[i].emotion = -1;
ms[i].cancel = 0;
ms[i].casttime = skill_castfix(&sd->bl,skill_id, ms[i].skill_lv);
- ms[i].delay = 5000+skill_delayfix(&sd->bl,skill_id, ms[i].skill_lv, ms[i].casttime == 0);
+ ms[i].delay = 5000+skill_delayfix(&sd->bl,skill_id, ms[i].skill_lv);
inf = skill_get_inf(skill_id);
if (inf&INF_ATTACK_SKILL) {
diff --git a/src/map/skill.c b/src/map/skill.c
index ee9cffcb7..07952db59 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1513,7 +1513,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
//Set canact delay. [Skotlex]
ud = unit_bl2ud(src);
if (ud) {
- rate = skill_delayfix(src, skill, skilllv, true);
+ rate = skill_delayfix(src, skill, skilllv);
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0)
ud->canact_tick = tick+rate;
}
@@ -1689,7 +1689,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
//Set canact delay. [Skotlex]
ud = unit_bl2ud(bl);
if (ud) {
- rate = skill_delayfix(bl, skillid, skilllv, true);
+ rate = skill_delayfix(bl, skillid, skilllv);
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0)
ud->canact_tick = tick+rate;
}
@@ -5910,7 +5910,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
if (ud->walktimer != -1 && ud->skillid != TK_RUN)
unit_stop_walking(src,1);
- ud->canact_tick = tick + skill_delayfix(src, ud->skillid, ud->skilllv, tid == -1);
+ ud->canact_tick = tick + skill_delayfix(src, ud->skillid, ud->skilllv);
if (skill_get_state(ud->skillid) != ST_MOVE_ENABLE)
unit_set_walkdelay(src, tick, battle_config.default_skill_delay+skill_get_walkdelay(ud->skillid, ud->skilllv), 1);
@@ -6079,7 +6079,7 @@ int skill_castend_pos (int tid, unsigned int tick, int id, int data)
ShowInfo("Type %d, ID %d skill castend pos [id =%d, lv=%d, (%d,%d)]\n",
src->type, src->id, ud->skillid, ud->skilllv, ud->skillx, ud->skilly);
unit_stop_walking(src,1);
- ud->canact_tick = tick + skill_delayfix(src, ud->skillid, ud->skilllv, tid == -1);
+ ud->canact_tick = tick + skill_delayfix(src, ud->skillid, ud->skilllv);
unit_set_walkdelay(src, tick, battle_config.default_skill_delay+skill_get_walkdelay(ud->skillid, ud->skilllv), 1);
map_freeblock_lock();
@@ -8855,7 +8855,7 @@ int skill_castfix_sc (struct block_list *bl, int time)
/*==========================================
* Does delay reductions based on dex/agi, sc data, item bonuses, ...
*------------------------------------------*/
-int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv, bool instantcast)
+int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
{
int delaynodex = skill_get_delaynodex(skill_id, skill_lv);
int time = skill_get_delay(skill_id, skill_lv);
@@ -8865,15 +8865,15 @@ int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv, bool inst
if (bl->type&battle_config.no_skill_delay)
return battle_config.min_skill_delay_limit;
- // no-delay skills get aspd delay IF they were also instant cast (reported by Tharis) [Skotlex]
- if (time == 0) {
- if (instantcast)
- time = status_get_amotion(bl); //Use attack delay.
- else
- time = battle_config.default_skill_delay;
- } else if (time < 0)
- time = -time + status_get_amotion(bl); // if set to <0, add to attack motion.
- else //Agi reduction should apply only to non-zero delay skills.
+ if (time < 0)
+ time = -time + status_get_amotion(bl); // If set to <0, add to attack motion.
+ else if (time == 0)
+ time = battle_config.default_skill_delay; // Use default skill delay.
+
+ if (time < status_get_amotion(bl))
+ time = status_get_amotion(bl); // Delay can never be lower than attack motion.
+
+ // Delay reductions
switch (skill_id)
{ //Monk combo skills have their delay reduced by agi/dex.
case MO_TRIPLEATTACK:
diff --git a/src/map/skill.h b/src/map/skill.h
index d8e8b4f5a..9905c761b 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -215,7 +215,7 @@ int skill_unit_ondamaged(struct skill_unit *src,struct block_list *bl,
int skill_castfix( struct block_list *bl, int skill_id, int skill_lv);
int skill_castfix_sc( struct block_list *bl, int time);
-int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv, bool instantcast);
+int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv);
int skill_check_condition( struct map_session_data *sd,int skill, int lv, int type);
int skill_check_pc_partner(struct map_session_data *sd, int skill_id, int* skill_lv, int range, int cast_flag);
// -- moonsoul (added skill_check_unit_cell)