diff options
-rw-r--r-- | src/server/game/Entities/Item/ItemTemplate.h | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 21 | ||||
-rw-r--r-- | src/server/game/Handlers/CharacterHandler.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 2 |
7 files changed, 26 insertions, 13 deletions
diff --git a/src/server/game/Entities/Item/ItemTemplate.h b/src/server/game/Entities/Item/ItemTemplate.h index 14f9b114d15..d91080ce91c 100644 --- a/src/server/game/Entities/Item/ItemTemplate.h +++ b/src/server/game/Entities/Item/ItemTemplate.h @@ -516,7 +516,7 @@ enum ItemSubclassWeapon #define ITEM_SUBCLASS_MASK_WEAPON_RANGED (\ (1 << ITEM_SUBCLASS_WEAPON_BOW) | (1 << ITEM_SUBCLASS_WEAPON_GUN) |\ - (1 << ITEM_SUBCLASS_WEAPON_CROSSBOW)) + (1 << ITEM_SUBCLASS_WEAPON_CROSSBOW) | (1 << ITEM_SUBCLASS_WEAPON_THROWN)) #define MAX_ITEM_SUBCLASS_WEAPON 21 diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9e1ad34d992..46a1beae507 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8202,7 +8202,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo) slot = EQUIPMENT_SLOT_OFFHAND; break; case RANGED_ATTACK: - slot = EQUIPMENT_SLOT_MAINHAND; + slot = EQUIPMENT_SLOT_RANGED; break; default: slot = EQUIPMENT_SLOT_END; @@ -9177,7 +9177,7 @@ Item* Player::GetWeaponForAttack(WeaponAttackType attackType, bool useable /*= f { case BASE_ATTACK: slot = EQUIPMENT_SLOT_MAINHAND; break; case OFF_ATTACK: slot = EQUIPMENT_SLOT_OFFHAND; break; - case RANGED_ATTACK: slot = EQUIPMENT_SLOT_MAINHAND; break; + case RANGED_ATTACK: slot = EQUIPMENT_SLOT_RANGED; break; default: return nullptr; } @@ -9241,8 +9241,9 @@ WeaponAttackType Player::GetAttackBySlot(uint8 slot, InventoryType inventoryType { switch (slot) { - case EQUIPMENT_SLOT_MAINHAND: return inventoryType != INVTYPE_RANGED && inventoryType != INVTYPE_RANGEDRIGHT ? BASE_ATTACK : RANGED_ATTACK; + case EQUIPMENT_SLOT_MAINHAND: return BASE_ATTACK; case EQUIPMENT_SLOT_OFFHAND: return OFF_ATTACK; + case EQUIPMENT_SLOT_RANGED: return (inventoryType == INVTYPE_RANGED || inventoryType == INVTYPE_THROWN || inventoryType == INVTYPE_RANGEDRIGHT) ? RANGED_ATTACK : MAX_ATTACK; default: return MAX_ATTACK; } } @@ -11321,6 +11322,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) { case EQUIPMENT_SLOT_MAINHAND: case EQUIPMENT_SLOT_OFFHAND: + case EQUIPMENT_SLOT_RANGED: RecalculateRating(CR_ARMOR_PENETRATION); break; default: @@ -11595,6 +11597,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) { case EQUIPMENT_SLOT_MAINHAND: case EQUIPMENT_SLOT_OFFHAND: + case EQUIPMENT_SLOT_RANGED: RecalculateRating(CR_ARMOR_PENETRATION); break; default: @@ -11732,6 +11735,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) { case EQUIPMENT_SLOT_MAINHAND: case EQUIPMENT_SLOT_OFFHAND: + case EQUIPMENT_SLOT_RANGED: RecalculateRating(CR_ARMOR_PENETRATION); break; default: @@ -24902,19 +24906,26 @@ bool Player::HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item cons if (Item* item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) if (item != ignoreItem && item->IsFitToSpellRequirements(spellInfo)) return true; + if (Item* item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) + if (item != ignoreItem && item->IsFitToSpellRequirements(spellInfo)) + return true; break; } case ITEM_CLASS_ARMOR: { if (!spellInfo->HasAttribute(SPELL_ATTR8_REQUIRES_EQUIPPED_INV_TYPES)) { - // most used check: shield only - if (spellInfo->EquippedItemSubClassMask & (1 << ITEM_SUBCLASS_ARMOR_SHIELD)) + if (spellInfo->EquippedItemSubClassMask & (1 << ITEM_SUBCLASS_ARMOR_SHIELD) || (1 << ITEM_SUBCLASS_ARMOR_IDOL) || + (1 << ITEM_SUBCLASS_ARMOR_TOTEM) || (1 << ITEM_SUBCLASS_ARMOR_SIGIL) || (1 << ITEM_SUBCLASS_ARMOR_RELIC)) { if (Item* item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) if (item != ignoreItem && item->IsFitToSpellRequirements(spellInfo)) return true; + if (Item* item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) + if (item != ignoreItem && item->IsFitToSpellRequirements(spellInfo)) + return true; + // special check to filter things like Shield Wall, the aura is not permanent and must stay even without required item if (!spellInfo->IsPassive()) for (SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects()) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 18e42f394c4..a413693ed0a 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1988,7 +1988,7 @@ void WorldSession::HandleUseEquipmentSet(WorldPackets::EquipmentSet::UseEquipmen continue; // Only equip weapons in combat - if (_player->IsInCombat() && i != EQUIPMENT_SLOT_MAINHAND && i != EQUIPMENT_SLOT_OFFHAND) + if (_player->IsInCombat() && i != EQUIPMENT_SLOT_MAINHAND && i != EQUIPMENT_SLOT_OFFHAND && i != EQUIPMENT_SLOT_RANGED) continue; Item* item = _player->GetItemByGuid(useEquipmentSet.Items[i].Item); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d894f7079e7..ededcc7ba58 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2456,7 +2456,7 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, flagChangeFunc = [](Unit* u) { if (u->HasUnitFlag2(UNIT_FLAG2_DISARM_RANGED)) { return false; } u->SetUnitFlag2(UNIT_FLAG2_DISARM_RANGED); return true; }; else flagChangeFunc = [](Unit* u) { if (u->HasAuraType(SPELL_AURA_MOD_DISARM_RANGED)) { return false; } u->RemoveUnitFlag2(UNIT_FLAG2_DISARM_RANGED); return true; }; - slot = EQUIPMENT_SLOT_MAINHAND; + slot = EQUIPMENT_SLOT_RANGED; attType = RANGED_ATTACK; break; default: diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index dea58e024fe..99d62a98956 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1908,10 +1908,12 @@ uint32 Aura::GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo if (DamageInfo const* damageInfo = eventInfo.GetDamageInfo()) { - if (damageInfo->GetAttackType() != OFF_ATTACK) + if (damageInfo->GetAttackType() == BASE_ATTACK) item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); - else + else if (damageInfo->GetAttackType() == OFF_ATTACK) item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); + else + item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED); } } else if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_ARMOR) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index d526ef5de53..47a737dca40 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -686,7 +686,7 @@ class instance_ulduar : public InstanceMapScript Map::PlayerList const& players = instance->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if (Player* player = itr->GetSource()) - for (uint8 slot = EQUIPMENT_SLOT_MAINHAND; slot <= EQUIPMENT_SLOT_OFFHAND; ++slot) + for (uint8 slot = EQUIPMENT_SLOT_MAINHAND; slot <= EQUIPMENT_SLOT_RANGED; ++slot) if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) if (item->GetItemLevel(player) > _maxWeaponItemLevel) _maxWeaponItemLevel = item->GetItemLevel(player); @@ -707,7 +707,7 @@ class instance_ulduar : public InstanceMapScript if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) { - if (slot >= EQUIPMENT_SLOT_MAINHAND && slot <= EQUIPMENT_SLOT_OFFHAND) + if (slot >= EQUIPMENT_SLOT_MAINHAND && slot <= EQUIPMENT_SLOT_RANGED) { if (item->GetItemLevel(player) > _maxWeaponItemLevel) _maxWeaponItemLevel = item->GetItemLevel(player); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 3f9ab732a06..d49718cb190 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -985,7 +985,7 @@ class spell_gen_clone_weapon_aura : public AuraScript if (Player* player = caster->ToPlayer()) { - if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) + if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) target->SetVirtualItem(2, rangedItem->GetEntry()); } else |