summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/packets_struct.h46
2 files changed, 39 insertions, 11 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index da8ba3a95..82ced2d24 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1627,6 +1627,7 @@ static bool clif_spawn(struct block_list *bl)
/// 022e <name>.24B <modified>.B <level>.W <hunger>.W <intimacy>.W <equip id>.W <atk>.W <matk>.W <hit>.W <crit>.W <def>.W <mdef>.W <flee>.W <aspd>.W <hp>.W <max hp>.W <sp>.W <max sp>.W <exp>.L <max exp>.L <skill points>.W <atk range>.W
static void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
{
+#if PACKETVER_MAIN_NUM >= 20101005 || PACKETVER_RE_NUM >= 20080827 || defined(PACKETVER_ZERO_NUM)
struct status_data *hstatus;
enum homun_type htype;
struct PACKET_ZC_PROPERTY_HOMUN p;
@@ -1638,7 +1639,7 @@ static void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int
htype = homun->class2type(hd->homunculus.class_);
memset(&p, 0, sizeof(p));
- p.packetType = hominfoType;
+ p.packetType = HEADER_ZC_PROPERTY_HOMUN;
memcpy(p.name, hd->homunculus.name, NAME_LENGTH);
// Bit field, bit 0 : rename_flag (1 = already renamed), bit 1 : homunc vaporized (1 = true), bit 2 : homunc dead (1 = true)
p.flags = (!battle_config.hom_rename && hd->homunculus.rename_flag ? 0x1 : 0x0) | (hd->homunculus.vaporize == HOM_ST_REST ? 0x2 : 0) | (hd->homunculus.hp > 0 ? 0x4 : 0);
@@ -1704,6 +1705,7 @@ static void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int
p.skillPoints = hd->homunculus.skillpts;
p.range = status_get_range(&hd->bl);
clif->send(&p, sizeof(p), &sd->bl, SELF);
+#endif
}
/// Notification about a change in homunuculus' state (ZC_CHANGESTATE_MER).
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index c1b93e781..1f4df6fc9 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -418,12 +418,6 @@ enum packet_headers {
#else
buyingStoreUpdateItemType = 0x81b,
#endif
-// probably can works also for < 20141223, but in 3CeaM packet size defined only for 20150513
-#if PACKETVER >= 20150513
- hominfoType = 0x9f7,
-#else
- hominfoType = 0x22e,
-#endif
reqName = 0x95,
#if PACKETVER >= 20150503 // Confirm this?
reqNameAllType = 0xA30,
@@ -2276,6 +2270,8 @@ struct PACKET_ZC_ACK_WEAPONREFINE {
#endif
} __attribute__((packed));
+#if PACKETVER_MAIN_NUM >= 20131230 || PACKETVER_RE_NUM >= 20131230 || defined(PACKETVER_ZERO_NUM)
+// PACKET_ZC_PROPERTY_HOMUN2
struct PACKET_ZC_PROPERTY_HOMUN {
int16 packetType;
char name[NAME_LENGTH];
@@ -2297,13 +2293,41 @@ struct PACKET_ZC_PROPERTY_HOMUN {
uint16 mdef;
uint16 flee;
uint16 amotion;
-#if PACKETVER < 20150513
- uint16 hp;
- uint16 maxHp;
-#else
uint32 hp;
uint32 maxHp;
+ uint16 sp;
+ uint16 maxSp;
+ uint32 exp;
+ uint32 expNext;
+ uint16 skillPoints;
+ uint16 range;
+} __attribute__((packed));
+DEFINE_PACKET_HEADER(ZC_PROPERTY_HOMUN, 0x09f7);
+#elif PACKETVER_MAIN_NUM >= 20101005 || PACKETVER_RE_NUM >= 20080827 || defined(PACKETVER_ZERO_NUM)
+// PACKET_ZC_PROPERTY_HOMUN1
+struct PACKET_ZC_PROPERTY_HOMUN {
+ int16 packetType;
+ char name[NAME_LENGTH];
+ // Bit field, bit 0 : rename_flag (1 = already renamed), bit 1 : homunc vaporized (1 = true), bit 2 : homunc dead (1 = true)
+ uint8 flags;
+ uint16 level;
+ uint16 hunger;
+ uint16 intimacy;
+#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
+ uint32 itemId;
+#else
+ uint16 itemId;
#endif
+ uint16 atk2;
+ uint16 matk;
+ uint16 hit;
+ uint16 crit;
+ uint16 def;
+ uint16 mdef;
+ uint16 flee;
+ uint16 amotion;
+ uint16 hp;
+ uint16 maxHp;
uint16 sp;
uint16 maxSp;
uint32 exp;
@@ -2311,6 +2335,8 @@ struct PACKET_ZC_PROPERTY_HOMUN {
uint16 skillPoints;
uint16 range;
} __attribute__((packed));
+DEFINE_PACKET_HEADER(ZC_PROPERTY_HOMUN, 0x022e);
+#endif
struct PACKET_ZC_FAILED_TRADE_BUYING_STORE_TO_SELLER {
int16 packetType;