diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 12 | ||||
-rw-r--r-- | src/map/pc.c | 29 | ||||
-rw-r--r-- | src/map/pc.h | 1 |
3 files changed, 40 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 7721c4644..ca2a80693 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -6351,10 +6351,13 @@ void clif_vendinglist(struct map_session_data* sd, unsigned int id, struct s_ven const int offset = 12; #endif -#if PACKETVER >= 20150226 +#if PACKETVER < 20150226 + const int item_length = 22; +// [4144] date 20160921 not confirmend. Can be bigger or smaller +#elif PACKETVER < 20160921 const int item_length = 47; #else - const int item_length = 22; + const int item_length = 53; #endif nullpo_retv(sd); @@ -6387,6 +6390,11 @@ void clif_vendinglist(struct map_session_data* sd, unsigned int id, struct s_ven #if PACKETVER >= 20150226 clif->add_item_options(WFIFOP(fd, offset + 22 + i * item_length), &vsd->status.cart[index]); #endif +// [4144] date 20160921 not confirmend. Can be bigger or smaller +#if PACKETVER >= 20160921 + WFIFOL(fd, offset + 47 + i * item_length) = pc->item_equippoint(sd, data); + WFIFOW(fd, offset + 51 + i * item_length) = data->look; +#endif } WFIFOSET(fd,WFIFOW(fd,2)); } diff --git a/src/map/pc.c b/src/map/pc.c index 2303a83ca..c52da3c14 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -750,6 +750,7 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo return 0; } +// [4144] probably pc_equippoint should be replaced to pc_item_equippoint int pc_equippoint(struct map_session_data *sd,int n) { int ep = 0; @@ -782,6 +783,33 @@ int pc_equippoint(struct map_session_data *sd,int n) return ep; } +int pc_item_equippoint(struct map_session_data *sd, struct item_data* id) +{ + int ep = 0; + + nullpo_ret(sd); + nullpo_ret(id); + + if (!itemdb->isequip2(id)) + return 0; //Not equippable by players. + + ep = id->equip; + if (id->look == W_DAGGER || + id->look == W_1HSWORD || + id->look == W_1HAXE) { + if (pc->checkskill(sd, AS_LEFT) > 0 || + (sd->job & MAPID_UPPERMASK) == MAPID_ASSASSIN || + (sd->job & MAPID_UPPERMASK) == MAPID_KAGEROUOBORO) { + // Kagerou and Oboro can dual wield daggers. [Rytech] + if (ep == EQP_HAND_R) + return EQP_ARMS; + if (ep == EQP_SHADOW_WEAPON) + return EQP_SHADOW_ARMS; + } + } + return ep; +} + int pc_setinventorydata(struct map_session_data *sd) { int i; @@ -12044,6 +12072,7 @@ void pc_defaults(void) { pc->isequip = pc_isequip; pc->equippoint = pc_equippoint; + pc->item_equippoint = pc_item_equippoint; pc->setinventorydata = pc_setinventorydata; pc->checkskill = pc_checkskill; diff --git a/src/map/pc.h b/src/map/pc.h index af52f8946..634814f07 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -859,6 +859,7 @@ END_ZEROED_BLOCK; /* End */ int (*isequip) (struct map_session_data *sd,int n); int (*equippoint) (struct map_session_data *sd,int n); + int (*item_equippoint) (struct map_session_data *sd, struct item_data* id); int (*setinventorydata) (struct map_session_data *sd); int (*checkskill) (struct map_session_data *sd,uint16 skill_id); |