Core/Players: Implement warband scene collection

Port From (https://github.com/TrinityCore/TrinityCore/commit/29e032707686b18bbcce7029e8dd2eaa6606f6d4)
This commit is contained in:
Hondacrx
2025-06-16 16:42:29 -04:00
parent af80dc75f2
commit 9287b9b3a7
15 changed files with 349 additions and 23 deletions
@@ -3139,6 +3139,15 @@ namespace Framework.Constants
NoPaddingAboveUiWidgets = 0x020000
}
public enum WarbandSceneFlags
{
DoNotInclude = 0x01,
HiddenUntilCollected = 0x02,
CannotBeSaved = 0x04,
AwardedAutomatically = 0x08,
IsDefault = 0x10
}
public enum WorldMapTransformsFlags
{
Dungeon = 0x04
@@ -1629,6 +1629,13 @@ namespace Framework.Database
"MinHeight, VignetteType, RewardQuestID, UiWidgetSetID, UiMapPinInfoID, ObjectiveType FROM vignette WHERE (`VerifiedBuild` > 0) = ?");
PrepareStatement(HotfixStatements.SEL_VIGNETTE_LOCALE, "SELECT ID, Name_lang FROM vignette_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
// WarbandScene.db2
PrepareStatement(HotfixStatements.SEL_WARBAND_SCENE, "SELECT Name, Description, Source, PositionX, PositionY, PositionZ, LookAtX, LookAtY, LookAtZ, ID, " +
"MapID, Fov, TimeOfDay, Flags, SoundAmbienceID, Quality, TextureKit, DefaultScenePriority, SourceType FROM warband_scene" +
" WHERE (`VerifiedBuild` > 0) = ?");
PrepareStatement(HotfixStatements.SEL_WARBAND_SCENE_LOCALE, "SELECT ID, Name_lang, Description_lang, Source_lang FROM warband_scene_locale" +
" WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
// WmoAreaTable.db2
PrepareStatement(HotfixStatements.SEL_WMO_AREA_TABLE, "SELECT AreaName, ID, WmoID, NameSetID, WmoGroupID, SoundProviderPref, SoundProviderPrefUnderwater, " +
"AmbienceID, UwAmbience, ZoneMusic, UwZoneMusic, IntroSound, UwIntroSound, AreaTableID, Flags FROM wmo_area_table" +
@@ -2435,6 +2442,9 @@ namespace Framework.Database
SEL_VIGNETTE,
SEL_VIGNETTE_LOCALE,
SEL_WARBAND_SCENE,
SEL_WARBAND_SCENE_LOCALE,
SEL_WMO_AREA_TABLE,
SEL_WMO_AREA_TABLE_LOCALE,
@@ -174,6 +174,11 @@ namespace Framework.Database
PrepareStatement(LoginStatements.SEL_BNET_TRANSMOG_ILLUSIONS, "SELECT blobIndex, illusionMask FROM battlenet_account_transmog_illusions WHERE battlenetAccountId = ? ORDER BY blobIndex DESC");
PrepareStatement(LoginStatements.INS_BNET_TRANSMOG_ILLUSIONS, "INSERT INTO battlenet_account_transmog_illusions (battlenetAccountId, blobIndex, illusionMask) VALUES (?, ?, ?) " +
"ON DUPLICATE KEY UPDATE illusionMask = illusionMask | VALUES(illusionMask)");
PrepareStatement(LoginStatements.SEL_BNET_WARBAND_SCENES, "SELECT warbandSceneId, isFavorite, hasFanfare FROM battlenet_account_warband_scenes WHERE battlenetAccountId = ?");
PrepareStatement(LoginStatements.INS_BNET_WARBAND_SCENE, "INSERT INTO battlenet_account_warband_scenes (battlenetAccountId, warbandSceneId, isFavorite, hasFanfare) VALUES (?, ?, ?, ?) " +
"ON DUPLICATE KEY UPDATE isFavorite = VALUES(isFavorite)");
PrepareStatement(LoginStatements.UPD_BNET_WARBAND_SCENE, "UPDATE battlenet_account_warband_scenes SET isFavorite = ?, hasFanfare = ? WHERE battlenetAccountId = ? AND warbandSceneId = ?");
PrepareStatement(LoginStatements.DEL_BNET_WARBAND_SCENE, "DELETE FROM battlenet_account_warband_scenes WHERE battlenetAccountId = ? AND warbandSceneId = ?");
}
}
@@ -327,6 +332,10 @@ namespace Framework.Database
DEL_BNET_ITEM_FAVORITE_APPEARANCE,
SEL_BNET_TRANSMOG_ILLUSIONS,
INS_BNET_TRANSMOG_ILLUSIONS,
SEL_BNET_WARBAND_SCENES,
INS_BNET_WARBAND_SCENE,
UPD_BNET_WARBAND_SCENE,
DEL_BNET_WARBAND_SCENE,
MAX_LOGINDATABASE_STATEMENTS
}