summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-09-05 00:07:08 +0200
committerHaru <haru@dotalux.com>2017-09-17 17:48:11 +0200
commita98b2d93f3727d18d8add5cb5c35830cbb171114 (patch)
tree39eda9621cf0a0f5f734a2d0d9360db3eeff73ff /src/map
parent00570591031eb6fc99c7c26ba58a2a7efb144e7f (diff)
downloadhercules-a98b2d93f3727d18d8add5cb5c35830cbb171114.tar.gz
hercules-a98b2d93f3727d18d8add5cb5c35830cbb171114.tar.bz2
hercules-a98b2d93f3727d18d8add5cb5c35830cbb171114.tar.xz
hercules-a98b2d93f3727d18d8add5cb5c35830cbb171114.zip
Split 'View' in two different fields in the item database
- The field was used both for sprite view IDs and for weapon or ammunition subtypes. Now the fields 'ViewSprite' and 'Subtype' are used respectively. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c9
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/itemdb.c43
-rw-r--r--src/map/itemdb.h6
-rw-r--r--src/map/pc.c105
-rw-r--r--src/map/script.c4
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.c2
8 files changed, 102 insertions, 73 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index b5ad62407..9d67242a2 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4575,8 +4575,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if(!skill_id) {
//Skills ALWAYS use ONLY your right-hand weapon (tested on Aegis 10.2)
- if (sd && sd->weapontype1 == 0 && sd->weapontype2 > 0)
- {
+ if (sd && sd->weapontype1 == W_FIST && sd->weapontype2 != W_FIST) {
flag.rh=0;
flag.lh=1;
}
@@ -6102,7 +6101,7 @@ bool battle_check_arrows(struct map_session_data *sd)
if (sd->inventory_data[index]) {
switch (sd->status.weapon) {
case W_BOW:
- if (sd->inventory_data[index]->look != A_ARROW) {
+ if (sd->inventory_data[index]->subtype != A_ARROW) {
clif->arrow_fail(sd, 0);
return false;
}
@@ -6111,13 +6110,13 @@ bool battle_check_arrows(struct map_session_data *sd)
case W_RIFLE:
case W_GATLING:
case W_SHOTGUN:
- if (sd->inventory_data[index]->look != A_BULLET) {
+ if (sd->inventory_data[index]->subtype != A_BULLET) {
clif->skill_fail(sd, 0, USESKILL_FAIL_NEED_MORE_BULLET, 0);
return false;
}
break;
case W_GRENADE:
- if (sd->inventory_data[index]->look != A_GRENADE) {
+ if (sd->inventory_data[index]->subtype != A_GRENADE) {
clif->skill_fail(sd, 0, USESKILL_FAIL_NEED_MORE_BULLET, 0);
return false;
}
diff --git a/src/map/clif.c b/src/map/clif.c
index 1731e88ca..3599640b9 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2597,7 +2597,7 @@ void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *it, struc
#endif
#if PACKETVER >= 20100629
- p->wItemSpriteNumber = (id->equip&EQP_VISIBLE) ? id->look : 0;
+ p->wItemSpriteNumber = (id->equip&EQP_VISIBLE) ? id->view_sprite : 0;
#endif
#if PACKETVER >= 20120925
@@ -3527,7 +3527,7 @@ void clif_equipitemack(struct map_session_data *sd,int n,int pos,enum e_EQUIP_IT
p.wearLocation = pos;
#if PACKETVER >= 20100629
if (result == EIA_SUCCESS && sd->inventory_data[n]->equip&EQP_VISIBLE)
- p.wItemSpriteNumber = sd->inventory_data[n]->look;
+ p.wItemSpriteNumber = sd->inventory_data[n]->view_sprite;
else
p.wItemSpriteNumber = 0;
#endif
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 2b0847e1a..40dd9ab4f 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -1638,9 +1638,9 @@ int itemdb_gendercheck(struct item_data *id)
return 1;
if (id->nameid == WEDDING_RING_F) //Bride Ring
return 0;
- if (id->look == W_MUSICAL && id->type == IT_WEAPON) //Musical instruments are always male-only
+ if (id->subtype == W_MUSICAL && id->type == IT_WEAPON) //Musical instruments are always male-only
return 1;
- if (id->look == W_WHIP && id->type == IT_WEAPON) //Whips are always female-only
+ if (id->subtype == W_WHIP && id->type == IT_WEAPON) //Whips are always female-only
return 0;
return (battle_config.ignore_items_gender) ? 2 : id->sex;
@@ -1788,10 +1788,14 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
memset(&entry->stack, '\0', sizeof(entry->stack));
}
- if (entry->type == IT_WEAPON && (entry->look < 0 || entry->look >= MAX_SINGLE_WEAPON_TYPE)) {
- ShowWarning("itemdb_validate_entry: Invalid View for weapon items. View value %d for item %d (%s) in '%s', defaulting to 1.\n",
- entry->look, entry->nameid, entry->jname, source);
- entry->look = 1;
+ if (entry->type == IT_WEAPON && (entry->subtype <= 0 || entry->subtype >= MAX_SINGLE_WEAPON_TYPE)) {
+ ShowWarning("itemdb_validate_entry: Invalid View for weapon items. View value %d for item %d (%s) in '%s', defaulting to W_DAGGER.\n",
+ entry->subtype, entry->nameid, entry->jname, source);
+ entry->subtype = W_DAGGER;
+ } else if (entry->type == IT_AMMO && (entry->subtype <= 0 || entry->subtype >= MAX_AMMO_TYPE)) {
+ ShowWarning("itemdb_validate_entry: Invalid View for ammunition items. View value %d for item %d (%s) in '%s', defaulting to A_ARROW.\n",
+ entry->subtype, entry->nameid, entry->jname, source);
+ entry->subtype = A_ARROW;
}
entry->wlv = cap_value(entry->wlv, REFINE_TYPE_ARMOR, REFINE_TYPE_MAX);
@@ -1986,6 +1990,14 @@ int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const char *
else if( !inherit )
id.type = IT_ETC;
+ if (itemdb->lookup_const(it, "Subtype", &i32) && i32 >= 0) {
+ if (id.type == IT_WEAPON || id.type == IT_AMMO)
+ id.subtype = i32;
+ else
+ ShowWarning("itemdb_readdb_libconfig_sub: Field 'Subtype' is only allowed for IT_WEAPON or IT_AMMO (Item #%d: %s). Ignoring.\n",
+ id.nameid, id.name);
+ }
+
if( itemdb->lookup_const(it, "Buy", &i32) )
id.value_buy = i32;
else if( !inherit )
@@ -2058,8 +2070,23 @@ int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const char *
if ((t = libconfig->setting_get_member(it, "DisableOptions")))
id.flag.no_options = libconfig->setting_get_bool(t) ? 1 : 0;
- if( itemdb->lookup_const(it, "View", &i32) && i32 >= 0 )
- id.look = i32;
+ if (itemdb->lookup_const(it, "ViewSprite", &i32) && i32 >= 0)
+ id.view_sprite = i32;
+
+ if (itemdb->lookup_const(it, "View", &i32) && i32 >= 0) { // TODO: Remove (Deprecated - 2016-09-04 [Haru])
+ if ((id.type == IT_WEAPON || id.type == IT_AMMO) && id.subtype == 0) {
+ ShowWarning("itemdb_readdb_libconfig_sub: The 'View' field is deprecated. Please rename it to 'Subtype' (or 'ViewSprite'). (Item #%d: %s)\n",
+ id.nameid, id.name);
+ id.subtype = i32;
+ } else if ((id.type != IT_WEAPON && id.type != IT_AMMO) && id.view_sprite == 0) {
+ ShowWarning("itemdb_readdb_libconfig_sub: The 'View' field is deprecated. Please rename it to 'ViewSprite' (or 'Subtype'). (Item #%d: %s)\n",
+ id.nameid, id.name);
+ id.view_sprite = i32;
+ } else {
+ ShowWarning("itemdb_readdb_libconfig_sub: The 'View' field is deprecated. Please rename it to 'Subtype' or 'ViewSprite'. (Item #%d: %s)\n",
+ id.nameid, id.name);
+ }
+ }
if( (t = libconfig->setting_get_member(it, "BindOnEquip")) )
id.flag.bindonequip = libconfig->setting_get_bool(t) ? 1 : 0;
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 0ab6ef65b..8a1799fbd 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -457,6 +457,7 @@ struct item_data {
int value_buy;
int value_sell;
int type;
+ int subtype;
int maxchance; //For logs, for external game info, for scripts: Max drop chance of this item (e.g. 0.01% , etc.. if it = 0, then monsters don't drop it, -1 denotes items sold in shops only) [Lupus]
int sex;
int equip;
@@ -465,7 +466,7 @@ struct item_data {
int def;
int range;
int slot;
- int look;
+ int view_sprite;
int elv;
int wlv;
int view_id;
@@ -521,7 +522,8 @@ struct item_data {
#define itemdb_type(n) (itemdb->search(n)->type)
#define itemdb_atk(n) (itemdb->search(n)->atk)
#define itemdb_def(n) (itemdb->search(n)->def)
-#define itemdb_look(n) (itemdb->search(n)->look)
+#define itemdb_subtype(n) (itemdb->search(n)->subtype)
+#define itemdb_sprite(n) (itemdb->search(n)->view_sprite)
#define itemdb_weight(n) (itemdb->search(n)->weight)
#define itemdb_equip(n) (itemdb->search(n)->equip)
#define itemdb_usescript(n) (itemdb->search(n)->script)
diff --git a/src/map/pc.c b/src/map/pc.c
index f332feea8..904867f76 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -765,9 +765,9 @@ int pc_equippoint(struct map_session_data *sd,int n)
return 0; //Not equippable by players.
ep = sd->inventory_data[n]->equip;
- if (sd->inventory_data[n]->look == W_DAGGER
- || sd->inventory_data[n]->look == W_1HSWORD
- || sd->inventory_data[n]->look == W_1HAXE
+ if (sd->inventory_data[n]->subtype == W_DAGGER
+ || sd->inventory_data[n]->subtype == W_1HSWORD
+ || sd->inventory_data[n]->subtype == W_1HAXE
) {
if (pc->checkskill(sd,AS_LEFT) > 0
|| (sd->job & MAPID_UPPERMASK) == MAPID_ASSASSIN
@@ -794,9 +794,9 @@ int pc_item_equippoint(struct map_session_data *sd, struct item_data* id)
return 0; //Not equippable by players.
ep = id->equip;
- if (id->look == W_DAGGER ||
- id->look == W_1HSWORD ||
- id->look == W_1HAXE) {
+ if (id->subtype == W_DAGGER ||
+ id->subtype == W_1HSWORD ||
+ id->subtype == W_1HAXE) {
if (pc->checkskill(sd, AS_LEFT) > 0 ||
(sd->job & MAPID_UPPERMASK) == MAPID_ASSASSIN ||
(sd->job & MAPID_UPPERMASK) == MAPID_KAGEROUOBORO) {
@@ -837,7 +837,7 @@ int pc_calcweapontype(struct map_session_data *sd)
return 1;
}
// dual-wield
- sd->status.weapon = 0;
+ sd->status.weapon = W_FIST;
switch (sd->weapontype1){
case W_DAGGER:
switch (sd->weapontype2) {
@@ -861,7 +861,7 @@ int pc_calcweapontype(struct map_session_data *sd)
}
}
// unknown, default to right hand type
- if (!sd->status.weapon)
+ if (sd->status.weapon == W_FIST)
sd->status.weapon = sd->weapontype1;
return 2;
@@ -884,20 +884,18 @@ int pc_setequipindex(struct map_session_data *sd)
if(sd->status.inventory[i].equip & pc->equip_pos[j])
sd->equip_index[j] = i;
- if(sd->status.inventory[i].equip & EQP_HAND_R)
- {
- if(sd->inventory_data[i])
- sd->weapontype1 = sd->inventory_data[i]->look;
+ if (sd->status.inventory[i].equip & EQP_HAND_R) {
+ if (sd->inventory_data[i])
+ sd->weapontype1 = sd->inventory_data[i]->subtype;
else
- sd->weapontype1 = 0;
+ sd->weapontype1 = W_FIST;
}
- if( sd->status.inventory[i].equip & EQP_HAND_L )
- {
- if( sd->inventory_data[i] && sd->inventory_data[i]->type == IT_WEAPON )
- sd->weapontype2 = sd->inventory_data[i]->look;
+ if (sd->status.inventory[i].equip & EQP_HAND_L) {
+ if (sd->inventory_data[i] != NULL && sd->inventory_data[i]->type == IT_WEAPON)
+ sd->weapontype2 = sd->inventory_data[i]->subtype;
else
- sd->weapontype2 = 0;
+ sd->weapontype2 = W_FIST;
}
}
}
@@ -1088,13 +1086,13 @@ int pc_isequip(struct map_session_data *sd,int n)
return 1; //Can equip all helms
if (sd->status.base_level > 96 && item->equip & EQP_ARMS && item->type == IT_WEAPON)
- switch(item->look) { //In weapons, the look determines type of weapon.
- case W_DAGGER: //Level 4 Knives are equippable.. this means all knives, I'd guess?
- case W_1HSWORD: //All 1H swords
- case W_1HAXE: //All 1H Axes
- case W_MACE: //All 1H Maces
- case W_STAFF: //All 1H Staves
- return 1;
+ switch (item->subtype) { //In weapons, the look determines type of weapon.
+ case W_DAGGER: //Level 4 Knives are equippable.. this means all knives, I'd guess?
+ case W_1HSWORD: //All 1H swords
+ case W_1HAXE: //All 1H Axes
+ case W_MACE: //All 1H Maces
+ case W_STAFF: //All 1H Staves
+ return 1;
}
}
}
@@ -5942,7 +5940,7 @@ int pc_checkallowskill(struct map_session_data *sd)
status_change_end(&sd->bl, scw_list[i], INVALID_TIMER);
}
- if(sd->sc.data[SC_STRUP] && sd->status.weapon)
+ if(sd->sc.data[SC_STRUP] && sd->status.weapon != W_FIST)
// Spurt requires bare hands (feet, in fact xD)
status_change_end(&sd->bl, SC_STRUP, INVALID_TIMER);
@@ -9757,25 +9755,27 @@ void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n,
nullpo_retv(sd);
if ((!map_no_view(sd->bl.m,EQP_SHADOW_WEAPON) && pos & EQP_SHADOW_WEAPON) ||
(pos & EQP_HAND_R)) {
- if(id)
- sd->weapontype1 = id->look;
+ if (id != NULL)
+ sd->weapontype1 = id->subtype;
else
- sd->weapontype1 = 0;
+ sd->weapontype1 = W_FIST;
pc->calcweapontype(sd);
clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
}
if ((!map_no_view(sd->bl.m,EQP_SHADOW_SHIELD) && pos & EQP_SHADOW_SHIELD) ||
(pos & EQP_HAND_L)) {
- if (id) {
- if(id->type == IT_WEAPON) {
+ if (id != NULL) {
+ if (id->type == IT_WEAPON) {
sd->status.shield = 0;
- sd->weapontype2 = id->look;
- } else if(id->type == IT_ARMOR) {
- sd->status.shield = id->look;
- sd->weapontype2 = 0;
+ sd->weapontype2 = id->subtype;
+ } else if (id->type == IT_ARMOR) {
+ sd->status.shield = id->view_sprite;
+ sd->weapontype2 = W_FIST;
}
- } else
- sd->status.shield = sd->weapontype2 = 0;
+ } else {
+ sd->status.shield = 0;
+ sd->weapontype2 = W_FIST;
+ }
pc->calcweapontype(sd);
clif->changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
}
@@ -9783,42 +9783,42 @@ void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n,
//causes client to redraw item on top of itself. (suggested by Lupus)
if (!map_no_view(sd->bl.m,EQP_HEAD_LOW) && pos & EQP_HEAD_LOW && pc->checkequip(sd,EQP_COSTUME_HEAD_LOW) == -1) {
if (id && !(pos&(EQP_HEAD_TOP|EQP_HEAD_MID)))
- sd->status.head_bottom = id->look;
+ sd->status.head_bottom = id->view_sprite;
else
sd->status.head_bottom = 0;
clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
if (!map_no_view(sd->bl.m,EQP_HEAD_TOP) && pos & EQP_HEAD_TOP && pc->checkequip(sd,EQP_COSTUME_HEAD_TOP) == -1) {
if (id)
- sd->status.head_top = id->look;
+ sd->status.head_top = id->view_sprite;
else
sd->status.head_top = 0;
clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
if (!map_no_view(sd->bl.m,EQP_HEAD_MID) && pos & EQP_HEAD_MID && pc->checkequip(sd,EQP_COSTUME_HEAD_MID) == -1) {
if (id && !(pos&EQP_HEAD_TOP))
- sd->status.head_mid = id->look;
+ sd->status.head_mid = id->view_sprite;
else
sd->status.head_mid = 0;
clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
if (!map_no_view(sd->bl.m,EQP_COSTUME_HEAD_TOP) && pos & EQP_COSTUME_HEAD_TOP) {
if (id){
- sd->status.head_top = id->look;
+ sd->status.head_top = id->view_sprite;
} else
sd->status.head_top = 0;
clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
if (!map_no_view(sd->bl.m,EQP_COSTUME_HEAD_MID) && pos & EQP_COSTUME_HEAD_MID) {
if(id && !(pos&EQP_HEAD_TOP)){
- sd->status.head_mid = id->look;
+ sd->status.head_mid = id->view_sprite;
} else
sd->status.head_mid = 0;
clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
if (!map_no_view(sd->bl.m,EQP_COSTUME_HEAD_LOW) && pos & EQP_COSTUME_HEAD_LOW) {
if (id && !(pos&(EQP_HEAD_TOP|EQP_HEAD_MID))){
- sd->status.head_bottom = id->look;
+ sd->status.head_bottom = id->view_sprite;
} else
sd->status.head_bottom = 0;
clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
@@ -9827,12 +9827,12 @@ void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n,
if (!map_no_view(sd->bl.m,EQP_SHOES) && pos & EQP_SHOES)
clif->changelook(&sd->bl,LOOK_SHOES,0);
if (!map_no_view(sd->bl.m,EQP_GARMENT) && pos&EQP_GARMENT && pc->checkequip(sd,EQP_COSTUME_GARMENT) == -1) {
- sd->status.robe = id ? id->look : 0;
+ sd->status.robe = id ? id->view_sprite : 0;
clif->changelook(&sd->bl, LOOK_ROBE, sd->status.robe);
}
if (!map_no_view(sd->bl.m,EQP_COSTUME_GARMENT) && pos & EQP_COSTUME_GARMENT) {
- sd->status.robe = id ? id->look : 0;
+ sd->status.robe = id ? id->view_sprite : 0;
clif->changelook(&sd->bl,LOOK_ROBE,sd->status.robe);
}
}
@@ -9987,7 +9987,7 @@ void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
{
nullpo_retv(sd);
if (pos & EQP_HAND_R) {
- sd->weapontype1 = 0;
+ sd->weapontype1 = W_FIST;
sd->status.weapon = sd->weapontype2;
pc->calcweapontype(sd);
clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
@@ -9995,7 +9995,8 @@ void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
status_change_end(&sd->bl, SC_DANCING, INVALID_TIMER); // Unequipping => stop dancing.
}
if (pos & EQP_HAND_L) {
- sd->status.shield = sd->weapontype2 = 0;
+ sd->status.shield = 0;
+ sd->weapontype2 = W_FIST;
pc->calcweapontype(sd);
clif->changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
}
@@ -10013,17 +10014,17 @@ void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
}
if (pos & EQP_COSTUME_HEAD_TOP) {
- sd->status.head_top = ( pc->checkequip(sd,EQP_HEAD_TOP) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_HEAD_TOP)]->look : 0;
+ sd->status.head_top = ( pc->checkequip(sd,EQP_HEAD_TOP) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_HEAD_TOP)]->view_sprite : 0;
clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
if (pos & EQP_COSTUME_HEAD_MID) {
- sd->status.head_mid = ( pc->checkequip(sd,EQP_HEAD_MID) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_HEAD_MID)]->look : 0;
+ sd->status.head_mid = ( pc->checkequip(sd,EQP_HEAD_MID) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_HEAD_MID)]->view_sprite : 0;
clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
if (pos & EQP_COSTUME_HEAD_LOW) {
- sd->status.head_bottom = ( pc->checkequip(sd,EQP_HEAD_LOW) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_HEAD_LOW)]->look : 0;
+ sd->status.head_bottom = ( pc->checkequip(sd,EQP_HEAD_LOW) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_HEAD_LOW)]->view_sprite : 0;
clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
@@ -10036,7 +10037,7 @@ void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
}
if (pos & EQP_COSTUME_GARMENT) {
- sd->status.robe = ( pc->checkequip(sd,EQP_GARMENT) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_GARMENT)]->look : 0;
+ sd->status.robe = ( pc->checkequip(sd,EQP_GARMENT) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_GARMENT)]->view_sprite : 0;
clif->changelook(&sd->bl,LOOK_ROBE,sd->status.robe);
}
}
@@ -10091,7 +10092,7 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
clif->unequipitemack(sd, n, pos, UIA_SUCCESS);
if ((pos & EQP_ARMS) &&
- sd->weapontype1 == 0 && sd->weapontype2 == 0 && (sd->sc.data[SC_TK_SEVENWIND] == 0 || sd->sc.data[SC_ASPERSIO])) //Check for seven wind (but not level seven!)
+ sd->weapontype1 == W_FIST && sd->weapontype2 == W_FIST && (sd->sc.data[SC_TK_SEVENWIND] == NULL || sd->sc.data[SC_ASPERSIO] != NULL)) //Check for seven wind (but not level seven!)
skill->enchant_elemental_end(&sd->bl, -1);
if (pos & EQP_ARMOR) {
diff --git a/src/map/script.c b/src/map/script.c
index 914bee75c..a919467cf 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -14034,7 +14034,7 @@ BUILDIN(getiteminfo)
script_pushint(st, it->slot);
break;
case 11:
- script_pushint(st, it->look);
+ script_pushint(st, it->subtype);
break;
case 12:
script_pushint(st, it->elv);
@@ -14287,7 +14287,7 @@ BUILDIN(setiteminfo)
it->slot = value;
break;
case 11:
- it->look = value;
+ it->subtype = value;
break;
case 12:
it->elv = value;
diff --git a/src/map/skill.c b/src/map/skill.c
index e187b7e8b..1f510e6fe 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -14555,7 +14555,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
clif->messagecolor_self(sd->fd, COLOR_RED, e_msg);
return 0;
}
- if (!(require.ammo&1<<sd->inventory_data[i]->look)) { //Ammo type check. Send the "wrong weapon type" message
+ if (!(require.ammo&1<<sd->inventory_data[i]->subtype)) { //Ammo type check. Send the "wrong weapon type" message
//which is the closest we have to wrong ammo type. [Skotlex]
clif->arrow_fail(sd,0); //Haplo suggested we just send the equip-arrows message instead. [Skotlex]
//clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);
diff --git a/src/map/status.c b/src/map/status.c
index c98857736..0d2171eac 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -10747,7 +10747,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
}
if (begin_spurt && sce->val1 >= 7
&& DIFF_TICK(timer->gettick(), starttick) <= 1000
- && (!sd || (sd->weapontype1 == 0 && sd->weapontype2 == 0))
+ && (!sd || (sd->weapontype1 == W_FIST && sd->weapontype2 == W_FIST))
)
sc_start(bl, bl,SC_STRUP,100,sce->val1,skill->get_time2(status->sc2skill(type), sce->val1));
}