summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-10 19:34:51 -0200
committershennetsind <ind@henn.et>2014-02-10 19:34:51 -0200
commit90a2c005e8ec14e4af480dcf2e0dbb5112debfde (patch)
treeb0bd03448db3c3f539a46c65b17978d02c26c0bd
parent7baaf99a171e34c0a0820e5068e02055929d233b (diff)
downloadhercules-90a2c005e8ec14e4af480dcf2e0dbb5112debfde.tar.gz
hercules-90a2c005e8ec14e4af480dcf2e0dbb5112debfde.tar.bz2
hercules-90a2c005e8ec14e4af480dcf2e0dbb5112debfde.tar.xz
hercules-90a2c005e8ec14e4af480dcf2e0dbb5112debfde.zip
Fixed Bug 7993
Shadow Accs and Dual-Wielding fix, thanks to bgamez23 http://hercules.ws/board/tracker/issue-7993-shadow-system-bug-for-accessories/ Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r--src/map/pc.c37
-rw-r--r--src/map/pc.h2
2 files changed, 23 insertions, 16 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 6230ea634..3c0fca33a 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -645,11 +645,14 @@ int pc_equippoint(struct map_session_data *sd,int n)
if(sd->inventory_data[n]->look == W_DAGGER ||
sd->inventory_data[n]->look == W_1HSWORD ||
sd->inventory_data[n]->look == W_1HAXE) {
- if(ep == EQP_HAND_R && (pc->checkskill(sd,AS_LEFT) > 0 || (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN ||
- (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO))//Kagerou and Oboro can dual wield daggers. [Rytech]
- return EQP_ARMS;
- if( ep == EQP_SHADOW_SHIELD )/* are there conditions for those? */
- return EQP_SHADOW_WEAPON|EQP_SHADOW_SHIELD;
+ if( (pc->checkskill(sd,AS_LEFT) > 0 ||
+ (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN ||
+ (sd->class_&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;
}
@@ -8642,13 +8645,18 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
pos = req_pos&EQP_ACC;
if (pos == EQP_ACC) //User specified both slots..
pos = sd->equip_index[EQI_ACC_R] >= 0 ? EQP_ACC_L : EQP_ACC_R;
- }
-
- if(pos == EQP_ARMS && id->equip == EQP_HAND_R)
- { //Dual wield capable weapon.
+ } else if(pos == EQP_ARMS && id->equip == EQP_HAND_R) { //Dual wield capable weapon.
pos = (req_pos&EQP_ARMS);
if (pos == EQP_ARMS) //User specified both slots, pick one for them.
pos = sd->equip_index[EQI_HAND_R] >= 0 ? EQP_HAND_L : EQP_HAND_R;
+ } else if(pos == EQP_SHADOW_ACC) { //Accesories should only go in one of the two,
+ pos = req_pos&EQP_SHADOW_ACC;
+ if (pos == EQP_SHADOW_ACC) //User specified both slots..
+ pos = sd->equip_index[EQI_SHADOW_ACC_R] >= 0 ? EQP_SHADOW_ACC_L : EQP_SHADOW_ACC_R;
+ } else if( pos == EQP_SHADOW_ARMS && id->equip == EQP_SHADOW_WEAPON) { //Dual wield capable weapon.
+ pos = (req_pos&EQP_SHADOW_ARMS);
+ if (pos == EQP_SHADOW_ARMS) //User specified both slots, pick one for them.
+ pos = sd->equip_index[EQI_SHADOW_WEAPON] >= 0 ? EQP_SHADOW_SHIELD : EQP_SHADOW_WEAPON;
}
if (pos&EQP_HAND_R && battle_config.use_weapon_skill_range&BL_PC)
@@ -8678,7 +8686,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
sd->status.inventory[n].equip=pos;
- if(pos & EQP_HAND_R) {
+ if(pos & (EQP_HAND_R|EQP_SHADOW_WEAPON)) {
if(id)
sd->weapontype1 = id->look;
else
@@ -8686,19 +8694,16 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
pc->calcweapontype(sd);
clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
}
- if(pos & EQP_HAND_L) {
+ if(pos & (EQP_HAND_L|EQP_SHADOW_SHIELD)) {
if(id) {
if(id->type == IT_WEAPON) {
sd->status.shield = 0;
sd->weapontype2 = id->look;
- }
- else
- if(id->type == IT_ARMOR) {
+ } else if(id->type == IT_ARMOR) {
sd->status.shield = id->look;
sd->weapontype2 = 0;
}
- }
- else
+ } else
sd->status.shield = sd->weapontype2 = 0;
pc->calcweapontype(sd);
clif->changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
diff --git a/src/map/pc.h b/src/map/pc.h
index 30a24c00e..480dbd41a 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -577,6 +577,8 @@ enum equip_pos {
#define EQP_HELM (EQP_HEAD_LOW|EQP_HEAD_MID|EQP_HEAD_TOP)
#define EQP_ACC (EQP_ACC_L|EQP_ACC_R)
#define EQP_COSTUME (EQP_COSTUME_HEAD_TOP|EQP_COSTUME_HEAD_MID|EQP_COSTUME_HEAD_LOW|EQP_COSTUME_GARMENT)
+#define EQP_SHADOW_ACC (EQP_SHADOW_ACC_R|EQP_SHADOW_ACC_L)
+#define EQP_SHADOW_ARMS (EQP_SHADOW_WEAPON|EQP_SHADOW_SHIELD)
/// Equip positions that use a visible sprite
#if PACKETVER < 20110111