summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-08-13 13:48:30 -0600
committerJared Adams <jaxad0127@gmail.com>2009-08-13 13:48:30 -0600
commit1b7508c510aae8906fdcd7309da47c97b2804184 (patch)
tree9c0342ba083fa520e8dba147487bc851afb4da3a /src/map/clif.c
parent72eb808de6efd156af1463219572d809caf48978 (diff)
downloadtmwa-1b7508c510aae8906fdcd7309da47c97b2804184.tar.gz
tmwa-1b7508c510aae8906fdcd7309da47c97b2804184.tar.bz2
tmwa-1b7508c510aae8906fdcd7309da47c97b2804184.tar.xz
tmwa-1b7508c510aae8906fdcd7309da47c97b2804184.zip
Change sending of hair style and color
Send them together in overloaded change looks packets (twice for older clients). This lets newer clients be more flexible with their handling of hair.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 908e9ff..e734efe 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2388,6 +2388,35 @@ int clif_changelook_towards(struct block_list *bl,int type,int val, struct map_s
return 0;
}
+int clif_changehair(struct block_list *bl, int hairStyle, int hairColor)
+{
+ unsigned char buf[32];
+ struct map_session_data *sd = NULL;
+
+ nullpo_retr(0, bl);
+
+ if(bl->type == BL_PC)
+ sd = (struct map_session_data *)bl;
+
+ if(sd && sd->disguise > 23 && sd->disguise < 4001) // mob disguises [Valaris]
+ return 0;
+
+ if (sd && sd->status.option & OPTION_INVISIBILITY)
+ return 0;
+
+ WBUFW(buf,0)=0x1d7;
+ WBUFL(buf,2)=bl->id;
+ WBUFB(buf,6)=LOOK_HAIR;
+ WBUFW(buf,7)=hairStyle;
+ WBUFW(buf,9)=hairColor;
+ clif_send(buf, packet_len_table[0x1d7], bl, AREA);
+
+ WBUFB(buf,6)=LOOK_HAIR_COLOR;
+ WBUFW(buf,7)=hairColor;
+ WBUFW(buf,9)=hairStyle;
+ clif_send(buf, packet_len_table[0x1d7], bl, AREA);
+}
+
/*==========================================
*
*------------------------------------------