TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DBCStores.cpp File Reference
#include "DBCStores.h"
#include "Log.h"
#include "SharedDefines.h"
#include "SpellInfo.h"
#include "DBCfmt.h"
#include "Timer.h"
#include "DB2Stores.h"
#include <map>
+ Include dependency graph for DBCStores.cpp:

Classes

struct  WMOAreaTableTripple
 

Macros

#define LOAD_DBC(store, file)   LoadDBC(availableDbcLocales, bad_dbc_files, store, dbcPath, file, defaultLocale)
 
#define LOAD_GT(tableName, store, file)   LoadGameTable(bad_dbc_files, tableName, store, dbcPath, file)
 

Typedefs

typedef std::multimap< uint32,
CharSectionsEntry const * > 
CharSectionsMap
 
typedef std::map< uint32,
std::vector< uint32 > > 
FactionTeamMap
 
typedef std::map
< WMOAreaTableTripple,
WMOAreaTableEntry const * > 
WMOAreaInfoByTripple
 
typedef std::tuple< uint32,
uint32, uint32
EmotesTextSoundKey
 
typedef std::list< std::string > StoreProblemList
 

Functions

template<class T >
void LoadDBC (uint32 &availableDbcLocales, StoreProblemList &errors, DBCStorage< T > &storage, std::string const &dbcPath, std::string const &filename, uint32 defaultLocale, std::string const *customFormat=NULL, std::string const *customIndexName=NULL)
 
template<class T >
void LoadGameTable (StoreProblemList &errors, std::string const &tableName, GameTable< T > &storage, std::string const &dbcPath, std::string const &filename)
 
void LoadDBCStores (const std::string &dataPath, uint32 defaultLocale)
 
void LoadGameTables (const std::string &dataPath, uint32 defaultLocale)
 
std::vector< uint32 > constGetFactionTeamList (uint32 faction)
 
char constGetCreatureFamilyPetName (uint32 petfamily, uint32)
 
EmotesTextSoundEntry constFindTextSoundEmoteFor (uint32 emote, uint32 race, uint32 gender)
 
WMOAreaTableEntry constGetWMOAreaTableEntryByTripple (int32 rootid, int32 adtid, int32 groupid)
 
char constGetRaceName (uint8 race, uint8)
 
char constGetClassName (uint8 class_, uint8)
 
uint32 GetVirtualMapForMapAndZone (uint32 mapid, uint32 zoneId)
 
uint32 GetMaxLevelForExpansion (uint32 expansion)
 
uint32 GetExpansionForLevel (uint32 level)
 
bool IsTotemCategoryCompatibleWith (uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)
 
void Zone2MapCoordinates (float &x, float &y, uint32 worldMapAreaId)
 
void Map2ZoneCoordinates (float &x, float &y, uint32 worldMapAreaId)
 
MapDifficultyEntry constGetDefaultMapDifficulty (uint32 mapId, Difficulty *difficulty)
 
MapDifficultyEntry constGetMapDifficultyData (uint32 mapId, Difficulty difficulty)
 
MapDifficultyEntry constGetDownscaledMapDifficultyData (uint32 mapId, Difficulty &difficulty)
 
PvPDifficultyEntry constGetBattlegroundBracketByLevel (uint32 mapid, uint32 level)
 
PvPDifficultyEntry constGetBattlegroundBracketById (uint32 mapid, BattlegroundBracketId id)
 
uint32 GetLiquidFlags (uint32 liquidType)
 
CharSectionsEntry constGetCharSectionEntry (uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color)
 
LFGDungeonEntry constGetLFGDungeon (uint32 mapId, Difficulty difficulty)
 Returns LFGDungeonEntry for a specific map and difficulty. Will return first found entry if multiple dungeons use the same map (such as Scarlet Monastery) More...
 
uint32 GetDefaultMapLight (uint32 mapId)
 
SkillRaceClassInfoEntry constGetSkillRaceClassInfo (uint32 skill, uint8 race, uint8 class_)
 
void DeterminaAlternateMapPosition (uint32 mapId, float x, float y, float z, uint32 *newMapId, DBCPosition2D *newPos)
 

Variables

DBCStorage< AnimKitEntrysAnimKitStore (AnimKitfmt)
 
DBCStorage< AreaTableEntrysAreaTableStore (AreaTablefmt)
 
DBCStorage< AreaTriggerEntrysAreaTriggerStore (AreaTriggerfmt)
 
DBCStorage< ArmorLocationEntrysArmorLocationStore (ArmorLocationfmt)
 
DBCStorage
< BankBagSlotPricesEntry
sBankBagSlotPricesStore (BankBagSlotPricesfmt)
 
DBCStorage< BannedAddOnsEntrysBannedAddOnsStore (BannedAddOnsfmt)
 
DBCStorage< BattlemasterListEntrysBattlemasterListStore (BattlemasterListfmt)
 
DBCStorage< CharSectionsEntrysCharSectionsStore (CharSectionsfmt)
 
CharSectionsMap sCharSectionMap
 
DBCStorage< CharTitlesEntrysCharTitlesStore (CharTitlesfmt)
 
DBCStorage< ChatChannelsEntrysChatChannelsStore (ChatChannelsfmt)
 
DBCStorage< ChrClassesEntrysChrClassesStore (ChrClassesfmt)
 
DBCStorage< ChrRacesEntrysChrRacesStore (ChrRacesfmt)
 
DBCStorage
< ChrSpecializationEntry
sChrSpecializationStore (ChrSpecializationfmt)
 
ChrSpecializationByIndexArray sChrSpecializationByIndexStore
 
DBCStorage
< CreatureDisplayInfoExtraEntry
sCreatureDisplayInfoExtraStore (CreatureDisplayInfoExtrafmt)
 
DBCStorage< CreatureFamilyEntrysCreatureFamilyStore (CreatureFamilyfmt)
 
DBCStorage
< CreatureModelDataEntry
sCreatureModelDataStore (CreatureModelDatafmt)
 
DBCStorage< DifficultyEntrysDifficultyStore (DifficultyFmt)
 
DBCStorage< DungeonEncounterEntrysDungeonEncounterStore (DungeonEncounterfmt)
 
DBCStorage< DurabilityCostsEntrysDurabilityCostsStore (DurabilityCostsfmt)
 
DBCStorage< EmotesEntrysEmotesStore (Emotesfmt)
 
DBCStorage< EmotesTextEntrysEmotesTextStore (EmotesTextfmt)
 
static std::map
< EmotesTextSoundKey,
EmotesTextSoundEntry const * > 
sEmotesTextSoundMap
 
DBCStorage< EmotesTextSoundEntrysEmotesTextSoundStore (EmotesTextSoundEntryfmt)
 
DBCStorage< FactionEntrysFactionStore (Factionfmt)
 
static FactionTeamMap sFactionTeamMap
 
DBCStorage< FactionTemplateEntrysFactionTemplateStore (FactionTemplatefmt)
 
DBCStorage
< GameObjectDisplayInfoEntry
sGameObjectDisplayInfoStore (GameObjectDisplayInfofmt)
 
DBCStorage< GemPropertiesEntrysGemPropertiesStore (GemPropertiesfmt)
 
DBCStorage< GlyphPropertiesEntrysGlyphPropertiesStore (GlyphPropertiesfmt)
 
DBCStorage
< GuildColorBackgroundEntry
sGuildColorBackgroundStore (GuildColorBackgroundfmt)
 
DBCStorage< GuildColorBorderEntrysGuildColorBorderStore (GuildColorBorderfmt)
 
DBCStorage< GuildColorEmblemEntrysGuildColorEmblemStore (GuildColorEmblemfmt)
 
DBCStorage< ItemArmorQualityEntrysItemArmorQualityStore (ItemArmorQualityfmt)
 
DBCStorage< ItemArmorShieldEntrysItemArmorShieldStore (ItemArmorShieldfmt)
 
DBCStorage< ItemArmorTotalEntrysItemArmorTotalStore (ItemArmorTotalfmt)
 
DBCStorage< ItemBagFamilyEntrysItemBagFamilyStore (ItemBagFamilyfmt)
 
DBCStorage< ItemDamageEntrysItemDamageAmmoStore (ItemDamagefmt)
 
DBCStorage< ItemDamageEntrysItemDamageOneHandCasterStore (ItemDamagefmt)
 
DBCStorage< ItemDamageEntrysItemDamageOneHandStore (ItemDamagefmt)
 
DBCStorage< ItemDamageEntrysItemDamageRangedStore (ItemDamagefmt)
 
DBCStorage< ItemDamageEntrysItemDamageThrownStore (ItemDamagefmt)
 
DBCStorage< ItemDamageEntrysItemDamageTwoHandCasterStore (ItemDamagefmt)
 
DBCStorage< ItemDamageEntrysItemDamageTwoHandStore (ItemDamagefmt)
 
DBCStorage< ItemDamageEntrysItemDamageWandStore (ItemDamagefmt)
 
DBCStorage< ItemSetEntrysItemSetStore (ItemSetfmt)
 
DBCStorage< ItemSetSpellEntrysItemSetSpellStore (ItemSetSpellfmt)
 
ItemSetSpellsStore sItemSetSpellsStore
 
DBCStorage< LFGDungeonEntrysLFGDungeonStore (LFGDungeonfmt)
 
DBCStorage< LightEntrysLightStore (Lightfmt)
 
DBCStorage< LiquidTypeEntrysLiquidTypeStore (LiquidTypefmt)
 
DBCStorage< LockEntrysLockStore (Lockfmt)
 
DBCStorage< MapEntrysMapStore (Mapfmt)
 
DBCStorage< MapDifficultyEntrysMapDifficultyStore (MapDifficultyfmt)
 
