Skip to content

Commit

Permalink
Cleaned up Summer 2 code (rathena#3294)
Browse files Browse the repository at this point in the history
Fixes rathena#3293

Thanks to @Everade for reporting.
  • Loading branch information
Lemongrass3110 authored and SeravySensei committed Jan 26, 2019
1 parent a733976 commit 0079693
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 20 deletions.
1 change: 1 addition & 0 deletions conf/help.txt
Expand Up @@ -123,6 +123,7 @@ jobchange: "Params: <job name|ID>\n" "Changes your job.\n"
"4229 Baby Rebellion 4241 Baby Star Emperor 4242 Baby Soul Reaper\n"
"---- Modes And Others ----\n"
" 22 Wedding 26 Christmas 27 Summer 28 Hanbok\n"
" 29 Oktoberfest 30 Summer 2\n"
" 4048 Star Gladiator (Union) 4238 Baby Star Glad (Union)\n"
option: "Params: <param1> <param2>(stackable) <param3>(stackable)\n" "Adds different visual effects on or around your character.\n"
" <param1> <param2> <param3>\n"
Expand Down
1 change: 1 addition & 0 deletions src/char/inter.cpp
Expand Up @@ -115,6 +115,7 @@ const char* job_name(int class_) {
return msg_txt(20 - JOB_WEDDING+class_);

case JOB_SUMMER:
case JOB_SUMMER2:
return msg_txt(71);

case JOB_HANBOK:
Expand Down
1 change: 1 addition & 0 deletions src/common/mmo.hpp
Expand Up @@ -794,6 +794,7 @@ enum e_job {
JOB_SUMMER,
JOB_HANBOK,
JOB_OKTOBERFEST,
JOB_SUMMER2,
JOB_MAX_BASIC,

JOB_NOVICE_HIGH = 4001,
Expand Down
2 changes: 1 addition & 1 deletion src/map/atcommand.cpp
Expand Up @@ -1064,7 +1064,7 @@ ACMD_FUNC(jobchange)
if (job == JOB_KNIGHT2 || job == JOB_CRUSADER2 || job == JOB_WEDDING || job == JOB_XMAS || job == JOB_SUMMER || job == JOB_HANBOK || job == JOB_OKTOBERFEST
|| job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2 || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2 || job == JOB_STAR_GLADIATOR2
|| (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2) || job == JOB_BABY_STAR_GLADIATOR2
|| job == JOB_STAR_EMPEROR2 || job == JOB_BABY_STAR_EMPEROR2)
|| job == JOB_STAR_EMPEROR2 || job == JOB_BABY_STAR_EMPEROR2 || job == JOB_SUMMER2)
{ // Deny direct transformation into dummy jobs
clif_displaymessage(fd, msg_txt(sd,923)); //"You can not change to this job by command."
return 0;
Expand Down
14 changes: 4 additions & 10 deletions src/map/clif.cpp
Expand Up @@ -3515,16 +3515,13 @@ void clif_changelook(struct block_list *bl, int type, int val) {
vd->cloth_color = 0;
if (sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette)
vd->cloth_color = 0;
if (sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette)
if (sd->sc.option&(OPTION_SUMMER|OPTION_SUMMER2) && battle_config.summer_ignorepalette)
vd->cloth_color = 0;
if (sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette)
vd->cloth_color = 0;
if (sd->sc.option&OPTION_OKTOBERFEST && battle_config.oktoberfest_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))
if (vd->body_style && sd->sc.option&OPTION_COSTUME)
vd->body_style = 0;
}
break;
Expand All @@ -3549,7 +3546,7 @@ void clif_changelook(struct block_list *bl, int type, int val) {
val = 0;
if (sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette)
val = 0;
if (sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette)
if (sd->sc.option&(OPTION_SUMMER|OPTION_SUMMER2) && battle_config.summer_ignorepalette)
val = 0;
if (sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette)
val = 0;
Expand Down Expand Up @@ -3587,10 +3584,7 @@ void clif_changelook(struct block_list *bl, int type, int val) {
#if PACKETVER < 20150513
return;
#else
if (val && (
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))
if (val && sd->sc.option&OPTION_COSTUME)
val = 0;
vd->body_style = val;
#endif
Expand Down
1 change: 1 addition & 0 deletions src/map/map.hpp
Expand Up @@ -89,6 +89,7 @@ enum e_mapid {
MAPID_GANGSI,
MAPID_OKTOBERFEST,
MAPID_SUMMONER,
MAPID_SUMMER2,
//2-1 Jobs
MAPID_SUPER_NOVICE = JOBL_2_1|MAPID_NOVICE,
MAPID_KNIGHT,
Expand Down
5 changes: 4 additions & 1 deletion src/map/pc.cpp
Expand Up @@ -5923,6 +5923,7 @@ int pc_jobid2mapid(unsigned short b_class)
case JOB_HANBOK: return MAPID_HANBOK;
case JOB_GANGSI: return MAPID_GANGSI;
case JOB_OKTOBERFEST: return MAPID_OKTOBERFEST;
case JOB_SUMMER2: return MAPID_SUMMER2;
//2-1 Jobs
case JOB_SUPER_NOVICE: return MAPID_SUPER_NOVICE;
case JOB_KNIGHT: return MAPID_KNIGHT;
Expand Down Expand Up @@ -6081,6 +6082,7 @@ int pc_mapid2jobid(unsigned short class_, int sex)
case MAPID_HANBOK: return JOB_HANBOK;
case MAPID_GANGSI: return JOB_GANGSI;
case MAPID_OKTOBERFEST: return JOB_OKTOBERFEST;
case MAPID_SUMMER2: return JOB_SUMMER2;
//2-1 Jobs
case MAPID_SUPER_NOVICE: return JOB_SUPER_NOVICE;
case MAPID_KNIGHT: return JOB_KNIGHT;
Expand Down Expand Up @@ -6256,6 +6258,7 @@ const char* job_name(int class_)
return msg_txt(NULL,570 - JOB_WEDDING+class_);

case JOB_SUMMER:
case JOB_SUMMER2:
return msg_txt(NULL,621);

case JOB_HANBOK:
Expand Down Expand Up @@ -11481,7 +11484,7 @@ void pc_readdb(void) {
uint16 j;
if (!pcdb_checkid(i))
continue;
if (i == JOB_WEDDING || i == JOB_XMAS || i == JOB_SUMMER || i == JOB_HANBOK || i == JOB_OKTOBERFEST)
if (i == JOB_WEDDING || i == JOB_XMAS || i == JOB_SUMMER || i == JOB_HANBOK || i == JOB_OKTOBERFEST || i == JOB_SUMMER2)
continue; //Classes that do not need exp tables.
idx = pc_class2idx(i);
if (!job_info[idx].max_level[0])
Expand Down
1 change: 1 addition & 0 deletions src/map/script_constants.hpp
Expand Up @@ -73,6 +73,7 @@
export_constant(JOB_SUMMER);
export_constant(JOB_HANBOK);
export_constant(JOB_OKTOBERFEST);
export_constant(JOB_SUMMER2);

export_constant(JOB_NOVICE_HIGH);
export_constant(JOB_SWORDMAN_HIGH);
Expand Down
17 changes: 10 additions & 7 deletions src/map/status.cpp
Expand Up @@ -7772,17 +7772,14 @@ void status_set_viewdata(struct block_list *bl, int class_)
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)
if(sd->sc.option&(OPTION_SUMMER|OPTION_SUMMER2) && 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)
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))
if ( sd->vd.body_style && sd->sc.option&OPTION_COSTUME)
sd->vd.body_style = 0;
} else if (vd)
memcpy(&sd->vd, vd, sizeof(struct view_data));
Expand Down Expand Up @@ -11543,7 +11540,6 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
opt_flag |= 0x4;
break;
case SC_SUMMER:
case SC_DRESSUP:
sc->option |= OPTION_SUMMER;
opt_flag |= 0x4;
break;
Expand All @@ -11555,6 +11551,10 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
sc->option |= OPTION_OKTOBERFEST;
opt_flag |= 0x4;
break;
case SC_DRESSUP:
sc->option |= OPTION_SUMMER2;
opt_flag |= 0x4;
break;
case SC_ORCISH:
sc->option |= OPTION_ORCISH;
break;
Expand Down Expand Up @@ -12539,7 +12539,6 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
opt_flag |= 0x4;
break;
case SC_SUMMER:
case SC_DRESSUP:
sc->option &= ~OPTION_SUMMER;
opt_flag |= 0x4;
break;
Expand All @@ -12551,6 +12550,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_DRESSUP:
sc->option &= ~OPTION_SUMMER2;
opt_flag |= 0x4;
break;
case SC_ORCISH:
sc->option &= ~OPTION_ORCISH;
break;
Expand Down
3 changes: 2 additions & 1 deletion src/map/status.hpp
Expand Up @@ -2964,13 +2964,14 @@ enum e_option {
OPTION_DRAGON5 = 0x04000000,
OPTION_HANBOK = 0x08000000,
OPTION_OKTOBERFEST = 0x10000000,
OPTION_SUMMER2 = 0x20000000,

// compound constant for older carts
OPTION_CART = OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5,

// 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,
};

///Defines for the manner system [Skotlex]
Expand Down

0 comments on commit 0079693

Please sign in to comment.