summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 2ad066d33..5bc3df6f8 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1606,7 +1606,20 @@ static int battle_range_type(
return BF_SHORT;
return BF_LONG;
}
+static inline int battle_adjust_skill_damage(int m, unsigned short skill_id) {
+ if( map[m].skill_count ) {
+ int i;
+ ARR_FIND(0, map[m].skill_count, i, map[m].skills[i]->skill_id == skill_id );
+
+ if( i < map[m].skill_count ) {
+ return map[m].skills[i]->modifier;
+ }
+
+ }
+
+ return 0;
+}
static int battle_blewcount_bonus(struct map_session_data *sd, uint16 skill_id)
{
int i;
@@ -3094,6 +3107,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
if (skill_id && (i = pc_skillatk_bonus(sd, skill_id)))
ATK_ADDRATE(i);
+ if( (i = battle_adjust_skill_damage(sd->bl.m,skill_id)) )
+ ATK_RATE(i);
+
if( skill_id != PA_SACRIFICE && skill_id != MO_INVESTIGATE && skill_id != CR_GRANDCROSS && skill_id != NPC_GRANDDARKNESS && skill_id != PA_SHIELDCHAIN && !flag.cri )
{ //Elemental/Racial adjustments
if( sd->right_weapon.def_ratio_atk_ele & (1<<tstatus->def_ele) ||
@@ -4075,6 +4091,9 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
//Damage bonuses
if ((i = pc_skillatk_bonus(sd, skill_id)))
ad.damage += ad.damage*i/100;
+
+ if( (i = battle_adjust_skill_damage(sd->bl.m,skill_id)) )
+ MATK_RATE(i);
//Ignore Defense?
if (!flag.imdef && (
@@ -4456,6 +4475,9 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
if (sd && (i = pc_skillatk_bonus(sd, skill_id)))
md.damage += md.damage*i/100;
+ if( (i = battle_adjust_skill_damage(sd->bl.m,skill_id)) )
+ md.damage = md.damage * i / 100;
+
if(md.damage < 0)
md.damage = 0;
else if(md.damage && tstatus->mode&MD_PLANT){