MapDifficultyMap sMapDifficultyMap
 
DBCStorage< MovieEntrysMovieStore (Moviefmt)
 
DBCStorage< PhaseEntrysPhaseStore (Phasefmt)
 
DBCStorage< PowerDisplayEntrysPowerDisplayStore (PowerDisplayfmt)
 
DBCStorage< PvPDifficultyEntrysPvpDifficultyStore (PvpDifficultyfmt)
 
DBCStorage< QuestFactionRewEntrysQuestFactionRewardStore (QuestFactionRewardfmt)
 
DBCStorage
< RandomPropertiesPointsEntry
sRandomPropertiesPointsStore (RandPropPointsfmt)
 
DBCStorage< SkillLineAbilityEntrysSkillLineAbilityStore (SkillLineAbilityfmt)
 
DBCStorage< SkillLineEntrysSkillLineStore (SkillLinefmt)
 
DBCStorage
< SkillRaceClassInfoEntry
sSkillRaceClassInfoStore (SkillRaceClassInfofmt)
 
SkillRaceClassInfoMap SkillRaceClassInfoBySkill
 
DBCStorage< SpellAuraOptionsEntrysSpellAuraOptionsStore (SpellAuraOptionsfmt)
 
DBCStorage< SpellCategoriesEntrysSpellCategoriesStore (SpellCategoriesfmt)
 
DBCStorage< SpellCategoryEntrysSpellCategoryStore (SpellCategoryfmt)
 
DBCStorage< SpellCooldownsEntrysSpellCooldownsStore (SpellCooldownsfmt)
 
DBCStorage< SpellEffectEntrysSpellEffectStore (SpellEffectfmt)
 
DBCStorage
< SpellEffectScalingEntry
sSpellEffectScalingStore (SpellEffectScalingfmt)
 
SpellEffectScallingByEffectId sSpellEffectScallingByEffectId
 
DBCStorage< SpellEntrysSpellStore (Spellfmt)
 
DBCStorage
< SpellEquippedItemsEntry
sSpellEquippedItemsStore (SpellEquippedItemsfmt)
 
DBCStorage< SpellFocusObjectEntrysSpellFocusObjectStore (SpellFocusObjectfmt)
 
DBCStorage< SpellInterruptsEntrysSpellInterruptsStore (SpellInterruptsfmt)
 
DBCStorage
< SpellItemEnchantmentEntry
sSpellItemEnchantmentStore (SpellItemEnchantmentfmt)
 
DBCStorage< SpellLevelsEntrysSpellLevelsStore (SpellLevelsfmt)
 
DBCStorage< SpellScalingEntrysSpellScalingStore (SpellScalingfmt)
 
DBCStorage< SpellShapeshiftEntrysSpellShapeshiftStore (SpellShapeshiftfmt)
 
DBCStorage
< SpellShapeshiftFormEntry
sSpellShapeshiftFormStore (SpellShapeshiftFormfmt)
 
DBCStorage
< SpellTargetRestrictionsEntry
sSpellTargetRestrictionsStore (SpellTargetRestrictionsfmt)
 
DBCStorage< SummonPropertiesEntrysSummonPropertiesStore (SummonPropertiesfmt)
 
DBCStorage< TalentEntrysTalentStore (Talentfmt)
 
TalentsByPosition sTalentByPos
 
DBCStorage< VehicleEntrysVehicleStore (Vehiclefmt)
 
DBCStorage< VehicleSeatEntrysVehicleSeatStore (VehicleSeatfmt)
 
DBCStorage< WMOAreaTableEntrysWMOAreaTableStore (WMOAreaTablefmt)
 
static WMOAreaInfoByTripple sWMOAreaInfoByTripple
 
DBCStorage< WorldMapAreaEntrysWorldMapAreaStore (WorldMapAreafmt)
 
DBCStorage
< WorldMapTransformsEntry
sWorldMapTransformsStore (WorldMapTransformsfmt)
 
DBCStorage< WorldSafeLocsEntrysWorldSafeLocsStore (WorldSafeLocsfmt)
 
GameTable
< GtBarberShopCostBaseEntry
sGtBarberShopCostBaseStore (GtBarberShopCostBasefmt)
 
GameTable
< GtChanceToMeleeCritBaseEntry
sGtChanceToMeleeCritBaseStore (GtChanceToMeleeCritBasefmt)
 
GameTable
< GtChanceToMeleeCritEntry
sGtChanceToMeleeCritStore (GtChanceToMeleeCritfmt)
 
GameTable
< GtChanceToSpellCritBaseEntry
sGtChanceToSpellCritBaseStore (GtChanceToSpellCritBasefmt)
 
GameTable
< GtChanceToSpellCritEntry
sGtChanceToSpellCritStore (GtChanceToSpellCritfmt)
 
GameTable< GtCombatRatingsEntrysGtCombatRatingsStore (GtCombatRatingsfmt)
 
GameTable
< GtItemSocketCostPerLevelEntry
sGtItemSocketCostPerLevelStore (GtItemSocketCostPerLevelfmt)
 
GameTable
< GtNPCManaCostScalerEntry
sGtNPCManaCostScalerStore (GtNPCManaCostScalerfmt)
 
GameTable< GtNpcTotalHpEntrysGtNpcTotalHpStore (GtNpcTotalHpfmt)
 
GameTable< GtNpcTotalHpExp1EntrysGtNpcTotalHpExp1Store (GtNpcTotalHpExp1fmt)
 
GameTable< GtNpcTotalHpExp2EntrysGtNpcTotalHpExp2Store (GtNpcTotalHpExp2fmt)
 
GameTable< GtNpcTotalHpExp3EntrysGtNpcTotalHpExp3Store (GtNpcTotalHpExp3fmt)
 
GameTable< GtNpcTotalHpExp4EntrysGtNpcTotalHpExp4Store (GtNpcTotalHpExp4fmt)
 
GameTable< GtNpcTotalHpExp5EntrysGtNpcTotalHpExp5Store (GtNpcTotalHpExp5fmt)
 
GameTable
< GtOCTBaseHPByClassEntry
sGtOCTBaseHPByClassStore (GtOCTBaseHPByClassfmt)
 
GameTable
< GtOCTBaseMPByClassEntry
sGtOCTBaseMPByClassStore (GtOCTBaseMPByClassfmt)
 
GameTable< GtOCTHpPerStaminaEntrysGtOCTHpPerStaminaStore (GtOCTHpPerStaminafmt)
 
GameTable
< GtOCTLevelExperienceEntry
sGtOCTLevelExperienceStore (GtOCTLevelExperiencefmt)
 
GameTable< GtRegenMPPerSptEntrysGtRegenMPPerSptStore (GtRegenMPPerSptfmt)
 
GameTable< GtSpellScalingEntrysGtSpellScalingStore (GtSpellScalingfmt)
 
uint32 DBCFileCount = 0
 
uint32 GameTableCount = 0
 

Macro Definition Documentation

#define LOAD_DBC (   store,
  file 
)    LoadDBC(availableDbcLocales, bad_dbc_files, store, dbcPath, file, defaultLocale)
#define LOAD_GT (   tableName,
  store,
  file 
)    LoadGameTable(bad_dbc_files, tableName, store, dbcPath, file)

Typedef Documentation

typedef std::multimap<uint32, CharSectionsEntry const*> CharSectionsMap
typedef std::tuple<uint32, uint32, uint32> EmotesTextSoundKey
typedef std::map<uint32, std::vector<uint32> > FactionTeamMap
typedef std::list<std::string> StoreProblemList

Function Documentation

void DeterminaAlternateMapPosition ( uint32  mapId,
float  x,
float  y,
float  z,
uint32 newMapId,
DBCPosition2D newPos 
)
862 {
863  ASSERT(newMapId || newPos);
864  WorldMapTransformsEntry const* transformation = nullptr;
865  for (WorldMapTransformsEntry const* transform : sWorldMapTransformsStore)
866  {
867  if (transform->MapID != mapId)
868  continue;
869 
870  if (transform->RegionMin.X > x || transform->RegionMax.X < x)
871  continue;
872  if (transform->RegionMin.Y > y || transform->RegionMax.Y < y)
873  continue;
874  if (transform->RegionMin.Z > z || transform->RegionMax.Z < z)
875  continue;
876 
877  transformation = transform;
878  break;
879  }
880 
881  if (!transformation)
882  {
883  if (newMapId)
884  *newMapId = mapId;
885 
886  if (newPos)
887  {
888  newPos->X = x;
889  newPos->Y = y;
890  }
891  return;
892  }
893 
894  if (newMapId)
895  *newMapId = transformation->NewMapID;
896 
897  if (!newPos)
898  return;
899 
900  if (transformation->RegionScale > 0.0f && transformation->RegionScale < 1.0f)
901  {
902  x = (x - transformation->RegionMin.X) * transformation->RegionScale + transformation->RegionMin.X;
903  y = (y - transformation->RegionMin.Y) * transformation->RegionScale + transformation->RegionMin.Y;
904  }
905 
906  newPos->X = x + transformation->RegionOffset.X;
907  newPos->Y = y + transformation->RegionOffset.Y;
908 }
float Y
Definition: DBCEnums.h:35
DBCStorage< WorldMapTransformsEntry > sWorldMapTransformsStore(WorldMapTransformsfmt)
float X
Definition: DBCEnums.h:28
float Y
Definition: DBCEnums.h:29
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
float X
Definition: DBCEnums.h:34
DBCPosition3D RegionMin
Definition: DBCStructure.h:1424
#define ASSERT
Definition: Errors.h:55
G3D::int16 x
Definition: Vector2int16.h:37
Definition: DBCStructure.h:1420
float RegionScale
Definition: DBCStructure.h:1431
uint32 NewMapID
Definition: DBCStructure.h:1426
DBCPosition2D RegionOffset
Definition: DBCStructure.h:1427

