From c22bc45868e8ea2b7ef904848d178caeaa6b379c Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Wed, 19 Apr 2017 23:25:53 +0800 Subject: Implemented Official Summer 2 Costume Added summer2_ignorepalette configuration --- conf/map/battle/client.conf | 4 ++++ db/constants.conf | 3 +++ src/common/mmo.h | 3 ++- src/map/atcommand.c | 6 ++++++ src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/clif.c | 6 +++++- src/map/script.c | 1 + src/map/status.c | 17 ++++++++++++++++- src/map/status.h | 4 +++- 10 files changed, 42 insertions(+), 4 deletions(-) diff --git a/conf/map/battle/client.conf b/conf/map/battle/client.conf index c3409b578..45f89ce9b 100644 --- a/conf/map/battle/client.conf +++ b/conf/map/battle/client.conf @@ -126,6 +126,10 @@ summer_ignorepalette: false // Set this to true if your cloth palettes pack doesn't has Hanbok palettes (or has less than the other jobs) hanbok_ignorepalette: false +// Do not display cloth colors for the Summer 2 costume? +// Set this to true if your cloth palettes pack doesn't has Summer 2 palettes (or has less than the other jobs) +summer2_ignorepalette: false + // Show Hercules version to users when the login? display_version: false diff --git a/db/constants.conf b/db/constants.conf index 79530e7d1..c0fe61d96 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -1394,6 +1394,9 @@ constants_db: { SC_TUNAPARTY: 649 SC_SHRIMP: 650 SC_FRESHSHRIMP: 651 + + // Summer 2 Costume + SC_DRESS_UP: 652 comment__: "Emotes" e_gasp: 0 diff --git a/src/common/mmo.h b/src/common/mmo.h index b3069b27c..5e650e4e8 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -436,6 +436,7 @@ enum { OPTION_DRAGON5 = 0x04000000, OPTION_HANBOK = 0x08000000, OPTION_OKTOBERFEST = 0x10000000, + OPTION_SUMMER2 = 0x20000000, #ifndef NEW_CARTS OPTION_CART1 = 0x00000008, OPTION_CART2 = 0x00000080, @@ -447,7 +448,7 @@ enum { #endif // compound constants OPTION_DRAGON = OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5, - OPTION_COSTUME = OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK|OPTION_OKTOBERFEST, + OPTION_COSTUME = OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK|OPTION_OKTOBERFEST|OPTION_SUMMER2, }; struct s_skill { diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 881e50497..4c746d4ca 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -9256,6 +9256,9 @@ ACMD(costume){ "Hanbok", #if PACKETVER >= 20131218 "Oktoberfest", +#endif +#if PACKETVER >= 20141022 + "Summer2", #endif }; const int name2id[] = { @@ -9265,6 +9268,9 @@ ACMD(costume){ SC_HANBOK, #if PACKETVER >= 20131218 SC_OKTOBERFEST, +#endif +#if PACKETVER >= 20141022 + SC_DRESS_UP, #endif }; unsigned short k = 0, len = ARRAYLENGTH(names); diff --git a/src/map/battle.c b/src/map/battle.c index 63252caf7..a43fa11c8 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7042,6 +7042,7 @@ static const struct battle_data { { "xmas_ignorepalette", &battle_config.xmas_ignorepalette, 0, 0, 1, }, { "summer_ignorepalette", &battle_config.summer_ignorepalette, 0, 0, 1, }, { "hanbok_ignorepalette", &battle_config.hanbok_ignorepalette, 0, 0, 1, }, + { "summer2_ignorepalette", &battle_config.summer2_ignorepalette, 0, 0, 1, }, { "natural_healhp_interval", &battle_config.natural_healhp_interval, 6000, NATURAL_HEAL_INTERVAL, INT_MAX, }, { "natural_healsp_interval", &battle_config.natural_healsp_interval, 8000, NATURAL_HEAL_INTERVAL, INT_MAX, }, { "natural_heal_skill_interval", &battle_config.natural_heal_skill_interval, 10000, NATURAL_HEAL_INTERVAL, INT_MAX, }, diff --git a/src/map/battle.h b/src/map/battle.h index 806b07a20..2bc9f5b2e 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -246,6 +246,7 @@ struct Battle_Config { int xmas_ignorepalette; // [Valaris] int summer_ignorepalette; // [Zephyrus] int hanbok_ignorepalette; + int summer2_ignorepalette; int natural_healhp_interval; int natural_healsp_interval; int natural_heal_skill_interval; diff --git a/src/map/clif.c b/src/map/clif.c index 5939222e9..3bf77baef 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3215,10 +3215,12 @@ void clif_changelook(struct block_list *bl,int type,int val) vd->cloth_color = 0; if (sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */) vd->cloth_color = 0; + if (sd->sc.option&OPTION_SUMMER2 && battle_config.summer2_ignorepalette) + vd->cloth_color = 0; if (vd->body_style && ( sd->sc.option&OPTION_WEDDING || sd->sc.option&OPTION_XMAS || sd->sc.option&OPTION_SUMMER || sd->sc.option&OPTION_HANBOK || - sd->sc.option&OPTION_OKTOBERFEST)) + sd->sc.option&OPTION_OKTOBERFEST || sd->sc.option&OPTION_SUMMER2)) vd->body_style = 0; break; case LOOK_HAIR: @@ -3248,6 +3250,8 @@ void clif_changelook(struct block_list *bl,int type,int val) val = 0; if( sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */ ) val = 0; + if (sd->sc.option&OPTION_SUMMER2 && battle_config.summer2_ignorepalette) + val = 0; } vd->cloth_color = val; break; diff --git a/src/map/script.c b/src/map/script.c index 8604b62f7..bea0fe47c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -22102,6 +22102,7 @@ void script_hardcoded_constants(void) script->set_constant("Option_Dragon5",OPTION_DRAGON5,false, false); script->set_constant("Option_Hanbok",OPTION_HANBOK,false, false); script->set_constant("Option_Oktoberfest",OPTION_OKTOBERFEST,false, false); + script->set_constant("Option_Summer2", OPTION_SUMMER2, false, false); script->constdb_comment("status option compounds"); script->set_constant("Option_Dragon",OPTION_DRAGON,false, false); diff --git a/src/map/status.c b/src/map/status.c index d8fb9a350..529ab1c02 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1000,6 +1000,7 @@ void initChangeTables(void) status->dbs->IconChangeTable[SC_MONSTER_TRANSFORM] = SI_MONSTER_TRANSFORM; // Costumes + status->dbs->IconChangeTable[SC_DRESS_UP] = SI_DRESS_UP; status->dbs->IconChangeTable[SC_MOONSTAR] = SI_MOONSTAR; status->dbs->IconChangeTable[SC_SUPER_STAR] = SI_SUPER_STAR; status->dbs->IconChangeTable[SC_STRANGELIGHTS] = SI_STRANGELIGHTS; @@ -1178,6 +1179,7 @@ void initChangeTables(void) status->dbs->ChangeFlagTable[SC_MVPCARD_ORCLORD] |= SCB_ALL; // Costumes + status->dbs->ChangeFlagTable[SC_DRESS_UP] |= SCB_NONE; status->dbs->ChangeFlagTable[SC_MOONSTAR] |= SCB_NONE; status->dbs->ChangeFlagTable[SC_SUPER_STAR] |= SCB_NONE; status->dbs->ChangeFlagTable[SC_STRANGELIGHTS] |= SCB_NONE; @@ -6883,13 +6885,16 @@ void status_set_viewdata(struct block_list *bl, int class_) sd->vd.cloth_color = 0; if (sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */) sd->vd.cloth_color = 0; + if (sd->sc.option&OPTION_SUMMER2 && battle_config.summer2_ignorepalette) + sd->vd.cloth_color = 0; } if (sd->vd.body_style && (sd->sc.option&OPTION_WEDDING || sd->sc.option&OPTION_XMAS || sd->sc.option&OPTION_SUMMER || sd->sc.option&OPTION_HANBOK - || sd->sc.option&OPTION_OKTOBERFEST)) + || sd->sc.option&OPTION_OKTOBERFEST + || sd->sc.option&OPTION_SUMMER2)) sd->vd.body_style = 0; } else if (vd != NULL) { memcpy(&sd->vd, vd, sizeof(struct view_data)); @@ -8493,6 +8498,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_SUMMER: case SC_HANBOK: case SC_OKTOBERFEST: + case SC_DRESS_UP: if (!vd) return 0; //Store previous values as they could be removed. unit->stop_attack(bl); @@ -9896,6 +9902,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_SUMMER: case SC_HANBOK: case SC_OKTOBERFEST: + case SC_DRESS_UP: if( !vd ) break; clif->changelook(bl, LOOK_BASE, vd->class); clif->changelook(bl,LOOK_WEAPON,0); @@ -10284,6 +10291,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t sc->option |= OPTION_OKTOBERFEST; opt_flag |= 0x4; break; + case SC_DRESS_UP: + sc->option |= OPTION_SUMMER2; + opt_flag |= 0x4; + break; case SC__FEINTBOMB_MASTER: sc->option |= OPTION_INVISIBLE; opt_flag |= 0x4; @@ -11092,6 +11103,10 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const sc->option &= ~OPTION_OKTOBERFEST; opt_flag |= 0x4; break; + case SC_DRESS_UP: + sc->option &= ~OPTION_SUMMER2; + opt_flag |= 0x4; + break; case SC__FEINTBOMB_MASTER: sc->option &= ~OPTION_INVISIBLE; opt_flag |= 0x4; diff --git a/src/map/status.h b/src/map/status.h index 6f68c36c3..17585e6a1 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -840,6 +840,8 @@ typedef enum sc_type { SC_TUNAPARTY, SC_SHRIMP, // 650 SC_FRESHSHRIMP, + + SC_DRESS_UP, #ifndef SC_MAX SC_MAX, //Automatically updated max, used in for's to check we are within bounds. #endif @@ -1722,7 +1724,7 @@ enum si_type { //SI_SUMMEREVENT04 = 853, //SI_SUMMEREVENT05 = 854, //SI_MINIGAME_ROULETTE_BONUS_ITEM = 855, - //SI_DRESS_UP = 856, + SI_DRESS_UP = 856, SI_MAPLE_FALLS = 857, //SI_ALL_NIFLHEIM_RECALL = 858, //SI_ = 859, -- cgit v1.2.3-60-g2f50 From 94104f0e3c69e2089b42915de74c792acbda9e6d Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Wed, 19 Apr 2017 23:41:37 +0800 Subject: Added oktoberfest_ignorepalette configuration --- conf/map/battle/client.conf | 4 ++++ src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/clif.c | 4 ++-- src/map/status.c | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/conf/map/battle/client.conf b/conf/map/battle/client.conf index 45f89ce9b..32f1324be 100644 --- a/conf/map/battle/client.conf +++ b/conf/map/battle/client.conf @@ -126,6 +126,10 @@ summer_ignorepalette: false // Set this to true if your cloth palettes pack doesn't has Hanbok palettes (or has less than the other jobs) hanbok_ignorepalette: false +// Do not display cloth colors for the Oktoberfest costume? +// Set this to true if your cloth palettes pack doesn't has Oktoberfest palettes (or has less than the other jobs) +oktoberfest_ignorepalette: false + // Do not display cloth colors for the Summer 2 costume? // Set this to true if your cloth palettes pack doesn't has Summer 2 palettes (or has less than the other jobs) summer2_ignorepalette: false diff --git a/src/map/battle.c b/src/map/battle.c index a43fa11c8..349a71f4b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7042,6 +7042,7 @@ static const struct battle_data { { "xmas_ignorepalette", &battle_config.xmas_ignorepalette, 0, 0, 1, }, { "summer_ignorepalette", &battle_config.summer_ignorepalette, 0, 0, 1, }, { "hanbok_ignorepalette", &battle_config.hanbok_ignorepalette, 0, 0, 1, }, + { "oktoberfest_ignorepalette", &battle_config.oktoberfest_ignorepalette, 0, 0, 1, }, { "summer2_ignorepalette", &battle_config.summer2_ignorepalette, 0, 0, 1, }, { "natural_healhp_interval", &battle_config.natural_healhp_interval, 6000, NATURAL_HEAL_INTERVAL, INT_MAX, }, { "natural_healsp_interval", &battle_config.natural_healsp_interval, 8000, NATURAL_HEAL_INTERVAL, INT_MAX, }, diff --git a/src/map/battle.h b/src/map/battle.h index 2bc9f5b2e..4ec1be98d 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -246,6 +246,7 @@ struct Battle_Config { int xmas_ignorepalette; // [Valaris] int summer_ignorepalette; // [Zephyrus] int hanbok_ignorepalette; + int oktoberfest_ignorepalette; int summer2_ignorepalette; int natural_healhp_interval; int natural_healsp_interval; diff --git a/src/map/clif.c b/src/map/clif.c index 3bf77baef..fd1ec17bf 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3213,7 +3213,7 @@ void clif_changelook(struct block_list *bl,int type,int val) vd->cloth_color = 0; if (sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette) vd->cloth_color = 0; - if (sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */) + if (sd->sc.option&OPTION_OKTOBERFEST && battle_config.oktoberfest_ignorepalette) vd->cloth_color = 0; if (sd->sc.option&OPTION_SUMMER2 && battle_config.summer2_ignorepalette) vd->cloth_color = 0; @@ -3248,7 +3248,7 @@ void clif_changelook(struct block_list *bl,int type,int val) val = 0; if( sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette ) val = 0; - if( sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */ ) + if( sd->sc.option&OPTION_OKTOBERFEST && battle_config.oktoberfest_ignorepalette) val = 0; if (sd->sc.option&OPTION_SUMMER2 && battle_config.summer2_ignorepalette) val = 0; diff --git a/src/map/status.c b/src/map/status.c index 529ab1c02..fe09c1b7f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6883,7 +6883,7 @@ void status_set_viewdata(struct block_list *bl, int class_) sd->vd.cloth_color = 0; if (sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette) sd->vd.cloth_color = 0; - if (sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */) + if (sd->sc.option&OPTION_OKTOBERFEST && battle_config.oktoberfest_ignorepalette) sd->vd.cloth_color = 0; if (sd->sc.option&OPTION_SUMMER2 && battle_config.summer2_ignorepalette) sd->vd.cloth_color = 0; -- cgit v1.2.3-60-g2f50 From 359cc8da6b98c9716e4695b471acbe4d45140be2 Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Wed, 19 Apr 2017 23:52:06 +0800 Subject: Coding-style Fixes and White space adjustments --- src/common/mmo.h | 2 +- src/map/atcommand.c | 47 ++++++++++++++++++++++++++++------------------- src/map/clif.c | 40 +++++++++++++++++++--------------------- src/map/status.c | 48 ++++++++++++++++++++++-------------------------- 4 files changed, 70 insertions(+), 67 deletions(-) diff --git a/src/common/mmo.h b/src/common/mmo.h index 5e650e4e8..7bd5b7c06 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -448,7 +448,7 @@ enum { #endif // compound constants OPTION_DRAGON = OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5, - OPTION_COSTUME = OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK|OPTION_OKTOBERFEST|OPTION_SUMMER2, + OPTION_COSTUME = OPTION_WEDDING | OPTION_XMAS | OPTION_SUMMER | OPTION_HANBOK | OPTION_OKTOBERFEST | OPTION_SUMMER2, }; struct s_skill { diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 4c746d4ca..afdf180d5 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -9248,7 +9248,12 @@ ACMD(searchstore){ searchstore->open(sd, 99, val); return true; } -ACMD(costume){ + +/*========================================== +* @costume +*------------------------------------------*/ +ACMD(costume) +{ const char* names[] = { "Wedding", "Xmas", @@ -9276,37 +9281,40 @@ ACMD(costume){ unsigned short k = 0, len = ARRAYLENGTH(names); if (!*message) { - for( k = 0; k < len; k++ ) { - if( sd->sc.data[name2id[k]] ) { - safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1473),names[k]);//Costume '%s' removed. - clif->message(sd->fd,atcmd_output); - status_change_end(&sd->bl,name2id[k],INVALID_TIMER); + for (k = 0; k < len; k++) { + if (sd->sc.data[name2id[k]]) { + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1473), names[k]); // Costume '%s' removed. + clif->message(sd->fd, atcmd_output); + status_change_end(&sd->bl, name2id[k], INVALID_TIMER); return true; } } - clif->message(sd->fd,msg_fd(fd,1472)); - for( k = 0; k < len; k++ ) { - safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1471),names[k]);//-- %s - clif->message(sd->fd,atcmd_output); + + clif->message(sd->fd, msg_fd(fd, 1472)); // - Available Costumes + + for (k = 0; k < len; k++) { + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1471), names[k]); //-- %s + clif->message(sd->fd, atcmd_output); } return false; } - for( k = 0; k < len; k++ ) { - if( sd->sc.data[name2id[k]] ) { - safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1470),names[k]);// You're already with a '%s' costume, type '@costume' to remove it. - clif->message(sd->fd,atcmd_output); + for (k = 0; k < len; k++) { + if (sd->sc.data[name2id[k]]) { + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1470), names[k]); // You're already with a '%s' costume, type '@costume' to remove it. + clif->message(sd->fd, atcmd_output); return false; } } - for( k = 0; k < len; k++ ) { - if( strcmpi(message,names[k]) == 0 ) + for (k = 0; k < len; k++) { + if (strcmpi(message,names[k]) == 0) break; } - if( k == len ) { - safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1469),message);// '%s' is not a known costume - clif->message(sd->fd,atcmd_output); + + if (k == len) { + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1469), message); // '%s' is not a known costume + clif->message(sd->fd, atcmd_output); return false; } @@ -9314,6 +9322,7 @@ ACMD(costume){ return true; } + /* for debugging purposes (so users can easily provide us with debug info) */ /* should be trashed as soon as its no longer necessary */ ACMD(skdebug) diff --git a/src/map/clif.c b/src/map/clif.c index fd1ec17bf..09a14f2c2 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3194,33 +3194,31 @@ void clif_changelook(struct block_list *bl,int type,int val) vd->shield = val; break; case LOOK_BASE: - if( !sd ) break; + if (sd == NULL) + break; - if ( val == INVISIBLE_CLASS ) /* nothing to change look */ + if (val == INVISIBLE_CLASS) /* nothing to change look */ return; - if( sd->sc.option&OPTION_COSTUME ) + if (sd->sc.option & OPTION_COSTUME) vd->weapon = vd->shield = 0; - if( !vd->cloth_color ) + if (!vd->cloth_color) break; - if (sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette) + if ((sd->sc.option & OPTION_WEDDING) != 0 && battle_config.wedding_ignorepalette == true) vd->cloth_color = 0; - if (sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette) + if ((sd->sc.option & OPTION_XMAS) != 0 && battle_config.xmas_ignorepalette == true) vd->cloth_color = 0; - if (sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette) + if ((sd->sc.option & OPTION_SUMMER) != 0 && battle_config.summer_ignorepalette == true) vd->cloth_color = 0; - if (sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette) + if ((sd->sc.option & OPTION_HANBOK) != 0 && battle_config.hanbok_ignorepalette == true) vd->cloth_color = 0; - if (sd->sc.option&OPTION_OKTOBERFEST && battle_config.oktoberfest_ignorepalette) + if ((sd->sc.option & OPTION_OKTOBERFEST) != 0 && battle_config.oktoberfest_ignorepalette == true) vd->cloth_color = 0; - if (sd->sc.option&OPTION_SUMMER2 && battle_config.summer2_ignorepalette) + if ((sd->sc.option & OPTION_SUMMER2) != 0 && battle_config.summer2_ignorepalette == true) vd->cloth_color = 0; - if (vd->body_style && ( - sd->sc.option&OPTION_WEDDING || sd->sc.option&OPTION_XMAS || - sd->sc.option&OPTION_SUMMER || sd->sc.option&OPTION_HANBOK || - sd->sc.option&OPTION_OKTOBERFEST || sd->sc.option&OPTION_SUMMER2)) + if (vd->body_style != 0 && (sd->sc.option & OPTION_COSTUME) != 0) vd->body_style = 0; break; case LOOK_HAIR: @@ -3239,18 +3237,18 @@ void clif_changelook(struct block_list *bl,int type,int val) vd->hair_color = val; break; case LOOK_CLOTHES_COLOR: - if( val && sd ) { - if( sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette ) + if (val && sd != NULL) { + if ((sd->sc.option & OPTION_WEDDING) != 0 && battle_config.wedding_ignorepalette == true) val = 0; - if( sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette ) + if ((sd->sc.option & OPTION_XMAS) != 0 && battle_config.xmas_ignorepalette == true) val = 0; - if( sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette ) + if ((sd->sc.option & OPTION_SUMMER) != 0 && battle_config.summer_ignorepalette == true) val = 0; - if( sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette ) + if ((sd->sc.option & OPTION_HANBOK) != 0 && battle_config.hanbok_ignorepalette == true) val = 0; - if( sd->sc.option&OPTION_OKTOBERFEST && battle_config.oktoberfest_ignorepalette) + if ((sd->sc.option & OPTION_OKTOBERFEST) != 0 && battle_config.oktoberfest_ignorepalette == true) val = 0; - if (sd->sc.option&OPTION_SUMMER2 && battle_config.summer2_ignorepalette) + if ((sd->sc.option & OPTION_SUMMER2) != 0 && battle_config.summer2_ignorepalette == true) val = 0; } vd->cloth_color = val; diff --git a/src/map/status.c b/src/map/status.c index fe09c1b7f..1f068fdbc 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6875,26 +6875,20 @@ void status_set_viewdata(struct block_list *bl, int class_) sd->vd.sex = sd->status.sex; if (sd->vd.cloth_color) { - if (sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette) - sd->vd.cloth_color = 0; - if (sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette) - sd->vd.cloth_color = 0; - if (sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette) - sd->vd.cloth_color = 0; - if (sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette) - sd->vd.cloth_color = 0; - if (sd->sc.option&OPTION_OKTOBERFEST && battle_config.oktoberfest_ignorepalette) + if ((sd->sc.option & OPTION_WEDDING) != 0 && battle_config.wedding_ignorepalette == true) sd->vd.cloth_color = 0; - if (sd->sc.option&OPTION_SUMMER2 && battle_config.summer2_ignorepalette) + if ((sd->sc.option & OPTION_XMAS) != 0 && battle_config.xmas_ignorepalette == true) + sd->vd.cloth_color = 0; + if ((sd->sc.option & OPTION_SUMMER) != 0 && battle_config.summer_ignorepalette == true) + sd->vd.cloth_color = 0; + if ((sd->sc.option & OPTION_HANBOK) != 0 && battle_config.hanbok_ignorepalette == true) + sd->vd.cloth_color = 0; + if ((sd->sc.option & OPTION_OKTOBERFEST) != 0 && battle_config.oktoberfest_ignorepalette == true) + sd->vd.cloth_color = 0; + if ((sd->sc.option & OPTION_SUMMER2) != 0 && battle_config.summer2_ignorepalette == true) sd->vd.cloth_color = 0; } - if (sd->vd.body_style - && (sd->sc.option&OPTION_WEDDING - || sd->sc.option&OPTION_XMAS - || sd->sc.option&OPTION_SUMMER - || sd->sc.option&OPTION_HANBOK - || sd->sc.option&OPTION_OKTOBERFEST - || sd->sc.option&OPTION_SUMMER2)) + if (sd->vd.body_style != 0 && (sd->sc.option & OPTION_COSTUME) != 0) sd->vd.body_style = 0; } else if (vd != NULL) { memcpy(&sd->vd, vd, sizeof(struct view_data)); @@ -8499,8 +8493,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_HANBOK: case SC_OKTOBERFEST: case SC_DRESS_UP: - if (!vd) return 0; - //Store previous values as they could be removed. + if (vd == NULL) + return 0; + // Store previous values as they could be removed. unit->stop_attack(bl); break; case SC_NOCHAT: @@ -9895,20 +9890,21 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t return 0; } } - } else { //Special considerations when loading SC data. - switch( type ) { + } else { // Special considerations when loading SC data. + switch (type) { case SC_WEDDING: case SC_XMAS: case SC_SUMMER: case SC_HANBOK: case SC_OKTOBERFEST: case SC_DRESS_UP: - if( !vd ) break; + if (vd == NULL) + break; clif->changelook(bl, LOOK_BASE, vd->class); - clif->changelook(bl,LOOK_WEAPON,0); - clif->changelook(bl,LOOK_SHIELD,0); - clif->changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color); - clif->changelook(bl,LOOK_BODY2,0); + clif->changelook(bl, LOOK_WEAPON, 0); + clif->changelook(bl, LOOK_SHIELD, 0); + clif->changelook(bl, LOOK_CLOTHES_COLOR, vd->cloth_color); + clif->changelook(bl, LOOK_BODY2, 0); break; case SC_KAAHI: val4 = INVALID_TIMER; -- cgit v1.2.3-60-g2f50