Skip to content
Permalink
Browse files
Costume System cleanup.
- Cleaned up overall system to work like officials.
- Added costume atcommand to easily enable/disable costumes.
  • Loading branch information
aleos89 committed Apr 3, 2014
1 parent 2fe8140 commit 0081e259222cacf9ad7750732a32ca21c682c74f
Showing with 154 additions and 108 deletions.
  1. +4 −4 conf/battle/client.conf
  2. +7 −0 conf/msg_conf/map_msg.conf
  3. +1 −1 db/pre-re/item_db.txt
  4. +1 −1 db/re/item_db.txt
  5. +59 −0 src/map/atcommand.c
  6. +34 −18 src/map/clif.c
  7. +1 −1 src/map/map.h
  8. +2 −27 src/map/pc.c
  9. +45 −56 src/map/status.c
@@ -120,19 +120,19 @@ save_clothcolor: yes
// pack doesn't has wedding palettes (or has less than the other jobs)
wedding_ignorepalette: no

// Do not display cloth colors for the Xmas class?
// Do not display cloth colors for the Xmas costume?
// Set this to yes if your cloth palettes pack doesn't have Xmas palettes (or has less than the other jobs)
xmas_ignorepalette: no

// Do not display cloth colors for the Summer class?
// Do not display cloth colors for the Summer costume?
// Set this to yes if your cloth palettes pack doesn't have Summer palettes (or has less than the other jobs)
summer_ignorepalette: no

// Do not display cloth colors for the Hanbok class?
// Do not display cloth colors for the Hanbok costume?
// Set this to yes if your cloth palettes pack doesn't have Hanbok palettes (or has less than the other jobs)
hanbok_ignorepalette: no

// Do not display cloth colors for the Oktoberfest class?
// Do not display cloth colors for the Oktoberfest costume?
// Set this to yes if your cloth palettes pack doesn't have Oktoberfest palettes (or has less than the other jobs)
oktoberfest_ignorepalette: no

@@ -1561,5 +1561,12 @@
1499: Character cannot be disguised while in monster form.
1500: Transforming into monster is not allowed in Guild Wars.

// @costume
1501: '%s' is not a known costume

This comment has been minimized.

Copy link
@cydh

cydh Apr 3, 2014

Contributor

why not "unknown"? xD

This comment has been minimized.

Copy link
@aleos89

aleos89 Apr 3, 2014

Author Contributor

I'll change it for you Cydh. :)

This comment has been minimized.

Copy link
@cydh

cydh Apr 4, 2014

Contributor

btw, actually many free num if u concern to fill them first so don't need to add MAP_MAX_MSG to 1600
@8a723ee

1502: You're already with a '%s' costume, type '@costume' to remove it.
1503: -- %s
1504: - Available Costumes
1505: Costume '%s' removed.

//Custom translations
//import: conf/msg_conf/import/map_msg_eng_conf.txt
@@ -1594,7 +1594,7 @@
2773,Krieger_Ring2,Glorious Mass-Production Ring,4,20,,0,,0,,0,0xFFFFFFFE,7,2,136,,61,0,0,{ bonus bAllStats,2; },{},{}
2774,Krieger_Ring3,Glorious Popularized Ring,4,20,,0,,0,,0,0xFFFFFFFE,7,2,136,,0,0,0,{ bonus bAllStats,1; },{},{}
2775,Lure,Lure,4,20,,100,,0,,0,0xFFFFFFFF,7,2,136,,0,0,0,{},{},{}
2776,Cool_Towel,Adventurer's Trusty Towel,4,20,,100,,,,0,0xFFFFFFFF,7,2,136,,0,0,0,{},{ setoption Option_Summer,1; },{ setoption Option_Summer,0; }
2776,Cool_Towel,Adventurer's Trusty Towel,4,20,,100,,,,0,0xFFFFFFFF,7,2,136,,0,0,0,{},{ sc_start SC_SUMMER,-1,0; },{ sc_end SC_SUMMER; }

This comment has been minimized.

Copy link
@Traxis

Traxis Apr 4, 2014

No item_db.sql update?

