summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorJedzkie <jedzkie13@rocketmail.com>2015-12-15 00:43:36 +0800
committerHaru <haru@dotalux.com>2015-12-14 18:28:35 +0100
commit8924522fe29079a66f4d9b6d88b50bcdadf7df9a (patch)
treebf625568a7f1873e0d85540d20234c8ef2ccaaca /src/map/battle.c
parent9bafc4a5a02e2fb3f48bb9abefaf41ea452929d5 (diff)
downloadhercules-8924522fe29079a66f4d9b6d88b50bcdadf7df9a.tar.gz
hercules-8924522fe29079a66f4d9b6d88b50bcdadf7df9a.tar.bz2
hercules-8924522fe29079a66f4d9b6d88b50bcdadf7df9a.tar.xz
hercules-8924522fe29079a66f4d9b6d88b50bcdadf7df9a.zip
Added official effect of Mora Berry.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 1725d8c65..a581cd3c8 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3044,18 +3044,30 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
// Compressed code, fixed by map.h [Epoque]
if (src->type == BL_MOB) {
int i;
- if (sc->data[SC_MANU_DEF])
- for (i=0;ARRAYLENGTH(mob->manuk)>i;i++)
- if (mob->manuk[i]==((TBL_MOB*)src)->class_) {
+ if (sc->data[SC_MANU_DEF] != NULL) {
+ for (i = 0; i < ARRAYLENGTH(mob->manuk); i++) {
+ if (mob->manuk[i] == ((TBL_MOB*)src)->class_) {
damage -= damage * sc->data[SC_MANU_DEF]->val1 / 100;
break;
}
- if (sc->data[SC_SPL_DEF])
- for (i=0;ARRAYLENGTH(mob->splendide)>i;i++)
- if (mob->splendide[i]==((TBL_MOB*)src)->class_) {
+ }
+ }
+ if (sc->data[SC_SPL_DEF] != NULL) {
+ for (i = 0; i < ARRAYLENGTH(mob->splendide); i++) {
+ if (mob->splendide[i] == ((TBL_MOB*)src)->class_) {
damage -= damage * sc->data[SC_SPL_DEF]->val1 / 100;
break;
}
+ }
+ }
+ if (sc->data[SC_MORA_BUFF] != NULL) {
+ for (i = 0; i < ARRAYLENGTH(mob->mora); i++) {
+ if (mob->mora[i] == ((TBL_MOB*)src)->class_) {
+ damage -= damage * sc->data[SC_MORA_BUFF]->val1 / 100;
+ break;
+ }
+ }
+ }
}
if((sce=sc->data[SC_ARMOR]) && //NPC_DEFENDER