summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-19 00:15:02 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-19 00:15:02 +0000
commit0f4b1a36a2552e62227ee1350e8034a8f122c028 (patch)
treefff93ef0e7cf78051335cdd6996486e965ac9a4c
parentbfbd8f32351ead7ecf3bbd2915c84d897f7edc37 (diff)
downloadhercules-0f4b1a36a2552e62227ee1350e8034a8f122c028.tar.gz
hercules-0f4b1a36a2552e62227ee1350e8034a8f122c028.tar.bz2
hercules-0f4b1a36a2552e62227ee1350e8034a8f122c028.tar.xz
hercules-0f4b1a36a2552e62227ee1350e8034a8f122c028.zip
Added delay_dependon_agi since people actually use and need it...
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10887 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--conf-tmpl/Changelog.txt2
-rw-r--r--conf-tmpl/battle/skill.conf5
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/battle.h3
-rw-r--r--src/map/skill.c10
6 files changed, 19 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 854bbcd2d..87f9b9698 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,7 @@ 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/07/18
+ * Added delay_dependon_agi since people actually use and need it...
* Small update to the effects list (new exe's effects by Au{R}oN)
* No sending of the pet_equip packet when pet has no equip (thx2Skotlex)
* Added back exp gain limiting for old formula to stop exploits (see r8177)
diff --git a/conf-tmpl/Changelog.txt b/conf-tmpl/Changelog.txt
index a5263da0b..aa86be8b3 100644
--- a/conf-tmpl/Changelog.txt
+++ b/conf-tmpl/Changelog.txt
@@ -1,5 +1,7 @@
Date Added
+2007/07/18
+ * Added delay_dependon_agi, both options are available now [ultramage]
2007/06/10
* Rev. 10744 Fixed nopvp mapflag entry for mosk_in. [L0ne_W0lf]
2007/06/08
diff --git a/conf-tmpl/battle/skill.conf b/conf-tmpl/battle/skill.conf
index 0c981d147..3b4a58d2b 100644
--- a/conf-tmpl/battle/skill.conf
+++ b/conf-tmpl/battle/skill.conf
@@ -31,9 +31,10 @@ casting_rate: 100
// Delay time after casting (Note 2)
delay_rate: 100
-// Is the delay time is dependent on the caster's DEX? (Note 1)
-// Note: On Official servers Dex does NOT affect delay time
+// Does the delay time depend on the caster's DEX and/or AGI? (Note 1)
+// Note: On Official servers, neither Dex nor Agi affect delay time
delay_dependon_dex: no
+delay_dependon_agi: no
// Minimum allowed delay for ANY skills after casting (in miliseconds) (Note 1)
// Note: Setting this to anything above 0 can stop speedhacks.
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))