2777,Shaman_Ring,Shaman Ring,4,20,,100,,0,,1,0xFFFFFFFF,7,2,136,,30,0,0,{ bonus bUseSPrate,-5; },{},{}
2778,Shaman_Earing,Shaman Earrings,4,20,,100,,0,,0,0xFFFFFFFF,7,2,136,,30,0,0,{ bonus bInt,2; },{},{}
2779,Dark_Knight_Belt,Dark Knight Belt,4,20,,500,,1,,0,0xFFFFFFFF,7,2,136,,30,0,0,{ bonus bStr,2; bonus bAgi,1; },{},{}
@@ -1830,7 +1830,7 @@
2773,Krieger_Ring2,Glorious Mass-Production Ring,4,20,,0,,0,,0,0xFFFFFFFE,63,2,136,,61,0,0,{ bonus bAllStats,2; },{},{}
2774,Krieger_Ring3,Glorious Popularized Ring,4,20,,0,,0,,0,0xFFFFFFFE,63,2,136,,0,0,0,{ bonus bAllStats,1; },{},{}
2775,Lure,Lure,4,20,,100,,0,,0,0xFFFFFFFF,63,2,136,,0,0,0,{},{},{}
2776,Cool_Towel,Adventurer's Trusty Towel,4,20,,100,,,,0,0xFFFFFFFF,63,2,136,,0,0,0,{},{ setoption Option_Summer,1; },{ setoption Option_Summer,0; }
2776,Cool_Towel,Adventurer's Trusty Towel,4,20,,100,,,,0,0xFFFFFFFF,63,2,136,,0,0,0,{},{ sc_start SC_SUMMER,-1,0; },{ sc_end SC_SUMMER; }

This comment has been minimized.

Copy link
@Traxis

Traxis Apr 4, 2014

No item_db_re.sql update?

2777,Shaman_Ring,Shaman Ring,4,20,,100,,0,,1,0xFFFFFFFF,63,2,136,,30,0,0,{ bonus bUseSPrate,-5; },{},{}
2778,Shaman_Earing,Shaman Earrings,4,20,,100,,0,,0,0xFFFFFFFF,63,2,136,,30,0,0,{ bonus bInt,2; },{},{}
2779,Dark_Knight_Belt,Dark Knight Belt,4,20,,500,,1,,0,0xFFFFFFFF,63,2,136,,30,0,0,{ bonus bStr,2; bonus bAgi,1; },{},{}
@@ -9397,6 +9397,64 @@ ACMD_FUNC(fullstrip) {
return 0;
}

ACMD_FUNC(costume) {
const char* names[] = {
"Wedding",
"Xmas",
"Summer",
"Hanbok",
"Oktoberfest",
};
const int name2id[] = {
SC_WEDDING,
SC_XMAS,
SC_SUMMER,
SC_HANBOK,
SC_OKTOBERFEST
};
unsigned short k = 0, len = ARRAYLENGTH(names);

if( !message || !*message ) {
for( k = 0; k < len; k++ ) {
if( sd->sc.data[name2id[k]] ) {
sprintf(atcmd_output, msg_txt(sd, 1505), names[k]); // Costume '%s' removed.
clif_displaymessage(sd->fd, atcmd_output);
status_change_end(&sd->bl, (sc_type)name2id[k], INVALID_TIMER);
return 0;
}
}

clif_displaymessage(sd->fd, msg_txt(sd, 1504)); // Available Costumes
for( k = 0; k < len; k++ ) {
sprintf(atcmd_output, msg_txt(sd, 1503), names[k]); // -- %s
clif_displaymessage(sd->fd, atcmd_output);
}
return -1;
}

for( k = 0; k < len; k++ ) {
if( sd->sc.data[name2id[k]] ) {
sprintf(atcmd_output, msg_txt(sd, 1502), names[k]); // You're already with a '%s' costume, type '@costume' to remove it.
clif_displaymessage(sd->fd, atcmd_output);
return -1;
}
}

for( k = 0; k < len; k++ )
if( strcmpi(message, names[k]) == 0 )
break;

if( k == len ) {
sprintf(atcmd_output, msg_txt(sd, 1501), message); // '%s' is not a known costume
clif_displaymessage(sd->fd, atcmd_output);
return -1;
}

sc_start(&sd->bl, &sd->bl, (sc_type)name2id[k], 100, 0, -1);

return 0;
}

#include "../custom/atcommand.inc"

