Core/Items: Relaxed transmog restrictiions
Port From (https://github.com/TrinityCore/TrinityCore/commit/718c0f54bda4685629d66143c02f086e0cd32095)
This commit is contained in:
@@ -1495,7 +1495,6 @@ namespace Framework.Constants
|
|||||||
// One-handed
|
// One-handed
|
||||||
AxeMaceSword1H,
|
AxeMaceSword1H,
|
||||||
Dagger,
|
Dagger,
|
||||||
Fist,
|
|
||||||
|
|
||||||
Invalid
|
Invalid
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1513,36 +1513,9 @@ namespace Game.Entities
|
|||||||
if (proto.HasFlag(ItemFlags2.NoAlterItemVisual))
|
if (proto.HasFlag(ItemFlags2.NoAlterItemVisual))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!HasStats())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasStats()
|
|
||||||
{
|
|
||||||
ItemTemplate proto = GetTemplate();
|
|
||||||
Player owner = GetOwner();
|
|
||||||
for (byte i = 0; i < ItemConst.MaxStats; ++i)
|
|
||||||
{
|
|
||||||
if ((owner != null ? GetItemStatValue(i, owner) : proto.GetStatPercentEditor(i)) != 0)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool HasStats(ItemInstance itemInstance, BonusData bonus)
|
|
||||||
{
|
|
||||||
for (byte i = 0; i < ItemConst.MaxStats; ++i)
|
|
||||||
{
|
|
||||||
if (bonus.StatPercentEditor[i] != 0)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ItemTransmogrificationWeaponCategory GetTransmogrificationWeaponCategory(ItemTemplate proto)
|
static ItemTransmogrificationWeaponCategory GetTransmogrificationWeaponCategory(ItemTemplate proto)
|
||||||
{
|
{
|
||||||
if (proto.GetClass() == ItemClass.Weapon)
|
if (proto.GetClass() == ItemClass.Weapon)
|
||||||
@@ -1563,11 +1536,10 @@ namespace Game.Entities
|
|||||||
case ItemSubClassWeapon.Mace:
|
case ItemSubClassWeapon.Mace:
|
||||||
case ItemSubClassWeapon.Sword:
|
case ItemSubClassWeapon.Sword:
|
||||||
case ItemSubClassWeapon.Warglaives:
|
case ItemSubClassWeapon.Warglaives:
|
||||||
|
case ItemSubClassWeapon.Fist:
|
||||||
return ItemTransmogrificationWeaponCategory.AxeMaceSword1H;
|
return ItemTransmogrificationWeaponCategory.AxeMaceSword1H;
|
||||||
case ItemSubClassWeapon.Dagger:
|
case ItemSubClassWeapon.Dagger:
|
||||||
return ItemTransmogrificationWeaponCategory.Dagger;
|
return ItemTransmogrificationWeaponCategory.Dagger;
|
||||||
case ItemSubClassWeapon.Fist:
|
|
||||||
return ItemTransmogrificationWeaponCategory.Fist;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -543,22 +543,6 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint[] PlayerClassByArmorSubclass =
|
|
||||||
{
|
|
||||||
(int)Class.ClassMaskAllPlayable, //ITEM_SUBCLASS_ARMOR_MISCELLANEOUS
|
|
||||||
(1 << ((int)Class.Priest - 1)) | (1 << ((int)Class.Mage - 1)) | (1 << ((int)Class.Warlock - 1)), //ITEM_SUBCLASS_ARMOR_CLOTH
|
|
||||||
(1 << ((int)Class.Rogue - 1)) | (1 << ((int)Class.Monk - 1)) | (1 << ((int)Class.Druid - 1)) | (1 << ((int)Class.DemonHunter - 1)), //ITEM_SUBCLASS_ARMOR_LEATHER
|
|
||||||
(1 << ((int)Class.Hunter - 1)) | (1 << ((int)Class.Shaman - 1)) | (1 << ((int)Class.Evoker - 1)), //ITEM_SUBCLASS_ARMOR_MAIL
|
|
||||||
(1 << ((int)Class.Warrior - 1)) | (1 << ((int)Class.Paladin - 1)) | (1 << ((int)Class.Deathknight - 1)), //ITEM_SUBCLASS_ARMOR_PLATE
|
|
||||||
(int)Class.ClassMaskAllPlayable, //ITEM_SUBCLASS_ARMOR_BUCKLER
|
|
||||||
(1 << ((int)Class.Warrior - 1)) | (1 << ((int)Class.Paladin - 1)) | (1 << ((int)Class.Shaman - 1)), //ITEM_SUBCLASS_ARMOR_SHIELD
|
|
||||||
1 << ((int)Class.Paladin - 1), //ITEM_SUBCLASS_ARMOR_LIBRAM
|
|
||||||
1 << ((int)Class.Druid - 1), //ITEM_SUBCLASS_ARMOR_IDOL
|
|
||||||
1 << ((int)Class.Shaman - 1), //ITEM_SUBCLASS_ARMOR_TOTEM
|
|
||||||
1 << ((int)Class.Deathknight - 1), //ITEM_SUBCLASS_ARMOR_SIGIL
|
|
||||||
(1 << ((int)Class.Paladin - 1)) | (1 << ((int)Class.Deathknight - 1)) | (1 << ((int)Class.Shaman - 1)) | (1 << ((int)Class.Druid - 1)), //ITEM_SUBCLASS_ARMOR_RELIC
|
|
||||||
};
|
|
||||||
|
|
||||||
public void AddItemAppearance(Item item)
|
public void AddItemAppearance(Item item)
|
||||||
{
|
{
|
||||||
if (!item.IsSoulBound())
|
if (!item.IsSoulBound())
|
||||||
@@ -601,12 +585,6 @@ namespace Game.Entities
|
|||||||
if (itemTemplate == null)
|
if (itemTemplate == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (_owner.GetPlayer() == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (_owner.GetPlayer().CanUseItem(itemTemplate) != InventoryResult.Ok)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (itemTemplate.HasFlag(ItemFlags2.NoSourceForItemVisual) || itemTemplate.GetQuality() == ItemQuality.Artifact)
|
if (itemTemplate.HasFlag(ItemFlags2.NoSourceForItemVisual) || itemTemplate.GetQuality() == ItemQuality.Artifact)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -614,8 +592,6 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
case ItemClass.Weapon:
|
case ItemClass.Weapon:
|
||||||
{
|
{
|
||||||
if (!Convert.ToBoolean(_owner.GetPlayer().GetWeaponProficiency() & (1 << (int)itemTemplate.GetSubClass())))
|
|
||||||
return false;
|
|
||||||
if (itemTemplate.GetSubClass() == (int)ItemSubClassWeapon.Exotic ||
|
if (itemTemplate.GetSubClass() == (int)ItemSubClassWeapon.Exotic ||
|
||||||
itemTemplate.GetSubClass() == (int)ItemSubClassWeapon.Exotic2 ||
|
itemTemplate.GetSubClass() == (int)ItemSubClassWeapon.Exotic2 ||
|
||||||
itemTemplate.GetSubClass() == (int)ItemSubClassWeapon.Miscellaneous ||
|
itemTemplate.GetSubClass() == (int)ItemSubClassWeapon.Miscellaneous ||
|
||||||
@@ -650,9 +626,6 @@ namespace Game.Entities
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (itemTemplate.GetInventoryType() != InventoryType.Cloak)
|
|
||||||
if (!Convert.ToBoolean(PlayerClassByArmorSubclass[itemTemplate.GetSubClass()] & _owner.GetPlayer().GetClassMask()))
|
|
||||||
return false;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -664,6 +637,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo check this
|
//todo check this
|
||||||
void AddItemAppearance(ItemModifiedAppearanceRecord itemModifiedAppearance)
|
void AddItemAppearance(ItemModifiedAppearanceRecord itemModifiedAppearance)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user