misc major faction
This commit is contained in:
@@ -166,8 +166,8 @@ void MajorFactionMgr::LoadWorldData()
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT factionId, hiddenFromExpansionPage, displayAsJourney, useJourneyRewardTrack, "
|
||||
// 4 5 6 7 8
|
||||
"useJourneyUnlockToast, uiPriority, introQuestId, playerCompanionId, renownCampaignId "
|
||||
// 4 5 6 7 8 9
|
||||
"useJourneyUnlockToast, uiPriority, introQuestId, introQuestIdAlliance, playerCompanionId, renownCampaignId "
|
||||
"FROM major_faction_config");
|
||||
|
||||
uint32 count = 0;
|
||||
@@ -191,8 +191,9 @@ void MajorFactionMgr::LoadWorldData()
|
||||
config.UseJourneyUnlockToast = fields[4].GetBool();
|
||||
config.UiPriority = fields[5].GetInt32();
|
||||
config.IntroQuestID = fields[6].GetUInt32();
|
||||
config.PlayerCompanionID = fields[7].GetUInt32();
|
||||
config.RenownCampaignID = fields[8].GetUInt32();
|
||||
config.IntroQuestIDAlliance = fields[7].GetUInt32();
|
||||
config.PlayerCompanionID = fields[8].GetUInt32();
|
||||
config.RenownCampaignID = fields[9].GetUInt32();
|
||||
++count;
|
||||
|
||||
// Validate Campaign FK if set.
|
||||
@@ -385,6 +386,16 @@ uint32 MajorFactionMgr::GetIntroQuestID(uint32 factionId) const
|
||||
return config ? config->IntroQuestID : 0u;
|
||||
}
|
||||
|
||||
uint32 MajorFactionMgr::GetIntroQuestID(Player const* player, uint32 factionId) const
|
||||
{
|
||||
MajorFactions::MajorFactionConfig const* config = GetConfig(factionId);
|
||||
if (!config)
|
||||
return 0u;
|
||||
if (player && player->GetTeam() == ALLIANCE && config->IntroQuestIDAlliance)
|
||||
return config->IntroQuestIDAlliance;
|
||||
return config->IntroQuestID;
|
||||
}
|
||||
|
||||
uint32 MajorFactionMgr::GetRenownCampaignID(uint32 factionId) const
|
||||
{
|
||||
MajorFactions::MajorFactionConfig const* config = GetConfig(factionId);
|
||||
@@ -423,8 +434,9 @@ bool MajorFactionMgr::IsUnlockedForPlayer(Player const* player, uint32 factionId
|
||||
return false;
|
||||
|
||||
// If an intro quest is configured, treat the faction as locked until the
|
||||
// quest is rewarded.
|
||||
if (uint32 introQuest = GetIntroQuestID(factionId))
|
||||
// quest is rewarded. Alliance players use the Alliance variant if the
|
||||
// row provides one (e.g. Dragonscale 2507: Horde 65435 / Alliance 65436).
|
||||
if (uint32 introQuest = GetIntroQuestID(player, factionId))
|
||||
if (!player->GetQuestRewardStatus(introQuest))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -73,7 +73,8 @@ namespace MajorFactions
|
||||
bool UseJourneyRewardTrack = false;
|
||||
bool UseJourneyUnlockToast = false;
|
||||
int32 UiPriority = 0;
|
||||
uint32 IntroQuestID = 0;
|
||||
uint32 IntroQuestID = 0; // canonical/Horde intro quest
|
||||
uint32 IntroQuestIDAlliance = 0; // 0 = use IntroQuestID for both teams
|
||||
uint32 PlayerCompanionID = 0;
|
||||
uint32 RenownCampaignID = 0; // Campaign.db2 ID for the faction's main renown campaign
|
||||
};
|
||||
@@ -165,6 +166,10 @@ public:
|
||||
bool ShouldUseJourneyUnlockToast(uint32 factionId) const;
|
||||
uint32 GetPlayerCompanionID(uint32 factionId) const;
|
||||
uint32 GetIntroQuestID(uint32 factionId) const;
|
||||
// Team-aware variant: returns the Alliance variant for Alliance
|
||||
// players if the row provides one, otherwise falls back to the
|
||||
// canonical IntroQuestID. Pass nullptr to get the canonical value.
|
||||
uint32 GetIntroQuestID(Player const* player, uint32 factionId) const;
|
||||
uint32 GetRenownCampaignID(uint32 factionId) const;
|
||||
|
||||
// Walks faction -> renown Campaign -> Campaign.UiTextureKitID ->
|
||||
|
||||
@@ -440,7 +440,8 @@ uint32 Quest::XPValue(Player const* player, uint32 contentTuningId, uint32 xpDif
|
||||
return 0;
|
||||
|
||||
uint32 xp = questXp->Difficulty[xpDifficulty];
|
||||
if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(contentTuningId))
|
||||
uint32 redirectedContentTuningId = sDB2Manager.GetRedirectedContentTuningId(contentTuningId, player->m_playerData->CtrOptions->ConditionalFlags);
|
||||
if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(redirectedContentTuningId))
|
||||
xp = xp * contentTuning->QuestXpMultiplier;
|
||||
|
||||
int32 diffFactor = 2 * (questLevel - player->GetLevel()) + 12;
|
||||
|
||||
@@ -693,7 +693,7 @@ class spell_warr_enrage_proc : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_FRESH_MEAT_TALENT, SPELL_WARRIOR_FRESH_MEAT_DEBUFF });
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_ENRAGE });
|
||||
}
|
||||
|
||||
static bool CheckRampageProc(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
|
||||
|
||||
Reference in New Issue
Block a user