/**
@@ -9684,6 +9742,7 @@ void atcommand_basecommands(void) {
ACMD_DEF(showrate),
#endif
ACMD_DEF(fullstrip),
ACMD_DEF(costume),
};
AtCommandInfo* atcommand;
int i;
@@ -3080,17 +3080,26 @@ void clif_changelook(struct block_list *bl,int type,int val)
else vd->shield = val;
break;
case LOOK_BASE:
vd->class_ = val;
if (vd->class_ == JOB_WEDDING || vd->class_ == JOB_XMAS || vd->class_ == JOB_SUMMER || vd->class_ == JOB_HANBOK || vd->class_ == JOB_OKTOBERFEST)
if (!sd) break;

if (sd->sc.option&OPTION_COSTUME)
vd->weapon = vd->shield = 0;
if (vd->cloth_color && (
(vd->class_ == JOB_WEDDING && battle_config.wedding_ignorepalette) ||
(vd->class_ == JOB_XMAS && battle_config.xmas_ignorepalette) ||
(vd->class_ == JOB_SUMMER && battle_config.summer_ignorepalette) ||
(vd->class_ == JOB_HANBOK && battle_config.hanbok_ignorepalette) ||
(vd->class_ == JOB_OKTOBERFEST && battle_config.oktoberfest_ignorepalette)
))
clif_changelook(bl,LOOK_CLOTHES_COLOR,0);

if (!vd->cloth_color)
break;

if (sd) {
if (sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette)
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)
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;
}
break;
case LOOK_HAIR:
vd->hair_style = val;
@@ -3108,14 +3117,18 @@ void clif_changelook(struct block_list *bl,int type,int val)
vd->hair_color = val;
break;
case LOOK_CLOTHES_COLOR:
if (val && (
(vd->class_ == JOB_WEDDING && battle_config.wedding_ignorepalette) ||
(vd->class_ == JOB_XMAS && battle_config.xmas_ignorepalette) ||
(vd->class_ == JOB_SUMMER && battle_config.summer_ignorepalette) ||
(vd->class_ == JOB_HANBOK && battle_config.hanbok_ignorepalette) ||
(vd->class_ == JOB_OKTOBERFEST && battle_config.oktoberfest_ignorepalette)
))
val = 0;
if (val && sd) {
if (sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette)
val = 0;
if (sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette)
val = 0;
if (sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette)
val = 0;
if (sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette)
val = 0;
if (sd->sc.option&OPTION_OKTOBERFEST && battle_config.oktoberfest_ignorepalette)
val = 0;
}
vd->cloth_color = val;
break;
case LOOK_SHOES:
@@ -10255,6 +10268,9 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
if( sd->sc.option&OPTION_COSTUME )
return;

if( sd->sc.option&OPTION_COSTUME )
return;

if( sd->sc.data[SC_BASILICA] || sd->sc.data[SC__SHADOWFORM] )
return;

@@ -140,8 +140,8 @@ enum {
MAPID_XMAS,
MAPID_SUMMER,
MAPID_HANBOK,
MAPID_OKTOBERFEST,
MAPID_GANGSI,
MAPID_OKTOBERFEST,
//2-1 Jobs
MAPID_SUPER_NOVICE = JOBL_2_1|0x0,
MAPID_KNIGHT,
@@ -5341,8 +5341,8 @@ int pc_jobid2mapid(unsigned short b_class)
case JOB_XMAS: return MAPID_XMAS;
case JOB_SUMMER: return MAPID_SUMMER;
case JOB_HANBOK: return MAPID_HANBOK;
case JOB_OKTOBERFEST: return MAPID_OKTOBERFEST;
case JOB_GANGSI: return MAPID_GANGSI;
case JOB_OKTOBERFEST: return MAPID_OKTOBERFEST;
//2-1 Jobs
case JOB_SUPER_NOVICE: return MAPID_SUPER_NOVICE;
case JOB_KNIGHT: return MAPID_KNIGHT;
@@ -5485,8 +5485,8 @@ int pc_mapid2jobid(unsigned short class_, int sex)
case MAPID_XMAS: return JOB_XMAS;
case MAPID_SUMMER: return JOB_SUMMER;
case MAPID_HANBOK: return JOB_HANBOK;
case MAPID_OKTOBERFEST: return JOB_OKTOBERFEST;
case MAPID_GANGSI: return JOB_GANGSI;
case MAPID_OKTOBERFEST: return JOB_OKTOBERFEST;
//2-1 Jobs
case MAPID_SUPER_NOVICE: return JOB_SUPER_NOVICE;
case MAPID_KNIGHT: return JOB_KNIGHT;
@@ -8052,31 +8052,6 @@ void pc_setoption(struct map_session_data *sd,int type)
else if (!(type&OPTION_FLYING) && p_type&OPTION_FLYING)
new_look = -1;

if (type&OPTION_WEDDING && !(p_type&OPTION_WEDDING))
new_look = JOB_WEDDING;
else if (!(type&OPTION_WEDDING) && p_type&OPTION_WEDDING)
new_look = -1;

if (type&OPTION_XMAS && !(p_type&OPTION_XMAS))
new_look = JOB_XMAS;
else if (!(type&OPTION_XMAS) && p_type&OPTION_XMAS)
new_look = -1;

if (type&OPTION_SUMMER && !(p_type&OPTION_SUMMER))
new_look = JOB_SUMMER;
else if (!(type&OPTION_SUMMER) && p_type&OPTION_SUMMER)
new_look = -1;

if (type&OPTION_HANBOK && !(p_type&OPTION_HANBOK))
new_look = JOB_HANBOK;
else if (!(type&OPTION_HANBOK) && p_type&OPTION_HANBOK)
new_look = -1;

if (type&OPTION_OKTOBERFEST && !(p_type&OPTION_OKTOBERFEST))
new_look = JOB_OKTOBERFEST;
else if (!(type&OPTION_OKTOBERFEST) && p_type&OPTION_OKTOBERFEST)
new_look = -1;

if (sd->disguise || !new_look)
return; //Disguises break sprite changes

0 comments on commit 0081e25

Please sign in to comment.