+ Here is the caller graph for this function:

EmotesTextSoundEntry const* FindTextSoundEmoteFor ( uint32  emote,
uint32  race,
uint32  gender 
)
574 {
575  auto itr = sEmotesTextSoundMap.find(EmotesTextSoundKey(emote, race, gender));
576  return itr != sEmotesTextSoundMap.end() ? itr->second : nullptr;
577 }
static std::map< EmotesTextSoundKey, EmotesTextSoundEntry const * > sEmotesTextSoundMap
Definition: DBCStores.cpp:79
std::tuple< uint32, uint32, uint32 > EmotesTextSoundKey
Definition: DBCStores.cpp:78

+ Here is the caller graph for this function:

PvPDifficultyEntry const* GetBattlegroundBracketById ( uint32  mapid,
BattlegroundBracketId  id 
)
785 {
786  for (uint32 i = 0; i < sPvpDifficultyStore.GetNumRows(); ++i)
787  if (PvPDifficultyEntry const* entry = sPvpDifficultyStore.LookupEntry(i))
788  if (entry->MapID == mapid && entry->GetBracketId() == id)
789  return entry;
790 
791  return NULL;
792 }
arena_t NULL
Definition: jemalloc_internal.h:624
DBCStorage< PvPDifficultyEntry > sPvpDifficultyStore(PvpDifficultyfmt)
uint32_t uint32
Definition: Define.h:150
Definition: DBCStructure.h:926

+ Here is the caller graph for this function:

PvPDifficultyEntry const* GetBattlegroundBracketByLevel ( uint32  mapid,
uint32  level 
)
761 {
762  PvPDifficultyEntry const* maxEntry = NULL; // used for level > max listed level case
763  for (uint32 i = 0; i < sPvpDifficultyStore.GetNumRows(); ++i)
764  {
765  if (PvPDifficultyEntry const* entry = sPvpDifficultyStore.LookupEntry(i))
766  {
767  // skip unrelated and too-high brackets
768  if (entry->MapID != mapid || entry->MinLevel > level)
769  continue;
770 
771  // exactly fit
772  if (entry->MaxLevel >= level)
773  return entry;
774 
775  // remember for possible out-of-range case (search higher from existed)
776  if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel)
777  maxEntry = entry;
778  }
779  }
780 
781  return maxEntry;
782 }
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 MaxLevel
Definition: DBCStructure.h:932
DBCStorage< PvPDifficultyEntry > sPvpDifficultyStore(PvpDifficultyfmt)
uint32_t uint32
Definition: Define.h:150
Definition: DBCStructure.h:926

+ Here is the caller graph for this function:

CharSectionsEntry const* GetCharSectionEntry ( uint8  race,
CharSectionType  genType,
uint8  gender,
uint8  type,
uint8  color 
)
803 {
804  std::pair<CharSectionsMap::const_iterator, CharSectionsMap::const_iterator> eqr = sCharSectionMap.equal_range(uint32(genType) | uint32(gender << 8) | uint32(race << 16));
805  for (CharSectionsMap::const_iterator itr = eqr.first; itr != eqr.second; ++itr)
806  {
807  if (itr->second->Type == type && itr->second->Color == color)
808  return itr->second;
809  }
810 
811  return NULL;
812 }
arena_t NULL
Definition: jemalloc_internal.h:624
CharSectionsMap sCharSectionMap
Definition: DBCStores.cpp:61
uint32_t uint32
Definition: g3dmath.h:168
char const* GetClassName ( uint8  class_,
uint8   
)
594 {
595  ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_);
596  return classEntry ? classEntry->Name_lang : NULL;
597 }
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesfmt)
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: DBCStructure.h:181
char * Name_lang
Definition: DBCStructure.h:186

+ Here is the caller graph for this function:

char const* GetCreatureFamilyPetName ( uint32  petfamily,
uint32   
)
562 {
563  if (!petfamily)
564  return nullptr;
565 
566  CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily);
567  if (!pet_family)
568  return nullptr;
569 
570  return pet_family->Name_lang ? pet_family->Name_lang : NULL;
571 }
arena_t NULL
Definition: jemalloc_internal.h:624
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
char * Name_lang
Definition: DBCStructure.h:290
Definition: DBCStructure.h:279

+ Here is the caller graph for this function:

MapDifficultyEntry const* GetDefaultMapDifficulty ( uint32  mapId,
Difficulty difficulty 
)
695 {
696  auto itr = sMapDifficultyMap.find(mapId);
697  if (itr == sMapDifficultyMap.end())
698  return nullptr;
699 
700  if (itr->second.empty())
701  return nullptr;
702 
703  for (auto& p : itr->second)
704  {
705  DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(p.first);
706  if (!difficultyEntry)
707  continue;
708 
709  if (difficultyEntry->Flags & DIFFICULTY_FLAG_DEFAULT)
710  {
711  if (difficulty)
712  *difficulty = Difficulty(p.first);
713 
714  return p.second;
715  }
716  }
717 
718  if (difficulty)
719  *difficulty = Difficulty(itr->second.begin()->first);
720 
721  return itr->second.begin()->second;
722 }
Difficulty
Definition: DBCEnums.h:402
MapDifficultyMap sMapDifficultyMap
Definition: DBCStores.cpp:115
uint32 Flags
Definition: DBCStructure.h:346
Definition: DBCEnums.h:432
DBCStorage< DifficultyEntry > sDifficultyStore(DifficultyFmt)
Definition: DBCStructure.h:338

+ Here is the caller graph for this function:

uint32 GetDefaultMapLight ( uint32  mapId)
831 {
832  for (int32 i = sLightStore.GetNumRows(); i >= 0; --i)
833  {
834  LightEntry const* light = sLightStore.LookupEntry(uint32(i));
835  if (!light)
836  continue;
837 
838  if (light->MapID == mapId && light->Pos.X == 0.0f && light->Pos.Y == 0.0f && light->Pos.Z == 0.0f)
839  return light->ID;
840  }
841 
842  return 0;
843 }
uint32 MapID
Definition: DBCStructure.h:782
float Z
Definition: DBCEnums.h:36
float Y
Definition: DBCEnums.h:35
Definition: DBCStructure.h:779
int32_t int32
Definition: Define.h:146
float X
Definition: DBCEnums.h:34
uint32 ID
Definition: DBCStructure.h:781
uint32_t uint32
Definition: g3dmath.h:168
DBCStorage< LightEntry > sLightStore(Lightfmt)
DBCPosition3D Pos
Definition: DBCStructure.h:783
MapDifficultyEntry const* GetDownscaledMapDifficultyData ( uint32  mapId,
Difficulty difficulty 
)
738 {
739  DifficultyEntry const* diffEntry = sDifficultyStore.LookupEntry(difficulty);
740  if (!diffEntry)
741  return GetDefaultMapDifficulty(mapId, &difficulty);
742 
743  uint32 tmpDiff = difficulty;
744  MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));
745  while (!mapDiff)
746  {
747  tmpDiff = diffEntry->FallbackDifficultyID;
748  diffEntry = sDifficultyStore.LookupEntry(tmpDiff);
749  if (!diffEntry)
750  return GetDefaultMapDifficulty(mapId, &difficulty);
751 
752  // pull new data
753  mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal
754  }
755 
756  difficulty = Difficulty(tmpDiff);
757  return mapDiff;
758 }
Difficulty
Definition: DBCEnums.h:402
MapDifficultyEntry const * GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
Definition: DBCStores.cpp:724
uint32 FallbackDifficultyID
Definition: DBCStructure.h:341
MapDifficultyEntry const * GetDefaultMapDifficulty(uint32 mapId, Difficulty *difficulty)
Definition: DBCStores.cpp:694
uint32_t uint32
Definition: Define.h:150
Definition: DBCStructure.h:885
DBCStorage< DifficultyEntry > sDifficultyStore(DifficultyFmt)
Definition: DBCStructure.h:338

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32 GetExpansionForLevel ( uint32  level)
633 {
634  if (level < 60)
635  return EXPANSION_CLASSIC;
636  else if (level < 70)
638  else if (level < 80)
640  else if (level < 85)
641  return EXPANSION_CATACLYSM;
642  else if (level < 90)
644  else
645  return CURRENT_EXPANSION;
646 }
Definition: SharedDefines.h:80
#define CURRENT_EXPANSION
Definition: SharedDefines.h:88
Definition: SharedDefines.h:81
Definition: SharedDefines.h:79
Definition: SharedDefines.h:82
Definition: SharedDefines.h:83

+ Here is the caller graph for this function:

std::vector<uint32> const* GetFactionTeamList ( uint32  faction)
553 {
554  FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction);
555  if (itr != sFactionTeamMap.end())
556  return &itr->second;
557 
558  return NULL;
559 }
arena_t NULL
Definition: jemalloc_internal.h:624
static FactionTeamMap sFactionTeamMap
Definition: DBCStores.cpp:83

+ Here is the caller graph for this function:

LFGDungeonEntry const* GetLFGDungeon ( uint32  mapId,
Difficulty  difficulty 
)

Returns LFGDungeonEntry for a specific map and difficulty. Will return first found entry if multiple dungeons use the same map (such as Scarlet Monastery)

