Core/Items: Classify wands as ranged weapons (fixes wand shooting)
Port From (https://github.com/TrinityCore/TrinityCore/commit/bd87381eab32f0e136675ade503fe70285590803)
This commit is contained in:
@@ -2718,7 +2718,6 @@ namespace Game.Entities
|
||||
public bool IsPotion() { return GetTemplate().IsPotion(); }
|
||||
public bool IsVellum() { return GetTemplate().IsVellum(); }
|
||||
public bool IsConjuredConsumable() { return GetTemplate().IsConjuredConsumable(); }
|
||||
public bool IsRangedWeapon() { return GetTemplate().IsRangedWeapon(); }
|
||||
public ItemQuality GetQuality() { return _bonusData.Quality; }
|
||||
public int GetItemStatType(uint index)
|
||||
{
|
||||
|
||||
@@ -335,8 +335,21 @@ namespace Game.Entities
|
||||
|
||||
public bool IsRangedWeapon()
|
||||
{
|
||||
return IsWeapon() && (GetSubClass() == (uint)ItemSubClassWeapon.Bow ||
|
||||
GetSubClass() == (uint)ItemSubClassWeapon.Gun || GetSubClass() == (uint)ItemSubClassWeapon.Crossbow);
|
||||
if (!IsWeapon())
|
||||
return false;
|
||||
|
||||
switch ((ItemSubClassWeapon)GetSubClass())
|
||||
{
|
||||
case ItemSubClassWeapon.Bow:
|
||||
case ItemSubClassWeapon.Gun:
|
||||
case ItemSubClassWeapon.Crossbow:
|
||||
case ItemSubClassWeapon.Wand:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public uint MaxDurability;
|
||||
|
||||
Reference in New Issue
Block a user