diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-18 21:14:18 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-18 21:14:18 +0000 |
commit | eb5f477097d2af88c242d57ba73a5a96f5a3bf80 (patch) | |
tree | c3e153a72b23622fc191262189ada800c2a1df1f /src/map | |
parent | aa934a7bb6f0910b9edb53e4c711e2af97bbaf4e (diff) | |
download | hercules-eb5f477097d2af88c242d57ba73a5a96f5a3bf80.tar.gz hercules-eb5f477097d2af88c242d57ba73a5a96f5a3bf80.tar.bz2 hercules-eb5f477097d2af88c242d57ba73a5a96f5a3bf80.tar.xz hercules-eb5f477097d2af88c242d57ba73a5a96f5a3bf80.zip |
- Added 5 config settings to adjust damage in pk-mode servers (misc.conf)
- Corrected LoV's effect range for levels 11+ to range 8.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6646 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 32 | ||||
-rw-r--r-- | src/map/battle.h | 5 |
2 files changed, 29 insertions, 8 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 6dc56eace..4d856966e 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -557,17 +557,21 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i }
}
- if (battle_config.pk_mode && bl->type == BL_PC && damage > 0) {
- if (flag & BF_WEAPON) {
+ if (battle_config.pk_mode && sd && damage > 0)
+ {
+ if (flag & BF_SKILL) { //Skills get a different reduction than non-skills. [Skotlex]
+ if (flag&BF_WEAPON)
+ damage = damage * battle_config.pk_weapon_damage_rate/100;
+ if (flag&BF_MAGIC)
+ damage = damage * battle_config.pk_magic_damage_rate/100;
+ if (flag&BF_MISC)
+ damage = damage * battle_config.pk_misc_damage_rate/100;
+ } else { //Normal attacks get reductions based on range.
if (flag & BF_SHORT)
- damage = damage * 80/100;
+ damage = damage * battle_config.pk_short_damage_rate/100;
if (flag & BF_LONG)
- damage = damage * 70/100;
+ damage = damage * battle_config.pk_long_damage_rate/100;
}
- if (flag & BF_MAGIC)
- damage = damage * 60/100;
- if(flag & BF_MISC)
- damage = damage * 60/100;
if(damage < 1) damage = 1;
}
@@ -3718,6 +3722,11 @@ static const struct battle_data_short { { "gvg_magic_attack_damage_rate", &battle_config.gvg_magic_damage_rate },
{ "gvg_misc_attack_damage_rate", &battle_config.gvg_misc_damage_rate },
{ "gvg_flee_penalty", &battle_config.gvg_flee_penalty },
+ { "pk_short_attack_damage_rate", &battle_config.pk_short_damage_rate },
+ { "pk_long_attack_damage_rate", &battle_config.pk_long_damage_rate },
+ { "pk_weapon_attack_damage_rate", &battle_config.pk_weapon_damage_rate },
+ { "pk_magic_attack_damage_rate", &battle_config.pk_magic_damage_rate },
+ { "pk_misc_attack_damage_rate", &battle_config.pk_misc_damage_rate },
{ "mob_changetarget_byskill", &battle_config.mob_changetarget_byskill},
{ "attack_direction_change", &battle_config.attack_direction_change },
{ "land_skill_limit", &battle_config.land_skill_limit },
@@ -4116,6 +4125,13 @@ void battle_set_defaults() { battle_config.gvg_misc_damage_rate = 60;
battle_config.gvg_flee_penalty = 20;
battle_config.gvg_eliminate_time = 7000;
+
+ battle_config.pk_short_damage_rate = 80;
+ battle_config.pk_long_damage_rate = 70;
+ battle_config.pk_weapon_damage_rate = 60;
+ battle_config.pk_magic_damage_rate = 60;
+ battle_config.pk_misc_damage_rate = 60;
+
battle_config.mob_changetarget_byskill = 0;
battle_config.attack_direction_change = BL_ALL;
battle_config.land_skill_limit = BL_ALL;
diff --git a/src/map/battle.h b/src/map/battle.h index 145a14fc8..54ad800e3 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -251,6 +251,11 @@ extern struct Battle_Config { unsigned short gvg_misc_damage_rate;
unsigned short gvg_flee_penalty;
int gvg_eliminate_time;
+ unsigned short pk_short_damage_rate;
+ unsigned short pk_long_damage_rate;
+ unsigned short pk_weapon_damage_rate;
+ unsigned short pk_magic_damage_rate;
+ unsigned short pk_misc_damage_rate;
unsigned short mob_changetarget_byskill;
unsigned short attack_direction_change;
unsigned short land_skill_limit;
|