816 {
817  for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i)
818  {
819  LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(i);
820  if (!dungeon)
821  continue;
822 
823  if (dungeon->MapID == int32(mapId) && Difficulty(dungeon->DifficultyID) == difficulty)
824  return dungeon;
825  }
826 
827  return NULL;
828 }
Difficulty
Definition: DBCEnums.h:402
DBCStorage< LFGDungeonEntry > sLFGDungeonStore(LFGDungeonfmt)
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: DBCStructure.h:742
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
int32 MapID
Definition: DBCStructure.h:751
uint32 DifficultyID
Definition: DBCStructure.h:752

+ Here is the caller graph for this function:

uint32 GetLiquidFlags ( uint32  liquidType)
795 {
796  if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
797  return 1 << liq->Type;
798 
799  return 0;
800 }
DBCStorage< LiquidTypeEntry > sLiquidTypeStore(LiquidTypefmt)
Definition: DBCStructure.h:789

+ Here is the caller graph for this function:

MapDifficultyEntry const* GetMapDifficultyData ( uint32  mapId,
Difficulty  difficulty 
)
725 {
726  auto itr = sMapDifficultyMap.find(mapId);
727  if (itr == sMapDifficultyMap.end())
728  return nullptr;
729 
730  auto diffItr = itr->second.find(difficulty);
731  if (diffItr == itr->second.end())
732  return nullptr;
733 
734  return diffItr->second;
735 }
MapDifficultyMap sMapDifficultyMap
Definition: DBCStores.cpp:115

+ Here is the caller graph for this function:

uint32 GetMaxLevelForExpansion ( uint32  expansion)
611 {
612  switch (expansion)
613  {
614  case EXPANSION_CLASSIC:
615  return 60;
617  return 70;
619  return 80;
620  case EXPANSION_CATACLYSM:
621  return 85;
623  return 90;
625  return 100;
626  default:
627  break;
628  }
629  return 0;
630 }
Definition: SharedDefines.h:80
Definition: SharedDefines.h:81
Definition: SharedDefines.h:79
Definition: SharedDefines.h:84
Definition: SharedDefines.h:82
Definition: SharedDefines.h:83

+ Here is the caller graph for this function:

char const* GetRaceName ( uint8  race,
uint8   
)
588 {
589  ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race);
590  return raceEntry ? raceEntry->Name_lang : NULL;
591 }
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesfmt)
Definition: DBCStructure.h:204
arena_t NULL
Definition: jemalloc_internal.h:624
char * Name_lang
Definition: DBCStructure.h:220

+ Here is the caller graph for this function:

SkillRaceClassInfoEntry const* GetSkillRaceClassInfo ( uint32  skill,
uint8  race,
uint8  class_ 
)
846 {
847  SkillRaceClassInfoBounds bounds = SkillRaceClassInfoBySkill.equal_range(skill);
848  for (SkillRaceClassInfoMap::iterator itr = bounds.first; itr != bounds.second; ++itr)
849  {
850  if (itr->second->RaceMask && !(itr->second->RaceMask & (1 << (race - 1))))
851  continue;
852  if (itr->second->ClassMask && !(itr->second->ClassMask & (1 << (class_ - 1))))
853  continue;
854 
855  return itr->second;
856  }
857 
858  return NULL;
859 }
arena_t NULL
Definition: jemalloc_internal.h:624
std::pair< SkillRaceClassInfoMap::iterator, SkillRaceClassInfoMap::iterator > SkillRaceClassInfoBounds
Definition: DBCStores.h:73
SkillRaceClassInfoMap SkillRaceClassInfoBySkill
Definition: DBCStores.cpp:129

+ Here is the caller graph for this function:

uint32 GetVirtualMapForMapAndZone ( uint32  mapid,
uint32  zoneId 
)
600 {
601  if (mapid != 530 && mapid != 571 && mapid != 732) // speed for most cases
602  return mapid;
603 
604  if (WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId))
605  return wma->DisplayMapID >= 0 ? wma->DisplayMapID : wma->MapID;
606 
607  return mapid;
608 }
Definition: DBCStructure.h:1402
DBCStorage< WorldMapAreaEntry > sWorldMapAreaStore(WorldMapAreafmt)

+ Here is the caller graph for this function:

WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple ( int32  rootid,
int32  adtid,
int32  groupid 
)
580 {
581  WMOAreaInfoByTripple::iterator i = sWMOAreaInfoByTripple.find(WMOAreaTableTripple(rootid, adtid, groupid));
582  if (i == sWMOAreaInfoByTripple.end())
583  return NULL;
584  return i->second;
585 }
static WMOAreaInfoByTripple sWMOAreaInfoByTripple
Definition: DBCStores.cpp:156
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: DBCStores.cpp:30

+ Here is the caller graph for this function:

bool IsTotemCategoryCompatibleWith ( uint32  itemTotemCategoryId,
uint32  requiredTotemCategoryId 
)
649 {
650  if (requiredTotemCategoryId == 0)
651  return true;
652  if (itemTotemCategoryId == 0)
653  return false;
654 
655  TotemCategoryEntry const* itemEntry = sTotemCategoryStore.LookupEntry(itemTotemCategoryId);
656  if (!itemEntry)
657  return false;
658  TotemCategoryEntry const* reqEntry = sTotemCategoryStore.LookupEntry(requiredTotemCategoryId);
659  if (!reqEntry)
660  return false;
661 
662  if (itemEntry->CategoryType != reqEntry->CategoryType)
663  return false;
664 
665  return (itemEntry->CategoryMask & reqEntry->CategoryMask) == reqEntry->CategoryMask;
666 }
DB2Storage< TotemCategoryEntry > sTotemCategoryStore("TotemCategory.db2", TotemCategoryFormat, HOTFIX_SEL_TOTEM_CATEGORY)
uint32 CategoryMask
Definition: DB2Structure.h:1363
Definition: DB2Structure.h:1358
uint32 CategoryType
Definition: DB2Structure.h:1362
template<class T >
void LoadDBC ( uint32 availableDbcLocales,
StoreProblemList errors,
DBCStorage< T > &  storage,
std::string const dbcPath,
std::string const filename,
uint32  defaultLocale,
std::string const customFormat = NULL,
std::string const customIndexName = NULL 
)
inline
189 {
190  // compatibility format and C++ structure sizes
191  ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T),
192  "Size of '%s' set by format string (%u) not equal size of C++ structure (%u).",
193  filename.c_str(), DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), uint32(sizeof(T)));
194 
195  ++DBCFileCount;
196  std::string dbcFilename = dbcPath + localeNames[defaultLocale] + '/' + filename;
197  SqlDbc * sql = NULL;
198  if (customFormat)
199  sql = new SqlDbc(&filename, customFormat, customIndexName, storage.GetFormat());
200 
201  if (storage.Load(dbcFilename.c_str(), sql))
202  {
203  for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
204  {
205  if (i == LOCALE_none || !(availableDbcLocales & (1 << i)))
206  continue;
207 
208  std::string localizedName(dbcPath);
209  localizedName.append(localeNames[i]);
210  localizedName.push_back('/');
211  localizedName.append(filename);
212 
213  if (!storage.LoadStringsFrom(localizedName.c_str()))
214  availableDbcLocales &= ~(1<<i); // mark as not available for speedup next checks
215  }
216  }
217  else
218  {
219  // sort problematic dbc to (1) non compatible and (2) non-existed
220  if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
221  {
222  std::ostringstream stream;
223  stream << dbcFilename << " exists, and has " << storage.GetFieldCount() << " field(s) (expected " << strlen(storage.GetFormat()) << "). Extracted file might be from wrong client version or a database-update has been forgotten.";
224  std::string buf = stream.str();
225  errors.push_back(buf);
226  fclose(f);
227  }
228  else
229  errors.push_back(dbcFilename);
230  }
231 
232  delete sql;
233 }
Definition: Common.h:126
Definition: DBCStore.h:30
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 DBCFileCount
Definition: DBCStores.cpp:184
char const * GetFormat() const
Definition: DBCStore.h:102
bool LoadStringsFrom(char const *fn)
Definition: DBCStore.h:268
uint32 GetFieldCount() const
Definition: DBCStore.h:103
bool Load(char const *fn, SqlDbc *sql)
Definition: DBCStore.h:105
static uint32 GetFormatRecordSize(const char *format, int32 *index_pos=NULL)
Definition: DBCFileLoader.cpp:128
TC_COMMON_API char const * localeNames[TOTAL_LOCALES]
Definition: Common.cpp:21
uint8_t uint8
Definition: Define.h:152
#define ASSERT
Definition: Errors.h:55
uint32_t uint32
Definition: g3dmath.h:168
Definition: Common.h:130

+ Here is the call graph for this function:

