diff options
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/map/status.c b/src/map/status.c index a6e6b24c0..589acff5c 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6407,13 +6407,24 @@ static int status_get_class(const struct block_list *bl) { nullpo_ret(bl); switch (bl->type) { - case BL_PC: return BL_UCCAST(BL_PC, bl)->status.class; - case BL_MOB: return BL_UCCAST(BL_MOB, bl)->vd->class; //Class used on all code should be the view class of the mob. - case BL_PET: return BL_UCCAST(BL_PET, bl)->pet.class_; - case BL_HOM: return BL_UCCAST(BL_HOM, bl)->homunculus.class_; - case BL_MER: return BL_UCCAST(BL_MER, bl)->mercenary.class_; - case BL_NPC: return BL_UCCAST(BL_NPC, bl)->class_; - case BL_ELEM: return BL_UCCAST(BL_ELEM, bl)->elemental.class_; + case BL_PC: + return BL_UCCAST(BL_PC, bl)->status.class; + case BL_MOB: + { + const struct view_data *const vd = BL_UCCAST(BL_MOB, bl)->vd; + nullpo_ret(vd); + return vd->class; //Class used on all code should be the view class of the mob. + } + case BL_PET: + return BL_UCCAST(BL_PET, bl)->pet.class_; + case BL_HOM: + return BL_UCCAST(BL_HOM, bl)->homunculus.class_; + case BL_MER: + return BL_UCCAST(BL_MER, bl)->mercenary.class_; + case BL_NPC: + return BL_UCCAST(BL_NPC, bl)->class_; + case BL_ELEM: + return BL_UCCAST(BL_ELEM, bl)->elemental.class_; } return 0; } @@ -6503,7 +6514,7 @@ static defType status_get_def(struct block_list *bl) int def = st ? st->def : 0; ud = unit->bl2ud(bl); if (ud && ud->skilltimer != INVALID_TIMER) - def -= def * skill->get_castdef(ud->skill_id)/100; + def -= def * skill->get_castdef(ud->skill_id, ud->skill_lv) / 100; return cap_value(def, DEFTYPE_MIN, DEFTYPE_MAX); } |