Changed ItemTypes to ItemUseTypes

This commit is contained in:
Uleat 2013-10-27 09:04:52 -04:00
parent 0d5fc26841
commit 3e6be197e6
15 changed files with 186 additions and 150 deletions

View File

@ -13,6 +13,7 @@ Uleat: Moved DeityTypes enumeration from eq_constants.h to deity.h (expanded uti
Uleat: Changed ItemUseType to ItemInstTypes to better reflect the definition (also to free-up the namespace) Uleat: Changed ItemUseType to ItemInstTypes to better reflect the definition (also to free-up the namespace)
Uleat: Changed ItemClass to ItemClassTypes Uleat: Changed ItemClass to ItemClassTypes
Uleat: Converted MATERIAL defines to MaterialUseSlots enumeration - use of scripted 'Bracer' and 'Max' are deprecated Uleat: Converted MATERIAL defines to MaterialUseSlots enumeration - use of scripted 'Bracer' and 'Max' are deprecated
Uleat: Changed ItemTypes to ItemUseTypes - retained the 'ItemType' prefix to avoid too much confusion. Also adopted the '1H Piercing' model found in later clients
== 10/24/2013 == == 10/24/2013 ==
demonstar55: Fix some memory leaks in Mob::SpellOnTarget demonstar55: Fix some memory leaks in Mob::SpellOnTarget

View File

@ -340,8 +340,8 @@ bool ItemInst::IsAmmo() const {
if(!m_item) return false; if(!m_item) return false;
if((m_item->ItemType == ItemTypeArrow) || if((m_item->ItemType == ItemTypeArrow) ||
(m_item->ItemType == ItemTypeThrowing) || (m_item->ItemType == ItemTypeLargeThrowing) ||
(m_item->ItemType == ItemTypeThrowingv2)) (m_item->ItemType == ItemTypeSmallThrowing))
return true; return true;
return false; return false;
@ -1863,7 +1863,7 @@ bool Inventory::CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_S
if((Container->BagType == BagTypeQuiver) && (ItemToTry->ItemType != ItemTypeArrow)) return false; if((Container->BagType == BagTypeQuiver) && (ItemToTry->ItemType != ItemTypeArrow)) return false;
if((Container->BagType == BagTypeBandolier) && (ItemToTry->ItemType != ItemTypeThrowingv2)) return false; if((Container->BagType == BagTypeBandolier) && (ItemToTry->ItemType != ItemTypeSmallThrowing)) return false;
return true; return true;
} }

View File

