summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c24
-rw-r--r--src/map/mob.c5
-rw-r--r--src/map/mob.h11
-rw-r--r--src/map/status.c4
-rw-r--r--src/map/status.h1
5 files changed, 33 insertions, 12 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
diff --git a/src/map/mob.c b/src/map/mob.c
index a6e2c7c21..e06a16317 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4981,9 +4981,10 @@ int do_final_mob(void)
}
void mob_defaults(void) {
- //Defines the Manuk/Splendide mob groups for the status reductions [Epoque]
+ // Defines the Manuk/Splendide/Mora mob groups for the status reductions [Epoque & Frost]
const int mob_manuk[8] = { 1986, 1987, 1988, 1989, 1990, 1997, 1998, 1999 };
const int mob_splendide[5] = { 1991, 1992, 1993, 1994, 1995 };
+ const int mob_mora[5] = { 2137, 2136, 2134, 2133, 2132 };
mob = &mob_s;
@@ -4993,6 +4994,8 @@ void mob_defaults(void) {
memcpy(mob->manuk, mob_manuk, sizeof(mob->manuk));
memcpy(mob->splendide, mob_splendide, sizeof(mob->splendide));
+ memcpy(mob->mora, mob_mora, sizeof(mob->mora));
+
/* */
mob->reload = mob_reload;
mob->init = do_init_mob;
diff --git a/src/map/mob.h b/src/map/mob.h
index f7e071261..458a2d423 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -272,14 +272,15 @@ struct item_drop_list {
#define mob_is_treasure(md) (((md)->class_ >= MOBID_TREAS01 && (md)->class_ <= MOBID_TREAS40) || ((md)->class_ >= MOBID_TREAS41 && (md)->class_ <= MOBID_TREAS49))
struct mob_interface {
- //Dynamic mob database, allows saving of memory when there's big gaps in the mob_db [Skotlex]
- struct mob_db *db_data[MAX_MOB_DB+1];
+ // Dynamic mob database, allows saving of memory when there's big gaps in the mob_db [Skotlex]
+ struct mob_db *db_data[MAX_MOB_DB + 1];
struct mob_db *dummy; //Dummy mob to be returned when a non-existant one is requested.
- //Dynamic mob chat database
- struct mob_chat *chat_db[MAX_MOB_CHAT+1];
- //Defines the Manuk/Splendide mob groups for the status reductions [Epoque]
+ // Dynamic mob chat database
+ struct mob_chat *chat_db[MAX_MOB_CHAT + 1];
+ // Defines the Manuk/Splendide/Mora mob groups for the status reductions [Epoque & Frost]
int manuk[8];
int splendide[5];
+ int mora[5];
/* */
int (*init) (bool mimimal);
int (*final) (void);
diff --git a/src/map/status.c b/src/map/status.c
index 951615fb2..8b767f6a2 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -803,6 +803,7 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_PLUSATTACKPOWER] = SI_PLUSATTACKPOWER;
status->dbs->IconChangeTable[SC_PLUSMAGICPOWER] = SI_PLUSMAGICPOWER;
status->dbs->IconChangeTable[SC_FOOD_CRITICALSUCCESSVALUE] = SI_FOOD_CRITICALSUCCESSVALUE;
+ status->dbs->IconChangeTable[SC_MORA_BUFF] = SI_MORA_BUFF;
// Cash Items
status->dbs->IconChangeTable[SC_FOOD_STR_CASH] = SI_FOOD_STR_CASH;
@@ -8582,6 +8583,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_SPL_MATK:
val2 = 2; // Splendide group
break;
+ case SC_MORA_BUFF:
+ val2 = 3; // Mora group
+ break;
/**
* General
**/
diff --git a/src/map/status.h b/src/map/status.h
index f2173d81c..fe4c970cd 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -776,6 +776,7 @@ typedef enum sc_type {
SC_FOOD_CRITICALSUCCESSVALUE, // 610
SC_CUP_OF_BOZA,
SC_OVERLAPEXPUP,
+ SC_MORA_BUFF,
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
} sc_type;