Skip to content

Commit

Permalink
Added official effect of Mora Berry.
Browse files Browse the repository at this point in the history
Signed-off-by: Haru <haru@dotalux.com>
  • Loading branch information
Jedzkie authored and MishimaHaruna committed Dec 14, 2015
1 parent 9bafc4a commit 8924522
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 13 deletions.
1 change: 1 addition & 0 deletions db/const.txt
Expand Up @@ -1316,6 +1316,7 @@ SC_ATKER_MOVESPEED 609
SC_FOOD_CRITICALSUCCESSVALUE 610
SC_CUP_OF_BOZA 611
SC_OVERLAPEXPUP 612
SC_MORA_BUFF 613

e_gasp 0
e_what 1
Expand Down
6 changes: 5 additions & 1 deletion db/re/item_db.conf
Expand Up @@ -83987,7 +83987,11 @@ item_db: (
Weight: 20
EquipLv: 120
BuyingStore: true
Script: <" itemheal 0,rand(50,65); ">
Script: <"
itemheal 0, rand(50,65);
specialeffect2 EF_GUARD;
sc_start SC_MORA_BUFF, 120000, 50;
">
},
{
Id: 12575
Expand Down
1 change: 1 addition & 0 deletions db/sc_config.txt
Expand Up @@ -422,6 +422,7 @@ SC_GEFFEN_MAGIC3, 2
//SC_FENRIR_CARD, ??

SC_OVERLAPEXPUP, 12
SC_MORA_BUFF, 2

// Guild Auras should not be saved
SC_LEADERSHIP,78
Expand Down
24 changes: 18 additions & 6 deletions src/map/battle.c
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/map/mob.c
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
11 changes: 6 additions & 5 deletions src/map/mob.h
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/map/status.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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
**/
Expand Down
1 change: 1 addition & 0 deletions src/map/status.h
Expand Up @@ -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;
Expand Down

0 comments on commit 8924522

Please sign in to comment.