mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Achievements: Fix gender-specific Matron/Patron title reward.
Closes #1406
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
-- Replaces MATRON with PATRON title on MALE char.
|
||||
UPDATE characters SET knownTitles = CONCAT(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(knownTitles, ' ', 1), ' ', -1), ' ',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(knownTitles, ' ', 2), ' ', -1), ' ',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(knownTitles, ' ', 3), ' ', -1), ' ',
|
||||
(SUBSTRING_INDEX(SUBSTRING_INDEX(knownTitles, ' ', 4), ' ', -1) | 512) &~256, ' ',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(knownTitles, ' ', 5), ' ', -1), ' ',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(knownTitles, ' ', 6), ' ', -1))
|
||||
WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(knownTitles, ' ', 4), ' ', -1) & 256 AND gender = 0;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Set `title_A` to male variant (Patron)
|
||||
UPDATE `achievement_reward` SET `title_A`=138 WHERE `entry`=1793;
|
||||
@@ -2039,7 +2039,11 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
return;
|
||||
|
||||
// titles
|
||||
if (uint32 titleId = reward->titleId[GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1])
|
||||
//! Currently there's only one achievement that deals with gender-specific titles.
|
||||
//! Since no common attributes were found, (not even in titleRewardFlags field)
|
||||
//! we explicitly check by ID. Maybe in the future we could move the achievement_reward
|
||||
//! condition fields to the condition system.
|
||||
if (uint32 titleId = reward->titleId[achievement->ID == 1793 ? GetPlayer()->getGender() : (GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1)])
|
||||
if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId))
|
||||
GetPlayer()->SetTitle(titleEntry);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user