summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-20 18:29:08 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-20 18:29:08 +0000
commit3e7eb3999221a0bc3ac28739848199de5aed6953 (patch)
tree109051ba9d85f2cf151e916e760fd155887af3db
parente6183e5b3d7461425ef5f529c3d757952b659652 (diff)
downloadhercules-3e7eb3999221a0bc3ac28739848199de5aed6953.tar.gz
hercules-3e7eb3999221a0bc3ac28739848199de5aed6953.tar.bz2
hercules-3e7eb3999221a0bc3ac28739848199de5aed6953.tar.xz
hercules-3e7eb3999221a0bc3ac28739848199de5aed6953.zip
- Added battle config settings agi_penalty_target and vit_penalty_target, they define which object types will get vit/flee reductions when multi-targetted and defaults to only players (battle/battle.conf)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7774 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--conf-tmpl/battle/battle.conf10
-rw-r--r--src/map/battle.c13
-rw-r--r--src/map/battle.h2
4 files changed, 24 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 16cb282bc..ffd31258f 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.
2006/07/20
+ * Added battle config settings agi_penalty_target and vit_penalty_target,
+ they define which object types will get vit/flee reductions when
+ multi-targetted and defaults to only players (battle/battle.conf) [Skotlex]
* Added the dummy intravision case for the changeoption packet 0x229
[Skotlex]
* Corrected Fog of Wall so that all targetted offensive skills (not only
diff --git a/conf-tmpl/battle/battle.conf b/conf-tmpl/battle/battle.conf
index ccde3771b..26dc1113f 100644
--- a/conf-tmpl/battle/battle.conf
+++ b/conf-tmpl/battle/battle.conf
@@ -72,6 +72,10 @@ max_hitrate: 100
// 2 = agi_penalty_num is reduced from FLEE as an exact amount
agi_penalty_type: 1
+// When agi penalty is enabled, to whom it should apply to? (Note 4)
+// By default, only players get the penalty.
+agi_penalty_target: 1
+
// Amount of enemies required to be targetting player before FLEE begins to be penalized
agi_penalty_count: 3
@@ -84,7 +88,11 @@ agi_penalty_num: 10
// 2 = vit_penalty_num is reduced from FLEE as an exact amount
vit_penalty_type: 1
-// Amount of enemies required to be targetting player before VIT defense begins to be penalized
+// When vit penalty is enabled, to whom it should apply to? (Note 4)
+// By default, only players get the penalty.
+vit_penalty_target: 1
+
+// Amount of enemies required to be targetting player before defense begins to be penalized
vit_penalty_count: 3
// Amount of VIT defense penalized per each attacking monster more than vit_penalty_count
diff --git a/src/map/battle.c b/src/map/battle.c
index d900a4de4..22d850132 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1043,7 +1043,8 @@ static struct Damage battle_calc_weapon_attack(
flee = tstatus->flee,
hitrate=80; //Default hitrate
- if(battle_config.agi_penalty_type)
+ if(battle_config.agi_penalty_type &&
+ battle_config.agi_penalty_target&target->type)
{
unsigned char target_count; //256 max targets should be a sane max
target_count = unit_counttargeted(target,battle_config.agi_penalty_count_lv);
@@ -1626,7 +1627,8 @@ static struct Damage battle_calc_weapon_attack(
short vit_def;
signed char def1 = (signed char)status_get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
short def2 = (short)tstatus->def2;
- if(battle_config.vit_penalty_type)
+ if(battle_config.vit_penalty_type &&
+ battle_config.vit_penalty_target&target->type)
{
unsigned char target_count; //256 max targets should be a sane max
target_count = unit_counttargeted(target,battle_config.vit_penalty_count_lv);
@@ -2582,7 +2584,8 @@ struct Damage battle_calc_misc_attack(
flee = tstatus->flee,
hitrate=80; //Default hitrate
- if(battle_config.agi_penalty_type)
+ if(battle_config.agi_penalty_type &&
+ battle_config.agi_penalty_target&target->type)
{
unsigned char target_count; //256 max targets should be a sane max
target_count = unit_counttargeted(target,battle_config.agi_penalty_count_lv);
@@ -3450,10 +3453,12 @@ static const struct battle_data_short {
{ "auto_counter_type", &battle_config.auto_counter_type },
{ "min_hitrate", &battle_config.min_hitrate },
{ "max_hitrate", &battle_config.max_hitrate },
+ { "agi_penalty_target", &battle_config.agi_penalty_target },
{ "agi_penalty_type", &battle_config.agi_penalty_type },
{ "agi_penalty_count", &battle_config.agi_penalty_count },
{ "agi_penalty_num", &battle_config.agi_penalty_num },
{ "agi_penalty_count_lv", &battle_config.agi_penalty_count_lv },
+ { "vit_penalty_target", &battle_config.vit_penalty_target },
{ "vit_penalty_type", &battle_config.vit_penalty_type },
{ "vit_penalty_count", &battle_config.vit_penalty_count },
{ "vit_penalty_num", &battle_config.vit_penalty_num },
@@ -3857,10 +3862,12 @@ void battle_set_defaults() {
battle_config.auto_counter_type = BL_ALL;
battle_config.min_hitrate = 5;
battle_config.max_hitrate = 100;
+ battle_config.agi_penalty_target = BL_PC;
battle_config.agi_penalty_type = 1;
battle_config.agi_penalty_count = 3;
battle_config.agi_penalty_num = 10;
battle_config.agi_penalty_count_lv = ATK_FLEE;
+ battle_config.vit_penalty_target = BL_PC;
battle_config.vit_penalty_type = 1;
battle_config.vit_penalty_count = 3;
battle_config.vit_penalty_num = 5;
diff --git a/src/map/battle.h b/src/map/battle.h
index 63d3aa530..6e665f10f 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -228,9 +228,11 @@ extern struct Battle_Config {
unsigned short auto_counter_type;
unsigned short min_hitrate; //[Skotlex]
unsigned short max_hitrate; //[Skotlex]
+ unsigned short agi_penalty_target;
unsigned short agi_penalty_type;
unsigned short agi_penalty_count;
unsigned short agi_penalty_num;
+ unsigned short vit_penalty_target;
unsigned short vit_penalty_type;
unsigned short vit_penalty_count;
unsigned short vit_penalty_num;