summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-09 18:06:42 -0300
committershennetsind <ind@henn.et>2013-07-09 18:06:42 -0300
commit55d42874dcf24c466f0104123d9efe280c0fd03c (patch)
tree7d4f517a84fcdf96b791ff5d93321b2fbfd4c4b1 /src/map/skill.c
parent482c1ef58d94d8e124a9b8102f2503818bbc1c90 (diff)
downloadhercules-55d42874dcf24c466f0104123d9efe280c0fd03c.tar.gz
hercules-55d42874dcf24c466f0104123d9efe280c0fd03c.tar.bz2
hercules-55d42874dcf24c466f0104123d9efe280c0fd03c.tar.xz
hercules-55d42874dcf24c466f0104123d9efe280c0fd03c.zip
Mob Parse & Mob Skill Use fixes
Special Thanks to Masao for bringing this to us. mob parser will now throw out warnings when a field in the mob db has a value higher than the field supported (e.g. if you get a monster with 70k hp it will tell you its higher and cap it to the maximum supported, which is 65k), this failsafe also works for def/mdef, str/agi/vit/int_/dex/luk. Modified the formula that measures skill field data for skill levels higher than the maximum (e.g. mistress' high-level jupitel thunder), to match the previous version, also fixed a issue where depending on the level the blewcount could get higher than the systems' hardcoded 25-cell maximum. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 78914869c..7b6652dda 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -179,9 +179,9 @@ void skill_chk(uint16* skill_id) {
#define skill_get2(var,id,lv) { \
skill->chk(&id); \
if(!id) return 0; \
- if( lv >= MAX_SKILL_LEVEL && var > 1 ) { \
+ if( lv > MAX_SKILL_LEVEL && var > 1 ) { \
int lv2 = lv; lv = skill_db[id].max; \
- return (var) + (lv2-lv);\
+ return (var) + ((lv2-lv)/2);\
} \
return var;\
}
@@ -2655,6 +2655,11 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
break;
}
+
+ /* monsters with skill lv higher than MAX_SKILL_LEVEL may get this value beyond the max depending on conditions, we cap to the system's limit */
+ if( dsrc && dsrc->type == BL_MOB && skill_lv > MAX_SKILL_LEVEL && dmg.blewcount > 25 )
+ dmg.blewcount = 25;
+
//blown-specific handling
switch( skill_id ) {
case LG_OVERBRAND:
@@ -18087,7 +18092,7 @@ int do_init_skill (void) {
iTimer->add_timer_func_list(skill->blockpc_end, "skill_blockpc_end");
iTimer->add_timer_interval(iTimer->gettick()+SKILLUNITTIMER_INTERVAL,skill->unit_timer,0,0,SKILLUNITTIMER_INTERVAL);
-
+
return 0;
}