diff options
author | shennetsind <ind@henn.et> | 2013-02-14 23:12:19 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-02-14 23:12:19 -0200 |
commit | ef49bfc4445d464f19f84d78a2e6a1a5a3d9f0ac (patch) | |
tree | df150223d48b5379d47a365c05a143691c79cdf6 /src/map/battle.c | |
parent | 7d33212f95653edd621961487f5622611d62ae88 (diff) | |
download | hercules-ef49bfc4445d464f19f84d78a2e6a1a5a3d9f0ac.tar.gz hercules-ef49bfc4445d464f19f84d78a2e6a1a5a3d9f0ac.tar.bz2 hercules-ef49bfc4445d464f19f84d78a2e6a1a5a3d9f0ac.tar.xz hercules-ef49bfc4445d464f19f84d78a2e6a1a5a3d9f0ac.zip |
New Mapflag adjust_skill_damage
Made as a improvement of the original ADJUST_SKILL_DAMAGE -- special thanks to Muad_Dib! .
This mapflag allows you to modify the damage of any skill in any map, for example
"prontera mapflag adjust_skill_damage MG_FIREBOLT 200"
doubles the damage of Firebolt in prontera
Another Example:
"prontera mapflag adjust_skill_damage MG_FIREBOLT 50"
Halves the damage of Firebolt in prontera.
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 22 |
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){ |