diff --git a/conf/transmog.conf.dist b/conf/transmog.conf.dist index e15558e..249436e 100644 --- a/conf/transmog.conf.dist +++ b/conf/transmog.conf.dist @@ -149,7 +149,10 @@ Transmogrification.TokenAmount = 1 # # Transmogrification.AllowMixedWeaponTypes # Description: Allow axe to be transmogrified with dagger for example -# Default: 0 +# Possible options: +# Default: 0 - STRICT - Fully restricted like original Blizzard 4.3 transmog - Weapons must be the same weapon type (exceptions: Guns, Crossbows, or Bows) +# 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.AllowFishingPoles # Description: Allow fishing poles to be transmogrified diff --git a/src/Transmogrification.cpp b/src/Transmogrification.cpp index 71c2faa..ca7e9b5 100644 --- a/src/Transmogrification.cpp +++ b/src/Transmogrification.cpp @@ -470,13 +470,62 @@ bool Transmogrification::CanTransmogrifyItemWithItem(Player* player, ItemTemplat { if (source->Class == ITEM_CLASS_ARMOR && !AllowMixedArmorTypes) return false; - if (source->Class == ITEM_CLASS_WEAPON && !AllowMixedWeaponTypes) - return false; + if (source->Class == ITEM_CLASS_WEAPON) + { + if (AllowMixedWeaponTypes == MIXED_WEAPONS_STRICT) + { + return false; + } + if (AllowMixedWeaponTypes == MIXED_WEAPONS_MODERN) + { + switch (source->SubClass) + { + case ITEM_SUBCLASS_WEAPON_WAND: + case ITEM_SUBCLASS_WEAPON_DAGGER: + case ITEM_SUBCLASS_WEAPON_FIST: + return false; + case ITEM_SUBCLASS_WEAPON_AXE: + case ITEM_SUBCLASS_WEAPON_SWORD: + case ITEM_SUBCLASS_WEAPON_MACE: + if (target->SubClass != ITEM_SUBCLASS_WEAPON_MACE && + target->SubClass != ITEM_SUBCLASS_WEAPON_AXE && + target->SubClass != ITEM_SUBCLASS_WEAPON_SWORD) + { + return false; + } + break; + case ITEM_SUBCLASS_WEAPON_AXE2: + case ITEM_SUBCLASS_WEAPON_SWORD2: + case ITEM_SUBCLASS_WEAPON_MACE2: + case ITEM_SUBCLASS_WEAPON_STAFF: + case ITEM_SUBCLASS_WEAPON_POLEARM: + if (target->SubClass != ITEM_SUBCLASS_WEAPON_MACE2 && + target->SubClass != ITEM_SUBCLASS_WEAPON_AXE2 && + target->SubClass != ITEM_SUBCLASS_WEAPON_SWORD2 && + target->SubClass != ITEM_SUBCLASS_WEAPON_STAFF && + target->SubClass != ITEM_SUBCLASS_WEAPON_POLEARM) + { + return false; + } + break; + default: + break; + } + } + } } } if (source->InventoryType != target->InventoryType) { + + // 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))) + { + return false; + } + if (source->Class == ITEM_CLASS_WEAPON && !(IsRangedWeapon(target->Class, target->SubClass) || ( // [AZTH] Yehonal: fixed weapon check @@ -519,7 +568,7 @@ bool Transmogrification::SuitableForTransmogrification(Player* player, ItemTempl return false; } - if (proto->Class == ITEM_CLASS_WEAPON && !AllowMixedWeaponTypes) + if (proto->Class == ITEM_CLASS_WEAPON && AllowMixedWeaponTypes != MIXED_WEAPONS_LOOSE) { return false; } @@ -801,9 +850,10 @@ void Transmogrification::LoadConfig(bool reload) AllowTradeable = sConfigMgr->GetOption("Transmogrification.AllowTradeable", false); AllowMixedArmorTypes = sConfigMgr->GetOption("Transmogrification.AllowMixedArmorTypes", false); - AllowMixedWeaponTypes = sConfigMgr->GetOption("Transmogrification.AllowMixedWeaponTypes", false); AllowFishingPoles = sConfigMgr->GetOption("Transmogrification.AllowFishingPoles", false); + AllowMixedWeaponTypes = sConfigMgr->GetOption("Transmogrification.AllowMixedWeaponTypes", MIXED_WEAPONS_STRICT); + IgnoreReqRace = sConfigMgr->GetOption("Transmogrification.IgnoreReqRace", false); IgnoreReqClass = sConfigMgr->GetOption("Transmogrification.IgnoreReqClass", false); IgnoreReqSkill = sConfigMgr->GetOption("Transmogrification.IgnoreReqSkill", false); @@ -881,7 +931,7 @@ bool Transmogrification::GetAllowMixedArmorTypes() const { return AllowMixedArmorTypes; }; -bool Transmogrification::GetAllowMixedWeaponTypes() const +uint8 Transmogrification::GetAllowMixedWeaponTypes() const { return AllowMixedWeaponTypes; }; diff --git a/src/Transmogrification.h b/src/Transmogrification.h index 8fbe573..e08bfa7 100644 --- a/src/Transmogrification.h +++ b/src/Transmogrification.h @@ -31,6 +31,13 @@ enum TransmogSettings SETTING_RETROACTIVE_CHECK = 1 }; +enum MixedWeaponSettings +{ + MIXED_WEAPONS_STRICT = 0, + MIXED_WEAPONS_MODERN = 1, + MIXED_WEAPONS_LOOSE = 2 +}; + enum TransmogAcoreStrings // Language.h might have same entries, appears when executing SQL, change if needed { LANG_ERR_TRANSMOG_OK = 11100, // change this @@ -125,9 +132,10 @@ public: bool AllowTradeable; bool AllowMixedArmorTypes; - bool AllowMixedWeaponTypes; bool AllowFishingPoles; + uint8 AllowMixedWeaponTypes; + bool IgnoreReqRace; bool IgnoreReqClass; bool IgnoreReqSkill; @@ -181,7 +189,7 @@ public: uint32 GetTokenAmount() const; bool GetAllowMixedArmorTypes() const; - bool GetAllowMixedWeaponTypes() const; + uint8 GetAllowMixedWeaponTypes() const; // Config bool GetEnableTransmogInfo() const;