@ -50,56 +50,91 @@ enum ItemClassTypes
}; };
/* /*
** Item uses ** Item use types
** **
** (ref: database and eqstr_us.txt)
**
** (Looking at a recent database, it's possible that some of the item values may be off [10-27-2013] -U)
*/ */
enum ItemTypes enum ItemUseTypes : uint8
{ {
ItemType1HS = 0, /*9138*/ ItemType1HSlash = 0,
ItemType2HS = 1, /*9141*/ ItemType2HSlash,
ItemTypePierce = 2, /*9140*/ ItemType1HPiercing,
ItemType1HB = 3, /*9139*/ ItemType1HBlunt,
ItemType2HB = 4, /*9142*/ ItemType2HBlunt,
ItemTypeBow = 5, /*5504*/ ItemTypeBow,
//6 /*----*/ ItemTypeUnknown1,
ItemTypeThrowing = 7, /*----*/ ItemTypeLargeThrowing,
ItemTypeShield = 8, /*5505*/ ItemTypeShield,
//9 /*5506*/ ItemTypeScroll,
ItemTypeArmor = 10, /*5507*/ ItemTypeArmor,
ItemTypeUnknon = 11, //A lot of random crap has this item use. /*5508*/ ItemTypeMisc, // a lot of random crap has this item use.
ItemTypeLockPick = 12, /*7564*/ ItemTypeLockPick,
ItemTypeFood = 14, /*----*/ ItemTypeUnknown2,
ItemTypeDrink = 15, /*5509*/ ItemTypeFood,
ItemTypeLightSource = 16, /*5510*/ ItemTypeDrink,
ItemTypeStackable = 17, //Not all stackable items are this use... /*5511*/ ItemTypeLight,
ItemTypeBandage = 18, /*5512*/ ItemTypeCombinable, // not all stackable items are this use...
ItemTypeThrowingv2 = 19, /*5513*/ ItemTypeBandage,
ItemTypeSpell = 20, //spells and tomes /*----*/ ItemTypeSmallThrowing,
ItemTypePotion = 21, /*----*/ ItemTypeSpell, // spells and tomes
ItemTypeWindInstr = 23, /*5514*/ ItemTypePotion,
ItemTypeStringInstr = 24, /*----*/ ItemTypeUnknown3,
ItemTypeBrassInstr = 25, /*0406*/ ItemTypeWindInstrument,
ItemTypeDrumInstr = 26, /*0407*/ ItemTypeStringedInstrument,
ItemTypeArrow = 27, /*0408*/ ItemTypeBrassInstrument,
ItemTypeJewlery = 29, /*0405*/ ItemTypePercussionInstrument,
ItemTypeSkull = 30, /*5515*/ ItemTypeArrow,
ItemTypeTome = 31, /*----*/ ItemTypeUnknown4,
ItemTypeNote = 32, /*5521*/ ItemTypeJewelry,
ItemTypeKey = 33, /*----*/ ItemTypeSkull,
ItemTypeCoin = 34, /*5516*/ ItemTypeBook, // skill-up tomes/books? (would probably need a pp flag if true...)
ItemType2HPierce = 35, /*5517*/ ItemTypeNote,
ItemTypeFishingPole = 36, /*5518*/ ItemTypeKey,
ItemTypeFishingBait = 37, /*----*/ ItemTypeCoin,
ItemTypeAlcohol = 38, /*5520*/ ItemType2HPiercing,
ItemTypeCompass = 40, /*----*/ ItemTypeFishingPole,
ItemTypePoison = 42, //might be wrong, but includes poisons /*----*/ ItemTypeFishingBait,
ItemTypeHand2Hand = 45, /*5519*/ ItemTypeAlcohol,
ItemUseSinging = 50, /*----*/ ItemTypeKey2, // keys and satchels?? (questable keys?)
ItemUseAllInstruments = 51, /*----*/ ItemTypeCompass,
ItemTypeCharm = 52, /*----*/ ItemTypeUnknown5,
ItemTypeAugment = 54, /*----*/ ItemTypePoison, // might be wrong, but includes poisons
ItemTypeAugmentSolvent = 55, /*----*/ ItemTypeUnknown6,
ItemTypeAugmentDistill = 56 /*----*/ ItemTypeUnknown7,
/*5522*/ ItemTypeMartial,
/*----*/ ItemTypeUnknown8,
/*----*/ ItemTypeUnknown9,
/*----*/ ItemTypeUnknown10,
/*----*/ ItemTypeUnknown11,
/*----*/ ItemTypeSinging,
/*5750*/ ItemTypeAllInstrumentTypes,
/*5776*/ ItemTypeCharm,
/*----*/ ItemTypeDye,
/*----*/ ItemTypeAugmentation,
/*----*/ ItemTypeAugmentationSolvent,
/*----*/ ItemTypeAugmentationDistiller,
/*----*/ ItemTypeUnknown12,
/*----*/ ItemTypeFellowshipKit,
/*----*/ ItemTypeUnknown13,
/*----*/ ItemTypeRecipe,
/*----*/ ItemTypeAdvancedRecipe,
/*----*/ ItemTypeJournal, // only one(1) database entry
/*----*/ ItemTypeAltCurrency, // alt-currency (as opposed to coinage)
/*5881*/ ItemTypePerfectedAugmentationDistiller,
/*----*/ _ItemTypeCount
/*
Unknowns:
Mounts?
Ornamentations?
GuildBanners?
Collectible?
Placeable?
(others?)
*/
}; };
/* /*

View File

@ -846,9 +846,9 @@ void Client::AI_Process()
if (ExtraAttackChanceBonus && GetTarget()) { if (ExtraAttackChanceBonus && GetTarget()) {
ItemInst *wpn = GetInv().GetItem(SLOT_PRIMARY); ItemInst *wpn = GetInv().GetItem(SLOT_PRIMARY);
if(wpn){ if(wpn){
if(wpn->GetItem()->ItemType == ItemType2HS || if(wpn->GetItem()->ItemType == ItemType2HSlash ||
wpn->GetItem()->ItemType == ItemType2HB || wpn->GetItem()->ItemType == ItemType2HBlunt ||
wpn->GetItem()->ItemType == ItemType2HPierce ) wpn->GetItem()->ItemType == ItemType2HPiercing )
{ {
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus) if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
{ {

View File

@ -64,43 +64,43 @@ bool Mob::AttackAnimation(SkillType &skillinuse, int Hand, const ItemInst* weapo
#endif #endif
switch (item->ItemType) switch (item->ItemType)
{ {
case ItemType1HS: // 1H Slashing case ItemType1HSlash: // 1H Slashing
{ {
skillinuse = _1H_SLASHING; skillinuse = _1H_SLASHING;
type = anim1HWeapon; type = anim1HWeapon;
break; break;
} }
case ItemType2HS: // 2H Slashing case ItemType2HSlash: // 2H Slashing
{ {
skillinuse = _2H_SLASHING; skillinuse = _2H_SLASHING;
type = anim2HSlashing; type = anim2HSlashing;
break; break;
} }
case ItemTypePierce: // Piercing case ItemType1HPiercing: // Piercing
{ {
skillinuse = PIERCING; skillinuse = PIERCING;
type = animPiercing; type = animPiercing;
break; break;
} }
case ItemType1HB: // 1H Blunt case ItemType1HBlunt: // 1H Blunt
{ {
skillinuse = _1H_BLUNT; skillinuse = _1H_BLUNT;
type = anim1HWeapon; type = anim1HWeapon;
break; break;
} }
case ItemType2HB: // 2H Blunt case ItemType2HBlunt: // 2H Blunt
{ {
skillinuse = _2H_BLUNT; skillinuse = _2H_BLUNT;
type = anim2HWeapon; type = anim2HWeapon;
break; break;
} }
case ItemType2HPierce: // 2H Piercing case ItemType2HPiercing: // 2H Piercing
{ {
skillinuse = PIERCING; skillinuse = PIERCING;
type = anim2HWeapon; type = anim2HWeapon;
break; break;
} }
case ItemTypeHand2Hand: case ItemTypeMartial:
{ {
skillinuse = HAND_TO_HAND; skillinuse = HAND_TO_HAND;
type = animHand2Hand; type = animHand2Hand;
@ -465,7 +465,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
if(equiped2) { if(equiped2) {
uint8 TwoHandBlunt = CastToClient()->m_inv.GetItem(13)->GetItem()->ItemType; uint8 TwoHandBlunt = CastToClient()->m_inv.GetItem(13)->GetItem()->ItemType;
float bonusStaffBlock = 0.0f; float bonusStaffBlock = 0.0f;
if(TwoHandBlunt == ItemType2HB) { if(TwoHandBlunt == ItemType2HBlunt) {
bonusStaffBlock = aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock; bonusStaffBlock = aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock;
RollTable[1] += bonusStaffBlock; RollTable[1] += bonusStaffBlock;
@ -1771,27 +1771,27 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
} }
switch(weapon->ItemType){ switch(weapon->ItemType){
case ItemType1HS: case ItemType1HSlash:
skillinuse = _1H_SLASHING; skillinuse = _1H_SLASHING;
break; break;
case ItemType2HS: case ItemType2HSlash:
skillinuse = _2H_SLASHING; skillinuse = _2H_SLASHING;
break; break;
case ItemTypePierce: case ItemType1HPiercing:
case ItemType2HPierce: case ItemType2HPiercing:
skillinuse = PIERCING; skillinuse = PIERCING;
break; break;
case ItemType1HB: case ItemType1HBlunt:
skillinuse = _1H_BLUNT; skillinuse = _1H_BLUNT;
break; break;
case ItemType2HB: case ItemType2HBlunt:
skillinuse = _2H_BLUNT; skillinuse = _2H_BLUNT;
break; break;
case ItemTypeBow: case ItemTypeBow:
skillinuse = ARCHERY; skillinuse = ARCHERY;
break; break;
case ItemTypeThrowing: case ItemTypeLargeThrowing:
case ItemTypeThrowingv2: case ItemTypeSmallThrowing:
skillinuse = THROWING; skillinuse = THROWING;
break; break;
default: default:
@ -2650,7 +2650,7 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon )
// Assert: This function should not be called unless the player is a melee class, as casters do not receive a damage bonus. // Assert: This function should not be called unless the player is a melee class, as casters do not receive a damage bonus.
if( Weapon == nullptr || Weapon->ItemType == ItemType1HS || Weapon->ItemType == ItemType1HB || Weapon->ItemType == ItemTypeHand2Hand || Weapon->ItemType == ItemTypePierce ) if( Weapon == nullptr || Weapon->ItemType == ItemType1HSlash || Weapon->ItemType == ItemType1HBlunt || Weapon->ItemType == ItemTypeMartial || Weapon->ItemType == ItemType1HPiercing )
{ {
// The weapon in the player's main (primary) hand is a one-handed weapon, or there is no item equipped at all. // The weapon in the player's main (primary) hand is a one-handed weapon, or there is no item equipped at all.
// //
@ -3935,7 +3935,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct* weapon, Mob *on
bool bRangedAttack = false; bool bRangedAttack = false;
if (weapon != nullptr) { if (weapon != nullptr) {
if (weapon->ItemType == ItemTypeBow || weapon->ItemType == ItemTypeThrowing || weapon->ItemType == ItemTypeThrowingv2) { if (weapon->ItemType == ItemTypeBow || weapon->ItemType == ItemTypeLargeThrowing || weapon->ItemType == ItemTypeSmallThrowing) {
bRangedAttack = true; bRangedAttack = true;
} }
} }
@ -3944,8 +3944,8 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct* weapon, Mob *on
if(weapon) if(weapon)
{ {
if(weapon->ItemType == ItemTypeArrow || if(weapon->ItemType == ItemTypeArrow ||
weapon->ItemType == ItemTypeThrowing || weapon->ItemType == ItemTypeLargeThrowing ||
weapon->ItemType == ItemTypeThrowingv2 || weapon->ItemType == ItemTypeSmallThrowing ||
weapon->ItemType == ItemTypeBow) weapon->ItemType == ItemTypeBow)
{ {
isRanged = true; isRanged = true;

View File

@ -1302,37 +1302,37 @@ uint16 Bot::GetPrimarySkillValue()
uint8 type = m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType; //is this the best way to do this? uint8 type = m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType; //is this the best way to do this?
switch(type) switch(type)
{ {
case ItemType1HS: // 1H Slashing case ItemType1HSlash: // 1H Slashing
{ {
skill = _1H_SLASHING; skill = _1H_SLASHING;
break; break;
} }
case ItemType2HS: // 2H Slashing case ItemType2HSlash: // 2H Slashing
{ {
skill = _2H_SLASHING; skill = _2H_SLASHING;
break; break;
} }
case ItemTypePierce: // Piercing case ItemType1HPiercing: // Piercing
{ {
skill = PIERCING; skill = PIERCING;
break; break;
} }
case ItemType1HB: // 1H Blunt case ItemType1HBlunt: // 1H Blunt
{ {
skill = _1H_BLUNT; skill = _1H_BLUNT;
break; break;
} }
case ItemType2HB: // 2H Blunt case ItemType2HBlunt: // 2H Blunt
{ {
skill = _2H_BLUNT; skill = _2H_BLUNT;
break; break;
} }
case ItemType2HPierce: // 2H Piercing case ItemType2HPiercing: // 2H Piercing
{ {
skill = PIERCING; skill = PIERCING;
break; break;
} }
case ItemTypeHand2Hand: // Hand to Hand case ItemTypeMartial: // Hand to Hand
{ {
skill = HAND_TO_HAND; skill = HAND_TO_HAND;
break; break;
@ -3802,9 +3802,9 @@ void Bot::AI_Process() {
if (GetTarget() && ExtraAttackChanceBonus) { if (GetTarget() && ExtraAttackChanceBonus) {
ItemInst *wpn = GetBotItem(SLOT_PRIMARY); ItemInst *wpn = GetBotItem(SLOT_PRIMARY);
if(wpn){ if(wpn){
if(wpn->GetItem()->ItemType == ItemType2HS || if(wpn->GetItem()->ItemType == ItemType2HSlash ||
wpn->GetItem()->ItemType == ItemType2HB || wpn->GetItem()->ItemType == ItemType2HBlunt ||
wpn->GetItem()->ItemType == ItemType2HPierce ) wpn->GetItem()->ItemType == ItemType2HPiercing )
{ {
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus) if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
{ {
@ -3843,7 +3843,7 @@ void Bot::AI_Process() {
bIsFist = false; bIsFist = false;
} }
if(bIsFist || ((weapontype != ItemType2HS) && (weapontype != ItemType2HPierce) && (weapontype != ItemType2HB))) { if(bIsFist || ((weapontype != ItemType2HSlash) && (weapontype != ItemType2HPiercing) && (weapontype != ItemType2HBlunt))) {
float DualWieldProbability = 0.0f; float DualWieldProbability = 0.0f;
int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity; int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
@ -6039,9 +6039,9 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
how_many_slots++; how_many_slots++;
if(!GetBotItem(j)) { if(!GetBotItem(j)) {
if(j == SLOT_PRIMARY) { if(j == SLOT_PRIMARY) {
if((mWeaponItem->ItemType == ItemType2HS) || (mWeaponItem->ItemType == ItemType2HB) || (mWeaponItem->ItemType == ItemType2HPierce)) { if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if(GetBotItem(SLOT_SECONDARY)) { if(GetBotItem(SLOT_SECONDARY)) {
if(mWeaponItem && (mWeaponItem->ItemType == ItemType2HS) || (mWeaponItem->ItemType == ItemType2HB) || (mWeaponItem->ItemType == ItemType2HPierce)) { if(mWeaponItem && (mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if(client->CheckLoreConflict(GetBotItem(SLOT_SECONDARY)->GetItem())) { if(client->CheckLoreConflict(GetBotItem(SLOT_SECONDARY)->GetItem())) {
failedLoreCheck = true; failedLoreCheck = true;
} }
@ -6076,7 +6076,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
if(success) { if(success) {
if(GetBotItem(SLOT_PRIMARY)) { if(GetBotItem(SLOT_PRIMARY)) {
ItemInst* remove_item = GetBotItem(SLOT_PRIMARY); ItemInst* remove_item = GetBotItem(SLOT_PRIMARY);
if((remove_item->GetItem()->ItemType == ItemType2HS) || (remove_item->GetItem()->ItemType == ItemType2HB) || (remove_item->GetItem()->ItemType == ItemType2HPierce)) { if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) {
BotTradeSwapItem(client, SLOT_PRIMARY, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); BotTradeSwapItem(client, SLOT_PRIMARY, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
} }
} }
@ -6110,7 +6110,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
} }
if(!failedLoreCheck) { if(!failedLoreCheck) {
if(j == SLOT_PRIMARY) { if(j == SLOT_PRIMARY) {
if((mWeaponItem->ItemType == ItemType2HS) || (mWeaponItem->ItemType == ItemType2HB) || (mWeaponItem->ItemType == ItemType2HPierce)) { if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if(GetBotItem(SLOT_SECONDARY)) { if(GetBotItem(SLOT_SECONDARY)) {
if(client->CheckLoreConflict(GetBotItem(SLOT_SECONDARY)->GetItem())) { if(client->CheckLoreConflict(GetBotItem(SLOT_SECONDARY)->GetItem())) {
failedLoreCheck = true; failedLoreCheck = true;
@ -6144,7 +6144,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
} }
if(success && GetBotItem(SLOT_PRIMARY)) { if(success && GetBotItem(SLOT_PRIMARY)) {
ItemInst* remove_item = GetBotItem(SLOT_PRIMARY); ItemInst* remove_item = GetBotItem(SLOT_PRIMARY);
if((remove_item->GetItem()->ItemType == ItemType2HS) || (remove_item->GetItem()->ItemType == ItemType2HB) || (remove_item->GetItem()->ItemType == ItemType2HPierce)) { if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) {
BotTradeSwapItem(client, SLOT_PRIMARY, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); BotTradeSwapItem(client, SLOT_PRIMARY, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
} }
} }
@ -7897,7 +7897,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
if(equiped2) { if(equiped2) {
uint8 TwoHandBlunt = GetBotItem(SLOT_PRIMARY)->GetItem()->ItemType; uint8 TwoHandBlunt = GetBotItem(SLOT_PRIMARY)->GetItem()->ItemType;
float bonusStaffBlock = 0.0f; float bonusStaffBlock = 0.0f;
if(TwoHandBlunt == ItemType2HB) { if(TwoHandBlunt == ItemType2HBlunt) {
bonusStaffBlock = aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock; bonusStaffBlock = aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock;
RollTable[1] = RollTable[0] + bonusStaffBlock; RollTable[1] = RollTable[0] + bonusStaffBlock;
@ -8138,7 +8138,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
const Item_Struct* botpiercer = nullptr; const Item_Struct* botpiercer = nullptr;
if(inst) if(inst)
botpiercer = inst->GetItem(); botpiercer = inst->GetItem();
if(!botpiercer || (botpiercer->ItemType != ItemTypePierce)) { if(!botpiercer || (botpiercer->ItemType != ItemType1HPiercing)) {
Say("I can't backstab with this weapon!"); Say("I can't backstab with this weapon!");
return; return;
} }
@ -8381,9 +8381,9 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
bool canBash = false; bool canBash = false;
if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) // Racial Slam if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) // Racial Slam
|| (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield || (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield
|| (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HS || (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HSlash
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HB || m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HBlunt
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPierce) || m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPiercing)
&& GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash && GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash
canBash = true; canBash = true;
} }
@ -8408,9 +8408,9 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
if(level >= RuleI(Combat, NPCBashKickLevel)){ if(level >= RuleI(Combat, NPCBashKickLevel)){
if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) // Racial Slam if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) // Racial Slam
|| (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield || (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield
|| (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HS || (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HSlash
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HB || m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HBlunt
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPierce) || m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPiercing)
&& GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash && GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash
skill_to_use = BASH; skill_to_use = BASH;
} }
@ -9027,9 +9027,9 @@ void Bot::SetAttackTimer() {
//if we have a 2H weapon in our main hand, no dual //if we have a 2H weapon in our main hand, no dual
if(PrimaryWeapon != nullptr) { if(PrimaryWeapon != nullptr) {
if( PrimaryWeapon->ItemClass == ItemClassCommon if( PrimaryWeapon->ItemClass == ItemClassCommon
&& (PrimaryWeapon->ItemType == ItemType2HS && (PrimaryWeapon->ItemType == ItemType2HSlash
|| PrimaryWeapon->ItemType == ItemType2HB || PrimaryWeapon->ItemType == ItemType2HBlunt
|| PrimaryWeapon->ItemType == ItemType2HPierce)) { || PrimaryWeapon->ItemType == ItemType2HPiercing)) {
attack_dw_timer.Disable(); attack_dw_timer.Disable();
continue; continue;
} }
@ -9052,7 +9052,7 @@ void Bot::SetAttackTimer() {
ItemToUse = nullptr; ItemToUse = nullptr;
} }
// Check to see if skill is valid // Check to see if skill is valid
else if((ItemToUse->ItemType > ItemTypeThrowing) && (ItemToUse->ItemType != ItemTypeHand2Hand) && (ItemToUse->ItemType != ItemType2HPierce)) { else if((ItemToUse->ItemType > ItemTypeLargeThrowing) && (ItemToUse->ItemType != ItemTypeMartial) && (ItemToUse->ItemType != ItemType2HPiercing)) {
//no weapon //no weapon
ItemToUse = nullptr; ItemToUse = nullptr;
} }
@ -9088,7 +9088,7 @@ void Bot::SetAttackTimer() {
if(speed < RuleI(Combat, MinHastedDelay)) if(speed < RuleI(Combat, MinHastedDelay))
speed = RuleI(Combat, MinHastedDelay); speed = RuleI(Combat, MinHastedDelay);
if(ItemToUse && (ItemToUse->ItemType == ItemTypeBow || ItemToUse->ItemType == ItemTypeThrowing)) if(ItemToUse && (ItemToUse->ItemType == ItemTypeBow || ItemToUse->ItemType == ItemTypeLargeThrowing))
{ {
/*if(IsClient()) /*if(IsClient())
{ {
@ -11430,17 +11430,17 @@ void Bot::CalcItemBonuses()
if(itembonuses.haste < itemtmp->Haste) if(itembonuses.haste < itemtmp->Haste)
itembonuses.haste = itemtmp->Haste; itembonuses.haste = itemtmp->Haste;
if(GetClass() == BARD && itemtmp->BardValue != 0) { if(GetClass() == BARD && itemtmp->BardValue != 0) {
if(itemtmp->BardType == ItemTypeBrassInstr) if(itemtmp->BardType == ItemTypeBrassInstrument)
itembonuses.brassMod += itemtmp->BardValue; itembonuses.brassMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeDrumInstr) else if(itemtmp->BardType == ItemTypePercussionInstrument)
itembonuses.percussionMod += itemtmp->BardValue; itembonuses.percussionMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseSinging) else if(itemtmp->BardType == ItemTypeSinging)
itembonuses.singingMod += itemtmp->BardValue; itembonuses.singingMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeStringInstr) else if(itemtmp->BardType == ItemTypeStringedInstrument)
itembonuses.stringedMod += itemtmp->BardValue; itembonuses.stringedMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeWindInstr) else if(itemtmp->BardType == ItemTypeWindInstrument)
itembonuses.windMod += itemtmp->BardValue; itembonuses.windMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseAllInstruments) { else if(itemtmp->BardType == ItemTypeAllInstrumentTypes) {
itembonuses.brassMod += itemtmp->BardValue; itembonuses.brassMod += itemtmp->BardValue;
itembonuses.percussionMod += itemtmp->BardValue; itembonuses.percussionMod += itemtmp->BardValue;
itembonuses.singingMod += itemtmp->BardValue; itembonuses.singingMod += itemtmp->BardValue;
@ -11514,17 +11514,17 @@ void Bot::CalcItemBonuses()
if(itembonuses.haste < itemtmp->Haste) if(itembonuses.haste < itemtmp->Haste)
itembonuses.haste = itemtmp->Haste; itembonuses.haste = itemtmp->Haste;
if(GetClass() == BARD && itemtmp->BardValue != 0) { if(GetClass() == BARD && itemtmp->BardValue != 0) {
if(itemtmp->BardType == ItemTypeBrassInstr) if(itemtmp->BardType == ItemTypeBrassInstrument)
itembonuses.brassMod += itemtmp->BardValue; itembonuses.brassMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeDrumInstr) else if(itemtmp->BardType == ItemTypePercussionInstrument)
itembonuses.percussionMod += itemtmp->BardValue; itembonuses.percussionMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseSinging) else if(itemtmp->BardType == ItemTypeSinging)
itembonuses.singingMod += itemtmp->BardValue; itembonuses.singingMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeStringInstr) else if(itemtmp->BardType == ItemTypeStringedInstrument)
itembonuses.stringedMod += itemtmp->BardValue; itembonuses.stringedMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeWindInstr) else if(itemtmp->BardType == ItemTypeWindInstrument)
itembonuses.windMod += itemtmp->BardValue; itembonuses.windMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseAllInstruments) { else if(itemtmp->BardType == ItemTypeAllInstrumentTypes) {
itembonuses.brassMod += itemtmp->BardValue; itembonuses.brassMod += itemtmp->BardValue;
itembonuses.percussionMod += itemtmp->BardValue; itembonuses.percussionMod += itemtmp->BardValue;
itembonuses.singingMod += itemtmp->BardValue; itembonuses.singingMod += itemtmp->BardValue;
@ -12235,7 +12235,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
c->Message(15, "I need something for my %s (Item %i)", equipped[i], i); c->Message(15, "I need something for my %s (Item %i)", equipped[i], i);
continue; continue;
} }
if((i == 13) && ((item2->ItemType == ItemType2HS) || (item2->ItemType == ItemType2HB) || (item2->ItemType == ItemType2HPierce))) { if((i == 13) && ((item2->ItemType == ItemType2HSlash) || (item2->ItemType == ItemType2HBlunt) || (item2->ItemType == ItemType2HPiercing))) {
is2Hweapon = true; is2Hweapon = true;
} }

View File

@ -3985,37 +3985,37 @@ uint16 Client::GetPrimarySkillValue()
switch (type) switch (type)
{ {
case ItemType1HS: // 1H Slashing case ItemType1HSlash: // 1H Slashing
{ {
skill = _1H_SLASHING; skill = _1H_SLASHING;
break; break;
} }
case ItemType2HS: // 2H Slashing case ItemType2HSlash: // 2H Slashing
{ {
skill = _2H_SLASHING; skill = _2H_SLASHING;
break; break;
} }
case ItemTypePierce: // Piercing case ItemType1HPiercing: // Piercing
{ {
skill = PIERCING; skill = PIERCING;
break; break;
} }
case ItemType1HB: // 1H Blunt case ItemType1HBlunt: // 1H Blunt
{ {
skill = _1H_BLUNT; skill = _1H_BLUNT;
break; break;
} }
case ItemType2HB: // 2H Blunt case ItemType2HBlunt: // 2H Blunt
{ {
skill = _2H_BLUNT; skill = _2H_BLUNT;
break; break;
} }
case ItemType2HPierce: // 2H Piercing case ItemType2HPiercing: // 2H Piercing
{ {
skill = PIERCING; skill = PIERCING;
break; break;
} }
case ItemTypeHand2Hand: // Hand to Hand case ItemTypeMartial: // Hand to Hand
{ {
skill = HAND_TO_HAND; skill = HAND_TO_HAND;
break; break;

View File

@ -1174,7 +1174,7 @@ public:
int32 mod_client_xp(int32 in_exp, NPC *npc); int32 mod_client_xp(int32 in_exp, NPC *npc);
uint32 mod_client_xp_for_level(uint32 xp, uint16 check_level); uint32 mod_client_xp_for_level(uint32 xp, uint16 check_level);
int mod_client_haste_cap(int cap); int mod_client_haste_cap(int cap);
int mod_consume(Item_Struct *item, ItemTypes type, int change); int mod_consume(Item_Struct *item, ItemUseTypes type, int change);
int mod_food_value(const Item_Struct *item, int change); int mod_food_value(const Item_Struct *item, int change);
int mod_drink_value(const Item_Struct *item, int change); int mod_drink_value(const Item_Struct *item, int change);

View File

@ -11029,8 +11029,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) {
} }
else if(GetClass() == ROGUE) else if(GetClass() == ROGUE)
{ {
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == ItemTypePierce) || if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == ItemType1HPiercing) ||
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == ItemTypePierce)) { (SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == ItemType1HPiercing)) {
float SuccessChance = (GetSkill(APPLY_POISON) + GetLevel()) / 400.0f; float SuccessChance = (GetSkill(APPLY_POISON) + GetLevel()) / 400.0f;
double ChanceRoll = MakeRandomFloat(0, 1); double ChanceRoll = MakeRandomFloat(0, 1);

View File

@ -314,7 +314,7 @@ bool Client::Process() {
ranged_timer.Start(); ranged_timer.Start();
} }
} }
else if(ranged->GetItem() && (ranged->GetItem()->ItemType == ItemTypeThrowing || ranged->GetItem()->ItemType == ItemTypeThrowingv2)){ else if(ranged->GetItem() && (ranged->GetItem()->ItemType == ItemTypeLargeThrowing || ranged->GetItem()->ItemType == ItemTypeSmallThrowing)){
if(ranged_timer.Check(false)){ if(ranged_timer.Check(false)){
if(GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient())){ if(GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient())){
if(!GetTarget()->BehindMob(this, GetTarget()->GetX(), GetTarget()->GetY())){ if(!GetTarget()->BehindMob(this, GetTarget()->GetX(), GetTarget()->GetY())){
@ -449,9 +449,9 @@ bool Client::Process() {
if (auto_attack_target && ExtraAttackChanceBonus) { if (auto_attack_target && ExtraAttackChanceBonus) {
ItemInst *wpn = GetInv().GetItem(SLOT_PRIMARY); ItemInst *wpn = GetInv().GetItem(SLOT_PRIMARY);
if(wpn){ if(wpn){
if(wpn->GetItem()->ItemType == ItemType2HS || if(wpn->GetItem()->ItemType == ItemType2HSlash ||
wpn->GetItem()->ItemType == ItemType2HB || wpn->GetItem()->ItemType == ItemType2HBlunt ||
wpn->GetItem()->ItemType == ItemType2HPierce ) wpn->GetItem()->ItemType == ItemType2HPiercing )
{ {
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus) if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
{ {

View File

@ -633,7 +633,7 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_cursor, ServerLootItem_Struct** bag_item_data) bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_cursor, ServerLootItem_Struct** bag_item_data)
{ {
// #1: Try to auto equip // #1: Try to auto equip
if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && !inst.GetItem()->Attuneable && inst.GetItem()->ItemType != ItemTypeAugment) if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && !inst.GetItem()->Attuneable && inst.GetItem()->ItemType != ItemTypeAugmentation)
{ {
for (int16 i = 0; i < 9999; i++) // originally (i < 22) for (int16 i = 0; i < 9999; i++) // originally (i < 22)
{ {
@ -646,7 +646,7 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
{ {
if( i == SLOT_PRIMARY && inst.IsWeapon() ) // If item is primary slot weapon if( i == SLOT_PRIMARY && inst.IsWeapon() ) // If item is primary slot weapon
{ {
if( (inst.GetItem()->ItemType == ItemType2HS) || (inst.GetItem()->ItemType == ItemType2HB) || (inst.GetItem()->ItemType == ItemType2HPierce) ) // and uses 2hs \ 2hb \ 2hp if( (inst.GetItem()->ItemType == ItemType2HSlash) || (inst.GetItem()->ItemType == ItemType2HBlunt) || (inst.GetItem()->ItemType == ItemType2HPiercing) ) // and uses 2hs \ 2hb \ 2hp
{ {
if( m_inv[SLOT_SECONDARY] ) // and if secondary slot is not empty if( m_inv[SLOT_SECONDARY] ) // and if secondary slot is not empty
{ {
@ -657,7 +657,7 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
if( i== SLOT_SECONDARY && m_inv[SLOT_PRIMARY]) // check to see if primary slot is a two hander if( i== SLOT_SECONDARY && m_inv[SLOT_PRIMARY]) // check to see if primary slot is a two hander
{ {
uint8 use = m_inv[SLOT_PRIMARY]->GetItem()->ItemType; uint8 use = m_inv[SLOT_PRIMARY]->GetItem()->ItemType;
if(use == ItemType2HS || use == ItemType2HB || use == ItemType2HPierce) if(use == ItemType2HSlash || use == ItemType2HBlunt || use == ItemType2HPiercing)
continue; continue;
} }
if if

View File

@ -282,8 +282,8 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
} }
else if (foundslot == SLOT_SECONDARY else if (foundslot == SLOT_SECONDARY
&& (GetOwner() != nullptr || (GetLevel() >= 13 && MakeRandomInt(0,99) < NPC_DW_CHANCE) || (item2->Damage==0)) && && (GetOwner() != nullptr || (GetLevel() >= 13 && MakeRandomInt(0,99) < NPC_DW_CHANCE) || (item2->Damage==0)) &&
(item2->ItemType == ItemType1HS || item2->ItemType == ItemType1HB || item2->ItemType == ItemTypeShield || (item2->ItemType == ItemType1HSlash || item2->ItemType == ItemType1HBlunt || item2->ItemType == ItemTypeShield ||
item2->ItemType == ItemTypePierce)) item2->ItemType == ItemType1HPiercing))
{ {
if (item2->Proc.Effect!=0) if (item2->Proc.Effect!=0)
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true); CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);

View File

@ -1715,7 +1715,7 @@ void Merc::AI_Process() {
int weapontype = 0; // No weapon type int weapontype = 0; // No weapon type
bool bIsFist = true; bool bIsFist = true;
if(bIsFist || ((weapontype != ItemType2HS) && (weapontype != ItemType2HPierce) && (weapontype != ItemType2HB))) { if(bIsFist || ((weapontype != ItemType2HSlash) && (weapontype != ItemType2HPiercing) && (weapontype != ItemType2HBlunt))) {
float DualWieldProbability = 0.0f; float DualWieldProbability = 0.0f;
int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity; int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;

View File

@ -1969,9 +1969,9 @@ void Mob::SetAttackTimer() {
//if we have a 2H weapon in our main hand, no dual //if we have a 2H weapon in our main hand, no dual
if(PrimaryWeapon != nullptr) { if(PrimaryWeapon != nullptr) {
if( PrimaryWeapon->ItemClass == ItemClassCommon if( PrimaryWeapon->ItemClass == ItemClassCommon
&& (PrimaryWeapon->ItemType == ItemType2HS && (PrimaryWeapon->ItemType == ItemType2HSlash
|| PrimaryWeapon->ItemType == ItemType2HB || PrimaryWeapon->ItemType == ItemType2HBlunt
|| PrimaryWeapon->ItemType == ItemType2HPierce)) { || PrimaryWeapon->ItemType == ItemType2HPiercing)) {
attack_dw_timer.Disable(); attack_dw_timer.Disable();
continue; continue;
} }
@ -2003,7 +2003,7 @@ void Mob::SetAttackTimer() {
ItemToUse = nullptr; ItemToUse = nullptr;
} }
// Check to see if skill is valid // Check to see if skill is valid
else if((ItemToUse->ItemType > ItemTypeThrowing) && (ItemToUse->ItemType != ItemTypeHand2Hand) && (ItemToUse->ItemType != ItemType2HPierce)) { else if((ItemToUse->ItemType > ItemTypeLargeThrowing) && (ItemToUse->ItemType != ItemTypeMartial) && (ItemToUse->ItemType != ItemType2HPiercing)) {
//no weapon //no weapon
ItemToUse = nullptr; ItemToUse = nullptr;
} }
@ -2039,7 +2039,7 @@ void Mob::SetAttackTimer() {
if(speed < RuleI(Combat, MinHastedDelay)) if(speed < RuleI(Combat, MinHastedDelay))
speed = RuleI(Combat, MinHastedDelay); speed = RuleI(Combat, MinHastedDelay);
if(ItemToUse && (ItemToUse->ItemType == ItemTypeBow || ItemToUse->ItemType == ItemTypeThrowing)) if(ItemToUse && (ItemToUse->ItemType == ItemTypeBow || ItemToUse->ItemType == ItemTypeLargeThrowing))
{ {
if(IsClient()) if(IsClient())
{ {
@ -2083,7 +2083,7 @@ bool Mob::CanThisClassDualWield(void) const
// 2HS, 2HB, or 2HP // 2HS, 2HB, or 2HP
if (inst && inst->IsType(ItemClassCommon)) { if (inst && inst->IsType(ItemClassCommon)) {
const Item_Struct* item = inst->GetItem(); const Item_Struct* item = inst->GetItem();
if ((item->ItemType == ItemType2HB) || (item->ItemType == ItemType2HS) || (item->ItemType == ItemType2HPierce)) if ((item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HPiercing))
return false; return false;
} else { } else {
//No weapon in hand... using hand-to-hand... //No weapon in hand... using hand-to-hand...
@ -4536,19 +4536,19 @@ uint16 Mob::GetSkillByItemType(int ItemType)
{ {
switch (ItemType) switch (ItemType)
{ {
case ItemType1HS: case ItemType1HSlash:
return _1H_SLASHING; return _1H_SLASHING;
case ItemType2HS: case ItemType2HSlash:
return _2H_SLASHING; return _2H_SLASHING;
case ItemTypePierce: case ItemType1HPiercing:
return PIERCING; return PIERCING;
case ItemType1HB: case ItemType1HBlunt:
return _1H_BLUNT; return _1H_BLUNT;
case ItemType2HB: case ItemType2HBlunt:
return _2H_BLUNT; return _2H_BLUNT;
case ItemType2HPierce: case ItemType2HPiercing:
return PIERCING; return PIERCING;
case ItemTypeHand2Hand: case ItemTypeMartial:
return HAND_TO_HAND; return HAND_TO_HAND;
default: default:
return HAND_TO_HAND; return HAND_TO_HAND;

View File

@ -506,7 +506,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
//make sure we have a proper weapon if we are a client. //make sure we have a proper weapon if we are a client.
if(IsClient()) { if(IsClient()) {
const ItemInst *wpn = CastToClient()->GetInv().GetItem(SLOT_PRIMARY); const ItemInst *wpn = CastToClient()->GetInv().GetItem(SLOT_PRIMARY);
if(!wpn || (wpn->GetItem()->ItemType != ItemTypePierce)){ if(!wpn || (wpn->GetItem()->ItemType != ItemType1HPiercing)){
Message_StringID(13, BACKSTAB_WEAPON); Message_StringID(13, BACKSTAB_WEAPON);
return; return;
} }
@ -1138,7 +1138,7 @@ void Client::ThrowingAttack(Mob* other) { //old was 51
} }
const Item_Struct* item = RangeWeapon->GetItem(); const Item_Struct* item = RangeWeapon->GetItem();
if(item->ItemType != ItemTypeThrowing && item->ItemType != ItemTypeThrowingv2) { if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) {
mlog(COMBAT__RANGED, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); mlog(COMBAT__RANGED, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(SLOT_RANGE)); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(SLOT_RANGE));
return; return;