From 6110a96ccfca527dfd96f04fcfda5153593b0bd1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2016 18:12:14 +0300 Subject: Add packet id clif_skill_nodamage for 20131223 (0x9c7 / ZC_USE_SKILL2) Based on 3CeaM commit: commit f89805da42c792aa9bf4274eb5a30756c06fece7 Author: rytech16 Date: Sat Apr 23 13:16:49 2016 +0000 git-svn-id: svn://svn.code.sf.net/p/v1-3ceam/code/trunk@805 cad27aaa-dce3-4a30-a00a-e4fd67c11881 --- src/map/clif.c | 45 +++++++++++++++++++++++++++++---------------- src/map/packets.h | 1 + 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index ce88b32da..397d80ec3 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5208,33 +5208,46 @@ int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tic } #endif // 0 -/// Non-damaging skill effect (ZC_USE_SKILL). -/// 011a .W .W .L .L .B -int clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail) +/// Non-damaging skill effect. +/// 011a .W .W .L .L .B (ZC_USE_SKILL) +/// 09cb .W .L .L .L .B (ZC_USE_SKILL2) +int clif_skill_nodamage(struct block_list *src, struct block_list *dst, uint16 skill_id, int heal, int fail) { unsigned char buf[32]; + short offset = 0; +#if PACKETVER < 20131223 + short cmd = 0x11a; +#else + short cmd = 0x9cb; +#endif + int len = packet_len(cmd); nullpo_ret(dst); - WBUFW(buf,0)=0x11a; - WBUFW(buf,2)=skill_id; - WBUFW(buf,4)=min(heal, INT16_MAX); - WBUFL(buf,6)=dst->id; - WBUFL(buf,10)=src?src->id:0; - WBUFB(buf,14)=fail; + WBUFW(buf, 0) = cmd; + WBUFW(buf, 2) = skill_id; +#if PACKETVER < 20131223 + WBUFW(buf, 4) = min(heal, INT16_MAX); +#else + WBUFL(buf, 4) = min(heal, INT_MAX); + offset += 2; +#endif + WBUFL(buf, 6 + offset) = dst->id; + WBUFL(buf, 10 + offset) = src ? src->id : 0; + WBUFB(buf, 14 + offset) = fail; if (clif->isdisguised(dst)) { - clif->send(buf,packet_len(0x11a),dst,AREA_WOS); - WBUFL(buf,6)=-dst->id; - clif->send(buf,packet_len(0x11a),dst,SELF); + clif->send(buf, len, dst, AREA_WOS); + WBUFL(buf, 6 + offset) = -dst->id; + clif->send(buf, len, dst, SELF); } else - clif->send(buf,packet_len(0x11a),dst,AREA); + clif->send(buf, len, dst, AREA); if (src && clif->isdisguised(src)) { - WBUFL(buf,10)=-src->id; + WBUFL(buf, 10 + offset) = -src->id; if (clif->isdisguised(dst)) - WBUFL(buf,6)=dst->id; - clif->send(buf,packet_len(0x11a),src,SELF); + WBUFL(buf, 6 + offset) = dst->id; + clif->send(buf, len, src, SELF); } return fail; diff --git a/src/map/packets.h b/src/map/packets.h index 0badd94f5..f8ceb266f 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2580,6 +2580,7 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0361,5,clif->pHomMenu,2,4); packet(0x08A4,36,clif->pStoragePassword,0); packet(0x09df,7); + packet(0x09cb,17); #endif // 2013-12-30aRagexe - Yommy -- cgit v1.2.3-70-g09d2 From fbd918a61906e6ee2edfd2e05c913e8b94414458 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2016 18:29:17 +0300 Subject: Add packet id clif_heal for 20150513 (0x0a27 / ZC_RECOVERY2) Based on 3CeaM commit: commit f89805da42c792aa9bf4274eb5a30756c06fece7 Author: rytech16 Date: Sat Apr 23 13:16:49 2016 +0000 git-svn-id: svn://svn.code.sf.net/p/v1-3ceam/code/trunk@805 cad27aaa-dce3-4a30-a00a-e4fd67c11881 --- src/map/clif.c | 23 +++++++++++++++++------ src/map/packets.h | 1 + 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 397d80ec3..80f32ae67 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5721,13 +5721,24 @@ void clif_broadcast2(struct block_list *bl, const char *mes, int len, unsigned i /// 5 = HP (SP_HP) /// 7 = SP (SP_SP) /// ? = ignored -void clif_heal(int fd,int type,int val) +void clif_heal(int fd, int type, int val) { - WFIFOHEAD(fd,packet_len(0x13d)); - WFIFOW(fd,0)=0x13d; - WFIFOW(fd,2)=type; - WFIFOW(fd,4)=cap_value(val,0,INT16_MAX); - WFIFOSET(fd,packet_len(0x13d)); +#if PACKETVER < 20150513 + short cmd = 0x13d; +#else + short cmd = 0xa27; +#endif + int len = packet_len(cmd); + + WFIFOHEAD(fd, len); + WFIFOW(fd, 0) = 0x13d; + WFIFOW(fd, 2) = type; +#if PACKETVER < 20150513 + WFIFOW(fd, 4) = cap_value(val, 0, INT16_MAX); +#else + WFIFOL(fd, 4) = cap_value(val, 0, INT_MAX); +#endif + WFIFOSET(fd, len); } /// Displays resurrection effect (ZC_RESURRECTION). diff --git a/src/map/packets.h b/src/map/packets.h index f8ceb266f..5f67a048f 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2915,6 +2915,7 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0A2E,6,clif->pDull); // TITLE packet(0x0A02,4); // ZC_DRESSROOM_OPEN packet(0x0A35,4,clif->pOneClick_ItemIdentify,2); + packet(0x0a27,8); // ZC_RECOVERY2 #endif #if PACKETVER >= 20150805 // RagexeRE -- cgit v1.2.3-70-g09d2 From 092ffb2b754365ea5487a82c7a2c60667a471cef Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2016 19:25:13 +0300 Subject: Add packet id clif_hominfo (0x9f7 / ZC_PROPERTY_HOMUN_2) Based on 3CeaM commit: commit 296480b6b4687c8f0faf698eae38f0e775bf5f6e Author: Rytech16 Date: Sun Apr 19 03:24:41 2015 +0000 git-svn-id: svn://svn.code.sf.net/p/v1-3ceam/code/trunk@757 cad27aaa-dce3-4a30-a00a-e4fd67c11881 Note: selected very new packet version for this id, because other servers have inconsistent data. --- src/map/clif.c | 87 +++++++++++++++++++++++++++++++++---------------------- src/map/packets.h | 1 + 2 files changed, 54 insertions(+), 34 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 80f32ae67..c6689f9c0 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1495,6 +1495,15 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) struct status_data *hstatus; unsigned char buf[128]; enum homun_type htype; + int offset = 0; + +// probably can works also for < 20141223, but in 3CeaM packet size defined only for 20150513 +#if PACKETVER < 20150513 + int cmd = 0x22e; +#else + int cmd = 0x9f7; +#endif + int len = packet_len(cmd); nullpo_retv(sd); nullpo_retv(hd); @@ -1502,65 +1511,75 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) hstatus = &hd->battle_status; htype = homun->class2type(hd->homunculus.class_); - memset(buf,0,packet_len(0x22e)); - WBUFW(buf,0)=0x22e; - memcpy(WBUFP(buf,2),hd->homunculus.name,NAME_LENGTH); + memset(buf, 0, len); + WBUFW(buf, 0) = cmd; + memcpy(WBUFP(buf, 2), 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) - WBUFB(buf,26)=(battle_config.hom_rename && hd->homunculus.rename_flag ? 0x1 : 0x0) | (hd->homunculus.vaporize == HOM_ST_REST ? 0x2 : 0) | (hd->homunculus.hp > 0 ? 0x4 : 0); - WBUFW(buf,27)=hd->homunculus.level; - WBUFW(buf,29)=hd->homunculus.hunger; - WBUFW(buf,31)=(unsigned short) (hd->homunculus.intimacy / 100) ; - WBUFW(buf,33)=0; // equip id + WBUFB(buf, 26) = (battle_config.hom_rename && hd->homunculus.rename_flag ? 0x1 : 0x0) | (hd->homunculus.vaporize == HOM_ST_REST ? 0x2 : 0) | (hd->homunculus.hp > 0 ? 0x4 : 0); + WBUFW(buf, 27) = hd->homunculus.level; + WBUFW(buf, 29) = hd->homunculus.hunger; + WBUFW(buf, 31) = (unsigned short) (hd->homunculus.intimacy / 100) ; + WBUFW(buf, 33) = 0; // equip id #ifdef RENEWAL WBUFW(buf, 35) = cap_value(hstatus->rhw.atk2, 0, INT16_MAX); #else - WBUFW(buf,35)=cap_value(hstatus->rhw.atk2+hstatus->batk, 0, INT16_MAX); + WBUFW(buf,35) = cap_value(hstatus->rhw.atk2 + hstatus->batk, 0, INT16_MAX); #endif - WBUFW(buf,37)=cap_value(hstatus->matk_max, 0, INT16_MAX); - WBUFW(buf,39)=hstatus->hit; + WBUFW(buf,37) = cap_value(hstatus->matk_max, 0, INT16_MAX); + WBUFW(buf,39) = hstatus->hit; if (battle_config.hom_setting&0x10) - WBUFW(buf,41)=hstatus->luk/3 + 1; //crit is a +1 decimal value! Just display purpose.[Vicious] + WBUFW(buf, 41) = hstatus->luk / 3 + 1; //crit is a +1 decimal value! Just display purpose.[Vicious] else - WBUFW(buf,41)=hstatus->cri/10; + WBUFW(buf, 41) = hstatus->cri / 10; #ifdef RENEWAL WBUFW(buf, 43) = hstatus->def + hstatus->def2; WBUFW(buf, 45) = hstatus->mdef + hstatus->mdef2; #else - WBUFW(buf,43)=hstatus->def + hstatus->vit ; + WBUFW(buf, 43) =hstatus->def + hstatus->vit ; WBUFW(buf, 45) = hstatus->mdef; #endif - WBUFW(buf,47)=hstatus->flee; - WBUFW(buf,49)=(flag)?0:hstatus->amotion; + WBUFW(buf, 47) = hstatus->flee; + WBUFW(buf, 49) = (flag) ? 0 : hstatus->amotion; + +// probably can works also for < 20141223, but in 3CeaM packet size defined only for 20150513 +#if PACKETVER < 20150513 if (hstatus->max_hp > INT16_MAX) { - WBUFW(buf,51) = hstatus->hp/(hstatus->max_hp/100); - WBUFW(buf,53) = 100; + WBUFW(buf, 51) = hstatus->hp / (hstatus->max_hp / 100); + WBUFW(buf, 53) = 100; } else { - WBUFW(buf,51)=hstatus->hp; - WBUFW(buf,53)=hstatus->max_hp; + WBUFW(buf, 51) = hstatus->hp; + WBUFW(buf, 53) = hstatus->max_hp; } +#else + WBUFL(buf, 51) = hstatus->hp; + WBUFL(buf, 55) = hstatus->max_hp; + offset = 4; +#endif + if (hstatus->max_sp > INT16_MAX) { - WBUFW(buf,55) = hstatus->sp/(hstatus->max_sp/100); - WBUFW(buf,57) = 100; + WBUFW(buf, 55 + offset) = hstatus->sp / (hstatus->max_sp / 100); + WBUFW(buf, 57 + offset) = 100; } else { - WBUFW(buf,55)=hstatus->sp; - WBUFW(buf,57)=hstatus->max_sp; + WBUFW(buf, 55 + offset) = hstatus->sp; + WBUFW(buf, 57 + offset) = hstatus->max_sp; } - WBUFL(buf,59)=hd->homunculus.exp; - WBUFL(buf,63)=hd->exp_next; - switch( htype ) { + WBUFL(buf, 59 + offset) = hd->homunculus.exp; + WBUFL(buf, 63 + offset) = hd->exp_next; + switch (htype) { case HT_REG: case HT_EVO: - if( hd->homunculus.level >= battle_config.hom_max_level ) - WBUFL(buf,63)=0; + if (hd->homunculus.level >= battle_config.hom_max_level) + WBUFL(buf, 63 + offset) = 0; break; case HT_S: - if( hd->homunculus.level >= battle_config.hom_S_max_level ) - WBUFL(buf,63)=0; + if (hd->homunculus.level >= battle_config.hom_S_max_level) + WBUFL(buf, 63 + offset) = 0; break; } - WBUFW(buf,67)=hd->homunculus.skillpts; - WBUFW(buf,69)=status_get_range(&hd->bl); - clif->send(buf,packet_len(0x22e),&sd->bl,SELF); + WBUFW(buf, 67 + offset) = hd->homunculus.skillpts; + WBUFW(buf, 69 + offset) = status_get_range(&hd->bl); + + clif->send(buf, len, &sd->bl, SELF); } /// Notification about a change in homunuculus' state (ZC_CHANGESTATE_MER). diff --git a/src/map/packets.h b/src/map/packets.h index 5f67a048f..077320798 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2916,6 +2916,7 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0A02,4); // ZC_DRESSROOM_OPEN packet(0x0A35,4,clif->pOneClick_ItemIdentify,2); packet(0x0a27,8); // ZC_RECOVERY2 + packet(0x09f7,75); // ZC_PROPERTY_HOMUN_2 #endif #if PACKETVER >= 20150805 // RagexeRE -- cgit v1.2.3-70-g09d2 From dfe7b9e4bb9c0f890009be0f037d4ba1a516605f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2016 19:43:56 +0300 Subject: Add packet id clif_vendingreport (0x9e5 / ZC_DELETEITEM_FROM_MCSTORE2) Based on rAthena commit: commit 01adc9c3ff3c1c6f0f69f6f9f2db77eba20071d4 Author: Napster Date: Mon Dec 21 20:05:29 2015 +0700 --- src/map/clif.c | 28 ++++++++++++++++++++-------- src/map/clif.h | 2 +- src/map/packets.h | 1 + src/map/vending.c | 2 +- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index c6689f9c0..eb6f848e9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -6428,20 +6428,32 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven #endif } -/// Inform merchant that someone has bought an item (ZC_DELETEITEM_FROM_MCSTORE). -/// 0137 .W .W -void clif_vendingreport(struct map_session_data* sd, int index, int amount) +/// Inform merchant that someone has bought an item. +/// 0137 .W .W (ZC_DELETEITEM_FROM_MCSTORE). +/// 09e5 .W .W .L .L .L (ZC_DELETEITEM_FROM_MCSTORE2). +void clif_vendingreport(struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny) { int fd; +#if PACKETVER < 20141016 // TODO : not sure for client date [Napster] + const int cmd = 0x137; +#else + const int cmd = 0x9e5; +#endif + const int len = packet_len(cmd); nullpo_retv(sd); fd = sd->fd; - WFIFOHEAD(fd,packet_len(0x137)); - WFIFOW(fd,0) = 0x137; - WFIFOW(fd,2) = index+2; - WFIFOW(fd,4) = amount; - WFIFOSET(fd,packet_len(0x137)); + WFIFOHEAD(fd, len); + WFIFOW(fd, 0) = cmd; + WFIFOW(fd, 2) = index + 2; + WFIFOW(fd, 4) = amount; +#if PACKETVER >= 20141016 + WFIFOL(fd,6) = char_id; // GID + WFIFOL(fd,10) = (int)time(NULL); // Date + WFIFOL(fd,14) = zeny; // zeny +#endif + WFIFOSET(fd, len); } /// Result of organizing a party (ZC_ACK_MAKE_GROUP). diff --git a/src/map/clif.h b/src/map/clif.h index 8b75a32f3..60c03d6e0 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -896,7 +896,7 @@ struct clif_interface { void (*vendinglist) (struct map_session_data* sd, unsigned int id, struct s_vending* vending_list); void (*buyvending) (struct map_session_data* sd, int index, int amount, int fail); void (*openvending) (struct map_session_data* sd, int id, struct s_vending* vending_list); - void (*vendingreport) (struct map_session_data* sd, int index, int amount); + void (*vendingreport) (struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny); /* storage handling */ void (*storagelist) (struct map_session_data* sd, struct item* items, int items_length); void (*updatestorageamount) (struct map_session_data* sd, int amount, int max_amount); diff --git a/src/map/packets.h b/src/map/packets.h index 077320798..236728bf8 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2820,6 +2820,7 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0936,36,clif->pStoragePassword,0); packet(0x09DF,7); packet(0x0a00,269); + packet(0x09e5,18); // ZC_DELETEITEM_FROM_MCSTORE2 #endif /* Roulette System [Yommy/Hercules] */ diff --git a/src/map/vending.c b/src/map/vending.c index 6f4515120..f92437cb8 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -191,7 +191,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, // vending item pc->additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING); vsd->vending[vend_list[i]].amount -= amount; - clif->vendingreport(vsd, idx, amount); + clif->vendingreport(vsd, idx, amount, sd->status.char_id, (int)z); pc->cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING); //print buyer's name -- cgit v1.2.3-70-g09d2 From 08de021655e1d032db5efa74f3da8f2d8b1efe99 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2016 19:59:04 +0300 Subject: Add packet id clif_buyingstore_update_item (0x9e6 / ZC_UPDATE_ITEM_FROM_BUYING_STORE2) Based on rAthena commit: commit 01adc9c3ff3c1c6f0f69f6f9f2db77eba20071d4 Author: Napster Date: Mon Dec 21 20:05:29 2015 +0700 --- src/map/buyingstore.c | 2 +- src/map/clif.c | 27 ++++++++++++++++++++------- src/map/clif.h | 2 +- src/map/packets.h | 1 + 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 58a1f925f..d2e2a2c20 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -383,7 +383,7 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int // notify clients clif->buyingstore_delete_item(sd, index, amount, pl_sd->buyingstore.items[listidx].price); - clif->buyingstore_update_item(pl_sd, nameid, amount); + clif->buyingstore_update_item(pl_sd, nameid, amount, sd->status.char_id, zeny); } if( map->save_settings&128 ) { diff --git a/src/map/clif.c b/src/map/clif.c index eb6f848e9..7e4f6b825 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -16911,18 +16911,31 @@ void clif_buyingstore_trade_failed_buyer(struct map_session_data* sd, short resu /// Updates the zeny limit and an item in the buying store item list (ZC_UPDATE_ITEM_FROM_BUYING_STORE). /// 081b .W .W .L -void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount) +void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny) { int fd; +#if PACKETVER < 20141016 // TODO : not sure for client date [Napster] + const int cmd = 0x81b; +#else + const int cmd = 0x9e6; +#endif + const int len = packet_len(cmd); nullpo_retv(sd); fd = sd->fd; - WFIFOHEAD(fd,packet_len(0x81b)); - WFIFOW(fd,0) = 0x81b; - WFIFOW(fd,2) = nameid; - WFIFOW(fd,4) = amount; // amount of nameid received - WFIFOL(fd,6) = sd->buyingstore.zenylimit; - WFIFOSET(fd,packet_len(0x81b)); + WFIFOHEAD(fd, len); + WFIFOW(fd, 0) = cmd; + WFIFOW(fd, 2) = nameid; + WFIFOW(fd, 4) = amount; // amount of nameid received +#if PACKETVER < 20141016 + WFIFOL(fd, 6) = sd->buyingstore.zenylimit; +#else + WFIFOL(fd, 6) = zeny; // zeny + WFIFOL(fd, 10) = sd->buyingstore.zenylimit; + WFIFOL(fd, 14) = char_id; // GID + WFIFOL(fd, 18) = (int)time(NULL); // date +#endif + WFIFOSET(fd, len); } /// Deletes item from inventory, that was sold to a buying store (ZC_ITEM_DELETE_BUYING_STORE). diff --git a/src/map/clif.h b/src/map/clif.h index 60c03d6e0..8f6950666 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1058,7 +1058,7 @@ struct clif_interface { void (*buyingstore_disappear_entry_single) (struct map_session_data* sd, struct map_session_data* pl_sd); void (*buyingstore_itemlist) (struct map_session_data* sd, struct map_session_data* pl_sd); void (*buyingstore_trade_failed_buyer) (struct map_session_data* sd, short result); - void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount); + void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny); void (*buyingstore_delete_item) (struct map_session_data* sd, short index, unsigned short amount, int price); void (*buyingstore_trade_failed_seller) (struct map_session_data* sd, short result, unsigned short nameid); /* search store-related */ diff --git a/src/map/packets.h b/src/map/packets.h index 236728bf8..33fa5236d 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2821,6 +2821,7 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x09DF,7); packet(0x0a00,269); packet(0x09e5,18); // ZC_DELETEITEM_FROM_MCSTORE2 + packet(0x09e6,22); // ZC_UPDATE_ITEM_FROM_BUYING_STORE2 #endif /* Roulette System [Yommy/Hercules] */ -- cgit v1.2.3-70-g09d2 From b6690d7bb05e75d28891f360f42e0dfe19ea0904 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2016 21:04:27 +0300 Subject: Add script command navigateto. Add packet for this command. Based on rAthena commits: commit 4f13007fec7f08c265620a71c3bc4806d186c0f1 Author: Lemongrass3110 Date: Sun Mar 6 21:48:47 2016 +0100 commit 809f220b9f5ef70ee062ee56ae6e8d5f56cb5d32 Author: aleos89 Date: Sun Mar 6 16:15:54 2016 -0500 commit 179f73424934d528ebe494dfb66503c182eacb09 Author: aleos89 Date: Sun Mar 6 16:10:15 2016 -0500 --- doc/script_commands.txt | 33 +++++++++++++++++++++++++++++ src/map/clif.c | 42 +++++++++++++++++++++++++++++++++++++ src/map/clif.h | 1 + src/map/script.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ src/map/script.h | 11 ++++++++++ 5 files changed, 142 insertions(+) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 04d2c0c16..eb7e0cd9d 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -7203,6 +7203,39 @@ Example: // coordinates are legit). movenpc("Bugga", 100, 20); +--------------------------------------- + +*navigateto(""{,,,,,,}); + +Generates a navigation for attached or specified character. Requires client +2011-10-10aRagEXE or newer. + +The flag specifies how the client will calculate the specific route. + +Valid flags are: + NAV_NONE - No services + NAV_AIRSHIP_ONLY - Airship only + NAV_SCROLL_ONLY - Scroll only + NAV_AIRSHIP_AND_SCROLL - Airship and Scroll + NAV_KAFRA_ONLY - Kafra only + NAV_KAFRA_AND_AIRSHIP - Kafra and Airship + NAV_KAFRA_AND_SCROLL - Kafra and Scroll + NAV_ALL - All services + +When flag is not specified, the default value is NAV_KAFRA_AND_AIRSHIP. + +The hide_window specifies whether to display (0) or hide (1) the navigation window. +By default the window is hidden. + +You can specify the monster_id in combination with a mapname to make the +navigation system tell you, that you have reached the desired mob. + +Note: +The client requires custom monster spawns be in the navigation file +for using the embedded client Navigation feature to work properly. In this +instance sending the player to the map where the monster spawns is a simpler +solution rather than sending the map and the monster_id. + --------------------------------------- //===================================== 6 - Other Commands diff --git a/src/map/clif.c b/src/map/clif.c index 7e4f6b825..749b3d068 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -18861,6 +18861,47 @@ void clif_selectcart(struct map_session_data *sd) #endif } +/// Starts navigation to the given target on client side +void clif_navigate_to(struct map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id) +{ +#if PACKETVER >= 20111010 + int fd; + + nullpo_retv(sd); + nullpo_retv(mapname); + fd = sd->fd; + WFIFOHEAD(fd, 27); + WFIFOW(fd, 0) = 0x8e2; + + // How detailed will our navigation be? + if (mob_id > 0) { + x = 0; + y = 0; + WFIFOB(fd, 2) = 3; // monster with destination field + } else if (x > 0 && y > 0) { + WFIFOB(fd, 2) = 0; // with coordinates + } else { + x = 0; + y = 0; + WFIFOB(fd, 2) = 1; // without coordinates(will fail if you are already on the map) + } + + // Which services can be used for transportation? + WFIFOB(fd, 3) = flag; + // If this flag is set, the navigation window will not be opened up + WFIFOB(fd, 4) = hideWindow; + // Target map + safestrncpy((char*)WFIFOP(fd, 5), mapname, MAP_NAME_LENGTH_EXT); + // Target x + WFIFOW(fd, 21) = x; + // Target y + WFIFOW(fd, 23) = y; + // Target monster ID + WFIFOW(fd, 25) = mob_id; + WFIFOSET(fd, 27); +#endif +} + /** * Returns the name of the given bl, in a client-friendly format. * @@ -19704,6 +19745,7 @@ void clif_defaults(void) { clif->selectcart = clif_selectcart; /* */ clif->isdisguised = clif_isdisguised; + clif->navigate_to = clif_navigate_to; clif->bl_type = clif_bl_type; /*------------------------ diff --git a/src/map/clif.h b/src/map/clif.h index 8f6950666..3203a3e66 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1111,6 +1111,7 @@ struct clif_interface { void (*ackmergeitems) (int fd, struct map_session_data *sd); /* */ bool (*isdisguised) (struct block_list* bl); + void (*navigate_to) (struct map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id); unsigned char (*bl_type) (struct block_list *bl); /*------------------------ *- Parse Incoming Packet diff --git a/src/map/script.c b/src/map/script.c index 2633c1e5f..f8754660c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -20506,6 +20506,48 @@ BUILDIN(pcre_match) return true; } +/** + * navigateto(""{,,,,,,}); + */ +BUILDIN(navigateto) +{ +#if PACKETVER >= 20111010 + struct map_session_data* sd; + const char *mapname; + uint16 x = 0; + uint16 y = 0; + uint16 monster_id = 0; + uint8 flag = NAV_KAFRA_AND_AIRSHIP; + bool hideWindow = true; + + mapname = script_getstr(st, 2); + + if (script_hasdata(st, 3)) + x = script_getnum(st, 3); + if (script_hasdata(st, 4)) + y = script_getnum(st, 4); + if (script_hasdata(st, 5)) + flag = (uint8)script_getnum(st, 5); + if (script_hasdata(st, 6)) + hideWindow = script_getnum(st, 6) ? true : false; + if (script_hasdata(st, 7)) + monster_id = script_getnum(st, 7); + + if (script_hasdata(st, 8)) { + sd = map->charid2sd(script_getnum(st, 8)); + } else { + sd = script->rid2sd(st); + } + + clif->navigate_to(sd, mapname, x, y, flag, hideWindow, monster_id); + + return true; +#else + ShowError("Navigation system works only with packet version >= 20111010"); + return false; +#endif +} + /** * Adds a built-in script function. * @@ -21175,6 +21217,9 @@ void script_parse_builtin(void) { BUILDIN_DEF(purchaseok,""), BUILDIN_DEF(shopcount, "i"), + /* Navigation */ + BUILDIN_DEF(navigateto, "s??????"), + BUILDIN_DEF(channelmes, "ss"), BUILDIN_DEF(showscript, "s?"), BUILDIN_DEF(mergeitem,""), @@ -21329,6 +21374,16 @@ void script_hardcoded_constants(void) script->set_constant("EQP_SHADOW_ACC_R", EQP_SHADOW_ACC_R, false, false); script->set_constant("EQP_SHADOW_ACC_L", EQP_SHADOW_ACC_L, false, false); + script->constdb_comment("Navigation constants, use with *navigateto*"); + script->set_constant("NAV_NONE", NAV_NONE, false, false); + script->set_constant("NAV_AIRSHIP_ONLY", NAV_AIRSHIP_ONLY, false, false); + script->set_constant("NAV_SCROLL_ONLY", NAV_SCROLL_ONLY, false, false); + script->set_constant("NAV_AIRSHIP_AND_SCROLL", NAV_AIRSHIP_AND_SCROLL, false, false); + script->set_constant("NAV_KAFRA_ONLY", NAV_KAFRA_ONLY, false, false); + script->set_constant("NAV_KAFRA_AND_AIRSHIP", NAV_KAFRA_AND_AIRSHIP, false, false); + script->set_constant("NAV_KAFRA_AND_SCROLL", NAV_KAFRA_AND_SCROLL, false, false); + script->set_constant("NAV_ALL", NAV_ALL, false, false); + script->constdb_comment("Renewal"); #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); diff --git a/src/map/script.h b/src/map/script.h index c4c082263..a69000991 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -338,6 +338,17 @@ enum { MF_NOVIEWID }; +enum navigation_service { + NAV_NONE = 0, + NAV_AIRSHIP_ONLY = 1, + NAV_SCROLL_ONLY = 10, + NAV_AIRSHIP_AND_SCROLL = NAV_AIRSHIP_ONLY + NAV_SCROLL_ONLY, //11 + NAV_KAFRA_ONLY = 100, + NAV_KAFRA_AND_AIRSHIP = NAV_KAFRA_ONLY + NAV_AIRSHIP_ONLY, // 101 + NAV_KAFRA_AND_SCROLL = NAV_KAFRA_ONLY + NAV_SCROLL_ONLY, // 110 + NAV_ALL = NAV_AIRSHIP_ONLY + NAV_SCROLL_ONLY + NAV_KAFRA_ONLY // 111-255 +}; + /** * Structures **/ -- cgit v1.2.3-70-g09d2 From fcffa6cafb701073995107748aaab9d6adb97224 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2016 21:22:02 +0300 Subject: Add packet id clif_bg_hp (0xa0e) Based on rAthena commit: commit ba184ab9a2a932b6ce2eba279fdc379b50b430a5 Author: Napster Date: Fri Dec 18 23:00:53 2015 +0700 --- src/map/clif.c | 38 ++++++++++++++++++++++++++++---------- src/map/packets.h | 4 ++++ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 749b3d068..183229f95 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -16181,28 +16181,46 @@ void clif_readbook(int fd, int book_id, int page) /// Battlegrounds /// -/// Updates HP bar of a camp member (ZC_BATTLEFIELD_NOTIFY_HP). -/// 02e0 .L .24B .W .W +/// Updates HP bar of a camp member. +/// 02e0 .L .24B .W .W (ZC_BATTLEFIELD_NOTIFY_HP). +/// 0a0e .L .L .L (ZC_BATTLEFIELD_NOTIFY_HP2) void clif_bg_hp(struct map_session_data *sd) { unsigned char buf[34]; + +// packet version can be wrong, because inconsistend data in other servers. +#if PACKETVER < 20140613 const int cmd = 0x2e0; nullpo_retv(sd); - WBUFW(buf,0) = cmd; - WBUFL(buf,2) = sd->status.account_id; - memcpy(WBUFP(buf,6), sd->status.name, NAME_LENGTH); + WBUFW(buf, 0) = cmd; + WBUFL(buf, 2) = sd->status.account_id; + memcpy(WBUFP(buf, 6), sd->status.name, NAME_LENGTH); - if( sd->battle_status.max_hp > INT16_MAX ) + if (sd->battle_status.max_hp > INT16_MAX) { // To correctly display the %hp bar. [Skotlex] - WBUFW(buf,30) = sd->battle_status.hp/(sd->battle_status.max_hp/100); - WBUFW(buf,32) = 100; + WBUFW(buf, 30) = sd->battle_status.hp / (sd->battle_status.max_hp / 100); + WBUFW(buf, 32) = 100; } else { - WBUFW(buf,30) = sd->battle_status.hp; - WBUFW(buf,32) = sd->battle_status.max_hp; + WBUFW(buf, 30) = sd->battle_status.hp; + WBUFW(buf, 32) = sd->battle_status.max_hp; } +#else + const int cmd = 0xa0e; + nullpo_retv(sd); + + WBUFW(buf, 0) = cmd; + WBUFL(buf, 2) = sd->status.account_id; + if (sd->battle_status.max_hp > INT32_MAX) { + WBUFL(buf, 6) = sd->battle_status.hp / (sd->battle_status.max_hp / 100); + WBUFL(buf, 10) = 100; + } else { + WBUFL(buf, 6) = sd->battle_status.hp; + WBUFL(buf, 10) = sd->battle_status.max_hp; + } +#endif clif->send(buf, packet_len(cmd), &sd->bl, BG_AREA_WOS); } diff --git a/src/map/packets.h b/src/map/packets.h index 33fa5236d..8b0a733c7 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2787,6 +2787,10 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x09DF,7); #endif +#if PACKETVER >= 20140613 + packet(0x0a0e,14); +#endif + // 2014-10-16aRagexe - YomRawr #if PACKETVER >= 20141016 packet(0x0369,7,clif->pActionRequest,2,6); -- cgit v1.2.3-70-g09d2 From cc21e11ed548e79a0f26516abe2cfb19045fc323 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2016 21:26:25 +0300 Subject: Update HPM hooks. --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 10 +++-- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 50 ++++++++++++++++------ 4 files changed, 49 insertions(+), 16 deletions(-) diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index c020d3130..6b88ddf43 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1396,8 +1396,8 @@ typedef void (*HPMHOOK_pre_clif_buyvending) (struct map_session_data **sd, int * typedef void (*HPMHOOK_post_clif_buyvending) (struct map_session_data *sd, int index, int amount, int fail); typedef void (*HPMHOOK_pre_clif_openvending) (struct map_session_data **sd, int *id, struct s_vending **vending_list); typedef void (*HPMHOOK_post_clif_openvending) (struct map_session_data *sd, int id, struct s_vending *vending_list); -typedef void (*HPMHOOK_pre_clif_vendingreport) (struct map_session_data **sd, int *index, int *amount); -typedef void (*HPMHOOK_post_clif_vendingreport) (struct map_session_data *sd, int index, int amount); +typedef void (*HPMHOOK_pre_clif_vendingreport) (struct map_session_data **sd, int *index, int *amount, uint32 *char_id, int *zeny); +typedef void (*HPMHOOK_post_clif_vendingreport) (struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny); typedef void (*HPMHOOK_pre_clif_storagelist) (struct map_session_data **sd, struct item **items, int *items_length); typedef void (*HPMHOOK_post_clif_storagelist) (struct map_session_data *sd, struct item *items, int items_length); typedef void (*HPMHOOK_pre_clif_updatestorageamount) (struct map_session_data **sd, int *amount, int *max_amount); @@ -1684,8 +1684,8 @@ typedef void (*HPMHOOK_pre_clif_buyingstore_itemlist) (struct map_session_data * typedef void (*HPMHOOK_post_clif_buyingstore_itemlist) (struct map_session_data *sd, struct map_session_data *pl_sd); typedef void (*HPMHOOK_pre_clif_buyingstore_trade_failed_buyer) (struct map_session_data **sd, short *result); typedef void (*HPMHOOK_post_clif_buyingstore_trade_failed_buyer) (struct map_session_data *sd, short result); -typedef void (*HPMHOOK_pre_clif_buyingstore_update_item) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount); -typedef void (*HPMHOOK_post_clif_buyingstore_update_item) (struct map_session_data *sd, unsigned short nameid, unsigned short amount); +typedef void (*HPMHOOK_pre_clif_buyingstore_update_item) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount, uint32 *char_id, int *zeny); +typedef void (*HPMHOOK_post_clif_buyingstore_update_item) (struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny); typedef void (*HPMHOOK_pre_clif_buyingstore_delete_item) (struct map_session_data **sd, short *index, unsigned short *amount, int *price); typedef void (*HPMHOOK_post_clif_buyingstore_delete_item) (struct map_session_data *sd, short index, unsigned short amount, int price); typedef void (*HPMHOOK_pre_clif_buyingstore_trade_failed_seller) (struct map_session_data **sd, short *result, unsigned short *nameid); @@ -1764,6 +1764,8 @@ typedef void (*HPMHOOK_pre_clif_ackmergeitems) (int *fd, struct map_session_data typedef void (*HPMHOOK_post_clif_ackmergeitems) (int fd, struct map_session_data *sd); typedef bool (*HPMHOOK_pre_clif_isdisguised) (struct block_list **bl); typedef bool (*HPMHOOK_post_clif_isdisguised) (bool retVal___, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_navigate_to) (struct map_session_data **sd, const char **mapname, uint16 *x, uint16 *y, uint8 *flag, bool *hideWindow, uint16 *mob_id); +typedef void (*HPMHOOK_post_clif_navigate_to) (struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id); typedef unsigned char (*HPMHOOK_pre_clif_bl_type) (struct block_list **bl); typedef unsigned char (*HPMHOOK_post_clif_bl_type) (unsigned char retVal___, struct block_list *bl); typedef void (*HPMHOOK_pre_clif_pWantToConnection) (int *fd, struct map_session_data **sd); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index c0b0fa9f6..d71ecc52f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1402,6 +1402,8 @@ struct { struct HPMHookPoint *HP_clif_ackmergeitems_post; struct HPMHookPoint *HP_clif_isdisguised_pre; struct HPMHookPoint *HP_clif_isdisguised_post; + struct HPMHookPoint *HP_clif_navigate_to_pre; + struct HPMHookPoint *HP_clif_navigate_to_post; struct HPMHookPoint *HP_clif_bl_type_pre; struct HPMHookPoint *HP_clif_bl_type_post; struct HPMHookPoint *HP_clif_pWantToConnection_pre; @@ -7463,6 +7465,8 @@ struct { int HP_clif_ackmergeitems_post; int HP_clif_isdisguised_pre; int HP_clif_isdisguised_post; + int HP_clif_navigate_to_pre; + int HP_clif_navigate_to_post; int HP_clif_bl_type_pre; int HP_clif_bl_type_post; int HP_clif_pWantToConnection_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 9f05884a4..b6ee443a3 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -723,6 +723,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->comparemergeitem, HP_clif_comparemergeitem) }, { HP_POP(clif->ackmergeitems, HP_clif_ackmergeitems) }, { HP_POP(clif->isdisguised, HP_clif_isdisguised) }, + { HP_POP(clif->navigate_to, HP_clif_navigate_to) }, { HP_POP(clif->bl_type, HP_clif_bl_type) }, { HP_POP(clif->pWantToConnection, HP_clif_pWantToConnection) }, { HP_POP(clif->pLoadEndAck, HP_clif_pLoadEndAck) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index b1bc0ce34..0c81e557f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -13447,14 +13447,14 @@ void HP_clif_openvending(struct map_session_data *sd, int id, struct s_vending * } return; } -void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount) { +void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny) { int hIndex = 0; if( HPMHooks.count.HP_clif_vendingreport_pre ) { - void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount); + void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount, uint32 *char_id, int *zeny); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_clif_vendingreport_pre[hIndex].func; - preHookFunc(&sd, &index, &amount); + preHookFunc(&sd, &index, &amount, &char_id, &zeny); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -13462,13 +13462,13 @@ void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount) { } } { - HPMHooks.source.clif.vendingreport(sd, index, amount); + HPMHooks.source.clif.vendingreport(sd, index, amount, char_id, zeny); } if( HPMHooks.count.HP_clif_vendingreport_post ) { - void (*postHookFunc) (struct map_session_data *sd, int index, int amount); + void (*postHookFunc) (struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny); for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_clif_vendingreport_post[hIndex].func; - postHookFunc(sd, index, amount); + postHookFunc(sd, index, amount, char_id, zeny); } } return; @@ -17200,14 +17200,14 @@ void HP_clif_buyingstore_trade_failed_buyer(struct map_session_data *sd, short r } return; } -void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short nameid, unsigned short amount) { +void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny) { int hIndex = 0; if( HPMHooks.count.HP_clif_buyingstore_update_item_pre ) { - void (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount); + void (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount, uint32 *char_id, int *zeny); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_clif_buyingstore_update_item_pre[hIndex].func; - preHookFunc(&sd, &nameid, &amount); + preHookFunc(&sd, &nameid, &amount, &char_id, &zeny); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -17215,13 +17215,13 @@ void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short } } { - HPMHooks.source.clif.buyingstore_update_item(sd, nameid, amount); + HPMHooks.source.clif.buyingstore_update_item(sd, nameid, amount, char_id, zeny); } if( HPMHooks.count.HP_clif_buyingstore_update_item_post ) { - void (*postHookFunc) (struct map_session_data *sd, unsigned short nameid, unsigned short amount); + void (*postHookFunc) (struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny); for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_clif_buyingstore_update_item_post[hIndex].func; - postHookFunc(sd, nameid, amount); + postHookFunc(sd, nameid, amount, char_id, zeny); } } return; @@ -18246,6 +18246,32 @@ bool HP_clif_isdisguised(struct block_list *bl) { } return retVal___; } +void HP_clif_navigate_to(struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_navigate_to_pre ) { + void (*preHookFunc) (struct map_session_data **sd, const char **mapname, uint16 *x, uint16 *y, uint8 *flag, bool *hideWindow, uint16 *mob_id); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_navigate_to_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_navigate_to_pre[hIndex].func; + preHookFunc(&sd, &mapname, &x, &y, &flag, &hideWindow, &mob_id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.navigate_to(sd, mapname, x, y, flag, hideWindow, mob_id); + } + if( HPMHooks.count.HP_clif_navigate_to_post ) { + void (*postHookFunc) (struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_navigate_to_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_navigate_to_post[hIndex].func; + postHookFunc(sd, mapname, x, y, flag, hideWindow, mob_id); + } + } + return; +} unsigned char HP_clif_bl_type(struct block_list *bl) { int hIndex = 0; unsigned char retVal___ = 0; -- cgit v1.2.3-70-g09d2 From edd59a66d8bfc83e601343c6d841cfaf9e135319 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 Sep 2016 17:31:03 +0300 Subject: Send correct homunculus rename flag to client. (Fixes #1424) --- src/map/clif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/clif.c b/src/map/clif.c index 183229f95..86a63f524 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1515,7 +1515,7 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) WBUFW(buf, 0) = cmd; memcpy(WBUFP(buf, 2), 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) - WBUFB(buf, 26) = (battle_config.hom_rename && hd->homunculus.rename_flag ? 0x1 : 0x0) | (hd->homunculus.vaporize == HOM_ST_REST ? 0x2 : 0) | (hd->homunculus.hp > 0 ? 0x4 : 0); + WBUFB(buf, 26) = (!battle_config.hom_rename && hd->homunculus.rename_flag ? 0x1 : 0x0) | (hd->homunculus.vaporize == HOM_ST_REST ? 0x2 : 0) | (hd->homunculus.hp > 0 ? 0x4 : 0); WBUFW(buf, 27) = hd->homunculus.level; WBUFW(buf, 29) = hd->homunculus.hunger; WBUFW(buf, 31) = (unsigned short) (hd->homunculus.intimacy / 100) ; -- cgit v1.2.3-70-g09d2