void LoadDBCStores ( const std::string &  dataPath,
uint32  defaultLocale 
)
289 {
290  uint32 oldMSTime = getMSTime();
291 
292  std::string dbcPath = dataPath + "dbc/";
293 
294  StoreProblemList bad_dbc_files;
295  uint32 availableDbcLocales = 0xFFFFFFFF;
296 
297 #define LOAD_DBC(store, file) LoadDBC(availableDbcLocales, bad_dbc_files, store, dbcPath, file, defaultLocale)
298 
299  LOAD_DBC(sAnimKitStore, "AnimKit.dbc");//20444
300  LOAD_DBC(sAreaTableStore, "AreaTable.dbc");//20444
301  LOAD_DBC(sAreaTriggerStore, "AreaTrigger.dbc");//20444
302  LOAD_DBC(sArmorLocationStore, "ArmorLocation.dbc");//20444
303  LOAD_DBC(sBankBagSlotPricesStore, "BankBagSlotPrices.dbc");//20444
304  LOAD_DBC(sBannedAddOnsStore, "BannedAddOns.dbc");//20444
305  LOAD_DBC(sBattlemasterListStore, "BattlemasterList.dbc");//20444
306  LOAD_DBC(sCharSectionsStore, "CharSections.dbc");//20444
307  LOAD_DBC(sCharTitlesStore, "CharTitles.dbc");//20444
308  LOAD_DBC(sChatChannelsStore, "ChatChannels.dbc");//20444
309  LOAD_DBC(sChrClassesStore, "ChrClasses.dbc");//20444
310  LOAD_DBC(sChrRacesStore, "ChrRaces.dbc");//20444
311  LOAD_DBC(sChrSpecializationStore, "ChrSpecialization.dbc");//20444
312  LOAD_DBC(sCreatureDisplayInfoExtraStore, "CreatureDisplayInfoExtra.dbc");//20444
313  LOAD_DBC(sCreatureFamilyStore, "CreatureFamily.dbc");//20444
314  LOAD_DBC(sCreatureModelDataStore, "CreatureModelData.dbc");//20444
315  LOAD_DBC(sDifficultyStore, "Difficulty.dbc");//20444
316  LOAD_DBC(sDungeonEncounterStore, "DungeonEncounter.dbc");//20444
317  LOAD_DBC(sDurabilityCostsStore, "DurabilityCosts.dbc");//20444
318  LOAD_DBC(sEmotesStore, "Emotes.dbc");//20444
319  LOAD_DBC(sEmotesTextStore, "EmotesText.dbc");//20444
320  LOAD_DBC(sEmotesTextSoundStore, "EmotesTextSound.dbc");
321  LOAD_DBC(sFactionStore, "Faction.dbc");//20444
322  LOAD_DBC(sFactionTemplateStore, "FactionTemplate.dbc");//20444
323  LOAD_DBC(sGameObjectDisplayInfoStore, "GameObjectDisplayInfo.dbc");//20444
324  LOAD_DBC(sGemPropertiesStore, "GemProperties.dbc");//20444
325  LOAD_DBC(sGlyphPropertiesStore, "GlyphProperties.dbc");//20444
326  LOAD_DBC(sGuildColorBackgroundStore, "GuildColorBackground.dbc");//20444
327  LOAD_DBC(sGuildColorBorderStore, "GuildColorBorder.dbc"); //20444
328  LOAD_DBC(sGuildColorEmblemStore, "GuildColorEmblem.dbc");//20444
329  LOAD_DBC(sItemArmorQualityStore, "ItemArmorQuality.dbc");//20444
330  LOAD_DBC(sItemArmorShieldStore, "ItemArmorShield.dbc");//20444
331  LOAD_DBC(sItemArmorTotalStore, "ItemArmorTotal.dbc");//20444
332  LOAD_DBC(sItemBagFamilyStore, "ItemBagFamily.dbc");//20444
333  LOAD_DBC(sItemDamageAmmoStore, "ItemDamageAmmo.dbc");//20444
334  LOAD_DBC(sItemDamageOneHandCasterStore, "ItemDamageOneHandCaster.dbc");//20444
335  LOAD_DBC(sItemDamageOneHandStore, "ItemDamageOneHand.dbc");//20444
336  LOAD_DBC(sItemDamageRangedStore, "ItemDamageRanged.dbc");//20444
337  LOAD_DBC(sItemDamageThrownStore, "ItemDamageThrown.dbc");//20444
338  LOAD_DBC(sItemDamageTwoHandCasterStore, "ItemDamageTwoHandCaster.dbc");//20444
339  LOAD_DBC(sItemDamageTwoHandStore, "ItemDamageTwoHand.dbc");//20444
340  LOAD_DBC(sItemDamageWandStore, "ItemDamageWand.dbc");//20444
341  LOAD_DBC(sItemSetSpellStore, "ItemSetSpell.dbc");//20444
342  LOAD_DBC(sItemSetStore, "ItemSet.dbc");//20444
343  LOAD_DBC(sLFGDungeonStore, "LfgDungeons.dbc");//20444
344  LOAD_DBC(sLightStore, "Light.dbc"); //20444
345  LOAD_DBC(sLiquidTypeStore, "LiquidType.dbc");//20444
346  LOAD_DBC(sLockStore, "Lock.dbc");//20444
347  LOAD_DBC(sMapDifficultyStore, "MapDifficulty.dbc");//20444
348  LOAD_DBC(sMapStore, "Map.dbc");//20444
349  LOAD_DBC(sMovieStore, "Movie.dbc");//20444
350  LOAD_DBC(sPhaseStore, "Phase.dbc"); // 20444
351  LOAD_DBC(sPowerDisplayStore, "PowerDisplay.dbc");//20444
352  LOAD_DBC(sPvpDifficultyStore, "PvpDifficulty.dbc");//20444
353  LOAD_DBC(sQuestFactionRewardStore, "QuestFactionReward.dbc");//20444
354  LOAD_DBC(sRandomPropertiesPointsStore, "RandPropPoints.dbc");//20444
355  LOAD_DBC(sSkillLineAbilityStore, "SkillLineAbility.dbc");//20444
356  LOAD_DBC(sSkillLineStore, "SkillLine.dbc");//20444
357  LOAD_DBC(sSkillRaceClassInfoStore, "SkillRaceClassInfo.dbc");//20444
358  LOAD_DBC(sSpellAuraOptionsStore, "SpellAuraOptions.dbc");//20444
359  LOAD_DBC(sSpellCategoriesStore, "SpellCategories.dbc");//20444
360  LOAD_DBC(sSpellCategoryStore, "SpellCategory.dbc");//20444
361  LOAD_DBC(sSpellCooldownsStore, "SpellCooldowns.dbc");//20444
362  LOAD_DBC(sSpellEffectScalingStore, "SpellEffectScaling.dbc");//20444
363  LOAD_DBC(sSpellEffectStore, "SpellEffect.dbc"/*, &CustomSpellEffectfmt, &CustomSpellEffectEntryIndex*/);//20444
364  LOAD_DBC(sSpellEquippedItemsStore, "SpellEquippedItems.dbc");//20444
365  LOAD_DBC(sSpellFocusObjectStore, "SpellFocusObject.dbc");//20444
366  LOAD_DBC(sSpellInterruptsStore, "SpellInterrupts.dbc");//20444
367  LOAD_DBC(sSpellItemEnchantmentStore, "SpellItemEnchantment.dbc");//20444
368  LOAD_DBC(sSpellLevelsStore, "SpellLevels.dbc");//20444
369  LOAD_DBC(sSpellScalingStore, "SpellScaling.dbc");//20444
370  LOAD_DBC(sSpellShapeshiftFormStore, "SpellShapeshiftForm.dbc");//20444
371  LOAD_DBC(sSpellShapeshiftStore, "SpellShapeshift.dbc");//20444
372  LOAD_DBC(sSpellStore, "Spell.dbc"/*, &CustomSpellfmt, &CustomSpellEntryIndex*/);//20444
373  LOAD_DBC(sSpellTargetRestrictionsStore, "SpellTargetRestrictions.dbc");//20444
374  LOAD_DBC(sSummonPropertiesStore, "SummonProperties.dbc");//20444
375  LOAD_DBC(sTalentStore, "Talent.dbc");//20444
376  LOAD_DBC(sVehicleSeatStore, "VehicleSeat.dbc");//20444
377  LOAD_DBC(sVehicleStore, "Vehicle.dbc");//20444
378  LOAD_DBC(sWMOAreaTableStore, "WMOAreaTable.dbc");//20444
379  LOAD_DBC(sWorldMapAreaStore, "WorldMapArea.dbc");//20444
380  LOAD_DBC(sWorldMapTransformsStore, "WorldMapTransforms.dbc");//20444
381  LOAD_DBC(sWorldSafeLocsStore, "WorldSafeLocs.dbc"); // 20444
382 
383 #undef LOAD_DBC
384 
385  for (uint32 i = 0; i < sCharSectionsStore.GetNumRows(); ++i)
386  if (CharSectionsEntry const* entry = sCharSectionsStore.LookupEntry(i))
387  if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) //ignore Nonplayable races
388  sCharSectionMap.insert({ entry->GenType | (entry->Gender << 8) | (entry->Race << 16), entry });
389 
391  for (uint32 i = 0; i < sChrSpecializationStore.GetNumRows(); ++i)
392  if (ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(i))
393  sChrSpecializationByIndexStore[chrSpec->ClassID][chrSpec->OrderIndex] = chrSpec;
394 
395  ASSERT(MAX_DIFFICULTY >= sDifficultyStore.GetNumRows(),
396  "MAX_DIFFICULTY is not large enough to contain all difficulties! (current value %d, required %d)",
397  MAX_DIFFICULTY, sDifficultyStore.GetNumRows());
398 
399  for (uint32 i = 0; i < sEmotesTextSoundStore.GetNumRows(); ++i)
400  if (EmotesTextSoundEntry const* entry = sEmotesTextSoundStore.LookupEntry(i))
401  sEmotesTextSoundMap[EmotesTextSoundKey(entry->EmotesTextId, entry->RaceId, entry->SexId)] = entry;
402 
403  for (uint32 i = 0; i < sFactionStore.GetNumRows(); ++i)
404  {
405  FactionEntry const* faction = sFactionStore.LookupEntry(i);
406  if (faction && faction->ParentFactionID)
407  {
408  std::vector<uint32> &flist = sFactionTeamMap[faction->ParentFactionID];
409  flist.push_back(i);
410  }
411  }
412 
413  for (uint32 i = 0; i < sGameObjectDisplayInfoStore.GetNumRows(); ++i)
414  {
415  if (GameObjectDisplayInfoEntry const* info = sGameObjectDisplayInfoStore.LookupEntry(i))
416  {
417  if (info->GeoBoxMax.X < info->GeoBoxMin.X)
418  std::swap(*(float*)(&info->GeoBoxMax.X), *(float*)(&info->GeoBoxMin.X));
419  if (info->GeoBoxMax.Y < info->GeoBoxMin.Y)
420  std::swap(*(float*)(&info->GeoBoxMax.Y), *(float*)(&info->GeoBoxMin.Y));
421  if (info->GeoBoxMax.Z < info->GeoBoxMin.Z)
422  std::swap(*(float*)(&info->GeoBoxMax.Z), *(float*)(&info->GeoBoxMin.Z));
423  }
424  }
425 
426  for (ItemSetSpellEntry const* entry : sItemSetSpellStore)
427  sItemSetSpellsStore[entry->ItemSetID].push_back(entry);
428 
429  // fill data
430  for (uint32 i = 0; i < sMapDifficultyStore.GetNumRows(); ++i)
431  if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i))
432  sMapDifficultyMap[entry->MapID][entry->DifficultyID] = entry;
433  sMapDifficultyMap[0][0] = sMapDifficultyMap[1][0]; //map 0 is missing from MapDifficulty.dbc use this till its ported to sql
434 
435  for (uint32 i = 0; i < sPvpDifficultyStore.GetNumRows(); ++i)
436  if (PvPDifficultyEntry const* entry = sPvpDifficultyStore.LookupEntry(i))
437  if (entry->BracketID > MAX_BATTLEGROUND_BRACKETS)
438  ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
439 
440  for (uint32 i = 0; i < sSkillRaceClassInfoStore.GetNumRows(); ++i)
441  if (SkillRaceClassInfoEntry const* entry = sSkillRaceClassInfoStore.LookupEntry(i))
442  if (sSkillLineStore.LookupEntry(entry->SkillID))
443  SkillRaceClassInfoBySkill.emplace(entry->SkillID, entry);
444 
445  for (uint32 j = 0; j < sSpellEffectScalingStore.GetNumRows(); j++)
446  {
447  SpellEffectScalingEntry const* spellEffectScaling = sSpellEffectScalingStore.LookupEntry(j);
448  if (!spellEffectScaling)
449  continue;
450 
451  sSpellEffectScallingByEffectId.insert(std::make_pair(spellEffectScaling->SpellEffectID, j));
452  }
453 
454  for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
455  {
456  if (TalentEntry const* talentInfo = sTalentStore.LookupEntry(i))
457  {
458  if (talentInfo->ClassID < MAX_CLASSES && talentInfo->TierID < MAX_TALENT_TIERS && talentInfo->ColumnIndex < MAX_TALENT_COLUMNS)
459  sTalentByPos[talentInfo->ClassID][talentInfo->TierID][talentInfo->ColumnIndex].push_back(talentInfo);
460  else
461  TC_LOG_ERROR("server.loading", "Value of class (found: %u, max allowed %u) or (found: %u, max allowed %u) tier or column (found: %u, max allowed %u) is invalid.",
462  talentInfo->ClassID, MAX_CLASSES, talentInfo->TierID, MAX_TALENT_TIERS, talentInfo->ColumnIndex, MAX_TALENT_COLUMNS);
463  }
464  }
465 
466  for (uint32 i = 0; i < sWMOAreaTableStore.GetNumRows(); ++i)
467  if (WMOAreaTableEntry const* entry = sWMOAreaTableStore.LookupEntry(i))
468  sWMOAreaInfoByTripple.insert(WMOAreaInfoByTripple::value_type(WMOAreaTableTripple(entry->WMOID, entry->NameSet, entry->WMOGroupID), entry));
469 
470  // error checks
471  if (bad_dbc_files.size() >= DBCFileCount)
472  {
473  TC_LOG_ERROR("misc", "Incorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc/%s/", DBCFileCount, dataPath.c_str(), localeNames[defaultLocale]);
474  exit(1);
475  }
476  else if (!bad_dbc_files.empty())
477  {
478  std::string str;
479  for (StoreProblemList::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
480  str += *i + "\n";
481 
482  TC_LOG_ERROR("misc", "Some required *.dbc files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), DBCFileCount, str.c_str());
483  exit(1);
484  }
485 
486  // Check loaded DBC files proper version
487  if (!sAreaTableStore.LookupEntry(7941) || // last area added in 6.2.2 (20444)
488  !sCharTitlesStore.LookupEntry(457) || // last char title added in 6.2.2 (20444)
489  !sGemPropertiesStore.LookupEntry(2544) || // last gem property added in 6.2.2 (20444)
490  !sMapStore.LookupEntry(1497) || // last map added in 6.2.2 (20444)
491  !sSpellStore.LookupEntry(197204) ) // last spell added in 6.2.2 (20444)
492  {
493  TC_LOG_ERROR("misc", "You have _outdated_ DBC files. Please extract correct versions from current using client.");
494  exit(1);
495  }
496 
497  TC_LOG_INFO("server.loading", ">> Initialized %d DBC data stores in %u ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
498 }
DBCStorage< EmotesTextSoundEntry > sEmotesTextSoundStore(EmotesTextSoundEntryfmt)
DBCStorage< GemPropertiesEntry > sGemPropertiesStore(GemPropertiesfmt)
DBCStorage< LiquidTypeEntry > sLiquidTypeStore(LiquidTypefmt)
static WMOAreaInfoByTripple sWMOAreaInfoByTripple
Definition: DBCStores.cpp:156
DBCStorage< QuestFactionRewEntry > sQuestFactionRewardStore(QuestFactionRewardfmt)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
Definition: DBCEnums.h:63
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsfmt)
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesfmt)
DBCStorage< DurabilityCostsEntry > sDurabilityCostsStore(DurabilityCostsfmt)
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesfmt)
DBCStorage< ItemSetEntry > sItemSetStore(ItemSetfmt)
Definition: DBCStructure.h:1030
DBCStorage< ItemDamageEntry > sItemDamageThrownStore(ItemDamagefmt)
DBCStorage< SpellCooldownsEntry > sSpellCooldownsStore(SpellCooldownsfmt)
uint32 ParentFactionID
Definition: DBCStructure.h:413
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
Definition: DBCStructure.h:396
MapDifficultyMap sMapDifficultyMap
Definition: DBCStores.cpp:115
DBCStorage< LockEntry > sLockStore(Lockfmt)
DBCStorage< ItemDamageEntry > sItemDamageOneHandCasterStore(ItemDamagefmt)
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerfmt)
DBCStorage< BattlemasterListEntry > sBattlemasterListStore(BattlemasterListfmt)
ItemSetSpellsStore sItemSetSpellsStore
Definition: DBCStores.cpp:106
DBCStorage< BankBagSlotPricesEntry > sBankBagSlotPricesStore(BankBagSlotPricesfmt)
DBCStorage< SpellScalingEntry > sSpellScalingStore(SpellScalingfmt)
uint32 getMSTime()
Definition: Timer.h:24
Definition: DBCEnums.h:426
DBCStorage< LFGDungeonEntry > sLFGDungeonStore(LFGDungeonfmt)
DBCStorage< ArmorLocationEntry > sArmorLocationStore(ArmorLocationfmt)
SpellEffectScallingByEffectId sSpellEffectScallingByEffectId
Definition: DBCStores.cpp:136
uint32 DBCFileCount
Definition: DBCStores.cpp:184
DBCStorage< MapDifficultyEntry > sMapDifficultyStore(MapDifficultyfmt)
DBCStorage< SpellLevelsEntry > sSpellLevelsStore(SpellLevelsfmt)
DBCStorage< ItemDamageEntry > sItemDamageOneHandStore(ItemDamagefmt)
#define LOAD_DBC(store, file)
DBCStorage< WorldMapTransformsEntry > sWorldMapTransformsStore(WorldMapTransformsfmt)
static std::map< EmotesTextSoundKey, EmotesTextSoundEntry const * > sEmotesTextSoundMap
Definition: DBCStores.cpp:79
DBCStorage< CharTitlesEntry > sCharTitlesStore(CharTitlesfmt)
CharSectionsMap sCharSectionMap
Definition: DBCStores.cpp:61
DBCStorage< EmotesEntry > sEmotesStore(Emotesfmt)
DBCStorage< SkillRaceClassInfoEntry > sSkillRaceClassInfoStore(SkillRaceClassInfofmt)
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTablefmt)
DBCStorage< RandomPropertiesPointsEntry > sRandomPropertiesPointsStore(RandPropPointsfmt)
DBCStorage< PvPDifficultyEntry > sPvpDifficultyStore(PvpDifficultyfmt)
Definition: DBCStructure.h:1383
DBCStorage< MovieEntry > sMovieStore(Moviefmt)
DBCStorage< CreatureModelDataEntry > sCreatureModelDataStore(CreatureModelDatafmt)
DBCStorage< ItemArmorTotalEntry > sItemArmorTotalStore(ItemArmorTotalfmt)
Definition: DBCStructure.h:245
std::list< std::string > StoreProblemList
Definition: DBCStores.cpp:182
DBCStorage< GuildColorEmblemEntry > sGuildColorEmblemStore(GuildColorEmblemfmt)
DBCStorage< CreatureDisplayInfoExtraEntry > sCreatureDisplayInfoExtraStore(CreatureDisplayInfoExtrafmt)
DBCStorage< SpellCategoryEntry > sSpellCategoryStore(SpellCategoryfmt)
DBCStorage< SpellEntry > sSpellStore(Spellfmt)
TalentsByPosition sTalentByPos
Definition: DBCStores.cpp:150
DBCStorage< GuildColorBorderEntry > sGuildColorBorderStore(GuildColorBorderfmt)
DBCStorage< ItemBagFamilyEntry > sItemBagFamilyStore(ItemBagFamilyfmt)
DBCStorage< ItemArmorShieldEntry > sItemArmorShieldStore(ItemArmorShieldfmt)
DBCStorage< ItemArmorQualityEntry > sItemArmorQualityStore(ItemArmorQualityfmt)
DBCStorage< SpellFocusObjectEntry > sSpellFocusObjectStore(SpellFocusObjectfmt)
Definition: DBCStructure.h:487
DBCStorage< WorldMapAreaEntry > sWorldMapAreaStore(WorldMapAreafmt)
DBCStorage< CharSectionsEntry > sCharSectionsStore(CharSectionsfmt)
Definition: DBCStructure.h:733
DBCStorage< ItemSetSpellEntry > sItemSetSpellStore(ItemSetSpellfmt)
uint32_t uint32
Definition: Define.h:150
DBCStorage< SpellInterruptsEntry > sSpellInterruptsStore(SpellInterruptsfmt)
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
DBCStorage< PowerDisplayEntry > sPowerDisplayStore(PowerDisplayfmt)
DBCStorage< GuildColorBackgroundEntry > sGuildColorBackgroundStore(GuildColorBackgroundfmt)
DBCStorage< PhaseEntry > sPhaseStore(Phasefmt)
DBCStorage< VehicleSeatEntry > sVehicleSeatStore(VehicleSeatfmt)
Definition: DBCStructure.h:982
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
#define MAX_CLASSES
Definition: SharedDefines.h:181
DBCStorage< SpellEquippedItemsEntry > sSpellEquippedItemsStore(SpellEquippedItemsfmt)
DBCStorage< GameObjectDisplayInfoEntry > sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt)
DBCStorage< SpellTargetRestrictionsEntry > sSpellTargetRestrictionsStore(SpellTargetRestrictionsfmt)
Definition: DBCStructure.h:405
DBCStorage< ItemDamageEntry > sItemDamageAmmoStore(ItemDamagefmt)
DBCStorage< TalentEntry > sTalentStore(Talentfmt)
DBCStorage< WMOAreaTableEntry > sWMOAreaTableStore(WMOAreaTablefmt)
DBCStorage< ChrSpecializationEntry > sChrSpecializationStore(ChrSpecializationfmt)
TC_COMMON_API char const * localeNames[TOTAL_LOCALES]
Definition: Common.cpp:21
DBCStorage< VehicleEntry > sVehicleStore(Vehiclefmt)
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
uint32 SpellEffectID
Definition: DBCStructure.h:1036
Definition: DBCStructure.h:885
DBCStorage< MapEntry > sMapStore(Mapfmt)
Definition: DBCStructure.h:926
DBCStorage< SpellEffectScalingEntry > sSpellEffectScalingStore(SpellEffectScalingfmt)
DBCStorage< ItemDamageEntry > sItemDamageWandStore(ItemDamagefmt)
DBCStorage< SpellEffectEntry > sSpellEffectStore(SpellEffectfmt)
DBCStorage< SpellAuraOptionsEntry > sSpellAuraOptionsStore(SpellAuraOptionsfmt)
#define RACEMASK_ALL_PLAYABLE
Definition: SharedDefines.h:133
DBCStorage< ItemDamageEntry > sItemDamageRangedStore(ItemDamagefmt)
DBCStorage< AnimKitEntry > sAnimKitStore(AnimKitfmt)
#define ASSERT
Definition: Errors.h:55
DBCStorage< SpellCategoriesEntry > sSpellCategoriesStore(SpellCategoriesfmt)
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
DBCStorage< EmotesTextEntry > sEmotesTextStore(EmotesTextfmt)
DBCStorage< ItemDamageEntry > sItemDamageTwoHandStore(ItemDamagefmt)
DBCStorage< FactionEntry > sFactionStore(Factionfmt)
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
static FactionTeamMap sFactionTeamMap
Definition: DBCStores.cpp:83
DBCStorage< ItemDamageEntry > sItemDamageTwoHandCasterStore(ItemDamagefmt)
DBCStorage< LightEntry > sLightStore(Lightfmt)
DBCStorage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore(SpellShapeshiftFormfmt)
DBCStorage< BannedAddOnsEntry > sBannedAddOnsStore(BannedAddOnsfmt)
Definition: DBCStructure.h:1255
DBCStorage< ChatChannelsEntry > sChatChannelsStore(ChatChannelsfmt)
SkillRaceClassInfoMap SkillRaceClassInfoBySkill
Definition: DBCStores.cpp:129
#define MAX_TALENT_COLUMNS
Definition: DBCStructure.h:1253
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplatefmt)
DBCStorage< DifficultyEntry > sDifficultyStore(DifficultyFmt)
std::tuple< uint32, uint32, uint32 > EmotesTextSoundKey
Definition: DBCStores.cpp:78
ChrSpecializationByIndexArray sChrSpecializationByIndexStore
Definition: DBCStores.cpp:67
DBCStorage< SpellShapeshiftEntry > sSpellShapeshiftStore(SpellShapeshiftfmt)
Definition: DBCStores.cpp:30
Definition: DBCStructure.h:149
#define MAX_TALENT_TIERS
Definition: DBCStructure.h:1252
DBCStorage< DungeonEncounterEntry > sDungeonEncounterStore(DungeonEncounterfmt)
DBCStorage< SkillLineAbilityEntry > sSkillLineAbilityStore(SkillLineAbilityfmt)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
void LoadGameTable ( StoreProblemList errors,
std::string const tableName,
GameTable< T > &  storage,
std::string const dbcPath,
std::string const filename 
)
inline
237 {
238  // compatibility format and C++ structure sizes
239  ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T),
240  "Size of '%s' set by format string (%u) not equal size of C++ structure (%u).",
241  filename.c_str(), DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), uint32(sizeof(T)));
242 
243  ++GameTableCount;
244  std::string dbcFilename = dbcPath + filename;
245 
246  if (storage.Load(dbcFilename.c_str()))
247  {
248  bool found = false;
249  // Find table definition in GameTables.db2
250  for (uint32 i = 0; i < sGameTablesStore.GetNumRows(); ++i)
251  {
252  GameTablesEntry const* gt = sGameTablesStore.LookupEntry(i);
253  if (!gt)
254  continue;
255 
256  for (uint32 l = 0; l < TOTAL_LOCALES; ++l)
257  {
258  if (l != LOCALE_none && tableName == gt->Name->Str[l])
259  {
260  found = true;
261  storage.SetGameTableEntry(gt);
262  break;
263  }
264  }
265 
266  if (found)
267  break;
268  }
269 
270  ASSERT(found, "Game table %s definition not found in GameTables.db2", tableName.c_str());
271  }
272  else
273  {
274  // sort problematic dbc to (1) non compatible and (2) non-existed
275  if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
276  {
277  std::ostringstream stream;
278  stream << dbcFilename << " exists, and has " << storage.GetFieldCount() << " field(s) (expected " << strlen(storage.GetFormat()) << "). Extracted file might be from wrong client version or a database-update has been forgotten.";
279  std::string buf = stream.str();
280  errors.push_back(buf);
281  fclose(f);
282  }
283  else
284  errors.push_back(dbcFilename);
285  }
286 }
uint32 GameTableCount
Definition: DBCStores.cpp:185
void SetGameTableEntry(GameTablesEntry const *gtEntry)
Definition: DBCStores.h:105
Definition: Common.h:126
char const * GetFormat() const
Definition: DBCStores.h:115
bool Load(char const *fileName)
Definition: DBCStores.h:117
LocalizedString * Name
Definition: DB2Structure.h:422
Definition: DB2Structure.h:419
char const * Str[TOTAL_LOCALES]
Definition: Common.h:148
uint32_t uint32
Definition: Define.h:150
DB2Storage< GameTablesEntry > sGameTablesStore("GameTables.db2", GameTablesFormat, HOTFIX_SEL_GAME_TABLES)
static uint32 GetFormatRecordSize(const char *format, int32 *index_pos=NULL)
Definition: DBCFileLoader.cpp:128
#define ASSERT
Definition: Errors.h:55
uint32_t uint32
Definition: g3dmath.h:168
uint32 GetFieldCount() const
Definition: DBCStores.h:116
Definition: Common.h:130

