summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIbrahem Hossam <ibrahem.h.basyone@gmail.com>2016-09-12 00:34:15 +0200
committerGitHub <noreply@github.com>2016-09-12 00:34:15 +0200
commitb407b408f2397eb6661c4ea152f6652142670455 (patch)
tree8b5f1b8c4b2ac743a2fd56c407051585a257900e
parent5b67dd0f17949beb1a54ee0ac13bd9b07c1bdd40 (diff)
parentedd59a66d8bfc83e601343c6d841cfaf9e135319 (diff)
downloadhercules-b407b408f2397eb6661c4ea152f6652142670455.tar.gz
hercules-b407b408f2397eb6661c4ea152f6652142670455.tar.bz2
hercules-b407b408f2397eb6661c4ea152f6652142670455.tar.xz
hercules-b407b408f2397eb6661c4ea152f6652142670455.zip
Merge pull request #1422 from 4144/packetsid
Update some packet ids for newer clients and add navigation script command.
-rw-r--r--doc/script_commands.txt33
-rw-r--r--src/map/buyingstore.c2
-rw-r--r--src/map/clif.c290
-rw-r--r--src/map/clif.h5
-rw-r--r--src/map/packets.h9
-rw-r--r--src/map/script.c55
-rw-r--r--src/map/script.h11
-rw-r--r--src/map/vending.c2
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc10
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc50
12 files changed, 371 insertions, 101 deletions
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
@@ -7204,6 +7204,39 @@ Example:
movenpc("Bugga", 100, 20);
---------------------------------------
+
+*navigateto("<map>"{,<x>,<y>,<flag>,<hide_window>,<monster_id>,<char_id>});
+
+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/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 ce88b32da..86a63f524 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).
@@ -5208,33 +5227,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 <skill id>.W <skill lv>.W <dst id>.L <src id>.L <result>.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 <skill id>.W <skill lv>.W <dst id>.L <src id>.L <result>.B (ZC_USE_SKILL)
+/// 09cb <skill id>.W <skill lv>.L <dst id>.L <src id>.L <result>.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;
@@ -5708,13 +5740,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).
@@ -6385,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 <index>.W <amount>.W
-void clif_vendingreport(struct map_session_data* sd, int index, int amount)
+/// Inform merchant that someone has bought an item.
+/// 0137 <index>.W <amount>.W (ZC_DELETEITEM_FROM_MCSTORE).
+/// 09e5 <index>.W <amount>.W <GID>.L <Date>.L <zeny>.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).
@@ -16126,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 <account id>.L <name>.24B <hp>.W <max hp>.W
+/// Updates HP bar of a camp member.
+/// 02e0 <account id>.L <name>.24B <hp>.W <max hp>.W (ZC_BATTLEFIELD_NOTIFY_HP).
+/// 0a0e <account id>.L <hp>.L <max hp>.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);
}
@@ -16856,18 +16929,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 <name id>.W <amount>.W <limit zeny>.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).
@@ -18793,6 +18879,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.
*
@@ -19636,6 +19763,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 8b75a32f3..3203a3e66 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);
@@ -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 */
@@ -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/packets.h b/src/map/packets.h
index 0badd94f5..8b0a733c7 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
@@ -2786,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);
@@ -2819,6 +2824,8 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0936,36,clif->pStoragePassword,0);
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] */
@@ -2914,6 +2921,8 @@ 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
+ packet(0x09f7,75); // ZC_PROPERTY_HOMUN_2
#endif
#if PACKETVER >= 20150805 // RagexeRE
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
@@ -20507,6 +20507,48 @@ BUILDIN(pcre_match)
}
/**
+ * navigateto("<map>"{,<x>,<y>,<flag>,<hide_window>,<monster_id>,<char_id>});
+ */
+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.
*
* @param buildin Script function data
@@ -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
**/
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
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;