feat: move SPELL_SUMMON_ETHEREAL_WARPWEAVER to config field (#144)

* feat: move SPELL_SUMMON_ETHEREAL_WARPWEAVER to config field

* style: move GetOption to be more in line with the .conf.dist order
This commit is contained in:
Axel Cocat
2024-03-19 21:30:06 +01:00
committed by GitHub
parent f984be398f
commit e70c5da3da
4 changed files with 12 additions and 7 deletions

View File

@@ -278,11 +278,17 @@ Transmogrification.SetCopperCost = 0
# Example: Transmogrification.MembershipLevelsPet = "1,2,3" # Example: Transmogrification.MembershipLevelsPet = "1,2,3"
# Default: "" # Default: ""
# #
# Transmogrification.PetSpellId
# Description: The ID used by the transmog pet in the spell_dbc table
# Example: Transmogrification.PetSpellId = 2000100
# Default: 2000100
#
Transmogrification.EnablePlus = 0 Transmogrification.EnablePlus = 0
Transmogrification.MembershipLevels = "" Transmogrification.MembershipLevels = ""
Transmogrification.MembershipLevelsLegendary = "" Transmogrification.MembershipLevelsLegendary = ""
Transmogrification.MembershipLevelsPet = "" Transmogrification.MembershipLevelsPet = ""
Transmogrification.PetSpellId = 2000100
# #
################################################################################################### ###################################################################################################

View File

@@ -1058,6 +1058,8 @@ void Transmogrification::LoadConfig(bool reload)
for (auto& itr : Acore::Tokenize(stringMembershipIds, ',', false)) { for (auto& itr : Acore::Tokenize(stringMembershipIds, ',', false)) {
MembershipIdsPet.push_back(Acore::StringTo<uint32>(itr).value()); MembershipIdsPet.push_back(Acore::StringTo<uint32>(itr).value());
} }
PetSpellId = sConfigMgr->GetOption<uint32>("Transmogrification.PetSpellId", 2000100);
} }
void Transmogrification::DeleteFakeFromDB(ObjectGuid::LowType itemLowGuid, CharacterDatabaseTransaction* trans /*= nullptr*/) void Transmogrification::DeleteFakeFromDB(ObjectGuid::LowType itemLowGuid, CharacterDatabaseTransaction* trans /*= nullptr*/)

View File

@@ -63,11 +63,6 @@ enum TransmogAcoreStrings // Language.h might have same entries, appears when ex
LANG_CMD_TRANSMOG_COMPLETE_SYNC = 11116, LANG_CMD_TRANSMOG_COMPLETE_SYNC = 11116,
}; };
enum TransmogSpells
{
SPELL_SUMMON_ETHEREAL_WARPWEAVER = 2000100
};
class Transmogrification class Transmogrification
{ {
public: public:
@@ -102,6 +97,8 @@ public:
float SetCostModifier; float SetCostModifier;
int32 SetCopperCost; int32 SetCopperCost;
uint32 PetSpellId;
bool GetEnableSets() const; bool GetEnableSets() const;
uint8 GetMaxSets() const; uint8 GetMaxSets() const;
float GetSetCostModifier() const; float GetSetCostModifier() const;

View File

@@ -307,7 +307,7 @@ public:
if (sTransmogrification->IsTransmogPlusEnabled) { if (sTransmogrification->IsTransmogPlusEnabled) {
if (sTransmogrification->isTransmogPlusPetEligible(player->GetGUID())) { if (sTransmogrification->isTransmogPlusPetEligible(player->GetGUID())) {
player->CastSpell((Unit*)nullptr, SPELL_SUMMON_ETHEREAL_WARPWEAVER, true); player->CastSpell((Unit*)nullptr, sTransmogrification->PetSpellId, true);
return true; return true;
} }
} }
@@ -316,7 +316,7 @@ public:
return true; return true;
} }
player->CastSpell((Unit*)nullptr, SPELL_SUMMON_ETHEREAL_WARPWEAVER, true); player->CastSpell((Unit*)nullptr, sTransmogrification->PetSpellId, true);
} }
return true; return true;