+ Here is the call graph for this function:

void LoadGameTables ( const std::string &  dataPath,
uint32  defaultLocale 
)
501 {
502  uint32 oldMSTime = getMSTime();
503 
504  std::string dbcPath = dataPath + "dbc/" + localeNames[defaultLocale] + '/';
505 
506  StoreProblemList bad_dbc_files;
507 
508 #define LOAD_GT(tableName, store, file) LoadGameTable(bad_dbc_files, tableName, store, dbcPath, file)
509 
510  LOAD_GT("BarberShopCostBase", sGtBarberShopCostBaseStore, "gtBarberShopCostBase.dbc"); // 20444
511  LOAD_GT("CombatRatings", sGtCombatRatingsStore, "gtCombatRatings.dbc"); // 20444
512  LOAD_GT("ChanceToMeleeCritBase", sGtChanceToMeleeCritBaseStore, "gtChanceToMeleeCritBase.dbc"); // 20444
513  LOAD_GT("ChanceToMeleeCrit", sGtChanceToMeleeCritStore, "gtChanceToMeleeCrit.dbc"); // 20444
514  LOAD_GT("ChanceToSpellCritBase", sGtChanceToSpellCritBaseStore, "gtChanceToSpellCritBase.dbc"); // 20444
515  LOAD_GT("ChanceToSpellCrit", sGtChanceToSpellCritStore, "gtChanceToSpellCrit.dbc"); // 20444
516  LOAD_GT("ItemSocketCostPerLevel", sGtItemSocketCostPerLevelStore, "gtItemSocketCostPerLevel.dbc"); // 20444
517  LOAD_GT("NPCManaCostScaler", sGtNPCManaCostScalerStore, "gtNPCManaCostScaler.dbc"); // 20444
518  LOAD_GT("NpcTotalHp", sGtNpcTotalHpStore, "gtNpcTotalHp.dbc"); // 20444
519  LOAD_GT("NpcTotalHpExp1", sGtNpcTotalHpExp1Store, "gtNpcTotalHpExp1.dbc"); // 20444
520  LOAD_GT("NpcTotalHpExp2", sGtNpcTotalHpExp2Store, "gtNpcTotalHpExp2.dbc"); // 20444
521  LOAD_GT("NpcTotalHpExp3", sGtNpcTotalHpExp3Store, "gtNpcTotalHpExp3.dbc"); // 20444
522  LOAD_GT("NpcTotalHpExp4", sGtNpcTotalHpExp4Store, "gtNpcTotalHpExp4.dbc"); // 20444
523  LOAD_GT("NpcTotalHpExp5", sGtNpcTotalHpExp5Store, "gtNpcTotalHpExp5.dbc"); // 20444
524  LOAD_GT("OCTHPPerStamina", sGtOCTHpPerStaminaStore, "gtOCTHpPerStamina.dbc"); // 20444
525  LOAD_GT("OCTLevelExperience", sGtOCTLevelExperienceStore, "gtOCTLevelExperience.dbc"); // 20444
526  LOAD_GT("RegenMPPerSpt", sGtRegenMPPerSptStore, "gtRegenMPPerSpt.dbc"); // 20444
527  LOAD_GT("SpellScaling", sGtSpellScalingStore, "gtSpellScaling.dbc"); // 20444
528  LOAD_GT("OCTBaseHPByClass", sGtOCTBaseHPByClassStore, "gtOCTBaseHPByClass.dbc"); // 20444
529  LOAD_GT("OCTBaseMPByClass", sGtOCTBaseMPByClassStore, "gtOCTBaseMPByClass.dbc"); // 20444
530 
531 #undef LOAD_GT
532 
533  // error checks
534  if (bad_dbc_files.size() >= GameTableCount)
535  {
536  TC_LOG_ERROR("misc", "Incorrect DataDir value in worldserver.conf or ALL required *.dbc GameTable files (%d) not found by path: %sdbc/%s/", DBCFileCount, dataPath.c_str(), localeNames[defaultLocale]);
537  exit(1);
538  }
539  else if (!bad_dbc_files.empty())
540  {
541  std::string str;
542  for (StoreProblemList::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
543  str += *i + "\n";
544 
545  TC_LOG_ERROR("misc", "Some required *.dbc GameTable files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), GameTableCount, str.c_str());
546  exit(1);
547  }
548 
549  TC_LOG_INFO("server.loading", ">> Initialized %d DBC GameTables data stores in %u ms", GameTableCount, GetMSTimeDiffToNow(oldMSTime));
550 }
GameTable< GtSpellScalingEntry > sGtSpellScalingStore(GtSpellScalingfmt)
uint32 GameTableCount
Definition: DBCStores.cpp:185
GameTable< GtNpcTotalHpEntry > sGtNpcTotalHpStore(GtNpcTotalHpfmt)
GameTable< GtNpcTotalHpExp3Entry > sGtNpcTotalHpExp3Store(GtNpcTotalHpExp3fmt)
uint32 getMSTime()
Definition: Timer.h:24
GameTable< GtNpcTotalHpExp1Entry > sGtNpcTotalHpExp1Store(GtNpcTotalHpExp1fmt)
uint32 DBCFileCount
Definition: DBCStores.cpp:184
GameTable< GtNpcTotalHpExp4Entry > sGtNpcTotalHpExp4Store(GtNpcTotalHpExp4fmt)
GameTable< GtRegenMPPerSptEntry > sGtRegenMPPerSptStore(GtRegenMPPerSptfmt)
#define LOAD_GT(tableName, store, file)
std::list< std::string > StoreProblemList
Definition: DBCStores.cpp:182
uint32_t uint32
Definition: Define.h:150
GameTable< GtChanceToMeleeCritEntry > sGtChanceToMeleeCritStore(GtChanceToMeleeCritfmt)
GameTable< GtNPCManaCostScalerEntry > sGtNPCManaCostScalerStore(GtNPCManaCostScalerfmt)
GameTable< GtNpcTotalHpExp5Entry > sGtNpcTotalHpExp5Store(GtNpcTotalHpExp5fmt)
GameTable< GtBarberShopCostBaseEntry > sGtBarberShopCostBaseStore(GtBarberShopCostBasefmt)
GameTable< GtOCTHpPerStaminaEntry > sGtOCTHpPerStaminaStore(GtOCTHpPerStaminafmt)
GameTable< GtItemSocketCostPerLevelEntry > sGtItemSocketCostPerLevelStore(GtItemSocketCostPerLevelfmt)
GameTable< GtOCTLevelExperienceEntry > sGtOCTLevelExperienceStore(GtOCTLevelExperiencefmt)
TC_COMMON_API char const * localeNames[TOTAL_LOCALES]
Definition: Common.cpp:21
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
GameTable< GtChanceToSpellCritEntry > sGtChanceToSpellCritStore(GtChanceToSpellCritfmt)
GameTable< GtOCTBaseHPByClassEntry > sGtOCTBaseHPByClassStore(GtOCTBaseHPByClassfmt)
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
GameTable< GtChanceToSpellCritBaseEntry > sGtChanceToSpellCritBaseStore(GtChanceToSpellCritBasefmt)
GameTable< GtOCTBaseMPByClassEntry > sGtOCTBaseMPByClassStore(GtOCTBaseMPByClassfmt)
GameTable< GtCombatRatingsEntry > sGtCombatRatingsStore(GtCombatRatingsfmt)
GameTable< GtChanceToMeleeCritBaseEntry > sGtChanceToMeleeCritBaseStore(GtChanceToMeleeCritBasefmt)
GameTable< GtNpcTotalHpExp2Entry > sGtNpcTotalHpExp2Store(GtNpcTotalHpExp2fmt)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Map2ZoneCoordinates ( float &  x,
float &  y,
uint32  worldMapAreaId 
)
682 {
683  WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(worldMapAreaId);
684 
685  // if not listed then map coordinates (instance)
686  if (!maEntry)
687  return;
688 
689  x = (x - maEntry->LocTop) / ((maEntry->LocBottom - maEntry->LocTop) / 100);
690  y = (y - maEntry->LocLeft) / ((maEntry->LocRight - maEntry->LocLeft) / 100); // client y coord from top to down
691  std::swap(x, y); // client have map coords swapped
692 }
float LocLeft
Definition: DBCStructure.h:1408
float LocTop
Definition: DBCStructure.h:1410
Definition: DBCStructure.h:1402
DBCStorage< WorldMapAreaEntry > sWorldMapAreaStore(WorldMapAreafmt)
G3D::int16 y
Definition: Vector2int16.h:38
float LocBottom
Definition: DBCStructure.h:1411
float LocRight
Definition: DBCStructure.h:1409
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

void Zone2MapCoordinates ( float &  x,
float &  y,
uint32  worldMapAreaId 
)
669 {
670  WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(worldMapAreaId);
671 
672  // if not listed then map coordinates (instance)
673  if (!maEntry)
674  return;
675 
676  std::swap(x, y); // at client map coords swapped
677  x = x*((maEntry->LocBottom-maEntry->LocTop)/100)+maEntry->LocTop;
678  y = y*((maEntry->LocRight-maEntry->LocLeft)/100)+maEntry->LocLeft; // client y coord from top to down
679 }
float LocLeft
Definition: DBCStructure.h:1408
float LocTop
Definition: DBCStructure.h:1410
Definition: DBCStructure.h:1402
DBCStorage< WorldMapAreaEntry > sWorldMapAreaStore(WorldMapAreafmt)
G3D::int16 y
Definition: Vector2int16.h:38
float LocBottom
Definition: DBCStructure.h:1411
float LocRight
Definition: DBCStructure.h:1409
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

Variable Documentation

uint32 DBCFileCount = 0
uint32 GameTableCount = 0
CharSectionsMap sCharSectionMap
ChrSpecializationByIndexArray sChrSpecializationByIndexStore
std::map<EmotesTextSoundKey, EmotesTextSoundEntry const*> sEmotesTextSoundMap
static
FactionTeamMap sFactionTeamMap
static
DBCStorage<ItemDamageEntry> sItemDamageAmmoStore(ItemDamagefmt)
DBCStorage<ItemDamageEntry> sItemDamageOneHandCasterStore(ItemDamagefmt)
DBCStorage<ItemDamageEntry> sItemDamageOneHandStore(ItemDamagefmt)
DBCStorage<ItemDamageEntry> sItemDamageRangedStore(ItemDamagefmt)
DBCStorage<ItemDamageEntry> sItemDamageThrownStore(ItemDamagefmt)
DBCStorage<ItemDamageEntry> sItemDamageTwoHandCasterStore(ItemDamagefmt)
DBCStorage<ItemDamageEntry> sItemDamageTwoHandStore(ItemDamagefmt)
DBCStorage<ItemDamageEntry> sItemDamageWandStore(ItemDamagefmt)
ItemSetSpellsStore sItemSetSpellsStore
SkillRaceClassInfoMap SkillRaceClassInfoBySkill
MapDifficultyMap sMapDifficultyMap
DBCStorage<MapEntry> sMapStore(Mapfmt)
SpellEffectScallingByEffectId sSpellEffectScallingByEffectId
TalentsByPosition sTalentByPos
WMOAreaInfoByTripple sWMOAreaInfoByTripple
static