diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-10-11 16:38:01 +0000 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-10-11 16:38:01 +0000 |
commit | a4ef465477e3701d5aebf419ab19823e685889c7 (patch) | |
tree | d89d2a2c99f5bd0d063cf0314178cec0406d5b03 /src | |
parent | e7ff598d02c8559661bcd39ad63e7a6d2577f3d0 (diff) | |
download | evol-hercules-a4ef465477e3701d5aebf419ab19823e685889c7.tar.gz evol-hercules-a4ef465477e3701d5aebf419ab19823e685889c7.tar.bz2 evol-hercules-a4ef465477e3701d5aebf419ab19823e685889c7.tar.xz evol-hercules-a4ef465477e3701d5aebf419ab19823e685889c7.zip |
This is a basic implementation so wands use MATK instead of ATK.
This causes wands, defined as W_STAFF (2H) or W_BOOK (1H, not planned AFAIK) to use MATK instead of ATK.
These basic magic attacks have a few quirks:
* Physical Defense will absorb them (needed)
* Can be evaded
* Use no mana
Inefficient, optimize later.
Diffstat (limited to 'src')
-rw-r--r-- | src/emap/battle.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/emap/battle.c b/src/emap/battle.c index 5a24927..3889c18 100644 --- a/src/emap/battle.c +++ b/src/emap/battle.c @@ -91,8 +91,8 @@ struct Damage ebattle_calc_weapon_attack_post(struct Damage retVal, struct block_list *src, struct block_list *target, uint16 skill_id, - uint16 skill_lv __attribute__ ((unused)), - int wflag __attribute__ ((unused))) + uint16 skill_lv, + int wflag) { if (src == NULL) return retVal; @@ -101,6 +101,14 @@ struct Damage ebattle_calc_weapon_attack_post(struct Damage retVal, if (sd == NULL) return retVal; + // Staffs and Books will use MATK instead of ATK. + // These regular attacks are still subject to regular DEF/Evade/etc. + // And base attack bonus might still be gained from STR instead of INT. + // TODO: Move this to a pre-hook to avoid extra calculation + if (!skill_id && (sd->weapontype == W_STAFF || sd->weapontype == W_BOOK)) { + retVal=battle->calc_magic_attack(src, target, skill_id, skill_lv, wflag); + } + struct mob_data *md = BL_CAST(BL_MOB, target); if (md == NULL) return retVal; |