summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--db/Changelog.txt2
-rw-r--r--db/item_db.txt2
-rw-r--r--db/packet_db.txt5
-rw-r--r--sql-files/main.sql1
-rw-r--r--sql-files/upgrade_svn14797.sql1
-rw-r--r--src/char/char.c31
-rw-r--r--src/char_sql/char.c14
-rw-r--r--src/common/mmo.h2
-rw-r--r--src/map/clif.c53
-rw-r--r--src/map/map.h5
-rw-r--r--src/map/pc.c14
-rw-r--r--src/map/pc.h7
-rw-r--r--src/map/unit.h3
14 files changed, 122 insertions, 21 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 41c7f759e..69789a602 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,6 +1,9 @@
Date Added
2011/04/16
+ * Added support for visible garments/robes. [Ai4rei]
+ - For SQL apply upgrade_svn14797.sql to upgrade table `char`; for TXT no action is necessary, as it upgrades itself.
+ - This also fixes NPCs not being visible with clients 2011-01-11aRagexeRE+ (bugreport:4865).
* Updated field `weapon` in table `char` to default to '0' (bare-handed) rather than '1' (knife) (follow up to r11696). [Ai4rei]
- Apply upgrade_svn14796.sql to reflect the change on existing setups.
* Some cleanups related to player and monster states. [Ai4rei]
diff --git a/db/Changelog.txt b/db/Changelog.txt
index 394e837ce..c1b2a26ed 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -9,6 +9,8 @@
13005 Angelic Wing Dagger: NEED INFO.
=======================
+2011/04/16
+ * Rev. 14797 Added Archangel Wings (2573) and their respective Box (16998) item based on client-side kRO description. [Ai4rei]
2011/03/19
* Rev. 14748 Fixed Beast Strafing (HT_POWER) SP requirement as provided by Playtester (bugreport:4675). [Gepard]
2011/03/06
diff --git a/db/item_db.txt b/db/item_db.txt
index 3effafee9..047bcd9fe 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -1445,6 +1445,7 @@
//2558,Freya_Soul_Scarf4,Freya Soul Scarf,
//2559,Guardian_Manteau,Guardian Manteau,
//2560,Para_Team_Manteau,Eden Team Manteau,5,0,,0,,14,,0,0xFFFFFFFF,7,2,4,,12,0,0,{ bonus2 bSubEle,Ele_Neutral,10; },{},{}
+2573,Archangel_Wings,Archangel Wings,5,0,,200,,18,,1,0xFFFFFFFF,7,2,4,,0,1,1,{},{},{}
// Accessories
//===================================================================
2601,Ring,Ring,5,30000,,100,,0,,0,0xFFFFFFFE,7,2,136,,20,0,0,{ bonus bStr,2; },{},{}
@@ -6192,6 +6193,7 @@
16680,Universal_Catalog_Gold_Box50,Universal Catalog Gold 50 Box,2,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 12581,50; },{},{}
16776,Universal_Catalog_Gold_Box10,Universal Catalog Gold 10 Box,2,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 12581,10; },{},{}
16777,Universal_Catalog_Gold_Box50,Universal Catalog Gold 50 Box,2,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 12581,50; },{},{}
+16998,Archangel_Wings_Box,Archangel Wings Box,2,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 2573,1; },{},{}
//18000,Cannon_Ball
//18001,Holy_Cannon_Ball
//18002,Dark_Cannon_Ball
diff --git a/db/packet_db.txt b/db/packet_db.txt
index 48d262845..dc5b72346 100644
--- a/db/packet_db.txt
+++ b/db/packet_db.txt
@@ -1586,7 +1586,7 @@ packet_ver: 25
0x0842,6,recall2,2
0x0843,6,remove2,2
-//2010-11-23aRagexeRE
+//2010-11-24aRagexeRE
packet_ver: 26
0x0436,19,wanttoconnection,2:6:10:14:18
0x035f,5,walktoxy,2
@@ -1600,6 +1600,9 @@ packet_ver: 26
0x0367,90,useskilltoposinfo,2:4:6:8:10
0x0368,6,getcharnamerequest,2
0x0369,6,solvecharname,2
+0x0856,-1
+0x0857,-1
+0x0858,-1
//Add new packets here
//packet_ver: 27
diff --git a/sql-files/main.sql b/sql-files/main.sql
index c2a30e086..feafcae3e 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -88,6 +88,7 @@ CREATE TABLE IF NOT EXISTS `char` (
`head_top` smallint(6) unsigned NOT NULL default '0',
`head_mid` smallint(6) unsigned NOT NULL default '0',
`head_bottom` smallint(6) unsigned NOT NULL default '0',
+ `robe` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',
`last_map` varchar(11) NOT NULL default '',
`last_x` smallint(4) unsigned NOT NULL default '53',
`last_y` smallint(4) unsigned NOT NULL default '111',
diff --git a/sql-files/upgrade_svn14797.sql b/sql-files/upgrade_svn14797.sql
new file mode 100644
index 000000000..acf6fb33d
--- /dev/null
+++ b/sql-files/upgrade_svn14797.sql
@@ -0,0 +1 @@
+ALTER TABLE `char` ADD `robe` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0' AFTER `head_bottom`;
diff --git a/src/char/char.c b/src/char/char.c
index 237e04638..178a20262 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -525,7 +525,7 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg,
"%d\t%d,%d\t%s\t%d,%d,%d\t%u,%u,%d" //Up to Zeny field
"\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d" //Up to Skill Point
"\t%d,%d,%d\t%d,%d,%d,%d" //Up to hom id
- "\t%d,%d,%d\t%d,%d,%d,%d,%d" //Up to head bottom
+ "\t%d,%d,%d\t%d,%d,%d,%d,%d,%d" //Up to robe
"\t%d,%d,%d\t%d,%d,%d" //last point + save point
",%d,%d,%d,%d,%d,%lu\t", //Family info + delete date
p->char_id, p->account_id, p->slot, p->name, //
@@ -537,7 +537,7 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg,
p->option, p->karma, p->manner, //
p->party_id, p->guild_id, p->pet_id, p->hom_id,
p->hair, p->hair_color, p->clothes_color,
- p->weapon, p->shield, p->head_top, p->head_mid, p->head_bottom,
+ p->weapon, p->shield, p->head_top, p->head_mid, p->head_bottom, p->robe,
p->last_point.map, p->last_point.x, p->last_point.y, //
p->save_point.map, p->save_point.x, p->save_point.y,
p->partner_id,p->father,p->mother,p->child,p->fame, //
@@ -599,7 +599,26 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
// initilialise character
memset(p, '\0', sizeof(struct mmo_charstatus));
-// Char structure of version 146xx (delete date)
+// Char structure of version 14797 (robe)
+ if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
+ "\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d,%d"
+ "\t%d,%d,%d\t%d,%d,%d,%d,%d,%d,%d,%d,%lu%n",
+ &tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0],
+ &tmp_int[3], &tmp_int[4], &tmp_int[5],
+ &tmp_uint[0], &tmp_uint[1], &tmp_int[8],
+ &tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
+ &tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
+ &tmp_int[19], &tmp_int[20],
+ &tmp_int[21], &tmp_int[22], &tmp_int[23], //
+ &tmp_int[24], &tmp_int[25], &tmp_int[26], &tmp_int[44],
+ &tmp_int[27], &tmp_int[28], &tmp_int[29],
+ &tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34], &tmp_int[47],
+ &tmp_int[45], &tmp_int[35], &tmp_int[36],
+ &tmp_int[46], &tmp_int[37], &tmp_int[38], &tmp_int[39],
+ &tmp_int[40], &tmp_int[41], &tmp_int[42], &tmp_int[43], &tmp_ulong[0], &next) != 50)
+ {
+ tmp_int[47] = 0; // robe
+// Char structure of version 14700 (delete date)
if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
"\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
"\t%d,%d,%d\t%d,%d,%d,%d,%d,%d,%d,%d,%lu%n",
@@ -742,7 +761,8 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
tmp_int[45] = mapindex_name2id(tmp_str[1]);
tmp_int[46] = mapindex_name2id(tmp_str[2]);
} // Char structure of version 1500 (homun + mapindex maps)
- } // Char structure of version 146xx (delete date)
+ } // Char structure of version 14700 (delete date)
+ } // Char structure of version 14797 (robe)
safestrncpy(p->name, tmp_str[0], NAME_LENGTH); //Overflow protection [Skotlex]
p->char_id = tmp_int[0];
@@ -793,6 +813,7 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
p->last_point.map = tmp_int[45];
p->save_point.map = tmp_int[46];
p->delete_date = tmp_ulong[0];
+ p->robe = tmp_int[47];
#ifndef TXT_SQL_CONVERT
// Some checks
@@ -1837,7 +1858,7 @@ int mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p)
offset += 4;
#endif
#if PACKETVER >= 20110111
- WBUFL(buf,128) = 0; // robe sprite id
+ WBUFL(buf,128) = p->robe;
offset += 4;
#endif
return 106+offset;
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 517ebed10..3b2e508b6 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -474,7 +474,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
(p->pet_id != cp->pet_id) || (p->weapon != cp->weapon) || (p->hom_id != cp->hom_id) ||
(p->shield != cp->shield) || (p->head_top != cp->head_top) ||
(p->head_mid != cp->head_mid) || (p->head_bottom != cp->head_bottom) || (p->delete_date != cp->delete_date) ||
- (p->rename != cp->rename)
+ (p->rename != cp->rename) || (p->robe != cp->robe)
)
{ //Save status
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `base_level`='%d', `job_level`='%d',"
@@ -484,7 +484,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
"`option`='%d',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',`homun_id`='%d',"
"`weapon`='%d',`shield`='%d',`head_top`='%d',`head_mid`='%d',`head_bottom`='%d',"
"`last_map`='%s',`last_x`='%d',`last_y`='%d',`save_map`='%s',`save_x`='%d',`save_y`='%d', `rename`='%d',"
- "`delete_date`='%lu'"
+ "`delete_date`='%lu',`robe`='%d'"
" WHERE `account_id`='%d' AND `char_id` = '%d'",
char_db, p->base_level, p->job_level,
p->base_exp, p->job_exp, p->zeny,
@@ -495,6 +495,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
mapindex_id2name(p->last_point.map), p->last_point.x, p->last_point.y,
mapindex_id2name(p->save_point.map), p->save_point.x, p->save_point.y, p->rename,
(unsigned long)p->delete_date, // FIXME: platform-dependent size
+ p->robe,
p->account_id, p->char_id) )
{
Sql_ShowDebug(sql_handle);
@@ -844,7 +845,8 @@ int mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
"`char_id`,`char_num`,`name`,`class`,`base_level`,`job_level`,`base_exp`,`job_exp`,`zeny`,"
"`str`,`agi`,`vit`,`int`,`dex`,`luk`,`max_hp`,`hp`,`max_sp`,`sp`,"
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`hair`,`hair_color`,"
- "`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`rename`,`delete_date`"
+ "`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`rename`,`delete_date`,"
+ "`robe`"
" FROM `%s` WHERE `account_id`='%d' AND `char_num` < '%d'", char_db, sd->account_id, MAX_CHARS)
|| SQL_ERROR == SqlStmt_Execute(stmt)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL)
@@ -882,6 +884,7 @@ int mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 32, SQLDT_STRING, &last_map, sizeof(last_map), NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 33, SQLDT_SHORT, &p.rename, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 34, SQLDT_UINT32, &p.delete_date, 0, NULL, NULL)
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 35, SQLDT_SHORT, &p.robe, 0, NULL, NULL)
)
{
SqlStmt_ShowDebug(stmt);
@@ -940,7 +943,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
"`str`,`agi`,`vit`,`int`,`dex`,`luk`,`max_hp`,`hp`,`max_sp`,`sp`,"
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`homun_id`,`hair`,"
"`hair_color`,`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`last_x`,`last_y`,"
- "`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`"
+ "`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`"
" FROM `%s` WHERE `char_id`=? LIMIT 1", char_db)
|| SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0)
|| SQL_ERROR == SqlStmt_Execute(stmt)
@@ -994,6 +997,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 47, SQLDT_INT, &p->fame, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 48, SQLDT_SHORT, &p->rename, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 49, SQLDT_UINT32, &p->delete_date, 0, NULL, NULL)
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 50, SQLDT_SHORT, &p->robe, 0, NULL, NULL)
)
{
SqlStmt_ShowDebug(stmt);
@@ -1615,7 +1619,7 @@ int mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p)
offset += 4;
#endif
#if PACKETVER >= 20110111
- WBUFL(buf,128) = 0; // robe sprite id
+ WBUFL(buf,128) = p->robe;
offset += 4;
#endif
return 106+offset;
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 857d42581..c45cec9a0 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -39,6 +39,7 @@
// 20100721 - 2010-07-21aRagexeRE+ - 0x6b, 0x6d
// 20100727 - 2010-07-27aRagexeRE+ - 0x6b, 0x6d
// 20100803 - 2010-08-03aRagexeRE+ - 0x6b, 0x6d, 0x827, 0x828, 0x829, 0x82a, 0x82b, 0x82c, 0x842, 0x843
+// 20101124 - 2010-11-24aRagexeRE+ - 0x856, 0x857, 0x858
// 20110111 - 2011-01-11aRagexeRE+ - 0x6b, 0x6d
#ifndef PACKETVER
@@ -330,6 +331,7 @@ struct mmo_charstatus {
short weapon; // enum weapon_type
short shield; // view-id
short head_top,head_mid,head_bottom;
+ short robe;
char name[NAME_LENGTH];
unsigned int base_level,job_level;
diff --git a/src/map/clif.c b/src/map/clif.c
index d1338314f..0bd3519ff 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -797,13 +797,19 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool
WBUFW(buf,0) = spawn?0x22b:0x22a;
#elif PACKETVER < 20091103
WBUFW(buf,0) = spawn?0x2ed:0x2ee;
-#else
+#elif PACKETVER < 20101124
WBUFW(buf,0) = spawn?0x7f8:0x7f9;
+#else
+ WBUFW(buf,0) = spawn?0x858:0x857;
#endif
#if PACKETVER >= 20091103
name = status_get_name(bl);
+#if PACKETVER < 20110111
WBUFW(buf,2) = (spawn?62:63)+strlen(name);
+#else
+ WBUFW(buf,2) = (spawn?64:65)+strlen(name);
+#endif
WBUFB(buf,4) = clif_bl_type(bl);
offset+=3;
buf = WBUFP(buffer,offset);
@@ -877,6 +883,11 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool
return packet_len(0x7c);
}
#endif
+#if PACKETVER >= 20110111
+ WBUFW(buf,34) = vd->robe;
+ offset+= 2;
+ buf = WBUFP(buf,offset);
+#endif
WBUFL(buf,34) = status_get_guild_id(bl);
WBUFW(buf,38) = status_get_emblem_id(bl);
WBUFW(buf,40) = (sd)? sd->status.manner : 0;
@@ -946,13 +957,19 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un
WBUFW(buf, 0) = 0x22c;
#elif PACKETVER < 20091103
WBUFW(buf, 0) = 0x2ec;
-#else
+#elif PACKETVER < 20101124
WBUFW(buf, 0) = 0x7f7;
+#else
+ WBUFW(buf, 0) = 0x856;
#endif
#if PACKETVER >= 20091103
name = status_get_name(bl);
+#if PACKETVER < 20110111
WBUFW(buf, 2) = 69+strlen(name);
+#else
+ WBUFW(buf, 2) = 71+strlen(name);
+#endif
offset+=2;
buf = WBUFP(buffer,offset);
#endif
@@ -989,6 +1006,11 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un
WBUFW(buf,32) = vd->hair_color;
WBUFW(buf,34) = vd->cloth_color;
WBUFW(buf,36) = (sd)? sd->head_dir : 0;
+#if PACKETVER >= 20110111
+ WBUFW(buf,38) = vd->robe;
+ offset+= 2;
+ buf = WBUFP(buf,offset);
+#endif
WBUFL(buf,38) = status_get_guild_id(bl);
WBUFW(buf,42) = status_get_emblem_id(bl);
WBUFW(buf,44) = (sd)? sd->status.manner : 0;
@@ -2057,7 +2079,7 @@ void clif_inventorylist(struct map_session_data *sd)
WBUFW(bufe,ne*se+28)=0; //Unknown
#endif
#if PACKETVER >= 20100629
- if (sd->inventory_data[i]->equip&EQP_HELM)
+ if (sd->inventory_data[i]->equip&EQP_VISIBLE)
WBUFW(bufe,ne*se+30)= sd->inventory_data[i]->look;
else
WBUFW(bufe,ne*se+30)=0;
@@ -2140,7 +2162,7 @@ void clif_equiplist(struct map_session_data *sd)
WBUFW(buf,n*cmd+28)=0; //Unknown
#endif
#if PACKETVER >= 20100629
- if (sd->inventory_data[i]->equip&EQP_HELM)
+ if (sd->inventory_data[i]->equip&EQP_VISIBLE)
WBUFW(buf,n*cmd+30)= sd->inventory_data[i]->look;
else
WBUFW(buf,n*cmd+30)=0;
@@ -2705,6 +2727,17 @@ void clif_changelook(struct block_list *bl,int type,int val)
#endif
//Shoes? No packet uses this....
break;
+ case LOOK_BODY:
+ case LOOK_FLOOR:
+ // unknown purpose
+ break;
+ case LOOK_ROBE:
+#if PACKETVER < 20110111
+ return;
+#else
+ vd->robe = val;
+#endif
+ break;
}
// prevent leaking the presence of GM-hidden objects
@@ -2726,8 +2759,7 @@ void clif_changelook(struct block_list *bl,int type,int val)
WBUFW(buf,9)=vd->shield;
} else {
WBUFB(buf,6)=type;
- WBUFW(buf,7)=val;
- WBUFW(buf,9)=0;
+ WBUFL(buf,7)=val;
}
clif_send(buf,packet_len(0x1d7),bl,target);
#endif
@@ -2952,7 +2984,7 @@ int clif_equipitemack(struct map_session_data *sd,int n,int pos,int ok)
#if PACKETVER < 20100629
WFIFOB(fd,6)=ok;
#else
- if (ok && sd->inventory_data[n]->equip&EQP_HELM)
+ if (ok && sd->inventory_data[n]->equip&EQP_VISIBLE)
WFIFOW(fd,6)=sd->inventory_data[n]->look;
else
WFIFOW(fd,6)=0;
@@ -8072,7 +8104,7 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
WFIFOL(fd, n*s+63) = tsd->status.inventory[i].expire_time;
WFIFOW(fd, n*s+67) = 0;
#if PACKETVER >= 20100629
- if (tsd->inventory_data[i]->equip&EQP_HELM)
+ if (tsd->inventory_data[i]->equip&EQP_VISIBLE)
WFIFOW(fd, n*s+69) = tsd->inventory_data[i]->look;
else
WFIFOW(fd, n*s+69) = 0;
@@ -14978,6 +15010,11 @@ static int packetdb_readdb(void)
3, -1, 8, -1, 86, 2, 6, 6, -1, -1, 4, 10, 10, 0, 0, 0,
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, -1, -1, 3, 2, 66, 5, 2, 12, 6, 0, 0,
+ //#0x0840
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
struct {
void (*func)(int, struct map_session_data *);
diff --git a/src/map/map.h b/src/map/map.h
index 3b1775e46..8e0c11a03 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -354,7 +354,10 @@ enum _look {
LOOK_HAIR_COLOR,
LOOK_CLOTHES_COLOR,
LOOK_SHIELD,
- LOOK_SHOES
+ LOOK_SHOES,
+ LOOK_BODY,
+ LOOK_FLOOR,
+ LOOK_ROBE,
};
// used by map_setcell()
diff --git a/src/map/pc.c b/src/map/pc.c
index 4cfec2de8..e1ecc171e 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -6398,6 +6398,7 @@ int pc_equiplookall(struct map_session_data *sd)
clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
+ clif_changelook(&sd->bl, LOOK_ROBE, sd->status.robe);
return 0;
}
@@ -6454,6 +6455,9 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
break;
case LOOK_SHOES:
break;
+ case LOOK_ROBE:
+ sd->status.robe = val;
+ break;
}
clif_changelook(&sd->bl,type,val);
return 0;
@@ -7184,6 +7188,11 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
}
if(pos & EQP_SHOES)
clif_changelook(&sd->bl,LOOK_SHOES,0);
+ if( pos&EQP_GARMENT )
+ {
+ sd->status.robe = id ? id->look : 0;
+ clif_changelook(&sd->bl, LOOK_ROBE, sd->status.robe);
+ }
pc_checkallowskill(sd); //Check if status changes should be halted.
@@ -7274,6 +7283,11 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
}
if(sd->status.inventory[n].equip & EQP_SHOES)
clif_changelook(&sd->bl,LOOK_SHOES,0);
+ if( sd->status.inventory[n].equip&EQP_GARMENT )
+ {
+ sd->status.robe = 0;
+ clif_changelook(&sd->bl, LOOK_ROBE, 0);
+ }
clif_unequipitemack(sd,n,sd->status.inventory[n].equip,1);
diff --git a/src/map/pc.h b/src/map/pc.h
index 7b14d45d8..9ed474b13 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -494,6 +494,13 @@ enum equip_pos {
#define EQP_HELM (EQP_HEAD_LOW|EQP_HEAD_MID|EQP_HEAD_TOP)
#define EQP_ACC (EQP_ACC_L|EQP_ACC_R)
+/// Equip positions that use a visible sprite
+#if PACKETVER < 20110111
+ #define EQP_VISIBLE EQP_HELM
+#else
+ #define EQP_VISIBLE (EQP_HELM|EQP_GARMENT)
+#endif
+
//Equip indexes constants. (eg: sd->equip_index[EQI_AMMO] returns the index
//where the arrows are equipped)
enum equip_index {
diff --git a/src/map/unit.h b/src/map/unit.h
index fd5a83208..e349a7466 100644
--- a/src/map/unit.h
+++ b/src/map/unit.h
@@ -47,9 +47,10 @@ struct unit_data {
struct view_data {
unsigned short
- class_,
+ class_,
weapon,
shield, //Or left-hand weapon.
+ robe,
head_top,
head_mid,
head_bottom,