This adds support for /changedress and /nocosplay by adding an atcommand for it and redirecting the client command to it. Thanks to @Everade for finding this.
@@ -63,6 +63,7 @@ aliases: {
cloneequip: ["eqclone"]
clonestat: ["stclone"]
reloadnpcfile: ["reloadnpc"]
+ changedress: ["nocosplay"]
}
/* Commands help file */
@@ -86,7 +86,7 @@ groups: (
level: 0
inherit: ( /*empty list*/ )
commands: {
- /* no commands by default */
+ changedress: true
permissions: {
/* without this basic permissions regular players could not
@@ -322,3 +322,4 @@ reload: "Params: <type>\n" "Reload a database or configuration file.\n"
" questdb msgconf packetdb\n"
langtype: "Params: <language>\n" "Changes your language setting."
limitedsale: "Opens the limited sale window."
+changedress: "Removes all character costumes."
@@ -9726,6 +9726,27 @@ ACMD_FUNC(fullstrip) {
return 0;
+ACMD_FUNC(changedress){
+ sc_type name2id[] = {
+ SC_WEDDING,
+ SC_XMAS,
+ SC_SUMMER,
+ SC_DRESSUP,
+ SC_HANBOK,
+ SC_OKTOBERFEST
+ };
+
+ for( sc_type type : name2id ) {
+ if( sd->sc.data[type] ) {
+ status_change_end( &sd->bl, type, INVALID_TIMER );
+ // You should only be able to have one - so we cancel here
+ return 0;
+ }
+ return -1;
+}
ACMD_FUNC(costume) {
const char* names[] = {
"Wedding",
@@ -10297,6 +10318,7 @@ void atcommand_basecommands(void) {
ACMD_DEF(agitstart3),
ACMD_DEF(agitend3),
ACMD_DEFR(limitedsale, ATCMD_NOCONSOLE|ATCMD_NOAUTOTRADE),
+ ACMD_DEFR(changedress, ATCMD_NOCONSOLE|ATCMD_NOAUTOTRADE),
};
AtCommandInfo* atcommand;
int i;
@@ -20251,6 +20251,21 @@ void clif_achievement_reward_ack(int fd, unsigned char result, int achievement_i
WFIFOSET(fd, packet_len(0xa26));
+/*
+ * This packet is sent by /changedress or /nocosplay
+ *
+ * 0ae8
+ */
+void clif_parse_changedress( int fd, struct map_session_data* sd ){
+#if PACKETVER >= 20180103
+ char command[CHAT_SIZE_MAX];
+ safesnprintf( command, sizeof(command), "%cchangedress", atcommand_symbol );
+ is_atcommand( fd, sd, command, 1 );
+#endif
/*==========================================
* Main client packet processing function
*------------------------------------------*/
@@ -2363,6 +2363,11 @@
packet(0x0ACC,18);
#endif
+// 2018-01-03aRagexeRE or 2018-01-03bRagexeRE
+ parseable_packet(0x0ae8,2,clif_parse_changedress,0);
// 2018-02-07bRagexeRE
#if PACKETVER >= 20180207
parseable_packet(0x0AF4,11,clif_parse_UseSkillToPos,2,4,6,8,10);