summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-29 21:31:36 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-29 21:31:36 +0000
commit5baa12ea4a48b09cfc2007ec5c1f05f60a92fd45 (patch)
tree028b0dca8498480d96997c08c649ca7547b37874 /src/map/clif.c
parent71201030aedb473d67f15c4ab72ba21c60cca30b (diff)
downloadhercules-5baa12ea4a48b09cfc2007ec5c1f05f60a92fd45.tar.gz
hercules-5baa12ea4a48b09cfc2007ec5c1f05f60a92fd45.tar.bz2
hercules-5baa12ea4a48b09cfc2007ec5c1f05f60a92fd45.tar.xz
hercules-5baa12ea4a48b09cfc2007ec5c1f05f60a92fd45.zip
* Collection of random insignificant changes.
- Added progress indication on map-server shutdown when objects are removed from maps, as it takes significant amount of time to complete. - Moved ers_free in db_obj_vclear, so that the node pointer is not used for comparison after it has been freed. - Some documentation of shop packets. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14639 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c42
1 files changed, 32 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index c5796555a..b640780a9 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9562,9 +9562,11 @@ void clif_parse_NpcBuyListSend(int fd, struct map_session_data* sd)
WFIFOSET(fd,packet_len(0xca));
}
-/*==========================================
- *
- *------------------------------------------*/
+/// Request to sell chosen items to npc shop
+/// R 00c9 <packet len>.W {<index>.W <amount>.W}.4B*
+/// S 00cb <result>.B
+/// result = 00 -> "The deal has successfully completed."
+/// result = 01 -> "The deal has failed."
void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
{
int fail=0,n;
@@ -11674,7 +11676,7 @@ void clif_parse_GMReqAccountName(int fd, struct map_session_data *sd)
* S 0198 <x>.W <y>.W <gat>.W
*------------------------------------------*/
void clif_parse_GMChangeMapType(int fd, struct map_session_data *sd)
-{// FIXME: type sent by client is 0 or 1 (even if you enter 2+); that suggests, that it is walkable gat attribute
+{
int x,y,type;
if( battle_config.atc_gmonly && !pc_isGM(sd) )
@@ -13139,6 +13141,31 @@ void clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd)
WFIFOSET(fd,WFIFOW(fd,2));
}
+/// Cashshop Buy Ack (ZC_PC_CASH_POINT_UPDATE)
+/// S 0289 <cash point>.L <kafra point>.L <error>.W
+///
+/// @param error
+/// 0: The deal has successfully completed. (ERROR_TYPE_NONE)
+/// 1: The Purchase has failed because the NPC does not exist. (ERROR_TYPE_NPC)
+/// 2: The Purchase has failed because the Kafra Shop System is not working correctly. (ERROR_TYPE_SYSTEM)
+/// 3: You are over your Weight Limit. (ERROR_TYPE_INVENTORY_WEIGHT)
+/// 4: You cannot purchase items while you are in a trade. (ERROR_TYPE_EXCHANGE)
+/// 5: The Purchase has failed because the Item Information was incorrect. (ERROR_TYPE_ITEM_ID)
+/// 6: You do not have enough Kafra Credit Points. (ERROR_TYPE_MONEY)
+/// 7: You can purchase up to 10 items.
+/// 8: Some items could not be purchased.
+void clif_cashshop_ack(struct map_session_data* sd, int error)
+{
+ int fd = sd->fd;
+
+ WFIFOHEAD(fd, packet_len(0x289));
+ WFIFOW(fd,0) = 0x289;
+ WFIFOL(fd,2) = sd->cashPoints;
+ WFIFOL(fd,6) = sd->kafraPoints;
+ WFIFOW(fd,10) = TOW(error);
+ WFIFOSET(fd, packet_len(0x289));
+}
+
void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)
{
int fail = 0, amount, points;
@@ -13154,12 +13181,7 @@ void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)
else
fail = npc_cashshop_buy(sd, nameid, amount, points);
- WFIFOHEAD(fd,12);
- WFIFOW(fd,0) = 0x289;
- WFIFOL(fd,2) = sd->cashPoints;
- WFIFOL(fd,6) = sd->kafraPoints;
- WFIFOW(fd,10) = fail;
- WFIFOSET(fd,12);
+ clif_cashshop_ack(sd, fail);
}
/*==========================================