summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/battle.h3
-rw-r--r--src/map/skill.c10
3 files changed, 13 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index cda47fc8c..0a8fb57ed 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3341,6 +3341,7 @@ static const struct battle_data_short {
{ "casting_rate", &battle_config.cast_rate },
{ "delay_rate", &battle_config.delay_rate },
{ "delay_dependon_dex", &battle_config.delay_dependon_dex },
+ { "delay_dependon_agi", &battle_config.delay_dependon_agi },
{ "skill_delay_attack_enable", &battle_config.sdelay_attack_enable },
{ "left_cardfix_to_right", &battle_config.left_cardfix_to_right },
{ "skill_add_range", &battle_config.skill_add_range },
@@ -3735,6 +3736,7 @@ void battle_set_defaults()
battle_config.cast_rate=100;
battle_config.delay_rate=100;
battle_config.delay_dependon_dex=0;
+ battle_config.delay_dependon_agi=0;
battle_config.sdelay_attack_enable=0;
battle_config.left_cardfix_to_right=0;
battle_config.skill_add_range=0;
diff --git a/src/map/battle.h b/src/map/battle.h
index 64efa3f70..bc1036203 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -94,7 +94,8 @@ extern struct Battle_Config {
unsigned short critical_rate;
unsigned short enable_baseatk;
unsigned short enable_perfect_flee;
- unsigned short cast_rate,delay_rate,delay_dependon_dex;
+ unsigned short cast_rate, delay_rate;
+ unsigned short delay_dependon_dex, delay_dependon_agi;
unsigned short sdelay_attack_enable;
unsigned short left_cardfix_to_right;
unsigned short skill_add_range;
diff --git a/src/map/skill.c b/src/map/skill.c
index 9ce83d48e..1f609117d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -8694,7 +8694,7 @@ int skill_castfix_sc (struct block_list *bl, int time)
}
/*==========================================
- * Does delay reductions based on dex, sc data, item bonuses, ...
+ * Does delay reductions based on dex/agi, sc data, item bonuses, ...
*------------------------------------------*/
int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
{
@@ -8733,6 +8733,14 @@ int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
else //To be capped later to minimum.
time = 0;
}
+ if (battle_config.delay_dependon_agi && !(delaynodex&1))
+ { // if skill delay is allowed to be reduced by agi
+ int scale = battle_config.castrate_dex_scale - status_get_agi(bl);
+ if (scale > 0)
+ time = time * scale / battle_config.castrate_dex_scale;
+ else //To be capped later to minimum.
+ time = 0;
+ }
}
if (!(delaynodex&2))