summaryrefslogtreecommitdiff
path: root/src/emap/battle.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-01 01:30:35 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-01 01:30:35 +0300
commit4f35fa5d10ba0a30157205227f25aed6da67f4e1 (patch)
tree5d348e835494204a5b4f6ea0a70cb5d0d2dae470 /src/emap/battle.c
parenta3158d2110a2a846d39a5ddc364adb40c212241d (diff)
downloadevol-hercules-4f35fa5d10ba0a30157205227f25aed6da67f4e1.tar.gz
evol-hercules-4f35fa5d10ba0a30157205227f25aed6da67f4e1.tar.bz2
evol-hercules-4f35fa5d10ba0a30157205227f25aed6da67f4e1.tar.xz
evol-hercules-4f35fa5d10ba0a30157205227f25aed6da67f4e1.zip
Add into mob_db skill type attacks modifier.
New group in mob_db: SkillAttacks Example: SkillAttacks: { SM_BASH: 5000 // mean SM_BASH skill do 50% of normal damage } Default value is 10000 mean 100%
Diffstat (limited to 'src/emap/battle.c')
-rw-r--r--src/emap/battle.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/emap/battle.c b/src/emap/battle.c
index 161da3d..1404795 100644
--- a/src/emap/battle.c
+++ b/src/emap/battle.c
@@ -85,8 +85,8 @@ bool ebattle_check_arrows_post(bool retVal,
struct Damage ebattle_calc_weapon_attack_post(struct Damage retVal,
struct block_list *src,
- struct block_list *target __attribute__ ((unused)),
- uint16 skill_id __attribute__ ((unused)),
+ struct block_list *target,
+ uint16 skill_id,
uint16 skill_lv __attribute__ ((unused)),
int wflag __attribute__ ((unused)))
{
@@ -105,9 +105,17 @@ struct Damage ebattle_calc_weapon_attack_post(struct Damage retVal,
if (data == NULL)
return retVal;
- const int mod = data->weaponAttacks[sd->weapontype1];
+ int mod = 0;
+ if (skill_id > 0)
+ {
+ const int idx = skill->get_index(skill_id);
+ mod = data->skillAttacks[idx];
+ }
+ else
+ {
+ mod = data->weaponAttacks[sd->weapontype1];
+ }
retVal.damage = apply_percentrate64(retVal.damage, mod, 10000);
retVal.damage2 = apply_percentrate64(retVal.damage2, mod, 10000);
-
return retVal;
}