Skip to content

Commit

Permalink
Fixed cash shop for 2011-11-22
Browse files Browse the repository at this point in the history
Special Thanks to Yommy, and M45T3R!

Signed-off-by: shennetsind <ind@henn.et>
  • Loading branch information
shennetsind committed May 16, 2013
1 parent 7f7ec56 commit cb9b70e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/common/mmo.h
@@ -1,5 +1,6 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams

#ifndef _MMO_H_
#define _MMO_H_
Expand Down Expand Up @@ -50,6 +51,9 @@
#define PACKETVER 20120418
#endif

/// uncomment if your client is NOT ragexeRE (required because of conflicting packets in ragexe vs ragexeRE)

This comment has been minimized.

Copy link
@shennetsind

shennetsind May 16, 2013

Author Member

ops. I meant comment :P will be fixed in a upcoming commit along with some other bug.

#define PACKETVER_RE

//Remove/Comment this line to disable sc_data saving. [Skotlex]
#define ENABLE_SC_SAVING
//Remove/Comment this line to disable server-side hot-key saving support [Skotlex]
Expand Down
22 changes: 21 additions & 1 deletion src/map/clif.c
Expand Up @@ -16869,7 +16869,27 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {

}
}
/* [Ind/Hercules] */
void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) {
short tab = RFIFOW(fd, 2);
int j;

if( tab < 0 || tab > CASHSHOP_TAB_MAX )
return;

WFIFOHEAD(fd, 10 + ( clif->cs.item_count[tab] * 6 ) );
WFIFOW(fd, 0) = 0x8c0;
WFIFOW(fd, 2) = 10 + ( clif->cs.item_count[tab] * 6 );
WFIFOL(fd, 4) = tab;
WFIFOW(fd, 8) = clif->cs.item_count[tab];

for( j = 0; j < clif->cs.item_count[tab]; j++ ) {
WFIFOW(fd, 10 + ( 6 * j ) ) = clif->cs.data[tab][j]->id;
WFIFOL(fd, 12 + ( 6 * j ) ) = clif->cs.data[tab][j]->price;
}

WFIFOSET(fd, 10 + ( clif->cs.item_count[tab] * 6 ));
}
/* [Ind/Hercules] */
void clif_maptypeproperty2(struct block_list *bl,enum send_target t) {
#if PACKETVER >= 20121010
Expand Down Expand Up @@ -16970,7 +16990,6 @@ int clif_parse(int fd) {
return 0;

cmd = RFIFOW(fd,0);

// filter out invalid / unsupported packets
if (cmd > MAX_PACKET_DB || packet_db[cmd].len == 0) {
ShowWarning("clif_parse: Received unsupported packet (packet 0x%04x, %d bytes received), disconnecting session #%d.\n", cmd, RFIFOREST(fd), fd);
Expand Down Expand Up @@ -17813,6 +17832,7 @@ void clif_defaults(void) {
/* RagExe Cash Shop [Ind/Hercules] */
clif->pCashShopOpen = clif_parse_CashShopOpen;
clif->pCashShopClose = clif_parse_CashShopClose;
clif->pCashShopReqTab = clif_parse_CashShopReqTab;
clif->pCashShopSchedule = clif_parse_CashShopSchedule;
clif->pCashShopBuy = clif_parse_CashShopBuy;
/* */
Expand Down
1 change: 1 addition & 0 deletions src/map/clif.h
Expand Up @@ -1081,6 +1081,7 @@ struct clif_interface {
/* RagExe Cash Shop [Ind/Hercules] */
void (*pCashShopOpen) (int fd, struct map_session_data *sd);
void (*pCashShopClose) (int fd, struct map_session_data *sd);
void (*pCashShopReqTab) (int fd, struct map_session_data *sd);
void (*pCashShopSchedule) (int fd, struct map_session_data *sd);
void (*pCashShopBuy) (int fd, struct map_session_data *sd);
void (*pPartyTick) (int fd, struct map_session_data *sd);
Expand Down
6 changes: 6 additions & 0 deletions src/map/packets.h
Expand Up @@ -1849,6 +1849,7 @@ packet(0x020d,-1);
#if PACKETVER >= 20110718
packet(0x0844,2,clif->pCashShopOpen,2);/* tell server cashshop window is being open */
packet(0x084a,2,clif->pCashShopClose,2);/* tell server cashshop window is being closed */
packet(0x0846,4,clif->pCashShopReqTab,2);
packet(0x08c9,2,clif->pCashShopSchedule,0);
packet(0x0848,-1,clif->pCashShopBuy,2);
#endif
Expand Down Expand Up @@ -1889,6 +1890,11 @@ packet(0x020d,-1);
packet(0x08ab,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
packet(0x088b,2,clif->pSearchStoreInfoNextPage,0);
packet(0x08a2,12,clif->pSearchStoreInfoListItemClick,2,6,10);
#ifndef PACKETVER_RE
packet(0x0835,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0892,5,clif->pWalkToXY,2);
packet(0x0899,6,clif->pTickSend,2);
#endif
#endif

//2012-03-07fRagexeRE
Expand Down

0 comments on commit cb9b70e

Please sign in to comment.