aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/database/Database/Implementation/HotfixDatabase.cpp66
-rw-r--r--src/server/database/Database/Implementation/HotfixDatabase.h23
-rw-r--r--src/server/game/Battlegrounds/BattlegroundQueue.cpp2
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp114
-rw-r--r--src/server/game/DataStores/DB2Stores.h14
-rw-r--r--src/server/game/DataStores/DB2Structure.h178
-rw-r--r--src/server/game/DataStores/DB2fmt.h18
-rw-r--r--src/server/game/DataStores/DBCStores.cpp72
-rw-r--r--src/server/game/DataStores/DBCStores.h18
-rw-r--r--src/server/game/DataStores/DBCStructure.h182
-rw-r--r--src/server/game/DataStores/DBCfmt.h10
-rw-r--r--src/server/game/Entities/Player/Player.cpp20
-rw-r--r--src/server/game/Entities/Totem/Totem.cpp12
-rw-r--r--src/server/game/Entities/Totem/Totem.h7
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp22
-rw-r--r--src/server/game/Entities/Vehicle/Vehicle.cpp10
-rw-r--r--src/server/game/Entities/Vehicle/Vehicle.h2
-rw-r--r--src/server/game/Groups/Group.cpp4
-rw-r--r--src/server/game/Handlers/BattleGroundHandler.cpp8
-rw-r--r--src/server/game/Handlers/CombatHandler.cpp2
-rw-r--r--src/server/game/Handlers/MovementHandler.cpp2
-rw-r--r--src/server/game/Handlers/SkillHandler.cpp3
-rw-r--r--src/server/game/Handlers/VehicleHandler.cpp15
-rw-r--r--src/server/game/Maps/Map.h1
-rw-r--r--src/server/game/Spells/Spell.cpp4
-rw-r--r--src/server/game/Spells/SpellEffects.cpp8
-rw-r--r--src/server/game/Spells/SpellInfo.cpp4
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp44
-rw-r--r--src/server/shared/DataStores/DB2SparseStorageLoader.cpp11
29 files changed, 483 insertions, 393 deletions
diff --git a/src/server/database/Database/Implementation/HotfixDatabase.cpp b/src/server/database/Database/Implementation/HotfixDatabase.cpp
index 666b697a4c3..d2a62e1f9ce 100644
--- a/src/server/database/Database/Implementation/HotfixDatabase.cpp
+++ b/src/server/database/Database/Implementation/HotfixDatabase.cpp
@@ -80,6 +80,10 @@ void HotfixDatabaseConnection::DoPrepareStatements()
"ItemID10, ItemID11, ItemID12, ItemID13, ItemID14, ItemID15, ItemID16, ItemID17, ItemID18, ItemID19, ItemID20, ItemID21, ItemID22, ItemID23, "
"ItemID24, PetDisplayID, RaceID, ClassID, GenderID, OutfitID, PetFamilyID FROM char_start_outfit ORDER BY ID DESC", CONNECTION_SYNCH);
+ // ChatChannels.db2
+ PrepareStatement(HOTFIX_SEL_CHAT_CHANNELS, "SELECT ID, Flags, Name, Shortcut, FactionGroup FROM chat_channels ORDER BY ID DESC", CONNECTION_SYNCH);
+ PREPARE_LOCALE_STMT(HOTFIX_SEL_CHAT_CHANNELS, "SELECT ID, Name_lang, Shortcut_lang FROM chat_channels_locale WHERE locale = ?", CONNECTION_SYNCH);
+
// ChrClassesXPowerTypes.db2
PrepareStatement(HOTFIX_SEL_CHR_CLASSES_X_POWER_TYPES, "SELECT ID, ClassID, PowerType FROM chr_classes_x_power_types ORDER BY ID DESC", CONNECTION_SYNCH);
@@ -93,6 +97,12 @@ void HotfixDatabaseConnection::DoPrepareStatements()
" ORDER BY ID DESC", CONNECTION_SYNCH);
PREPARE_LOCALE_STMT(HOTFIX_SEL_CHR_RACES, "SELECT ID, Name_lang, NameFemale_lang, NameMale_lang FROM chr_races_locale WHERE locale = ?", CONNECTION_SYNCH);
+ // ChrSpecialization.db2
+ PrepareStatement(HOTFIX_SEL_CHR_SPECIALIZATION, "SELECT ID, MasterySpellID1, MasterySpellID2, Flags, AnimReplacementSetID, Name, Name2, "
+ "Description, BackgroundFile, SpellIconID, ClassID, OrderIndex, PetTalentType, Role, PrimaryStatOrder FROM chr_specialization ORDER BY ID DESC", CONNECTION_SYNCH);
+ PREPARE_LOCALE_STMT(HOTFIX_SEL_CHR_SPECIALIZATION, "SELECT ID, Name_lang, Name2_lang, Description_lang FROM chr_specialization_locale"
+ " WHERE locale = ?", CONNECTION_SYNCH);
+
// CinematicSequences.db2
PrepareStatement(HOTFIX_SEL_CINEMATIC_SEQUENCES, "SELECT ID, SoundID, Camera1, Camera2, Camera3, Camera4, Camera5, Camera6, Camera7, Camera8"
" FROM cinematic_sequences ORDER BY ID DESC", CONNECTION_SYNCH);
@@ -104,10 +114,9 @@ void HotfixDatabaseConnection::DoPrepareStatements()
"Gender, Unk700 FROM creature_display_info ORDER BY ID DESC", CONNECTION_SYNCH);
// CreatureDisplayInfoExtra.db2
- PrepareStatement(HOTFIX_SEL_CREATURE_DISPLAY_INFO_EXTRA, "SELECT ID, NPCItemDisplay1, NPCItemDisplay2, NPCItemDisplay3, NPCItemDisplay4, "
- "NPCItemDisplay5, NPCItemDisplay6, NPCItemDisplay7, NPCItemDisplay8, NPCItemDisplay9, NPCItemDisplay10, FileDataID, HDFileDataID, "
- "DisplayRaceID, DisplaySexID, DisplayClassID, SkinID, FaceID, HairStyleID, HairColorID, FacialHairID, CustomDisplayOption1, "
- "CustomDisplayOption2, CustomDisplayOption3, Flags FROM creature_display_info_extra ORDER BY ID DESC", CONNECTION_SYNCH);
+ PrepareStatement(HOTFIX_SEL_CREATURE_DISPLAY_INFO_EXTRA, "SELECT ID, FileDataID, HDFileDataID, DisplayRaceID, DisplaySexID, DisplayClassID, "
+ "SkinID, FaceID, HairStyleID, HairColorID, FacialHairID, CustomDisplayOption1, CustomDisplayOption2, CustomDisplayOption3, Flags"
+ " FROM creature_display_info_extra ORDER BY ID DESC", CONNECTION_SYNCH);
// CreatureType.db2
PrepareStatement(HOTFIX_SEL_CREATURE_TYPE, "SELECT ID, Name, Flags FROM creature_type ORDER BY ID DESC", CONNECTION_SYNCH);
@@ -149,6 +158,10 @@ void HotfixDatabaseConnection::DoPrepareStatements()
// DurabilityQuality.db2
PrepareStatement(HOTFIX_SEL_DURABILITY_QUALITY, "SELECT ID, QualityMod FROM durability_quality ORDER BY ID DESC", CONNECTION_SYNCH);
+ // Emotes.db2
+ PrepareStatement(HOTFIX_SEL_EMOTES, "SELECT ID, EmoteSlashCommand, SpellVisualKitID, EmoteFlags, AnimID, EmoteSoundID, EmoteSpecProc, "
+ "EmoteSpecProcParam FROM emotes ORDER BY ID DESC", CONNECTION_SYNCH);
+
// EmotesTextSound.db2
PrepareStatement(HOTFIX_SEL_EMOTES_TEXT_SOUND, "SELECT ID, EmotesTextId, SoundId, RaceId, SexId, ClassId FROM emotes_text_sound ORDER BY ID DESC", CONNECTION_SYNCH);
@@ -160,8 +173,7 @@ void HotfixDatabaseConnection::DoPrepareStatements()
// GameobjectDisplayInfo.db2
PrepareStatement(HOTFIX_SEL_GAMEOBJECT_DISPLAY_INFO, "SELECT ID, FileDataID, GeoBoxMinX, GeoBoxMinY, GeoBoxMinZ, GeoBoxMaxX, GeoBoxMaxY, "
- "GeoBoxMaxZ, OverrideLootEffectScale, OverrideNameScale, Sound1, Sound2, Sound3, Sound4, Sound5, Sound6, Sound7, Sound8, Sound9, Sound10, "
- "ObjectEffectPackageID FROM gameobject_display_info ORDER BY ID DESC", CONNECTION_SYNCH);
+ "GeoBoxMaxZ, OverrideLootEffectScale, OverrideNameScale, ObjectEffectPackageID FROM gameobject_display_info ORDER BY ID DESC", CONNECTION_SYNCH);
// GameTables.db2
PrepareStatement(HOTFIX_SEL_GAME_TABLES, "SELECT ID, Name, NumRows, NumColumns FROM game_tables ORDER BY ID DESC", CONNECTION_SYNCH);
@@ -185,7 +197,7 @@ void HotfixDatabaseConnection::DoPrepareStatements()
"GarrSiteLevelPlotInstID, GarrBuildingID FROM garr_building_plot_inst ORDER BY ID DESC", CONNECTION_SYNCH);
// GarrClassSpec.db2
- PrepareStatement(HOTFIX_SEL_GARR_CLASS_SPEC, "SELECT ID, NameMale, NameFemale, NameGenderless, ClassAtlasID, GarrFollItemSetID"
+ PrepareStatement(HOTFIX_SEL_GARR_CLASS_SPEC, "SELECT ID, NameMale, NameFemale, NameGenderless, ClassAtlasID, GarrFollItemSetID, Unknown700"
" FROM garr_class_spec ORDER BY ID DESC", CONNECTION_SYNCH);
PREPARE_LOCALE_STMT(HOTFIX_SEL_GARR_CLASS_SPEC, "SELECT ID, NameMale_lang, NameFemale_lang, NameGenderless_lang FROM garr_class_spec_locale"
" WHERE locale = ?", CONNECTION_SYNCH);
@@ -222,6 +234,14 @@ void HotfixDatabaseConnection::DoPrepareStatements()
PrepareStatement(HOTFIX_SEL_GARR_SITE_LEVEL_PLOT_INST, "SELECT ID, LandmarkX, LandmarkY, GarrSiteLevelID, GarrPlotInstanceID, Unknown"
" FROM garr_site_level_plot_inst ORDER BY ID DESC", CONNECTION_SYNCH);
+ // GemProperties.db2
+ PrepareStatement(HOTFIX_SEL_GEM_PROPERTIES, "SELECT ID, Type, EnchantID, MinItemLevel, MaxCountInv, MaxCountItem FROM gem_properties"
+ " ORDER BY ID DESC", CONNECTION_SYNCH);
+
+ // GlyphProperties.db2
+ PrepareStatement(HOTFIX_SEL_GLYPH_PROPERTIES, "SELECT ID, SpellID, SpellIconID, Type, GlyphExclusiveCategoryID FROM glyph_properties"
+ " ORDER BY ID DESC", CONNECTION_SYNCH);
+
// GlyphSlot.db2
PrepareStatement(HOTFIX_SEL_GLYPH_SLOT, "SELECT ID, Type, Tooltip FROM glyph_slot ORDER BY ID DESC", CONNECTION_SYNCH);
@@ -354,6 +374,12 @@ void HotfixDatabaseConnection::DoPrepareStatements()
"Enchantment5, AllocationPct1, AllocationPct2, AllocationPct3, AllocationPct4, AllocationPct5 FROM item_random_suffix ORDER BY ID DESC", CONNECTION_SYNCH);
PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_RANDOM_SUFFIX, "SELECT ID, Name_lang, InternalName_lang FROM item_random_suffix_locale WHERE locale = ?", CONNECTION_SYNCH);
+ // ItemSet.db2
+ PrepareStatement(HOTFIX_SEL_ITEM_SET, "SELECT ID, Name, ItemID1, ItemID2, ItemID3, ItemID4, ItemID5, ItemID6, ItemID7, ItemID8, ItemID9, "
+ "ItemID10, ItemID11, ItemID12, ItemID13, ItemID14, ItemID15, ItemID16, ItemID17, RequiredSkillRank, RequiredSkill FROM item_set"
+ " ORDER BY ID DESC", CONNECTION_SYNCH);
+ PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_SET, "SELECT ID, Name_lang FROM item_set_locale WHERE locale = ?", CONNECTION_SYNCH);
+
// ItemSetSpell.db2
PrepareStatement(HOTFIX_SEL_ITEM_SET_SPELL, "SELECT ID, SpellID, ItemSetID, ChrSpecID, Threshold FROM item_set_spell ORDER BY ID DESC", CONNECTION_SYNCH);
@@ -392,6 +418,11 @@ void HotfixDatabaseConnection::DoPrepareStatements()
"Key15, Key16, Key17, Key18, Key19, Key20, Key21, Key22, Key23, Key24, Key25, Key26, Key27, Key28, Key29, Key30, Key31, Key32 FROM key_chain"
" ORDER BY ID DESC", CONNECTION_SYNCH);
+ // Lock.db2
+ PrepareStatement(HOTFIX_SEL_LOCK, "SELECT ID, Index1, Index2, Index3, Index4, Index5, Index6, Index7, Index8, Skill1, Skill2, Skill3, Skill4, "
+ "Skill5, Skill6, Skill7, Skill8, Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Action1, Action2, Action3, Action4, Action5, "
+ "Action6, Action7, Action8 FROM `lock` ORDER BY ID DESC", CONNECTION_SYNCH);
+
// MailTemplate.db2
PrepareStatement(HOTFIX_SEL_MAIL_TEMPLATE, "SELECT ID, Body FROM mail_template ORDER BY ID DESC", CONNECTION_SYNCH);
PREPARE_LOCALE_STMT(HOTFIX_SEL_MAIL_TEMPLATE, "SELECT ID, Body_lang FROM mail_template_locale WHERE locale = ?", CONNECTION_SYNCH);
@@ -457,6 +488,9 @@ void HotfixDatabaseConnection::DoPrepareStatements()
// PowerDisplay.db2
PrepareStatement(HOTFIX_SEL_POWER_DISPLAY, "SELECT ID, GlobalStringBaseTag, PowerType, Red, Green, Blue FROM power_display ORDER BY ID DESC", CONNECTION_SYNCH);
+ // PvpDifficulty.db2
+ PrepareStatement(HOTFIX_SEL_PVP_DIFFICULTY, "SELECT ID, MapID, BracketID, MinLevel, MaxLevel FROM pvp_difficulty ORDER BY ID DESC", CONNECTION_SYNCH);
+
// QuestFactionReward.db2
PrepareStatement(HOTFIX_SEL_QUEST_FACTION_REWARD, "SELECT ID, QuestRewFactionValue1, QuestRewFactionValue2, QuestRewFactionValue3, "
"QuestRewFactionValue4, QuestRewFactionValue5, QuestRewFactionValue6, QuestRewFactionValue7, QuestRewFactionValue8, QuestRewFactionValue9, "
@@ -590,7 +624,8 @@ void HotfixDatabaseConnection::DoPrepareStatements()
PrepareStatement(HOTFIX_SEL_SPELL_LEARN_SPELL, "SELECT ID, LearnSpellID, SpellID, OverridesSpellID FROM spell_learn_spell ORDER BY ID DESC", CONNECTION_SYNCH);
// SpellLevels.db2
- PrepareStatement(HOTFIX_SEL_SPELL_LEVELS, "SELECT ID, SpellID, BaseLevel, MaxLevel, SpellLevel, DifficultyID FROM spell_levels ORDER BY ID DESC", CONNECTION_SYNCH);
+ PrepareStatement(HOTFIX_SEL_SPELL_LEVELS, "SELECT ID, SpellID, BaseLevel, MaxLevel, SpellLevel, DifficultyID, MaxUsableLevel FROM spell_levels"
+ " ORDER BY ID DESC", CONNECTION_SYNCH);
// SpellMisc.db2
PrepareStatement(HOTFIX_SEL_SPELL_MISC, "SELECT ID, Attributes, AttributesEx, AttributesExB, AttributesExC, AttributesExD, AttributesExE, "
@@ -653,6 +688,9 @@ void HotfixDatabaseConnection::DoPrepareStatements()
PrepareStatement(HOTFIX_SEL_SPELL_X_SPELL_VISUAL, "SELECT ID, SpellID, Unk620, SpellVisualID1, SpellVisualID2, PlayerConditionID, DifficultyID, "
"Flags FROM spell_x_spell_visual ORDER BY ID DESC", CONNECTION_SYNCH);
+ // SummonProperties.db2
+ PrepareStatement(HOTFIX_SEL_SUMMON_PROPERTIES, "SELECT ID, Category, Faction, Type, Slot, Flags FROM summon_properties ORDER BY ID DESC", CONNECTION_SYNCH);
+
// TaxiNodes.db2
PrepareStatement(HOTFIX_SEL_TAXI_NODES, "SELECT ID, PosX, PosY, PosZ, Name, MountCreatureID1, MountCreatureID2, MapOffsetX, MapOffsetY, MapID, "
"ConditionID, LearnableIndex, Flags FROM taxi_nodes ORDER BY ID DESC", CONNECTION_SYNCH);
@@ -687,6 +725,18 @@ void HotfixDatabaseConnection::DoPrepareStatements()
PREPARE_LOCALE_STMT(HOTFIX_SEL_UNIT_POWER_BAR, "SELECT ID, Name_lang, Cost_lang, OutOfError_lang, ToolTip_lang FROM unit_power_bar_locale"
" WHERE locale = ?", CONNECTION_SYNCH);
+ // VehicleSeat.db2
+ PrepareStatement(HOTFIX_SEL_VEHICLE_SEAT, "SELECT ID, Flags1, Flags2, Flags3, AttachmentOffsetX, AttachmentOffsetY, AttachmentOffsetZ, "
+ "EnterPreDelay, EnterSpeed, EnterGravity, EnterMinDuration, EnterMaxDuration, EnterMinArcHeight, EnterMaxArcHeight, ExitPreDelay, ExitSpeed, "
+ "ExitGravity, ExitMinDuration, ExitMaxDuration, ExitMinArcHeight, ExitMaxArcHeight, PassengerYaw, PassengerPitch, PassengerRoll, "
+ "VehicleEnterAnimDelay, VehicleExitAnimDelay, CameraEnteringDelay, CameraEnteringDuration, CameraExitingDelay, CameraExitingDuration, "
+ "CameraOffsetX, CameraOffsetY, CameraOffsetZ, CameraPosChaseRate, CameraFacingChaseRate, CameraEnteringZoom, CameraSeatZoomMin, "
+ "CameraSeatZoomMax, UISkinFileDataID, EnterAnimStart, EnterAnimLoop, RideAnimStart, RideAnimLoop, RideUpperAnimStart, RideUpperAnimLoop, "
+ "ExitAnimStart, ExitAnimLoop, ExitAnimEnd, VehicleEnterAnim, VehicleExitAnim, VehicleRideAnimLoop, EnterUISoundID, ExitUISoundID, "
+ "EnterAnimKitID, RideAnimKitID, ExitAnimKitID, VehicleEnterAnimKitID, VehicleRideAnimKitID, VehicleExitAnimKitID, CameraModeID, AttachmentID, "
+ "PassengerAttachmentID, VehicleEnterAnimBone, VehicleExitAnimBone, VehicleRideAnimLoopBone, VehicleAbilityDisplay FROM vehicle_seat"
+ " ORDER BY ID DESC", CONNECTION_SYNCH);
+
// WorldMapOverlay.db2
PrepareStatement(HOTFIX_SEL_WORLD_MAP_OVERLAY, "SELECT ID, TextureName, MapAreaID, AreaID1, AreaID2, AreaID3, AreaID4, TextureWidth, "
"TextureHeight, OffsetX, OffsetY, HitRectTop, HitRectLeft, HitRectBottom, HitRectRight, PlayerConditionID FROM world_map_overlay"
diff --git a/src/server/database/Database/Implementation/HotfixDatabase.h b/src/server/database/Database/Implementation/HotfixDatabase.h
index 322df76d74d..cedaccf6168 100644
--- a/src/server/database/Database/Implementation/HotfixDatabase.h
+++ b/src/server/database/Database/Implementation/HotfixDatabase.h
@@ -63,11 +63,17 @@ enum HotfixDatabaseStatements
HOTFIX_SEL_CHAR_START_OUTFIT,
+ HOTFIX_SEL_CHAT_CHANNELS,
+ HOTFIX_SEL_CHAT_CHANNELS_LOCALE,
+
HOTFIX_SEL_CHR_CLASSES_X_POWER_TYPES,
HOTFIX_SEL_CHR_RACES,
HOTFIX_SEL_CHR_RACES_LOCALE,
+ HOTFIX_SEL_CHR_SPECIALIZATION,
+ HOTFIX_SEL_CHR_SPECIALIZATION_LOCALE,
+
HOTFIX_SEL_CINEMATIC_SEQUENCES,
HOTFIX_SEL_CREATURE_DISPLAY_INFO,
@@ -93,6 +99,8 @@ enum HotfixDatabaseStatements
HOTFIX_SEL_DURABILITY_QUALITY,
+ HOTFIX_SEL_EMOTES,
+
HOTFIX_SEL_EMOTES_TEXT_SOUND,
HOTFIX_SEL_GAMEOBJECTS,
@@ -131,6 +139,10 @@ enum HotfixDatabaseStatements
HOTFIX_SEL_GARR_SITE_LEVEL_PLOT_INST,
+ HOTFIX_SEL_GEM_PROPERTIES,
+
+ HOTFIX_SEL_GLYPH_PROPERTIES,
+
HOTFIX_SEL_GLYPH_SLOT,
HOTFIX_SEL_GUILD_COLOR_BACKGROUND,
@@ -205,6 +217,9 @@ enum HotfixDatabaseStatements
HOTFIX_SEL_ITEM_RANDOM_SUFFIX,
HOTFIX_SEL_ITEM_RANDOM_SUFFIX_LOCALE,
+ HOTFIX_SEL_ITEM_SET,
+ HOTFIX_SEL_ITEM_SET_LOCALE,
+
HOTFIX_SEL_ITEM_SET_SPELL,
HOTFIX_SEL_ITEM_SPARSE,
@@ -220,6 +235,8 @@ enum HotfixDatabaseStatements
HOTFIX_SEL_KEY_CHAIN,
+ HOTFIX_SEL_LOCK,
+
HOTFIX_SEL_MAIL_TEMPLATE,
HOTFIX_SEL_MAIL_TEMPLATE_LOCALE,
@@ -252,6 +269,8 @@ enum HotfixDatabaseStatements
HOTFIX_SEL_POWER_DISPLAY,
+ HOTFIX_SEL_PVP_DIFFICULTY,
+
HOTFIX_SEL_QUEST_FACTION_REWARD,
HOTFIX_SEL_QUEST_MONEY_REWARD,
@@ -351,6 +370,8 @@ enum HotfixDatabaseStatements
HOTFIX_SEL_SPELL_X_SPELL_VISUAL,
+ HOTFIX_SEL_SUMMON_PROPERTIES,
+
HOTFIX_SEL_TAXI_NODES,
HOTFIX_SEL_TAXI_NODES_LOCALE,
@@ -371,6 +392,8 @@ enum HotfixDatabaseStatements
HOTFIX_SEL_UNIT_POWER_BAR,
HOTFIX_SEL_UNIT_POWER_BAR_LOCALE,
+ HOTFIX_SEL_VEHICLE_SEAT,
+
HOTFIX_SEL_WORLD_MAP_OVERLAY,
HOTFIX_SEL_WORLD_MAP_TRANSFORMS,
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index 6b6c7558f3e..bb4aea1a22c 100644
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -814,7 +814,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
return;
}
- PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(), bracket_id);
+ PvPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketById(bg_template->GetMapId(), bracket_id);
if (!bracketEntry)
{
TC_LOG_ERROR("bg.battleground", "Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id);
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index ae01936ff0e..1778a0b97aa 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -36,9 +36,11 @@ DB2Storage<BattlePetBreedStateEntry> sBattlePetBreedStateStore("Battl
DB2Storage<BattlePetSpeciesEntry> sBattlePetSpeciesStore("BattlePetSpecies.db2", BattlePetSpeciesFormat, HOTFIX_SEL_BATTLE_PET_SPECIES);
DB2Storage<BattlePetSpeciesStateEntry> sBattlePetSpeciesStateStore("BattlePetSpeciesState.db2", BattlePetSpeciesStateFormat, HOTFIX_SEL_BATTLE_PET_SPECIES_STATE);
DB2Storage<BroadcastTextEntry> sBroadcastTextStore("BroadcastText.db2", BroadcastTextFormat, HOTFIX_SEL_BROADCAST_TEXT);
+DB2Storage<ChatChannelsEntry> sChatChannelsStore("ChatChannels.db2", ChatChannelsFormat, HOTFIX_SEL_CHAT_CHANNELS);
DB2Storage<CharStartOutfitEntry> sCharStartOutfitStore("CharStartOutfit.db2", CharStartOutfitFormat, HOTFIX_SEL_CHAR_START_OUTFIT);
DB2Storage<ChrClassesXPowerTypesEntry> sChrClassesXPowerTypesStore("ChrClassesXPowerTypes.db2", ChrClassesXPowerTypesFormat, HOTFIX_SEL_CHR_CLASSES_X_POWER_TYPES);
DB2Storage<ChrRacesEntry> sChrRacesStore("ChrRaces.db2", ChrRacesFormat, HOTFIX_SEL_CHR_RACES);
+DB2Storage<ChrSpecializationEntry> sChrSpecializationStore("ChrSpecialization.db2", ChrSpecializationFormat, HOTFIX_SEL_CHR_SPECIALIZATION);
DB2Storage<CinematicSequencesEntry> sCinematicSequencesStore("CinematicSequences.db2", CinematicSequencesFormat, HOTFIX_SEL_CINEMATIC_SEQUENCES);
DB2Storage<CreatureDisplayInfoEntry> sCreatureDisplayInfoStore("CreatureDisplayInfo.db2", CreatureDisplayInfoFormat, HOTFIX_SEL_CREATURE_DISPLAY_INFO);
DB2Storage<CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore("CreatureDisplayInfoExtra.db2", CreatureDisplayInfoExtraFormat, HOTFIX_SEL_CREATURE_DISPLAY_INFO_EXTRA);
@@ -50,6 +52,7 @@ DB2Storage<CurvePointEntry> sCurvePointStore("CurvePoint.db2
DB2Storage<DestructibleModelDataEntry> sDestructibleModelDataStore("DestructibleModelData.db2", DestructibleModelDataFormat, HOTFIX_SEL_DESTRUCTIBLE_MODEL_DATA);
DB2Storage<DurabilityCostsEntry> sDurabilityCostsStore("DurabilityCosts.db2", DurabilityCostsFormat, HOTFIX_SEL_DURABILITY_COSTS);
DB2Storage<DurabilityQualityEntry> sDurabilityQualityStore("DurabilityQuality.db2", DurabilityQualityFormat, HOTFIX_SEL_DURABILITY_QUALITY);
+DB2Storage<EmotesEntry> sEmotesStore("Emotes.db2", EmotesFormat, HOTFIX_SEL_EMOTES);
DB2Storage<EmotesTextSoundEntry> sEmotesTextSoundStore("EmotesTextSound.db2", EmotesTextSoundFormat, HOTFIX_SEL_EMOTES_TEXT_SOUND);
DB2Storage<GameObjectsEntry> sGameObjectsStore("GameObjects.db2", GameObjectsFormat, HOTFIX_SEL_GAMEOBJECTS);
DB2Storage<GameObjectDisplayInfoEntry> sGameObjectDisplayInfoStore("GameObjectDisplayInfo.db2", GameObjectDisplayInfoFormat, HOTFIX_SEL_GAMEOBJECT_DISPLAY_INFO);
@@ -65,6 +68,8 @@ DB2Storage<GarrPlotEntry> sGarrPlotStore("GarrPlot.db2", G
DB2Storage<GarrPlotInstanceEntry> sGarrPlotInstanceStore("GarrPlotInstance.db2", GarrPlotInstanceFormat, HOTFIX_SEL_GARR_PLOT_INSTANCE);
DB2Storage<GarrSiteLevelEntry> sGarrSiteLevelStore("GarrSiteLevel.db2", GarrSiteLevelFormat, HOTFIX_SEL_GARR_SITE_LEVEL);
DB2Storage<GarrSiteLevelPlotInstEntry> sGarrSiteLevelPlotInstStore("GarrSiteLevelPlotInst.db2", GarrSiteLevelPlotInstFormat, HOTFIX_SEL_GARR_SITE_LEVEL_PLOT_INST);
+DB2Storage<GemPropertiesEntry> sGemPropertiesStore("GemProperties.db2", GemPropertiesFormat, HOTFIX_SEL_GEM_PROPERTIES);
+DB2Storage<GlyphPropertiesEntry> sGlyphPropertiesStore("GlyphProperties.db2", GlyphPropertiesFormat, HOTFIX_SEL_GLYPH_PROPERTIES);
DB2Storage<GlyphSlotEntry> sGlyphSlotStore("GlyphSlot.db2", GlyphSlotFormat, HOTFIX_SEL_GLYPH_SLOT);
DB2Storage<GuildColorBackgroundEntry> sGuildColorBackgroundStore("GuildColorBackground.db2", GuildColorBackgroundFormat, HOTFIX_SEL_GUILD_COLOR_BACKGROUND);
DB2Storage<GuildColorBorderEntry> sGuildColorBorderStore("GuildColorBorder.db2", GuildColorBorderFormat, HOTFIX_SEL_GUILD_COLOR_BORDER);
@@ -99,6 +104,7 @@ DB2Storage<ItemModifiedAppearanceEntry> sItemModifiedAppearanceStore("It
DB2Storage<ItemPriceBaseEntry> sItemPriceBaseStore("ItemPriceBase.db2", ItemPriceBaseFormat, HOTFIX_SEL_ITEM_PRICE_BASE);
DB2Storage<ItemRandomPropertiesEntry> sItemRandomPropertiesStore("ItemRandomProperties.db2", ItemRandomPropertiesFormat, HOTFIX_SEL_ITEM_RANDOM_PROPERTIES);
DB2Storage<ItemRandomSuffixEntry> sItemRandomSuffixStore("ItemRandomSuffix.db2", ItemRandomSuffixFormat, HOTFIX_SEL_ITEM_RANDOM_SUFFIX);
+DB2Storage<ItemSetEntry> sItemSetStore("ItemSet.db2", ItemSetFormat, HOTFIX_SEL_ITEM_SET);
DB2Storage<ItemSetSpellEntry> sItemSetSpellStore("ItemSetSpell.db2", ItemSetSpellFormat, HOTFIX_SEL_ITEM_SET_SPELL);
DB2SparseStorage<ItemSparseEntry> sItemSparseStore("Item-sparse.db2", ItemSparseFormat, HOTFIX_SEL_ITEM_SPARSE);
DB2Storage<ItemSpecEntry> sItemSpecStore("ItemSpec.db2", ItemSpecFormat, HOTFIX_SEL_ITEM_SPEC);
@@ -106,6 +112,7 @@ DB2Storage<ItemSpecOverrideEntry> sItemSpecOverrideStore("ItemSpec
DB2Storage<ItemToBattlePetSpeciesEntry> sItemToBattlePetSpeciesStore("ItemToBattlePetSpecies.db2", ItemToBattlePetSpeciesFormat, HOTFIX_SEL_ITEM_TO_BATTLE_PET_SPECIES);
DB2Storage<ItemXBonusTreeEntry> sItemXBonusTreeStore("ItemXBonusTree.db2", ItemXBonusTreeFormat, HOTFIX_SEL_ITEM_X_BONUS_TREE);
DB2Storage<KeyChainEntry> sKeyChainStore("KeyChain.db2", KeyChainFormat, HOTFIX_SEL_KEY_CHAIN);
+DB2Storage<LockEntry> sLockStore("Lock.db2", LockFormat, HOTFIX_SEL_LOCK);
DB2Storage<MailTemplateEntry> sMailTemplateStore("MailTemplate.db2", MailTemplateFormat, HOTFIX_SEL_MAIL_TEMPLATE);
DB2Storage<ModifierTreeEntry> sModifierTreeStore("ModifierTree.db2", ModifierTreeFormat, HOTFIX_SEL_MODIFIER_TREE);
DB2Storage<MountCapabilityEntry> sMountCapabilityStore("MountCapability.db2", MountCapabilityFormat, HOTFIX_SEL_MOUNT_CAPABILITY);
@@ -120,6 +127,7 @@ DB2Storage<OverrideSpellDataEntry> sOverrideSpellDataStore("Overrid
DB2Storage<PhaseXPhaseGroupEntry> sPhaseXPhaseGroupStore("PhaseXPhaseGroup.db2", PhaseXPhaseGroupFormat, HOTFIX_SEL_PHASE_X_PHASE_GROUP);
DB2Storage<PlayerConditionEntry> sPlayerConditionStore("PlayerCondition.db2", PlayerConditionFormat, HOTFIX_SEL_PLAYER_CONDITION);
DB2Storage<PowerDisplayEntry> sPowerDisplayStore("PowerDisplay.db2", PowerDisplayFormat, HOTFIX_SEL_POWER_DISPLAY);
+DB2Storage<PvPDifficultyEntry> sPvpDifficultyStore("PvpDifficulty.db2", PvpDifficultyFormat, HOTFIX_SEL_PVP_DIFFICULTY);
DB2Storage<QuestFactionRewardEntry> sQuestFactionRewardStore("QuestFactionReward.db2", QuestFactionRewardFormat, HOTFIX_SEL_QUEST_FACTION_REWARD);
DB2Storage<QuestMoneyRewardEntry> sQuestMoneyRewardStore("QuestMoneyReward.db2", QuestMoneyRewardFormat, HOTFIX_SEL_QUEST_MONEY_REWARD);
DB2Storage<QuestPackageItemEntry> sQuestPackageItemStore("QuestPackageItem.db2", QuestPackageItemFormat, HOTFIX_SEL_QUEST_PACKAGE_ITEM);
@@ -165,6 +173,7 @@ DB2Storage<SpellShapeshiftFormEntry> sSpellShapeshiftFormStore("Spell
DB2Storage<SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore("SpellTargetRestrictions.db2", SpellTargetRestrictionsFormat, HOTFIX_SEL_SPELL_TARGET_RESTRICTIONS);
DB2Storage<SpellTotemsEntry> sSpellTotemsStore("SpellTotems.db2", SpellTotemsFormat, HOTFIX_SEL_SPELL_TOTEMS);
DB2Storage<SpellXSpellVisualEntry> sSpellXSpellVisualStore("SpellXSpellVisual.db2", SpellXSpellVisualFormat, HOTFIX_SEL_SPELL_X_SPELL_VISUAL);
+DB2Storage<SummonPropertiesEntry> sSummonPropertiesStore("SummonProperties.db2", SummonPropertiesFormat, HOTFIX_SEL_SUMMON_PROPERTIES);
DB2Storage<TaxiNodesEntry> sTaxiNodesStore("TaxiNodes.db2", TaxiNodesFormat, HOTFIX_SEL_TAXI_NODES);
DB2Storage<TaxiPathEntry> sTaxiPathStore("TaxiPath.db2", TaxiPathFormat, HOTFIX_SEL_TAXI_PATH);
DB2Storage<TaxiPathNodeEntry> sTaxiPathNodeStore("TaxiPathNode.db2", TaxiPathNodeFormat, HOTFIX_SEL_TAXI_PATH_NODE);
@@ -173,6 +182,7 @@ DB2Storage<ToyEntry> sToyStore("Toy.db2", ToyFormat,
DB2Storage<TransportAnimationEntry> sTransportAnimationStore("TransportAnimation.db2", TransportAnimationFormat, HOTFIX_SEL_TRANSPORT_ANIMATION);
DB2Storage<TransportRotationEntry> sTransportRotationStore("TransportRotation.db2", TransportRotationFormat, HOTFIX_SEL_TRANSPORT_ROTATION);
DB2Storage<UnitPowerBarEntry> sUnitPowerBarStore("UnitPowerBar.db2", UnitPowerBarFormat, HOTFIX_SEL_UNIT_POWER_BAR);
+DB2Storage<VehicleSeatEntry> sVehicleSeatStore("VehicleSeat.db2", VehicleSeatFormat, HOTFIX_SEL_VEHICLE_SEAT);
DB2Storage<WorldMapOverlayEntry> sWorldMapOverlayStore("WorldMapOverlay.db2", WorldMapOverlayFormat, HOTFIX_SEL_WORLD_MAP_OVERLAY);
DB2Storage<WorldMapTransformsEntry> sWorldMapTransformsStore("WorldMapTransforms.db2", WorldMapTransformsFormat, HOTFIX_SEL_WORLD_MAP_TRANSFORMS);
@@ -262,8 +272,10 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
LOAD_DB2(sBattlePetSpeciesStateStore);
LOAD_DB2(sBroadcastTextStore);
LOAD_DB2(sCharStartOutfitStore);
+ LOAD_DB2(sChatChannelsStore);
LOAD_DB2(sChrClassesXPowerTypesStore);
LOAD_DB2(sChrRacesStore);
+ LOAD_DB2(sChrSpecializationStore);
LOAD_DB2(sCinematicSequencesStore);
LOAD_DB2(sCreatureDisplayInfoStore);
LOAD_DB2(sCreatureDisplayInfoExtraStore);
@@ -275,6 +287,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
LOAD_DB2(sDestructibleModelDataStore);
LOAD_DB2(sDurabilityCostsStore);
LOAD_DB2(sDurabilityQualityStore);
+ LOAD_DB2(sEmotesStore);
LOAD_DB2(sEmotesTextSoundStore);
LOAD_DB2(sGameObjectsStore);
LOAD_DB2(sGameObjectDisplayInfoStore);
@@ -290,6 +303,8 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
LOAD_DB2(sGarrPlotStore);
LOAD_DB2(sGarrSiteLevelPlotInstStore);
LOAD_DB2(sGarrSiteLevelStore);
+ LOAD_DB2(sGemPropertiesStore);
+ LOAD_DB2(sGlyphPropertiesStore);
LOAD_DB2(sGlyphSlotStore);
LOAD_DB2(sGuildColorBackgroundStore);
LOAD_DB2(sGuildColorBorderStore);
@@ -323,6 +338,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
LOAD_DB2(sItemPriceBaseStore);
LOAD_DB2(sItemRandomPropertiesStore);
LOAD_DB2(sItemRandomSuffixStore);
+ LOAD_DB2(sItemSetStore);
LOAD_DB2(sItemSetSpellStore);
LOAD_DB2(sItemSparseStore);
LOAD_DB2(sItemSpecOverrideStore);
@@ -331,6 +347,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
LOAD_DB2(sItemToBattlePetSpeciesStore);
LOAD_DB2(sItemXBonusTreeStore);
LOAD_DB2(sKeyChainStore);
+ LOAD_DB2(sLockStore);
LOAD_DB2(sMailTemplateStore);
LOAD_DB2(sModifierTreeStore);
LOAD_DB2(sMountCapabilityStore);
@@ -345,6 +362,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
LOAD_DB2(sPhaseXPhaseGroupStore);
LOAD_DB2(sPlayerConditionStore);
LOAD_DB2(sPowerDisplayStore);
+ LOAD_DB2(sPvpDifficultyStore);
LOAD_DB2(sQuestFactionRewardStore);
LOAD_DB2(sQuestMoneyRewardStore);
LOAD_DB2(sQuestPackageItemStore);
@@ -389,6 +407,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
LOAD_DB2(sSpellTargetRestrictionsStore);
LOAD_DB2(sSpellTotemsStore);
LOAD_DB2(sSpellXSpellVisualStore);
+ LOAD_DB2(sSummonPropertiesStore);
LOAD_DB2(sTaxiNodesStore);
LOAD_DB2(sTaxiPathNodeStore);
LOAD_DB2(sTaxiPathStore);
@@ -397,6 +416,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
LOAD_DB2(sTransportAnimationStore);
LOAD_DB2(sTransportRotationStore);
LOAD_DB2(sUnitPowerBarStore);
+ LOAD_DB2(sVehicleSeatStore);
LOAD_DB2(sWorldMapOverlayStore);
LOAD_DB2(sWorldMapTransformsStore);
@@ -408,23 +428,36 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
for (CharStartOutfitEntry const* outfit : sCharStartOutfitStore)
_charStartOutfits[outfit->RaceID | (outfit->ClassID << 8) | (outfit->GenderID << 16)] = outfit;
- std::set<ChrClassesXPowerTypesEntry const*, ChrClassesXPowerTypesEntryComparator> powers;
- for (ChrClassesXPowerTypesEntry const* power : sChrClassesXPowerTypesStore)
- powers.insert(power);
+ {
+ std::set<ChrClassesXPowerTypesEntry const*, ChrClassesXPowerTypesEntryComparator> powers;
+ for (ChrClassesXPowerTypesEntry const* power : sChrClassesXPowerTypesStore)
+ powers.insert(power);
- for (uint32 i = 0; i < MAX_CLASSES; ++i)
- for (uint32 j = 0; j < MAX_POWERS; ++j)
- _powersByClass[i][j] = MAX_POWERS;
+ for (uint32 i = 0; i < MAX_CLASSES; ++i)
+ for (uint32 j = 0; j < MAX_POWERS; ++j)
+ _powersByClass[i][j] = MAX_POWERS;
- for (ChrClassesXPowerTypesEntry const* power : powers)
- {
- uint32 index = 0;
- for (uint32 j = 0; j < MAX_POWERS; ++j)
- if (_powersByClass[power->ClassID][j] != MAX_POWERS)
- ++index;
+ for (ChrClassesXPowerTypesEntry const* power : powers)
+ {
+ uint32 index = 0;
+ for (uint32 j = 0; j < MAX_POWERS; ++j)
+ if (_powersByClass[power->ClassID][j] != MAX_POWERS)
+ ++index;
+
+ ASSERT(power->PowerType < MAX_POWERS);
+ _powersByClass[power->ClassID][power->PowerType] = index;
+ }
+ }
- ASSERT(power->PowerType < MAX_POWERS);
- _powersByClass[power->ClassID][power->PowerType] = index;
+ memset(_chrSpecializationsByIndex, 0, sizeof(_chrSpecializationsByIndex));
+ for (uint32 i = 0; i < sChrSpecializationStore.GetNumRows(); ++i)
+ {
+ if (ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(i))
+ {
+ ASSERT(chrSpec->ClassID < MAX_CLASSES);
+ ASSERT(chrSpec->OrderIndex < MAX_SPECIALIZATIONS);
+ _chrSpecializationsByIndex[chrSpec->ClassID][chrSpec->OrderIndex] = chrSpec;
+ }
}
for (EmotesTextSoundEntry const* emoteTextSound : sEmotesTextSoundStore)
@@ -444,6 +477,9 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
if (glyphSlot->Type == GLYPH_SLOT_MAJOR || glyphSlot->Type == GLYPH_SLOT_MINOR)
_glyphSlots.insert(glyphSlot);
+ for (HeirloomEntry const* heirloom : sHeirloomStore)
+ _heirlooms[heirloom->ItemID] = heirloom;
+
for (ItemBonusEntry const* bonus : sItemBonusStore)
_itemBonusLists[bonus->BonusListID].push_back(bonus);
@@ -529,6 +565,11 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseID))
_phasesByGroup[group->PhaseGroupID].insert(phase->ID);
+ for (PvPDifficultyEntry const* entry : sPvpDifficultyStore)
+ {
+ ASSERT(entry->BracketID < MAX_BATTLEGROUND_BRACKETS, "PvpDifficulty bracket (%d) exceeded max allowed value (%d)", entry->BracketID, MAX_BATTLEGROUND_BRACKETS);
+ }
+
for (QuestPackageItemEntry const* questPackageItem : sQuestPackageItemStore)
_questPackages[questPackageItem->QuestPackageID].push_back(questPackageItem);
@@ -628,9 +669,6 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
for (ToyEntry const* toy : sToyStore)
_toys.insert(toy->ItemID);
- for (HeirloomEntry const* heirloom : sHeirloomStore)
- _heirlooms[heirloom->ItemID] = heirloom;
-
// error checks
if (bad_db2_files.size() >= DB2FilesCount)
{
@@ -648,7 +686,8 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
}
// Check loaded DB2 files proper version
- if (!sItemStore.LookupEntry(136350) || // last item added in 7.0.1 (20810)
+ if (!sGemPropertiesStore.LookupEntry(2960) || // last gem property added in 7.0.1 (20914)
+ !sItemStore.LookupEntry(136350) || // last item added in 7.0.1 (20810)
!sItemExtendedCostStore.LookupEntry(5951) || // last item extended cost added in 7.0.1 (20810)
!sSpellStore.LookupEntry(207511)) // last spell added in 7.0.1 (20810)
{
@@ -752,6 +791,11 @@ CharStartOutfitEntry const* DB2Manager::GetCharStartOutfitEntry(uint8 race, uint
return itr->second;
}
+ChrSpecializationEntry const* DB2Manager::GetChrSpecializationByIndex(uint32 class_, uint32 index) const
+{
+ return _chrSpecializationsByIndex[class_][index];
+}
+
uint32 DB2Manager::GetPowerIndexByClass(uint32 powerType, uint32 classId) const
{
return _powersByClass[classId][powerType];
@@ -929,6 +973,40 @@ ResponseCodes DB2Manager::ValidateName(std::string const& name, LocaleConstant l
return CHAR_NAME_SUCCESS;
}
+PvPDifficultyEntry const* DB2Manager::GetBattlegroundBracketByLevel(uint32 mapid, uint32 level)
+{
+ PvPDifficultyEntry const* maxEntry = NULL; // used for level > max listed level case
+ for (uint32 i = 0; i < sPvpDifficultyStore.GetNumRows(); ++i)
+ {
+ if (PvPDifficultyEntry const* entry = sPvpDifficultyStore.LookupEntry(i))
+ {
+ // skip unrelated and too-high brackets
+ if (entry->MapID != mapid || entry->MinLevel > level)
+ continue;
+
+ // exactly fit
+ if (entry->MaxLevel >= level)
+ return entry;
+
+ // remember for possible out-of-range case (search higher from existed)
+ if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel)
+ maxEntry = entry;
+ }
+ }
+
+ return maxEntry;
+}
+
+PvPDifficultyEntry const* DB2Manager::GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id)
+{
+ for (uint32 i = 0; i < sPvpDifficultyStore.GetNumRows(); ++i)
+ if (PvPDifficultyEntry const* entry = sPvpDifficultyStore.LookupEntry(i))
+ if (entry->MapID == mapid && entry->GetBracketId() == id)
+ return entry;
+
+ return nullptr;
+}
+
std::vector<QuestPackageItemEntry const*> const* DB2Manager::GetQuestPackageItems(uint32 questPackageID) const
{
auto itr = _questPackages.find(questPackageID);
diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h
index 4e3f7bdd70b..ded2bf01b4f 100644
--- a/src/server/game/DataStores/DB2Stores.h
+++ b/src/server/game/DataStores/DB2Stores.h
@@ -36,7 +36,9 @@ TC_GAME_API extern DB2Storage<BattlePetSpeciesEntry> sBattlePetSp
TC_GAME_API extern DB2Storage<BattlePetSpeciesStateEntry> sBattlePetSpeciesStateStore;
TC_GAME_API extern DB2Storage<BroadcastTextEntry> sBroadcastTextStore;
TC_GAME_API extern DB2Storage<CharStartOutfitEntry> sCharStartOutfitStore;
+TC_GAME_API extern DB2Storage<ChatChannelsEntry> sChatChannelsStore;
TC_GAME_API extern DB2Storage<ChrRacesEntry> sChrRacesStore;
+TC_GAME_API extern DB2Storage<ChrSpecializationEntry> sChrSpecializationStore;
TC_GAME_API extern DB2Storage<CinematicSequencesEntry> sCinematicSequencesStore;
TC_GAME_API extern DB2Storage<CreatureDisplayInfoEntry> sCreatureDisplayInfoStore;
TC_GAME_API extern DB2Storage<CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore;
@@ -47,6 +49,7 @@ TC_GAME_API extern DB2Storage<CurrencyTypesEntry> sCurrencyTyp
TC_GAME_API extern DB2Storage<DestructibleModelDataEntry> sDestructibleModelDataStore;
TC_GAME_API extern DB2Storage<DurabilityCostsEntry> sDurabilityCostsStore;
TC_GAME_API extern DB2Storage<DurabilityQualityEntry> sDurabilityQualityStore;
+TC_GAME_API extern DB2Storage<EmotesEntry> sEmotesStore;
TC_GAME_API extern DB2Storage<GameObjectsEntry> sGameObjectsStore;
TC_GAME_API extern DB2Storage<GameObjectDisplayInfoEntry> sGameObjectDisplayInfoStore;
TC_GAME_API extern DB2Storage<GameTablesEntry> sGameTablesStore;
@@ -61,6 +64,8 @@ TC_GAME_API extern DB2Storage<GarrPlotEntry> sGarrPlotSto
TC_GAME_API extern DB2Storage<GarrPlotInstanceEntry> sGarrPlotInstanceStore;
TC_GAME_API extern DB2Storage<GarrSiteLevelEntry> sGarrSiteLevelStore;
TC_GAME_API extern DB2Storage<GarrSiteLevelPlotInstEntry> sGarrSiteLevelPlotInstStore;
+TC_GAME_API extern DB2Storage<GemPropertiesEntry> sGemPropertiesStore;
+TC_GAME_API extern DB2Storage<GlyphPropertiesEntry> sGlyphPropertiesStore;
TC_GAME_API extern DB2Storage<GlyphSlotEntry> sGlyphSlotStore;
TC_GAME_API extern DB2Storage<GuildColorBackgroundEntry> sGuildColorBackgroundStore;
TC_GAME_API extern DB2Storage<GuildColorBorderEntry> sGuildColorBorderStore;
@@ -89,11 +94,13 @@ TC_GAME_API extern DB2Storage<ItemLimitCategoryEntry> sItemLimitCa
TC_GAME_API extern DB2Storage<ItemPriceBaseEntry> sItemPriceBaseStore;
TC_GAME_API extern DB2Storage<ItemRandomPropertiesEntry> sItemRandomPropertiesStore;
TC_GAME_API extern DB2Storage<ItemRandomSuffixEntry> sItemRandomSuffixStore;
+TC_GAME_API extern DB2Storage<ItemSetEntry> sItemSetStore;
TC_GAME_API extern DB2Storage<ItemSetSpellEntry> sItemSetSpellStore;
TC_GAME_API extern DB2SparseStorage<ItemSparseEntry> sItemSparseStore;
TC_GAME_API extern DB2Storage<ItemSpecEntry> sItemSpecStore;
TC_GAME_API extern DB2Storage<ItemSpecOverrideEntry> sItemSpecOverrideStore;
TC_GAME_API extern DB2Storage<ItemToBattlePetSpeciesEntry> sItemToBattlePetSpeciesStore;
+TC_GAME_API extern DB2Storage<LockEntry> sLockStore;
TC_GAME_API extern DB2Storage<MailTemplateEntry> sMailTemplateStore;
TC_GAME_API extern DB2Storage<ModifierTreeEntry> sModifierTreeStore;
TC_GAME_API extern DB2Storage<MountCapabilityEntry> sMountCapabilityStore;
@@ -141,9 +148,11 @@ TC_GAME_API extern DB2Storage<SpellShapeshiftFormEntry> sSpellShapes
TC_GAME_API extern DB2Storage<SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore;
TC_GAME_API extern DB2Storage<SpellTotemsEntry> sSpellTotemsStore;
TC_GAME_API extern DB2Storage<SpellXSpellVisualEntry> sSpellXSpellVisualStore;
+TC_GAME_API extern DB2Storage<SummonPropertiesEntry> sSummonPropertiesStore;
TC_GAME_API extern DB2Storage<TaxiNodesEntry> sTaxiNodesStore;
TC_GAME_API extern DB2Storage<TaxiPathEntry> sTaxiPathStore;
TC_GAME_API extern DB2Storage<UnitPowerBarEntry> sUnitPowerBarStore;
+TC_GAME_API extern DB2Storage<VehicleSeatEntry> sVehicleSeatStore;
TC_GAME_API extern DB2Storage<WorldMapOverlayEntry> sWorldMapOverlayStore;
TC_GAME_API extern TaxiMask sTaxiNodesMask;
@@ -179,6 +188,7 @@ public:
typedef std::map<uint32 /*hash*/, DB2StorageBase*> StorageMap;
typedef std::unordered_map<uint32 /*areaGroupId*/, std::vector<uint32/*areaId*/>> AreaGroupMemberContainer;
typedef std::unordered_map<uint32, CharStartOutfitEntry const*> CharStartOutfitContainer;
+ typedef ChrSpecializationEntry const* ChrSpecializationByIndexContainer[MAX_CLASSES][MAX_SPECIALIZATIONS];
typedef std::map<std::tuple<uint32, uint8, uint8, uint8>, EmotesTextSoundEntry const*> EmotesTextSoundContainer;
typedef std::set<GlyphSlotEntry const*, GlyphSlotEntryComparator> GlyphSlotContainer;
typedef std::map<uint32 /*curveID*/, std::map<uint32/*index*/, CurvePointEntry const*, std::greater<uint32>>> HeirloomCurvesContainer;
@@ -216,6 +226,7 @@ public:
std::vector<uint32> GetAreasForGroup(uint32 areaGroupId) const;
static char const* GetBroadcastTextValue(BroadcastTextEntry const* broadcastText, LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false);
CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender) const;
+ ChrSpecializationEntry const* GetChrSpecializationByIndex(uint32 class_, uint32 index) const;
uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId) const;
static char const* GetChrRaceName(uint8 race, LocaleConstant locale = DEFAULT_LOCALE);
EmotesTextSoundEntry const* GetTextSoundEmoteFor(uint32 emote, uint8 race, uint8 gender, uint8 class_) const;
@@ -236,6 +247,8 @@ public:
std::vector<QuestPackageItemEntry const*> const* GetQuestPackageItems(uint32 questPackageID) const;
uint32 GetQuestUniqueBitFlag(uint32 questId);
std::set<uint32> GetPhasesForGroup(uint32 group) const;
+ static PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
+ static PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_);
std::vector<SpecializationSpellsEntry const*> const* GetSpecializationSpells(uint32 specId) const;
std::vector<SpellPowerEntry const*> GetSpellPowers(uint32 spellId, Difficulty difficulty = DIFFICULTY_NONE, bool* hasDifficultyPowers = nullptr) const;
@@ -251,6 +264,7 @@ private:
AreaGroupMemberContainer _areaGroupMembers;
CharStartOutfitContainer _charStartOutfits;
uint32 _powersByClass[MAX_CLASSES][MAX_POWERS];
+ ChrSpecializationByIndexContainer _chrSpecializationsByIndex;
EmotesTextSoundContainer _emoteTextSounds;
GlyphSlotContainer _glyphSlots;
HeirloomItemsContainer _heirlooms;
diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h
index ff3b9efc9c1..171d4324a62 100644
--- a/src/server/game/DataStores/DB2Structure.h
+++ b/src/server/game/DataStores/DB2Structure.h
@@ -148,6 +148,14 @@ struct CharStartOutfitEntry
uint8 PetFamilyID; // Pet Family Entry for starting pet
};
+struct ChatChannelsEntry
+{
+ uint32 Flags;
+ LocalizedString* Name;
+ LocalizedString* Shortcut;
+ uint8 FactionGroup;
+};
+
struct ChrClassesXPowerTypesEntry
{
uint8 ClassID;
@@ -193,6 +201,26 @@ struct ChrRacesEntry
uint8 CharComponentTexLayoutHiResID;
};
+#define MAX_MASTERY_SPELLS 2
+
+struct ChrSpecializationEntry
+{
+ uint32 ID;
+ uint32 MasterySpellID[MAX_MASTERY_SPELLS];
+ uint32 Flags;
+ uint32 AnimReplacementSetID;
+ LocalizedString* Name;
+ LocalizedString* Name2;
+ LocalizedString* Description;
+ char* BackgroundFile;
+ uint16 SpellIconID;
+ uint8 ClassID;
+ uint8 OrderIndex;
+ uint8 PetTalentType;
+ uint8 Role;
+ uint8 PrimaryStatOrder;
+};
+
struct CinematicSequencesEntry
{
uint16 SoundID;
@@ -226,7 +254,6 @@ struct CreatureDisplayInfoEntry
struct CreatureDisplayInfoExtraEntry
{
- uint32 NPCItemDisplay[10];
uint32 FileDataID;
uint32 HDFileDataID;
uint8 DisplayRaceID;
@@ -451,6 +478,17 @@ struct DurabilityQualityEntry
float QualityMod;
};
+struct EmotesEntry
+{
+ char const* EmoteSlashCommand;
+ uint32 SpellVisualKitID;
+ uint32 EmoteFlags;
+ uint16 AnimID;
+ uint16 EmoteSoundID;
+ uint8 EmoteSpecProc;
+ uint8 EmoteSpecProcParam;
+};
+
struct EmotesTextSoundEntry
{
uint16 EmotesTextId;
@@ -486,7 +524,6 @@ struct GameObjectDisplayInfoEntry
DBCPosition3D GeoBoxMax;
float OverrideLootEffectScale;
float OverrideNameScale;
- uint16 Sound[10];
uint16 ObjectEffectPackageID;
};
@@ -554,6 +591,7 @@ struct GarrClassSpecEntry
LocalizedString* NameGenderless;
uint16 ClassAtlasID; // UiTextureAtlasMember.db2 ref
uint8 GarrFollItemSetID;
+ uint8 Unknown700;
};
struct GarrFollowerEntry
@@ -636,6 +674,23 @@ struct GarrSiteLevelPlotInstEntry
uint8 Unknown;
};
+struct GemPropertiesEntry
+{
+ uint32 Type;
+ uint16 EnchantID;
+ uint16 MinItemLevel;
+ uint8 MaxCountInv;
+ uint8 MaxCountItem;
+};
+
+struct GlyphPropertiesEntry
+{
+ uint32 SpellID;
+ uint16 SpellIconID;
+ uint8 Type;
+ uint8 GlyphExclusiveCategoryID;
+};
+
struct GlyphSlotEntry
{
uint8 Type;
@@ -905,6 +960,16 @@ struct ItemRandomSuffixEntry
uint16 AllocationPct[MAX_ITEM_RANDOM_PROPERTIES];
};
+#define MAX_ITEM_SET_ITEMS 17
+
+struct ItemSetEntry
+{
+ LocalizedString* Name;
+ uint32 ItemID[MAX_ITEM_SET_ITEMS];
+ uint16 RequiredSkillRank;
+ uint8 RequiredSkill;
+};
+
struct ItemSetSpellEntry
{
uint32 SpellID;
@@ -1017,6 +1082,16 @@ struct KeyChainEntry
uint8 Key[KEYCHAIN_SIZE];
};
+#define MAX_LOCK_CASE 8
+
+struct LockEntry
+{
+ uint32 Index[MAX_LOCK_CASE];
+ uint16 Skill[MAX_LOCK_CASE];
+ uint8 Type[MAX_LOCK_CASE];
+ uint8 Action[MAX_LOCK_CASE];
+};
+
struct MailTemplateEntry
{
LocalizedString* Body;
@@ -1205,6 +1280,17 @@ struct PowerDisplayEntry
uint8 Blue;
};
+struct PvPDifficultyEntry
+{
+ uint16 MapID;
+ uint8 BracketID;
+ uint8 MinLevel;
+ uint8 MaxLevel;
+
+ // helpers
+ BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(BracketID); }
+};
+
struct QuestFactionRewardEntry
{
int16 QuestRewFactionValue[10];
@@ -1511,6 +1597,7 @@ struct SpellLevelsEntry
uint16 MaxLevel;
uint16 SpellLevel;
uint8 DifficultyID;
+ uint8 MaxUsableLevel;
};
struct SpellMiscEntry
@@ -1673,6 +1760,15 @@ struct SpellXSpellVisualEntry
uint8 Flags;
};
+struct SummonPropertiesEntry
+{
+ uint32 Category;
+ uint32 Faction;
+ uint32 Type;
+ int32 Slot;
+ uint32 Flags;
+};
+
struct TaxiNodesEntry
{
uint32 ID;
@@ -1761,6 +1857,84 @@ struct UnitPowerBarEntry
uint8 BarType;
};
+struct VehicleSeatEntry
+{
+ uint32 Flags[3];
+ DBCPosition3D AttachmentOffset;
+ float EnterPreDelay;
+ float EnterSpeed;
+ float EnterGravity;
+ float EnterMinDuration;
+ float EnterMaxDuration;
+ float EnterMinArcHeight;
+ float EnterMaxArcHeight;
+ float ExitPreDelay;
+ float ExitSpeed;
+ float ExitGravity;
+ float ExitMinDuration;
+ float ExitMaxDuration;
+ float ExitMinArcHeight;
+ float ExitMaxArcHeight;
+ float PassengerYaw;
+ float PassengerPitch;
+ float PassengerRoll;
+ float VehicleEnterAnimDelay;
+ float VehicleExitAnimDelay;
+ float CameraEnteringDelay;
+ float CameraEnteringDuration;
+ float CameraExitingDelay;
+ float CameraExitingDuration;
+ DBCPosition3D CameraOffset;
+ float CameraPosChaseRate;
+ float CameraFacingChaseRate;
+ float CameraEnteringZoom;
+ float CameraSeatZoomMin;
+ float CameraSeatZoomMax;
+ uint32 UISkinFileDataID;
+ int16 EnterAnimStart;
+ int16 EnterAnimLoop;
+ int16 RideAnimStart;
+ int16 RideAnimLoop;
+ int16 RideUpperAnimStart;
+ int16 RideUpperAnimLoop;
+ int16 ExitAnimStart;
+ int16 ExitAnimLoop;
+ int16 ExitAnimEnd;
+ int16 VehicleEnterAnim;
+ int16 VehicleExitAnim;
+ int16 VehicleRideAnimLoop;
+ uint16 EnterUISoundID;
+ uint16 ExitUISoundID;
+ uint16 EnterAnimKitID;
+ uint16 RideAnimKitID;
+ uint16 ExitAnimKitID;
+ uint16 VehicleEnterAnimKitID;
+ uint16 VehicleRideAnimKitID;
+ uint16 VehicleExitAnimKitID;
+ uint16 CameraModeID;
+ int8 AttachmentID;
+ int8 PassengerAttachmentID;
+ int8 VehicleEnterAnimBone;
+ int8 VehicleExitAnimBone;
+ int8 VehicleRideAnimLoopBone;
+ uint8 VehicleAbilityDisplay;
+
+ bool CanEnterOrExit() const
+ {
+ return ((Flags[0] & VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT) != 0 ||
+ //If it has anmation for enter/ride, means it can be entered/exited by logic
+ (Flags[0] & (VEHICLE_SEAT_FLAG_HAS_LOWER_ANIM_FOR_ENTER | VEHICLE_SEAT_FLAG_HAS_LOWER_ANIM_FOR_RIDE)) != 0);
+ }
+ bool CanSwitchFromSeat() const { return (Flags[0] & VEHICLE_SEAT_FLAG_CAN_SWITCH) != 0; }
+ bool IsUsableByOverride() const
+ {
+ return (Flags[0] & (VEHICLE_SEAT_FLAG_UNCONTROLLED | VEHICLE_SEAT_FLAG_UNK18)
+ || (Flags[1] & (VEHICLE_SEAT_FLAG_B_USABLE_FORCED | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_2 |
+ VEHICLE_SEAT_FLAG_B_USABLE_FORCED_3 | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_4)));
+ }
+ bool IsEjectable() const { return (Flags[1] & VEHICLE_SEAT_FLAG_B_EJECTABLE) != 0; }
+};
+
#define MAX_WORLD_MAP_OVERLAY_AREA_IDX 4
struct WorldMapOverlayEntry
diff --git a/src/server/game/DataStores/DB2fmt.h b/src/server/game/DataStores/DB2fmt.h
index 1e8c3be57ea..596a67bd35d 100644
--- a/src/server/game/DataStores/DB2fmt.h
+++ b/src/server/game/DataStores/DB2fmt.h
@@ -31,11 +31,13 @@ char const BattlePetSpeciesFormat[] = "niiisshbb";
char const BattlePetSpeciesStateFormat[] = "nihb";
char const BroadcastTextFormat[] = "dsshhhhhhhhbb";
char const CharStartOutfitFormat[] = "diiiiiiiiiiiiiiiiiiiiiiiiibbbbb";
+char const ChatChannelsFormat[] = "dissb";
char const ChrClassesXPowerTypesFormat[] = "dbb";
char const ChrRacesFormat[] = "niSSsssSSSiiffffffihhhhhhhhhhhhbbbbbbbbb";
+char const ChrSpecializationFormat[] = "niiiisssShbbbbb";
char const CinematicSequencesFormat[] = "dhhhhhhhhh";
char const CreatureDisplayInfoFormat[] = "niffiiiSiiihhhhhhbbbbbb";
-char const CreatureDisplayInfoExtraFormat[] = "diiiiiiiiiiiibbbbbbbbbbbb";
+char const CreatureDisplayInfoExtraFormat[] = "diibbbbbbbbbbbb";
char const CreatureTypeFormat[] = "dsb";
char const CriteriaFormat[] = "diiihhhbbbbb";
char const CriteriaTreeFormat[] = "dishhhhb";
@@ -44,14 +46,15 @@ char const CurvePointFormat[] = "dffhb";
char const DestructibleModelDataFormat[] = "dhhhhhbbbbbbbbbbbbbbbbb";
char const DurabilityCostsFormat[] = "dhhhhhhhhhhhhhhhhhhhhhhhhhhhhh";
char const DurabilityQualityFormat[] = "df";
+char const EmotesFormat[] = "dSiihhbb";
char const EmotesTextSoundFormat[] = "dhhbbb";
char const GameObjectsFormat[] = "nffffffffiiiiiiiishhhhbb";
-char const GameObjectDisplayInfoFormat[] = "diffffffffhhhhhhhhhhh";
+char const GameObjectDisplayInfoFormat[] = "diffffffffh";
char const GameTablesFormat[] = "dshb";
char const GarrAbilityFormat[] = "nssihbbb";
char const GarrBuildingFormat[] = "diissssihhhhhhbbbbbbbbbbb";
char const GarrBuildingPlotInstFormat[] = "nffhhb";
-char const GarrClassSpecFormat[] = "nssshb";
+char const GarrClassSpecFormat[] = "nssshbb";
char const GarrFollowerFormat[] = "diissiihhbbbbbbbbbbbbbbbb";
char const GarrFollowerXAbilityFormat[] = "dhhb";
char const GarrPlotFormat[] = "dsiibbbbb";
@@ -59,6 +62,8 @@ char const GarrPlotBuildingFormat[] = "dbb";
char const GarrPlotInstanceFormat[] = "dsb";
char const GarrSiteLevelFormat[] = "dffhhhbbbbb";
char const GarrSiteLevelPlotInstFormat[] = "dffhbb";
+char const GemPropertiesFormat[] = "dihhbb";
+char const GlyphPropertiesFormat[] = "dihbb";
char const GlyphSlotFormat[] = "dbb";
char const GuildColorBackgroundFormat[] = "dbbb";
char const GuildColorBorderFormat[] = "dbbb";
@@ -93,6 +98,7 @@ char const ItemModifiedAppearanceFormat[] = "nihbb";
char const ItemPriceBaseFormat[] = "dffh";
char const ItemRandomPropertiesFormat[] = "dshhhhh";
char const ItemRandomSuffixFormat[] = "dsshhhhhhhhhh";
+char const ItemSetFormat[] = "dsiiiiiiiiiiiiiiiiihb";
char const ItemSetSpellFormat[] = "dihhb";
char const ItemSparseFormat[] = "iiiffiiiiiiiiiiiiiiiiifffffffffffsssssififhhhhhhhhhhhhhhhhhhhhhhhhhhhhhbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
char const ItemSpecFormat[] = "dhbbbbb";
@@ -100,6 +106,7 @@ char const ItemSpecOverrideFormat[] = "dih";
char const ItemToBattlePetSpeciesFormat[] = "dh";
char const ItemXBonusTreeFormat[] = "dih";
char const KeyChainFormat[] = "dbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
+char const LockFormat[] = "diiiiiiiihhhhhhhhbbbbbbbbbbbbbbbb";
char const MailTemplateFormat[] = "ds";
char const ModifierTreeFormat[] = "diihbbbb";
char const MountFormat[] = "niissshhhb";
@@ -114,6 +121,7 @@ char const OverrideSpellDataFormat[] = "diiiiiiiiiiib";
char const PhaseXPhaseGroupFormat[] = "dhh";
char const PlayerConditionFormat[] = "diiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisiihhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
char const PowerDisplayFormat[] = "dSbbbb";
+char const PvpDifficultyFormat[] = "dhbbb";
char const QuestFactionRewardFormat[] = "dhhhhhhhhhh";
char const QuestMoneyRewardFormat[] = "diiiiiiiiii";
char const QuestPackageItemFormat[] = "dihbb";
@@ -144,7 +152,7 @@ char const SpellFocusObjectFormat[] = "ds";
char const SpellInterruptsFormat[] = "diiiiihb";
char const SpellItemEnchantmentConditionFormat[] = "dbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
char const SpellLearnSpellFormat[] = "diii";
-char const SpellLevelsFormat[] = "dihhhb";
+char const SpellLevelsFormat[] = "dihhhbb";
char const SpellMiscFormat[] = "diiiiiiiiiiiiiiffhhhhhb";
char const SpellPowerFormat[] = "niiffifhhhhbbb";
char const SpellPowerDifficultyFormat[] = "nbb";
@@ -157,6 +165,7 @@ char const SpellShapeshiftFormFormat[] = "dsfihhhhhhhhhhhhhhbbb";
char const SpellTargetRestrictionsFormat[] = "diffihhbb";
char const SpellTotemsFormat[] = "diiibb";
char const SpellXSpellVisualFormat[] = "nifhhhbb";
+char const SummonPropertiesFormat[] = "diiiii";
char const TaxiNodesFormat[] = "nfffsiiffhhhb";
char const TaxiPathFormat[] = "nhhh";
char const TaxiPathNodeFormat[] = "nfffihhhhbb";
@@ -165,6 +174,7 @@ char const ToyFormat[] = "nisbb";
char const TransportAnimationFormat[] = "diifffb";
char const TransportRotationFormat[] = "diiffff";
char const UnitPowerBarFormat[] = "diffiiiiiiiiiiiissssffhhbbb";
+char const VehicleSeatFormat[] = "diiiffffffffffffffffffffffffffffffffffihhhhhhhhhhhhhhhhhhhhhbbbbbb";
char const WorldMapOverlayFormat[] = "dShhhhhhhhhhhhhh";
char const WorldMapTransformsFormat[] = "dfffffffffhhhhb";
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 0e0375826ce..04313191799 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -55,47 +55,35 @@ DBCStorage<BattlemasterListEntry> sBattlemasterListStore(BattlemasterL
DBCStorage<CharSectionsEntry> sCharSectionsStore(CharSectionsfmt);
CharSectionsMap sCharSectionMap;
DBCStorage<CharTitlesEntry> sCharTitlesStore(CharTitlesfmt);
-DBCStorage<ChatChannelsEntry> sChatChannelsStore(ChatChannelsfmt);
DBCStorage<ChrClassesEntry> sChrClassesStore(ChrClassesfmt);
-DBCStorage<ChrSpecializationEntry> sChrSpecializationStore(ChrSpecializationfmt);
-ChrSpecializationByIndexArray sChrSpecializationByIndexStore;
DBCStorage<CreatureFamilyEntry> sCreatureFamilyStore(CreatureFamilyfmt);
DBCStorage<CreatureModelDataEntry> sCreatureModelDataStore(CreatureModelDatafmt);
DBCStorage<DifficultyEntry> sDifficultyStore(DifficultyFmt);
DBCStorage<DungeonEncounterEntry> sDungeonEncounterStore(DungeonEncounterfmt);
-DBCStorage<EmotesEntry> sEmotesStore(Emotesfmt);
DBCStorage<EmotesTextEntry> sEmotesTextStore(EmotesTextfmt);
DBCStorage<FactionEntry> sFactionStore(Factionfmt);
static FactionTeamMap sFactionTeamMap;
DBCStorage<FactionTemplateEntry> sFactionTemplateStore(FactionTemplatefmt);
-DBCStorage<GemPropertiesEntry> sGemPropertiesStore(GemPropertiesfmt);
-DBCStorage<GlyphPropertiesEntry> sGlyphPropertiesStore(GlyphPropertiesfmt);
-DBCStorage<ItemSetEntry> sItemSetStore(ItemSetfmt);
-
DBCStorage<LFGDungeonEntry> sLFGDungeonStore(LFGDungeonfmt);
DBCStorage<LightEntry> sLightStore(Lightfmt);
DBCStorage<LiquidTypeEntry> sLiquidTypeStore(LiquidTypefmt);
-DBCStorage<LockEntry> sLockStore(Lockfmt);
DBCStorage<MapEntry> sMapStore(Mapfmt);
DBCStorage<MapDifficultyEntry> sMapDifficultyStore(MapDifficultyfmt); // only for loading
MapDifficultyMap sMapDifficultyMap;
DBCStorage<PhaseEntry> sPhaseStore(Phasefmt);
-DBCStorage<PvPDifficultyEntry> sPvpDifficultyStore(PvpDifficultyfmt);
DBCStorage<SpellItemEnchantmentEntry> sSpellItemEnchantmentStore(SpellItemEnchantmentfmt);
-DBCStorage<SummonPropertiesEntry> sSummonPropertiesStore(SummonPropertiesfmt);
DBCStorage<TalentEntry> sTalentStore(Talentfmt);
TalentsByPosition sTalentByPos;
DBCStorage<VehicleEntry> sVehicleStore(Vehiclefmt);
-DBCStorage<VehicleSeatEntry> sVehicleSeatStore(VehicleSeatfmt);
DBCStorage<WMOAreaTableEntry> sWMOAreaTableStore(WMOAreaTablefmt);
static WMOAreaInfoByTripple sWMOAreaInfoByTripple;
@@ -242,36 +230,26 @@ void LoadDBCStores(const std::string& dataPath, uint32 defaultLocale)
LOAD_DBC(sBattlemasterListStore, "BattlemasterList.dbc");//20810
LOAD_DBC(sCharSectionsStore, "CharSections.dbc");//20810
LOAD_DBC(sCharTitlesStore, "CharTitles.dbc");//20810
- LOAD_DBC(sChatChannelsStore, "ChatChannels.dbc");//20810
LOAD_DBC(sChrClassesStore, "ChrClasses.dbc");//20810
- LOAD_DBC(sChrSpecializationStore, "ChrSpecialization.dbc");//20810
LOAD_DBC(sCreatureFamilyStore, "CreatureFamily.dbc");//20810
LOAD_DBC(sCreatureModelDataStore, "CreatureModelData.dbc");//20810
LOAD_DBC(sDifficultyStore, "Difficulty.dbc");//20810
LOAD_DBC(sDungeonEncounterStore, "DungeonEncounter.dbc");//20810
- LOAD_DBC(sEmotesStore, "Emotes.dbc");//20810
LOAD_DBC(sEmotesTextStore, "EmotesText.dbc");//20810
LOAD_DBC(sFactionStore, "Faction.dbc");//20810
LOAD_DBC(sFactionTemplateStore, "FactionTemplate.dbc");//20810
- LOAD_DBC(sGemPropertiesStore, "GemProperties.dbc");//20810
- LOAD_DBC(sGlyphPropertiesStore, "GlyphProperties.dbc");//20810
- LOAD_DBC(sItemSetStore, "ItemSet.dbc");//20810
LOAD_DBC(sLFGDungeonStore, "LfgDungeons.dbc");//20810
LOAD_DBC(sLightStore, "Light.dbc"); //20810
LOAD_DBC(sLiquidTypeStore, "LiquidType.dbc");//20810
- LOAD_DBC(sLockStore, "Lock.dbc");//20810
LOAD_DBC(sMapDifficultyStore, "MapDifficulty.dbc");//20810
LOAD_DBC(sMapStore, "Map.dbc");//20810
LOAD_DBC(sPhaseStore, "Phase.dbc");//20810
- LOAD_DBC(sPvpDifficultyStore, "PvpDifficulty.dbc");//20810
LOAD_DBC(sSpellItemEnchantmentStore, "SpellItemEnchantment.dbc");//20810
- LOAD_DBC(sSummonPropertiesStore, "SummonProperties.dbc");//20810
LOAD_DBC(sTalentStore, "Talent.dbc");//20810
- LOAD_DBC(sVehicleSeatStore, "VehicleSeat.dbc");//20810
LOAD_DBC(sVehicleStore, "Vehicle.dbc");//20810
LOAD_DBC(sWMOAreaTableStore, "WMOAreaTable.dbc");//20810
- LOAD_DBC(sWorldMapAreaStore, "WorldMapArea.dbc");//20444
- LOAD_DBC(sWorldSafeLocsStore, "WorldSafeLocs.dbc"); // 20444
+ LOAD_DBC(sWorldMapAreaStore, "WorldMapArea.dbc");//20810
+ LOAD_DBC(sWorldSafeLocsStore, "WorldSafeLocs.dbc"); // 20810
#undef LOAD_DBC
@@ -280,12 +258,6 @@ void LoadDBCStores(const std::string& dataPath, uint32 defaultLocale)
if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) //ignore Nonplayable races
sCharSectionMap.insert({ entry->GenType | (entry->Gender << 8) | (entry->Race << 16), entry });
- memset(sChrSpecializationByIndexStore, 0, sizeof(sChrSpecializationByIndexStore));
- for (ChrSpecializationEntry const* chrSpec : sChrSpecializationStore)
- {
- ASSERT(chrSpec->ClassID < MAX_CLASSES);
- ASSERT(chrSpec->OrderIndex < MAX_SPECIALIZATIONS);
-
uint32 storageIndex = chrSpec->ClassID;
if (chrSpec->Flags & CHR_SPECIALIZATION_FLAG_PET_OVERRIDE_SPEC)
{
@@ -316,11 +288,6 @@ void LoadDBCStores(const std::string& dataPath, uint32 defaultLocale)
sMapDifficultyMap[entry->MapID][entry->DifficultyID] = entry;
sMapDifficultyMap[0][0] = sMapDifficultyMap[1][0]; //map 0 is missing from MapDifficulty.dbc use this till its ported to sql
- for (uint32 i = 0; i < sPvpDifficultyStore.GetNumRows(); ++i)
- if (PvPDifficultyEntry const* entry = sPvpDifficultyStore.LookupEntry(i))
- if (entry->BracketID > MAX_BATTLEGROUND_BRACKETS)
- ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
-
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
{
if (TalentEntry const* talentInfo = sTalentStore.LookupEntry(i))
@@ -356,7 +323,6 @@ void LoadDBCStores(const std::string& dataPath, uint32 defaultLocale)
// Check loaded DBC files proper version
if (!sAreaTableStore.LookupEntry(6719) || // last area (areaflag) added in 7.0.1 (20810)
!sCharTitlesStore.LookupEntry(469) || // last char title added in 7.0.1 (20810)
- !sGemPropertiesStore.LookupEntry(2952) || // last gem property added in 7.0.1 (20810)
!sMapStore.LookupEntry(1602) ) // last map added in 7.0.1 (20810)
{
TC_LOG_ERROR("misc", "You have _outdated_ DBC files. Please extract correct versions from current using client.");
@@ -606,40 +572,6 @@ MapDifficultyEntry const* GetDownscaledMapDifficultyData(uint32 mapId, Difficult
return mapDiff;
}
-PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level)
-{
- PvPDifficultyEntry const* maxEntry = NULL; // used for level > max listed level case
- for (uint32 i = 0; i < sPvpDifficultyStore.GetNumRows(); ++i)
- {
- if (PvPDifficultyEntry const* entry = sPvpDifficultyStore.LookupEntry(i))
- {
- // skip unrelated and too-high brackets
- if (entry->MapID != mapid || entry->MinLevel > level)
- continue;
-
- // exactly fit
- if (entry->MaxLevel >= level)
- return entry;
-
- // remember for possible out-of-range case (search higher from existed)
- if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel)
- maxEntry = entry;
- }
- }
-
- return maxEntry;
-}
-
-PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id)
-{
- for (uint32 i = 0; i < sPvpDifficultyStore.GetNumRows(); ++i)
- if (PvPDifficultyEntry const* entry = sPvpDifficultyStore.LookupEntry(i))
- if (entry->MapID == mapid && entry->GetBracketId() == id)
- return entry;
-
- return NULL;
-}
-
uint32 GetLiquidFlags(uint32 liquidType)
{
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index a1986effa48..b55c9573421 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -30,10 +30,6 @@ TC_GAME_API CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSection
// ChrClasses
TC_GAME_API char const* GetClassName(uint8 class_, uint8 locale);
-// ChrSpecialization
-#define PET_SPEC_OVERRIDE_CLASS_INDEX MAX_CLASSES
-typedef ChrSpecializationEntry const* ChrSpecializationByIndexArray[MAX_CLASSES + 1][MAX_SPECIALIZATIONS];
-
// CreatureFamilty
TC_GAME_API char const* GetCreatureFamilyPetName(uint32 petfamily, uint32 locale);
@@ -55,10 +51,6 @@ TC_GAME_API MapDifficultyEntry const* GetDefaultMapDifficulty(uint32 mapId, Diff
TC_GAME_API MapDifficultyEntry const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty);
TC_GAME_API MapDifficultyEntry const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty);
-// PvpDifficulty
-TC_GAME_API PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
-TC_GAME_API PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
-
// Talent
typedef std::vector<TalentEntry const*> TalentsByPosition[MAX_CLASSES][MAX_TALENT_TIERS][MAX_TALENT_COLUMNS];
@@ -107,33 +99,23 @@ TC_GAME_API extern DBCStorage<BannedAddOnsEntry> sBannedAddOnsSto
TC_GAME_API extern DBCStorage<BattlemasterListEntry> sBattlemasterListStore;
TC_GAME_API extern DBCStorage<CharSectionsEntry> sCharSectionsStore;
TC_GAME_API extern DBCStorage<CharTitlesEntry> sCharTitlesStore;
-TC_GAME_API extern DBCStorage<ChatChannelsEntry> sChatChannelsStore;
TC_GAME_API extern DBCStorage<ChrClassesEntry> sChrClassesStore;
-TC_GAME_API extern DBCStorage<ChrSpecializationEntry> sChrSpecializationStore;
-TC_GAME_API extern ChrSpecializationByIndexArray sChrSpecializationByIndexStore;
TC_GAME_API extern DBCStorage<CreatureFamilyEntry> sCreatureFamilyStore;
TC_GAME_API extern DBCStorage<CreatureModelDataEntry> sCreatureModelDataStore;
TC_GAME_API extern DBCStorage<DifficultyEntry> sDifficultyStore;
TC_GAME_API extern DBCStorage<DungeonEncounterEntry> sDungeonEncounterStore;
-TC_GAME_API extern DBCStorage<EmotesEntry> sEmotesStore;
TC_GAME_API extern DBCStorage<EmotesTextEntry> sEmotesTextStore;
TC_GAME_API extern DBCStorage<FactionEntry> sFactionStore;
TC_GAME_API extern DBCStorage<FactionTemplateEntry> sFactionTemplateStore;
-TC_GAME_API extern DBCStorage<GemPropertiesEntry> sGemPropertiesStore;
-TC_GAME_API extern DBCStorage<GlyphPropertiesEntry> sGlyphPropertiesStore;
-TC_GAME_API extern DBCStorage<ItemSetEntry> sItemSetStore;
TC_GAME_API extern DBCStorage<LFGDungeonEntry> sLFGDungeonStore;
TC_GAME_API extern DBCStorage<LiquidTypeEntry> sLiquidTypeStore;
-TC_GAME_API extern DBCStorage<LockEntry> sLockStore;
TC_GAME_API extern DBCStorage<MapEntry> sMapStore;
TC_GAME_API extern MapDifficultyMap sMapDifficultyMap;
TC_GAME_API extern DBCStorage<PhaseEntry> sPhaseStore;
TC_GAME_API extern DBCStorage<SpellItemEnchantmentEntry> sSpellItemEnchantmentStore;
-TC_GAME_API extern DBCStorage<SummonPropertiesEntry> sSummonPropertiesStore;
TC_GAME_API extern DBCStorage<TalentEntry> sTalentStore;
TC_GAME_API extern TalentsByPosition sTalentByPos;
TC_GAME_API extern DBCStorage<VehicleEntry> sVehicleStore;
-TC_GAME_API extern DBCStorage<VehicleSeatEntry> sVehicleSeatStore;
TC_GAME_API extern DBCStorage<WMOAreaTableEntry> sWMOAreaTableStore;
TC_GAME_API extern DBCStorage<WorldSafeLocsEntry> sWorldSafeLocsStore;
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index 30704aaadad..8dcb1a687a4 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -151,15 +151,6 @@ struct CharTitlesEntry
//uint32 Flags; // 5
};
-struct ChatChannelsEntry
-{
- uint32 ID; // 0
- uint32 Flags; // 1
- //uint32 FactionGroup // 2
- char* Name_lang; // 3
- //char* Shortcut_lang; // 4
-};
-
struct ChrClassesEntry
{
uint32 ID; // 0
@@ -183,25 +174,6 @@ struct ChrClassesEntry
//uint32 Unk1; // 18
};
-struct ChrSpecializationEntry
-{
- uint32 ID; // 0 Specialization ID
- //char* BackgroundFile; // 1
- uint32 ClassID; // 2
- uint32 MasterySpellID; // 3
- uint32 OrderIndex; // 4
- uint32 PetTalentType; // 5
- uint32 Role; // 6 (0 - Tank, 1 - Healer, 2 - DPS)
- uint32 SpellIconID; // 7
- uint32 RaidBuffs; // 8
- uint32 Flags; // 9
- //char* Name_lang; // 10
- //char* Name2_lang; // 11 Same as name_lang?
- //char* Description_lang; // 12
- //uint32 PrimaryStatOrder; // 13
- //uint32 AnimReplacementSetID; // 14
-};
-
struct CreatureFamilyEntry
{
uint32 ID; // 0
@@ -294,18 +266,6 @@ struct DungeonEncounterEntry
//uint32 Unk; // 8 Flags2?
};
-struct EmotesEntry
-{
- uint32 ID; // 0
- //char* EmoteSlashCommand; // 1
- //uint32 AnimID; // 2 ref to animationData
- uint32 EmoteFlags; // 3 bitmask, may be unit_flags
- uint32 EmoteSpecProc; // 4 Can be 0, 1 or 2 (determine how emote are shown)
- uint32 EmoteSpecProcParam; // 5 uncomfirmed, may be enum UnitStandStateType
- //uint32 EmoteSoundID; // 6 ref to soundEntries
- //uint32 SpellVisualKitID // 7
-};
-
struct EmotesTextEntry
{
uint32 ID; // 0
@@ -396,25 +356,6 @@ struct FactionTemplateEntry
bool IsContestedGuardFaction() const { return (Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; }
};
-struct GemPropertiesEntry
-{
- uint32 ID; // 0
- uint32 EnchantID; // 1
- //uint32 MaxCountInv; // 2
- //uint32 MaxCountItem; // 3
- uint32 Type; // 4
- uint32 MinItemLevel; // 5
-};
-
-struct GlyphPropertiesEntry
-{
- uint32 ID; // 0
- uint32 SpellID; // 1
- uint32 Type; // 2
- uint32 SpellIconID; // 3 GlyphIconId (SpellIcon.dbc)
- //uint32 GlyphExclusiveCategoryID; // 4
-};
-
struct GtArmorMitigationByLvlEntry
{
//uint32 level;
@@ -534,18 +475,6 @@ struct ItemDisplayInfoEntry
//uint32 ParticleColorID; // 22
};
-#define MAX_ITEM_SET_ITEMS 17
-#define MAX_ITEM_SET_SPELLS 8
-
-struct ItemSetEntry
-{
- uint32 ID; // 0
- char* Name_lang; // 1
- uint32 ItemID[MAX_ITEM_SET_ITEMS]; // 2-18
- uint32 RequiredSkill; // 19
- uint32 RequiredSkillRank; // 20
-};
-
struct LFGDungeonEntry
{
uint32 ID; // 0
@@ -617,17 +546,6 @@ struct LiquidTypeEntry
//uint32 Int[4]; // 47-50
};
-#define MAX_LOCK_CASE 8
-
-struct LockEntry
-{
- uint32 ID; // 0
- uint32 Type[MAX_LOCK_CASE]; // 1-8
- uint32 Index[MAX_LOCK_CASE]; // 9-16
- uint32 Skill[MAX_LOCK_CASE]; // 17-24
- //uint32 Action[MAX_LOCK_CASE]; // 25-32
-};
-
struct PhaseEntry
{
uint32 ID; // 0
@@ -711,18 +629,6 @@ struct MinorTalentEntry
uint32 OrderIndex; // 3
};
-struct PvPDifficultyEntry
-{
- //uint32 ID; // 0
- uint32 MapID; // 1
- uint32 BracketID; // 2 m_rangeIndex
- uint32 MinLevel; // 3
- uint32 MaxLevel; // 4
-
- // helpers
- BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(BracketID); }
-};
-
#define MAX_ITEM_ENCHANTMENT_EFFECTS 3
struct SpellItemEnchantmentEntry
@@ -755,16 +661,6 @@ struct StableSlotPricesEntry
uint32 Price;
};
-struct SummonPropertiesEntry
-{
- uint32 ID; // 0
- uint32 Category; // 1, 0 - can't be controlled?, 1 - something guardian?, 2 - pet?, 3 - something controllable?, 4 - taxi/mount?
- uint32 Faction; // 2, 14 rows > 0
- uint32 Type; // 3, see enum
- int32 Slot; // 4, 0-6
- uint32 Flags; // 5
-};
-
#define MAX_TALENT_TIERS 7
#define MAX_TALENT_COLUMNS 3
@@ -818,84 +714,6 @@ struct VehicleEntry
uint32 PowerDisplayID[3]; // 38-40
};
-struct VehicleSeatEntry
-{
- uint32 ID; // 0
- uint32 Flags; // 1
- int32 AttachmentID; // 2
- DBCPosition3D AttachmentOffset; // 3-5
- float EnterPreDelay; // 6
- float EnterSpeed; // 7
- float EnterGravity; // 8
- float EnterMinDuration; // 9
- float EnterMaxDuration; // 10
- float EnterMinArcHeight; // 11
- float EnterMaxArcHeight; // 12
- int32 EnterAnimStart; // 13
- int32 EnterAnimLoop; // 14
- int32 RideAnimStart; // 15
- int32 RideAnimLoop; // 16
- int32 RideUpperAnimStart; // 17
- int32 RideUpperAnimLoop; // 18
- float ExitPreDelay; // 19
- float ExitSpeed; // 20
- float ExitGravity; // 21
- float ExitMinDuration; // 22
- float ExitMaxDuration; // 23
- float ExitMinArcHeight; // 24
- float ExitMaxArcHeight; // 25
- int32 ExitAnimStart; // 26
- int32 ExitAnimLoop; // 27
- int32 ExitAnimEnd; // 28
- float PassengerYaw; // 29
- float PassengerPitch; // 30
- float PassengerRoll; // 31
- int32 PassengerAttachmentID; // 32
- int32 VehicleEnterAnim; // 33
- int32 VehicleExitAnim; // 34
- int32 VehicleRideAnimLoop; // 35
- int32 VehicleEnterAnimBone; // 36
- int32 VehicleExitAnimBone; // 37
- int32 VehicleRideAnimLoopBone; // 38
- float VehicleEnterAnimDelay; // 39
- float VehicleExitAnimDelay; // 40
- uint32 VehicleAbilityDisplay; // 41
- uint32 EnterUISoundID; // 42
- uint32 ExitUISoundID; // 43
- uint32 FlagsB; // 44
- float CameraEnteringDelay; // 45
- float CameraEnteringDuration; // 46
- float CameraExitingDelay; // 47
- float CameraExitingDuration; // 48
- DBCPosition3D CameraOffset; // 49-51
- float CameraPosChaseRate; // 52
- float CameraFacingChaseRate; // 53
- float CameraEnteringZoom; // 54
- float CameraSeatZoomMin; // 55
- float CameraSeatZoomMax; // 56
- uint32 EnterAnimKitID; // 57
- uint32 RideAnimKitID; // 58
- uint32 ExitAnimKitID; // 59
- uint32 VehicleEnterAnimKitID; // 60
- uint32 VehicleRideAnimKitID; // 61
- uint32 VehicleExitAnimKitID; // 62
- uint32 CameraModeID; // 63
- uint32 FlagsC; // 64
- uint32 UISkinFileDataID; // 65
-
- bool CanEnterOrExit() const
- {
- return ((Flags & VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT) != 0 ||
- //If it has anmation for enter/ride, means it can be entered/exited by logic
- (Flags & (VEHICLE_SEAT_FLAG_HAS_LOWER_ANIM_FOR_ENTER | VEHICLE_SEAT_FLAG_HAS_LOWER_ANIM_FOR_RIDE)) != 0);
- }
- bool CanSwitchFromSeat() const { return (Flags & VEHICLE_SEAT_FLAG_CAN_SWITCH) != 0; }
- bool IsUsableByOverride() const { return (Flags & (VEHICLE_SEAT_FLAG_UNCONTROLLED | VEHICLE_SEAT_FLAG_UNK18)
- || (FlagsB & (VEHICLE_SEAT_FLAG_B_USABLE_FORCED | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_2 |
- VEHICLE_SEAT_FLAG_B_USABLE_FORCED_3 | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_4))); }
- bool IsEjectable() const { return (FlagsB & VEHICLE_SEAT_FLAG_B_EJECTABLE) != 0; }
-};
-
struct WMOAreaTableEntry
{
uint32 ID; // 0 index
diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h
index b85710acae6..b20b55d709f 100644
--- a/src/server/game/DataStores/DBCfmt.h
+++ b/src/server/game/DataStores/DBCfmt.h
@@ -28,35 +28,25 @@ char const BannedAddOnsfmt[] = "nxxxxxxxxxx";
char const BattlemasterListfmt[] = "niiiiiiiiiiiiiiiiixsiiiixxxxxxx";
char const CharSectionsfmt[] = "diiixxxiii";
char const CharTitlesfmt[] = "nxssix";
-char const ChatChannelsfmt[] = "nixsx";
char const ChrClassesfmt[] = "nixsxxxixiiiiixxxxx";
-char const ChrSpecializationfmt[] = "nxiiiiiiiixxxxx";
char const CreatureFamilyfmt[] = "nfifiiiiixsx";
char const CreatureModelDatafmt[] = "niixxxxxxxxxxxxxxffxxxxxxxxxxxxxxxxx";
char const DifficultyFmt[] = "niiiixiixxxxix";
char const DungeonEncounterfmt[] = "niiixsxxx";
-char const Emotesfmt[] = "nxxiiixx";
char const EmotesTextfmt[] = "nxixxxxxxxxxxxxxxxx";
char const EmotesTextSoundEntryfmt[] = "niiii";
char const Factionfmt[] = "niiiiiiiiiiiiiiiiiiffixsxixx";
char const FactionTemplatefmt[] = "niiiiiiiiiiiii";
-char const GemPropertiesfmt[] = "nixxii";
-char const GlyphPropertiesfmt[] = "niiix";
-char const ItemSetfmt[] = "nsiiiiiiiiiiiiiiiiiii";
char const LFGDungeonfmt[] = "nsiiixxiiiixxixixxxxxxxxxxxxxx";
char const Lightfmt[] = "nifffxxxxxxxxxx";
char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
-char const Lockfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";
char const Mapfmt[] = "nxiixxsixxixiffxiiiiix";
char const MapDifficultyfmt[] = "diisiiii";
char const MinorTalentfmt[] = "niii";
char const Phasefmt[] = "ni";
-char const PvpDifficultyfmt[] = "diiii";
char const SpellItemEnchantmentfmt[] = "niiiiiiiiiixiiiiiiiiiifffxxx";
-char const SummonPropertiesfmt[] = "niiiii";
char const Talentfmt[] = "niiiiiiiiix";
char const Vehiclefmt[] = "niiffffiiiiiiiifffffffffffffffxxxxfifiiii";
-char const VehicleSeatfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiffffffffffffiiiiiiiii";
char const WMOAreaTablefmt[] = "niiixxxxxiixxxx";
char const WorldMapAreafmt[] = "xinxffffixxxxx";
char const WorldSafeLocsfmt[] = "niffffx";
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 38a47d999a9..04d7c07aa3d 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -3231,7 +3231,7 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const
bool Player::IsCurrentSpecMasterySpell(SpellInfo const* spellInfo) const
{
if (ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(GetSpecId(GetActiveTalentGroup())))
- return spellInfo->Id == chrSpec->MasterySpellID;
+ return spellInfo->Id == chrSpec->MasterySpellID[0] || spellInfo->Id == chrSpec->MasterySpellID[1];
return false;
}
@@ -4729,9 +4729,9 @@ void Player::UpdateLocalChannels(uint32 newZone)
else
currentNameExt = current_zone->AreaName_lang;
- snprintf(new_channel_name_buf, 100, channel->Name_lang, currentNameExt);
+ snprintf(new_channel_name_buf, 100, channel->Name->Str[m_session->GetSessionDbcLocale()], currentNameExt);
- joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, channel->ID);
+ joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, i);
if (usedChannel)
{
if (joinChannel != usedChannel)
@@ -4744,7 +4744,7 @@ void Player::UpdateLocalChannels(uint32 newZone)
}
}
else
- joinChannel = cMgr->GetJoinChannel(channel->Name_lang, channel->ID);
+ joinChannel = cMgr->GetJoinChannel(channel->Name->Str[m_session->GetSessionDbcLocale()], i);
}
else
removeChannel = usedChannel;
@@ -25235,8 +25235,9 @@ void Player::ActivateTalentGroup(uint8 spec)
if (CanUseMastery())
if (ChrSpecializationEntry const* specialization = sChrSpecializationStore.LookupEntry(GetSpecId(GetActiveTalentGroup())))
- if (uint32 mastery = specialization->MasterySpellID)
- LearnSpell(mastery, false);
+ for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
+ if (uint32 mastery = specialization->MasterySpellID[i])
+ LearnSpell(mastery, false);
// set glyphs
for (uint8 slot = 0; slot < MAX_GLYPH_SLOT_INDEX; ++slot)
@@ -26146,7 +26147,7 @@ void Player::RemoveSpecializationSpells()
{
for (uint32 i = 0; i < MAX_SPECIALIZATIONS; ++i)
{
- if (ChrSpecializationEntry const* specialization = sChrSpecializationByIndexStore[getClass()][i])
+ if (ChrSpecializationEntry const* specialization = sDB2Manager.GetChrSpecializationByIndex(getClass(), i))
{
if (std::vector<SpecializationSpellsEntry const*> const* specSpells = sDB2Manager.GetSpecializationSpells(specialization->ID))
{
@@ -26159,8 +26160,9 @@ void Player::RemoveSpecializationSpells()
}
}
- if (uint32 mastery = specialization->MasterySpellID)
- RemoveAurasDueToSpell(mastery);
+ for (uint32 j = 0; j < MAX_MASTERY_SPELLS; ++j)
+ if (uint32 mastery = specialization->MasterySpellID[j])
+ RemoveAurasDueToSpell(mastery);
}
}
}
diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp
index e3a5f9065e0..878475cd386 100644
--- a/src/server/game/Entities/Totem/Totem.cpp
+++ b/src/server/game/Entities/Totem/Totem.cpp
@@ -67,7 +67,17 @@ void Totem::InitStats(uint32 duration)
}
// set display id depending on caster's race
- SetDisplayId(owner->GetModelForTotem(PlayerTotemType(m_Properties->ID)));
+ if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL)))
+ {
+ SpellEffectInfoVector effects = createdBySpell->GetEffectsForDifficulty(DIFFICULTY_NONE);
+ auto summonEffect = std::find_if(effects.begin(), effects.end(), [](SpellEffectInfo const* effect)
+ {
+ return effect && effect->IsEffect(SPELL_EFFECT_SUMMON);
+ });
+
+ if (summonEffect != effects.end())
+ SetDisplayId(owner->GetModelForTotem(PlayerTotemType((*summonEffect)->MiscValueB)));
+ }
}
Minion::InitStats(duration);
diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h
index 14bb60f916f..d2b91bb8684 100644
--- a/src/server/game/Entities/Totem/Totem.h
+++ b/src/server/game/Entities/Totem/Totem.h
@@ -27,13 +27,6 @@ enum TotemType
TOTEM_ACTIVE = 1,
TOTEM_STATUE = 2 // copied straight from MaNGOS, may need more implementation to work
};
-// Some Totems cast spells that are not in creature DB
-enum TotemSpells
-{
- // Totemic Wrath
- SPELL_TOTEMIC_WRATH_TALENT = 77746,
- SPELL_TOTEMIC_WRATH = 77747
-};
class TC_GAME_API Totem : public Minion
{
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index f9ba83c19ca..da04c39c289 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -539,21 +539,21 @@ void Player::UpdateMastery()
if (!chrSpec)
return;
- if (!chrSpec->MasterySpellID)
- return;
-
- if (Aura* aura = GetAura(chrSpec->MasterySpellID))
+ for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
{
- for (SpellEffectInfo const* effect : aura->GetSpellEffectInfos())
+ if (Aura* aura = GetAura(chrSpec->MasterySpellID[i]))
{
- if (!effect)
- continue;
+ for (SpellEffectInfo const* effect : aura->GetSpellEffectInfos())
+ {
+ if (!effect)
+ continue;
- float mult = effect->BonusCoefficient;
- if (G3D::fuzzyEq(mult, 0.0f))
- continue;
+ float mult = effect->BonusCoefficient;
+ if (G3D::fuzzyEq(mult, 0.0f))
+ continue;
- aura->GetEffect(effect->EffectIndex)->ChangeAmount(int32(value * effect->BonusCoefficient));
+ aura->GetEffect(effect->EffectIndex)->ChangeAmount(int32(value * effect->BonusCoefficient));
+ }
}
}
}
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index cd7e038508c..a1523db5d62 100644
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -478,12 +478,12 @@ Vehicle* Vehicle::RemovePassenger(Unit* unit)
_me->SetFlag64(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));
// Remove UNIT_FLAG_NOT_SELECTABLE if passenger did not have it before entering vehicle
- if (seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE && !seat->second.Passenger.IsUnselectable)
+ if (seat->second.SeatInfo->Flags[0] & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE && !seat->second.Passenger.IsUnselectable)
unit->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
seat->second.Passenger.Reset();
- if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
+ if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->Flags[0] & VEHICLE_SEAT_FLAG_CAN_CONTROL)
_me->RemoveCharmedBy(unit);
if (_me->IsInWorld())
@@ -785,11 +785,11 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
player->StopCastingCharm();
player->StopCastingBindSight();
player->SendOnCancelExpectedVehicleRideAura();
- if (!(veSeat->FlagsB & VEHICLE_SEAT_FLAG_B_KEEP_PET))
+ if (!(veSeat->Flags[1] & VEHICLE_SEAT_FLAG_B_KEEP_PET))
player->UnsummonPetTemporaryIfAny();
}
- if (Seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE)
+ if (Seat->second.SeatInfo->Flags[0] & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE)
Passenger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Passenger->m_movementInfo.transport.pos.Relocate(veSeat->AttachmentOffset.X, veSeat->AttachmentOffset.Y, veSeat->AttachmentOffset.Z);
@@ -799,7 +799,7 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
Passenger->m_movementInfo.transport.vehicleId = Target->GetVehicleInfo()->ID;
if (Target->GetBase()->GetTypeId() == TYPEID_UNIT && Passenger->GetTypeId() == TYPEID_PLAYER &&
- Seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
+ Seat->second.SeatInfo->Flags[0] & VEHICLE_SEAT_FLAG_CAN_CONTROL)
ASSERT(Target->GetBase()->SetCharmedBy(Passenger, CHARM_TYPE_VEHICLE)); // SMSG_CLIENT_CONTROL
Passenger->SendClearTarget(); // SMSG_BREAK_TARGET
diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h
index dbaaa3b7b9f..6433004c744 100644
--- a/src/server/game/Entities/Vehicle/Vehicle.h
+++ b/src/server/game/Entities/Vehicle/Vehicle.h
@@ -65,6 +65,7 @@ class TC_GAME_API Vehicle : public TransportBase
void SetLastShootPos(Position const& pos) { _lastShootPos.Relocate(pos); }
Position const& GetLastShootPos() const { return _lastShootPos; }
+ SeatMap::iterator GetSeatIteratorForPassenger(Unit* passenger);
SeatMap Seats; ///< The collection of all seats on the vehicle. Including vacant ones.
VehicleSeatEntry const* GetSeatForPassenger(Unit const* passenger) const;
@@ -83,7 +84,6 @@ class TC_GAME_API Vehicle : public TransportBase
STATUS_UNINSTALLING,
};
- SeatMap::iterator GetSeatIteratorForPassenger(Unit* passenger);
void InitMovementInfoForBase();
/// This method transforms supplied transport offsets into global coordinates
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 43763631b0b..93e301bf548 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1935,7 +1935,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
if (!reference)
return ERR_BATTLEGROUND_JOIN_FAILED;
- PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(), reference->getLevel());
+ PvPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(), reference->getLevel());
if (!bracketEntry)
return ERR_BATTLEGROUND_JOIN_FAILED;
@@ -1959,7 +1959,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
return ERR_BATTLEGROUND_JOIN_TIMED_OUT;
}
// not in the same battleground level braket, don't let join
- PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->MapID, member->getLevel());
+ PvPDifficultyEntry const* memberBracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bracketEntry->MapID, member->getLevel());
if (memberBracketEntry != bracketEntry)
return ERR_BATTLEGROUND_JOIN_RANGE_INDEX;
// don't let join rated matches if the arena team id doesn't match
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
index e8fdb384d89..84a6c77bbe2 100644
--- a/src/server/game/Handlers/BattleGroundHandler.cpp
+++ b/src/server/game/Handlers/BattleGroundHandler.cpp
@@ -95,7 +95,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
return;
// expected bracket entry
- PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
+ PvPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
if (!bracketEntry)
return;
@@ -314,7 +314,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPackets::Battleground::Battl
bgTypeId = bg->GetTypeID();
// expected bracket entry
- PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
+ PvPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
if (!bracketEntry)
return;
@@ -475,7 +475,7 @@ void WorldSession::HandleRequestBattlefieldStatusOpcode(WorldPackets::Battlegrou
continue;
// expected bracket entry
- PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
+ PvPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
if (!bracketEntry)
continue;
@@ -511,7 +511,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPackets::Battleground::Battl
BattlegroundTypeId bgTypeId = bg->GetTypeID();
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, arenatype);
- PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
+ PvPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
if (!bracketEntry)
return;
diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp
index 4796ddf92fe..e067e4433d8 100644
--- a/src/server/game/Handlers/CombatHandler.cpp
+++ b/src/server/game/Handlers/CombatHandler.cpp
@@ -51,7 +51,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPackets::Combat::AttackSwing& pa
{
VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(_player);
ASSERT(seat);
- if (!(seat->Flags & VEHICLE_SEAT_FLAG_CAN_ATTACK))
+ if (!(seat->Flags[0] & VEHICLE_SEAT_FLAG_CAN_ATTACK))
{
SendAttackStop(enemy);
return;
diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp
index cace773b65e..ae0dcc586ef 100644
--- a/src/server/game/Handlers/MovementHandler.cpp
+++ b/src/server/game/Handlers/MovementHandler.cpp
@@ -362,7 +362,7 @@ void WorldSession::HandleMovementOpcodes(WorldPackets::Movement::ClientPlayerMov
{
if (VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(mover))
{
- if (seat->Flags & VEHICLE_SEAT_FLAG_ALLOW_TURNING)
+ if (seat->Flags[0] & VEHICLE_SEAT_FLAG_ALLOW_TURNING)
{
if (movementInfo.pos.GetOrientation() != mover->GetOrientation())
{
diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp
index d6e1b35de6e..3596eee68f6 100644
--- a/src/server/game/Handlers/SkillHandler.cpp
+++ b/src/server/game/Handlers/SkillHandler.cpp
@@ -88,8 +88,7 @@ void WorldSession::HandleSetSpecializationOpcode(WorldPackets::Talent::SetSpecia
return;
}
- ChrSpecializationEntry const* chrSpec = sChrSpecializationByIndexStore[player->getClass()][packet.SpecGroupIndex];
-
+ ChrSpecializationEntry const* chrSpec = sDB2Manager.GetChrSpecializationByIndex(player->getClass(), packet.SpecGroupIndex);
if (!chrSpec)
{
TC_LOG_DEBUG("network", "WORLD: HandleSetSpecializationOpcode - specialization index %u not found", packet.SpecGroupIndex);
diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp
index 57e941d1338..0ebc2957383 100644
--- a/src/server/game/Handlers/VehicleHandler.cpp
+++ b/src/server/game/Handlers/VehicleHandler.cpp
@@ -45,7 +45,7 @@ void WorldSession::HandleRequestVehiclePrevSeat(WorldPackets::Vehicle::RequestVe
if (!seat->CanSwitchFromSeat())
{
TC_LOG_ERROR("network", "HandleRequestVehiclePrevSeat: %s tried to switch seats but current seatflags %u don't permit that.",
- GetPlayer()->GetGUID().ToString().c_str(), seat->Flags);
+ GetPlayer()->GetGUID().ToString().c_str(), seat->Flags[0]);
return;
}
@@ -62,7 +62,7 @@ void WorldSession::HandleRequestVehicleNextSeat(WorldPackets::Vehicle::RequestVe
if (!seat->CanSwitchFromSeat())
{
TC_LOG_ERROR("network", "HandleRequestVehicleNextSeat: %s tried to switch seats but current seatflags %u don't permit that.",
- GetPlayer()->GetGUID().ToString().c_str(), seat->Flags);
+ GetPlayer()->GetGUID().ToString().c_str(), seat->Flags[0]);
return;
}
@@ -79,7 +79,7 @@ void WorldSession::HandleMoveChangeVehicleSeats(WorldPackets::Vehicle::MoveChang
if (!seat->CanSwitchFromSeat())
{
TC_LOG_ERROR("network", "HandleMoveChangeVehicleSeats: %s tried to switch seats but current seatflags %u don't permit that.",
- GetPlayer()->GetGUID().ToString().c_str(), seat->Flags);
+ GetPlayer()->GetGUID().ToString().c_str(), seat->Flags[0]);
return;
}
@@ -108,7 +108,7 @@ void WorldSession::HandleRequestVehicleSwitchSeat(WorldPackets::Vehicle::Request
if (!seat->CanSwitchFromSeat())
{
TC_LOG_ERROR("network", "HandleRequestVehicleSwitchSeat: %s tried to switch seats but current seatflags %u don't permit that.",
- GetPlayer()->GetGUID().ToString().c_str(), seat->Flags);
+ GetPlayer()->GetGUID().ToString().c_str(), seat->Flags[0]);
return;
}
@@ -174,13 +174,14 @@ void WorldSession::HandleRequestVehicleExit(WorldPackets::Vehicle::RequestVehicl
{
if (Vehicle* vehicle = GetPlayer()->GetVehicle())
{
- if (VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(GetPlayer()))
+ auto itr = vehicle->GetSeatIteratorForPassenger(GetPlayer());
+ if (itr != vehicle->Seats.end())
{
- if (seat->CanEnterOrExit())
+ if (itr->second.SeatInfo->CanEnterOrExit())
GetPlayer()->ExitVehicle();
else
TC_LOG_ERROR("network", "%s tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
- GetPlayer()->GetGUID().ToString().c_str(), seat->ID, seat->Flags);
+ GetPlayer()->GetGUID().ToString().c_str(), vehicle->GetVehicleInfo()->SeatID[itr->first], itr->second.SeatInfo->Flags[0]);
}
}
}
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index 6a87a1e3246..7d73d9b6625 100644
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -22,6 +22,7 @@
#include "Define.h"
#include "DBCStructure.h"
+#include "DB2Structure.h"
#include "GridDefines.h"
#include "Cell.h"
#include "Timer.h"
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index cf35e643a02..a6734f6c205 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4556,7 +4556,7 @@ SpellCastResult Spell::CheckRuneCost()
return SPELL_CAST_OK;
int32 readyRunes = 0;
- for (uint32 i = 0; i < player->GetMaxPower(POWER_RUNES); ++i)
+ for (int32 i = 0; i < player->GetMaxPower(POWER_RUNES); ++i)
if (player->GetRuneCooldown(i) == 0)
++readyRunes;
@@ -4579,7 +4579,7 @@ void Spell::TakeRunePower(bool didHit)
return cost.Power == POWER_RUNES;
})->Amount;
- for (uint32 i = 0; i < player->GetMaxPower(POWER_RUNES); ++i)
+ for (int32 i = 0; i < player->GetMaxPower(POWER_RUNES); ++i)
{
if (!player->GetRuneCooldown(i) && runeCost > 0)
{
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index b174454225d..31e0b126be6 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2034,7 +2034,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
// however so far noone found a generic check to find all of those (there's no related data in summonproperties.dbc
// and in spell attributes, possibly we need to add a table for those)
// so here's a list of MiscValueB values, which is currently most generic check
- switch (properties->ID)
+ switch (effectInfo->MiscValueB)
{
case 64:
case 61:
@@ -5175,7 +5175,7 @@ void Spell::EffectQuestStart(SpellEffIndex /*effIndex*/)
}
}
-void Spell::EffectActivateRune(SpellEffIndex effIndex)
+void Spell::EffectActivateRune(SpellEffIndex /*effIndex*/)
{
if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH)
return;
@@ -5196,7 +5196,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
count = 1;
// first restore fully depleted runes
- for (uint32 j = 0; j < player->GetMaxPower(POWER_RUNES) && count > 0; ++j)
+ for (int32 j = 0; j < player->GetMaxPower(POWER_RUNES) && count > 0; ++j)
{
if (player->GetRuneCooldown(j) == player->GetRuneBaseCooldown())
{
@@ -5206,7 +5206,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
}
// then the rest if we still got something left
- for (uint32 j = 0; j < player->GetMaxPower(POWER_RUNES) && count > 0; ++j)
+ for (int32 j = 0; j < player->GetMaxPower(POWER_RUNES) && count > 0; ++j)
{
player->SetRuneCooldown(j, 0);
--count;
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 5b820f02c02..031ab5bdbdf 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -2079,11 +2079,11 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const
VehicleSeatEntry const* vehicleSeat = vehicle->GetSeatForPassenger(caster);
if (!(AttributesEx6 & SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !(Attributes & SPELL_ATTR0_CASTABLE_WHILE_MOUNTED)
- && (vehicleSeat->Flags & checkMask) != checkMask)
+ && (vehicleSeat->Flags[0] & checkMask) != checkMask)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
// Can only summon uncontrolled minions/guardians when on controlled vehicle
- if (vehicleSeat->Flags & (VEHICLE_SEAT_FLAG_CAN_CONTROL | VEHICLE_SEAT_FLAG_UNK2))
+ if (vehicleSeat->Flags[0] & (VEHICLE_SEAT_FLAG_CAN_CONTROL | VEHICLE_SEAT_FLAG_UNK2))
{
for (SpellEffectInfo const* effect : GetEffectsForDifficulty(caster->GetMap()->GetDifficultyID()))
{
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index b032aa8ef2e..4ff0d1a70a9 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -425,27 +425,45 @@ public:
ItemSetEntry const* set = sItemSetStore.LookupEntry(id);
if (set)
{
- std::string name = set->Name_lang;
+ int32 locale = handler->GetSessionDbcLocale();
+ std::string name = set->Name->Str[locale];
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- continue;
-
- if (maxResults && count++ == maxResults)
{
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
+ locale = 0;
+ for (; locale < TOTAL_LOCALES; ++locale)
+ {
+ if (locale == handler->GetSessionDbcLocale())
+ continue;
+
+ name = set->Name->Str[locale];
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
}
- // send item set in "id - [namedlink locale]" format
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), "");
- else
- handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), "");
+ if (locale < TOTAL_LOCALES)
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- if (!found)
- found = true;
+ // send item set in "id - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), "");
+ else
+ handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), "");
+
+ if (!found)
+ found = true;
+ }
}
}
if (!found)
diff --git a/src/server/shared/DataStores/DB2SparseStorageLoader.cpp b/src/server/shared/DataStores/DB2SparseStorageLoader.cpp
index 2e7e974cb5d..42914b4da17 100644
--- a/src/server/shared/DataStores/DB2SparseStorageLoader.cpp
+++ b/src/server/shared/DataStores/DB2SparseStorageLoader.cpp
@@ -390,7 +390,7 @@ char* DB2SparseFileLoader::AutoProduceStrings(const char* format, char* dataTabl
++records;
uint32 recordsize = GetFormatRecordSize(format);
- std::size_t stringFields = GetFormatStringFieldCount(format);
+ std::size_t stringFields = GetFormatLocalizedStringFieldCount(format);
char* stringTable = new char[offsetsPos - dataStart - records * (recordsize - stringFields * sizeof(char*))];
memset(stringTable, 0, offsetsPos - dataStart - records * (recordsize - stringFields * sizeof(char*)));
char* stringPtr = stringTable;
@@ -402,7 +402,7 @@ char* DB2SparseFileLoader::AutoProduceStrings(const char* format, char* dataTabl
if (!offsets[y].FileOffset || !offsets[y].RecordSize)
continue;
- uint32 fieldOffset;
+ uint32 fieldOffset = 0;
for (uint32 x = 0; x < fieldCount; x++)
{
switch (format[x])
@@ -427,7 +427,6 @@ char* DB2SparseFileLoader::AutoProduceStrings(const char* format, char* dataTabl
break;
case FT_STRING:
{
- // fill only not filled entries
LocalizedString* db2str = *(LocalizedString**)(&dataTable[offset]);
db2str->Str[locale] = stringPtr;
strcpy(stringPtr, (char*)&data[offsets[y].FileOffset - dataStart + fieldOffset]);
@@ -438,11 +437,7 @@ char* DB2SparseFileLoader::AutoProduceStrings(const char* format, char* dataTabl
}
case FT_STRING_NOT_LOCALIZED:
{
- char** db2str = (char**)(&dataTable[offset]);
- *db2str = stringPtr;
- strcpy(stringPtr, (char*)&data[offsets[y].FileOffset - dataStart + fieldOffset]);
- fieldOffset += strlen(stringPtr) + 1;
- stringPtr += strlen(stringPtr) + 1;
+ fieldOffset += strlen((char*)&data[offsets[y].FileOffset - dataStart + fieldOffset]) + 1;
offset += sizeof(char*);
break;
}