feat: Add option to disable mainhand/offhand checks

This commit is contained in:
郑佩茹
2023-01-30 17:48:50 -07:00
parent b21f16e378
commit 74418db0d9
3 changed files with 15 additions and 3 deletions

View File

@@ -154,6 +154,11 @@ Transmogrification.TokenAmount = 1
# 1 - MODERN - Like later retail WoW, allow swords to be transmogged to axes, etc.
# 2 - FULL - No restrictions, allow any weapon to be transmogrified to any other weapon
#
# Transmogrification.AllowMixedWeaponHandedness
# Description: Normally main-hand and off-hand weapons can only be transmogged to this same type. Enable to remove this restriction.
# Not necessary when AllowMixedWeaponTypes is set to FULL.
# Default: 0
#
# Transmogrification.AllowFishingPoles
# Description: Allow fishing poles to be transmogrified
# Default: 0
@@ -198,6 +203,7 @@ Transmogrification.AllowTradeable = 0
Transmogrification.AllowMixedArmorTypes = 0
Transmogrification.AllowMixedWeaponTypes = 0
Transmogrification.AllowMixedWeaponHandedness = 0
Transmogrification.AllowFishingPoles = 0
Transmogrification.IgnoreReqRace = 0

View File

@@ -520,10 +520,14 @@ bool Transmogrification::CanTransmogrifyItemWithItem(Player* player, ItemTemplat
{
// Main-hand to offhand restrictions - see https://wowpedia.fandom.com/wiki/Transmogrification
if (AllowMixedWeaponTypes != MIXED_WEAPONS_LOOSE && ((source->InventoryType == INVTYPE_WEAPONMAINHAND && target->InventoryType != INVTYPE_WEAPONMAINHAND)
|| (source->InventoryType == INVTYPE_WEAPONOFFHAND && target->InventoryType != INVTYPE_WEAPONOFFHAND)))
if (!AllowMixedWeaponHandedness && AllowMixedWeaponTypes != MIXED_WEAPONS_LOOSE)
{
return false;
if ((source->InventoryType == INVTYPE_WEAPONMAINHAND && target->InventoryType != INVTYPE_WEAPONMAINHAND) ||
(source->InventoryType == INVTYPE_WEAPONOFFHAND && target->InventoryType != INVTYPE_WEAPONOFFHAND))
{
return false;
}
}
if (source->Class == ITEM_CLASS_WEAPON && !(IsRangedWeapon(target->Class, target->SubClass) ||
@@ -850,6 +854,7 @@ void Transmogrification::LoadConfig(bool reload)
AllowTradeable = sConfigMgr->GetOption<bool>("Transmogrification.AllowTradeable", false);
AllowMixedArmorTypes = sConfigMgr->GetOption<bool>("Transmogrification.AllowMixedArmorTypes", false);
AllowMixedWeaponHandedness = sConfigMgr->GetOption<bool>("Transmogrification.AllowMixedWeaponHandedness", false);
AllowFishingPoles = sConfigMgr->GetOption<bool>("Transmogrification.AllowFishingPoles", false);
AllowMixedWeaponTypes = sConfigMgr->GetOption<uint8>("Transmogrification.AllowMixedWeaponTypes", MIXED_WEAPONS_STRICT);

View File

@@ -132,6 +132,7 @@ public:
bool AllowTradeable;
bool AllowMixedArmorTypes;
bool AllowMixedWeaponHandedness;
bool AllowFishingPoles;
uint8 AllowMixedWeaponTypes;