OregonCore  revision 3611e8a-git
Your Favourite TBC server
DBCStores.h File Reference
#include "Common.h"
#include "Database/DBCStore.h"
#include "DBCStructure.h"
#include <list>

Go to the source code of this file.

Typedefs

typedef std::list< uint32SimpleFactionsList
 

Enumerations

enum  ContentLevels { CONTENT_1_60 = 0, CONTENT_61_70, CONTENT_71_80 }
 

Functions

bool IsAcceptableClientBuild (uint32 build)
 
std::string AcceptableClientBuildsListStr ()
 
SimpleFactionsList const * GetFactionTeamList (uint32 faction)
 
char * GetPetName (uint32 petfamily, uint32 dbclang)
 
uint32 GetTalentSpellCost (uint32 spellId)
 
TalentSpellPos const * GetTalentSpellPos (uint32 spellId)
 
int32 GetAreaFlagByAreaID (uint32 area_id)
 
AreaTableEntry const * GetAreaEntryByAreaID (uint32 area_id)
 
AreaTableEntry const * GetAreaEntryByAreaFlagAndMap (uint32 area_flag, uint32 map_id)
 
uint32 GetAreaFlagByMapId (uint32 mapid)
 
WMOAreaTableEntry const * GetWMOAreaTableEntryByTripple (int32 rootid, int32 adtid, int32 groupid)
 
uint32 GetVirtualMapForMapAndZone (uint32 mapid, uint32 zoneId)
 
ContentLevels GetContentLevelsForMapAndZone (uint32 mapid, uint32 zoneId)
 
ChatChannelsEntry const * GetChannelEntryFor (uint32 channel_id)
 
bool IsTotemCategoryCompatiableWith (uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)
 
void Zone2MapCoordinates (float &x, float &y, uint32 zone)
 
void Map2ZoneCoordinates (float &x, float &y, uint32 zone)
 
uint32 GetTalentInspectBitPosInTab (uint32 talentId)
 
uint32 GetTalentTabInspectBitSize (uint32 talentTabId)
 
uint32 const * GetTalentTabPages (uint32 cls)
 
uint32 GetLiquidFlags (uint32 liquidType)
 
void LoadDBCStores (const std::string &dataPath)
 
DBCStorage< SoundEntriesEntry > const * GetSoundEntriesStore ()
 
DBCStorage< SpellEntry > const * GetSpellStore ()
 
DBCStorage< SpellRangeEntry > const * GetSpellRangeStore ()
 

Variables

DBCStorage< AreaTableEntrysAreaStore
 
DBCStorage< AreaTriggerEntrysAreaTriggerStore
 
DBCStorage< AuctionHouseEntrysAuctionHouseStore
 
DBCStorage< BankBagSlotPricesEntrysBankBagSlotPricesStore
 
DBCStorage< BattlemasterListEntrysBattlemasterListStore
 
DBCStorage< CharStartOutfitEntrysCharStartOutfitStore
 
DBCStorage< CharTitlesEntrysCharTitlesStore
 
DBCStorage< ChrClassesEntrysChrClassesStore
 
DBCStorage< ChrRacesEntrysChrRacesStore
 
DBCStorage< CinematicCameraEntrysCinematicCameraStore
 
DBCStorage< CinematicSequencesEntrysCinematicSequencesStore
 
DBCStorage< CreatureDisplayInfoEntrysCreatureDisplayInfoStore
 
DBCStorage< CreatureFamilyEntrysCreatureFamilyStore
 
DBCStorage< CreatureSpellDataEntrysCreatureSpellDataStore
 
DBCStorage< DurabilityCostsEntrysDurabilityCostsStore
 
DBCStorage< DurabilityQualityEntrysDurabilityQualityStore
 
DBCStorage< EmotesEntrysEmotesStore
 
DBCStorage< EmotesTextEntrysEmotesTextStore
 
DBCStorage< FactionEntrysFactionStore
 
DBCStorage< FactionTemplateEntrysFactionTemplateStore
 
DBCStorage< GameObjectDisplayInfoEntrysGameObjectDisplayInfoStore
 
DBCStorage< GemPropertiesEntrysGemPropertiesStore
 
DBCStorage< GtCombatRatingsEntrysGtCombatRatingsStore
 
DBCStorage< GtChanceToMeleeCritBaseEntrysGtChanceToMeleeCritBaseStore
 
DBCStorage< GtChanceToMeleeCritEntrysGtChanceToMeleeCritStore
 
DBCStorage< GtChanceToSpellCritBaseEntrysGtChanceToSpellCritBaseStore
 
DBCStorage< GtChanceToSpellCritEntrysGtChanceToSpellCritStore
 
DBCStorage< GtOCTRegenHPEntrysGtOCTRegenHPStore
 
DBCStorage< GtNPCManaCostScalerEntrysGtNPCManaCostScalerStore
 
DBCStorage< GtRegenHPPerSptEntrysGtRegenHPPerSptStore
 
DBCStorage< GtRegenMPPerSptEntrysGtRegenMPPerSptStore
 
DBCStorage< ItemEntrysItemStore
 
DBCStorage< ItemExtendedCostEntrysItemExtendedCostStore
 
DBCStorage< ItemRandomPropertiesEntrysItemRandomPropertiesStore
 
DBCStorage< ItemRandomSuffixEntrysItemRandomSuffixStore
 
DBCStorage< ItemSetEntrysItemSetStore
 
DBCStorage< LiquidTypeEntrysLiquidTypeStore
 
DBCStorage< LockEntrysLockStore
 
DBCStorage< MailTemplateEntrysMailTemplateStore
 
DBCStorage< MapEntrysMapStore
 
DBCStorage< QuestSortEntrysQuestSortStore
 
DBCStorage< RandomPropertiesPointsEntrysRandomPropertiesPointsStore
 
DBCStorage< SkillLineEntrysSkillLineStore
 
DBCStorage< SkillLineAbilityEntrysSkillLineAbilityStore
 
DBCStorage< SoundEntriesEntrysSoundEntriesStore
 
DBCStorage< SpellCastTimesEntrysSpellCastTimesStore
 
DBCStorage< SpellDurationEntrysSpellDurationStore
 
DBCStorage< SpellFocusObjectEntrysSpellFocusObjectStore
 
DBCStorage< SpellItemEnchantmentEntrysSpellItemEnchantmentStore
 
DBCStorage< SpellItemEnchantmentConditionEntrysSpellItemEnchantmentConditionStore
 
SpellCategoryStore sSpellCategoryStore
 
PetFamilySpellsStore sPetFamilySpellsStore
 
DBCStorage< SpellRadiusEntrysSpellRadiusStore
 
DBCStorage< SpellRangeEntrysSpellRangeStore
 
DBCStorage< SpellShapeshiftEntrysSpellShapeshiftStore
 
DBCStorage< SpellEntrysSpellStore
 
DBCStorage< StableSlotPricesEntrysStableSlotPricesStore
 
DBCStorage< SummonPropertiesEntrysSummonPropertiesStore
 
DBCStorage< TalentEntrysTalentStore
 
DBCStorage< TalentTabEntrysTalentTabStore
 
DBCStorage< TaxiNodesEntrysTaxiNodesStore
 
DBCStorage< TaxiPathEntrysTaxiPathStore
 
TaxiMask sTaxiNodesMask
 
TaxiPathSetBySource sTaxiPathSetBySource
 
TaxiPathNodesByPath sTaxiPathNodesByPath
 
DBCStorage< TotemCategoryEntrysTotemCategoryStore
 
DBCStorage< WMOAreaTableEntrysWMOAreaTableStore
 
DBCStorage< WorldSafeLocsEntrysWorldSafeLocsStore
 

Typedef Documentation

typedef std::list<uint32> SimpleFactionsList

Definition at line 30 of file DBCStores.h.

Enumeration Type Documentation

Enumerator
CONTENT_1_60 
CONTENT_61_70 
CONTENT_71_80 

Definition at line 46 of file DBCStores.h.

Function Documentation

std::string AcceptableClientBuildsListStr ( )

Definition at line 168 of file DBCStores.cpp.

References EXPECTED_OREGONCORE_CLIENT_BUILD, and sLog.

Referenced by Master::Run().

169 {
170  std::ostringstream data;
171  int accepted_versions[] = EXPECTED_OREGONCORE_CLIENT_BUILD;
172  for (int i = 0; accepted_versions[i]; ++i)
173  data << accepted_versions[i] << " ";
174  return data.str();
175 }
#define EXPECTED_OREGONCORE_CLIENT_BUILD
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap ( uint32  area_flag,
uint32  map_id 
)

Definition at line 632 of file DBCStores.cpp.

References GetAreaEntryByAreaID(), sAreaStore, and sMapStore.

Referenced by Player::CheckAreaExploreAndOutdoor(), Map::GetAreaId(), GridMap::getLiquidStatus(), and Map::GetZoneId().

633 {
634  if (area_flag)
635  return sAreaStore.LookupEntry(area_flag);
636 
637  if (MapEntry const* mapEntry = sMapStore.LookupEntry(map_id))
638  return GetAreaEntryByAreaID(mapEntry->linked_zone);
639 
640  return NULL;
641 }
AreaTableEntry const * GetAreaEntryByAreaID(uint32 area_id)
Definition: DBCStores.cpp:623
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
DBCStorage< AreaTableEntry > sAreaStore(AreaTableEntryfmt)
int32 GetAreaFlagByAreaID ( uint32  area_id)

Definition at line 606 of file DBCStores.cpp.

Referenced by GetAreaEntryByAreaID().

607 {
608  AreaFlagByAreaID::iterator i = sAreaFlagByAreaID.find(area_id);
609  if (i == sAreaFlagByAreaID.end())
610  return -1;
611 
612  return i->second;
613 }
uint32 GetAreaFlagByMapId ( uint32  mapid)

Definition at line 643 of file DBCStores.cpp.

Referenced by Map::GetAreaFlag().

644 {
645  AreaFlagByMapID::iterator i = sAreaFlagByMapID.find(mapid);
646  if (i == sAreaFlagByMapID.end())
647  return 0;
648  else
649  return i->second;
650 }
ChatChannelsEntry const* GetChannelEntryFor ( uint32  channel_id)

Definition at line 682 of file DBCStores.cpp.

References ChatChannelsEntry::ChannelID, and sChatChannelsStore.

Referenced by Channel::Channel(), and Player::UpdateLocalChannels().

683 {
684  // not sorted, numbering index from 0
685  for (uint32 i = 0; i < sChatChannelsStore.GetNumRows(); ++i)
686  {
687  ChatChannelsEntry const* ch = sChatChannelsStore.LookupEntry(i);
688  if (ch && ch->ChannelID == channel_id)
689  return ch;
690  }
691  return NULL;
692 }
DBCStorage< ChatChannelsEntry > sChatChannelsStore(ChatChannelsEntryfmt)
ACE_UINT32 uint32
Definition: Define.h:71
ContentLevels GetContentLevelsForMapAndZone ( uint32  mapid,
uint32  zoneId 
)

Definition at line 663 of file DBCStores.cpp.

References CONTENT_1_60, CONTENT_61_70, MapEntry::Expansion(), GetVirtualMapForMapAndZone(), and sMapStore.

Referenced by Oregon::XP::Gain().

664 {
665  mapid = GetVirtualMapForMapAndZone(mapid, zoneId);
666  if (mapid < 2)
667  return CONTENT_1_60;
668 
669  MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
670  if (!mapEntry)
671  return CONTENT_1_60;
672 
673  switch (mapEntry->Expansion())
674  {
675  default:
676  return CONTENT_1_60;
677  case 1:
678  return CONTENT_61_70;
679  }
680 }
uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId)
Definition: DBCStores.cpp:652
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
uint32 Expansion() const
Definition: DBCStructure.h:545
SimpleFactionsList const* GetFactionTeamList ( uint32  faction)

Definition at line 571 of file DBCStores.cpp.

572 {
573  FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction);
574  if (itr == sFactionTeamMap.end())
575  return NULL;
576  return &itr->second;
577 }
uint32 GetLiquidFlags ( uint32  liquidType)

Definition at line 714 of file DBCStores.cpp.

References sLiquidTypeStore.

Referenced by World::SetInitialWorldSettings().

715 {
716  if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
717  return 1 << liq->Type;
718 
719  return 0;
720 }
DBCStorage< LiquidTypeEntry > sLiquidTypeStore(LiquidTypefmt)
char* GetPetName ( uint32  petfamily,
uint32  dbclang 
)

Definition at line 579 of file DBCStores.cpp.

References CreatureFamilyEntry::Name, and sCreatureFamilyStore.

Referenced by ObjectMgr::GeneratePetName().

580 {
581  if (!petfamily)
582  return NULL;
583  CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily);
584  if (!pet_family)
585  return NULL;
586  return pet_family->Name[dbclang] ? pet_family->Name[dbclang] : NULL;
587 }
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
DBCStorage<SoundEntriesEntry> const* GetSoundEntriesStore ( )

Definition at line 772 of file DBCStores.cpp.

References sSoundEntriesStore.

Referenced by ScriptedAI::DoPlaySoundToSet(), DoScriptText(), CreatureEventAI::DoScriptText(), SystemMgr::LoadScriptTexts(), and SystemMgr::LoadScriptTextsCustom().

773 {
774  return &sSoundEntriesStore;
775 }
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)
DBCStorage<SpellRangeEntry> const* GetSpellRangeStore ( )

Definition at line 780 of file DBCStores.cpp.

References sSpellRangeStore.

Referenced by ScriptedAI::CanCast(), CreatureEventAI::CanCast(), and ScriptedAI::SelectSpell().

781 {
782  return &sSpellRangeStore;
783 }
DBCStorage< SpellRangeEntry > sSpellRangeStore(SpellRangefmt)
uint32 GetTalentInspectBitPosInTab ( uint32  talentId)

Definition at line 748 of file DBCStores.cpp.

Referenced by WorldSession::HandleInspectOpcode().

749 {
750  TalentInspectMap::const_iterator itr = sTalentPosInInspect.find(talentId);
751  if (itr == sTalentPosInInspect.end())
752  return 0;
753 
754  return itr->second;
755 }
uint32 GetTalentSpellCost ( uint32  spellId)

Definition at line 598 of file DBCStores.cpp.

References GetTalentSpellPos().

Referenced by Player::AddSpell(), GetErrorAtShapeshiftedCast(), ChatHandler::HandleLearnAllMySpellsCommand(), ChatHandler::HandleListAurasCommand(), ChatHandler::HandleLookupSpellCommand(), and Player::RemoveSpell().

599 {
600  if (TalentSpellPos const* pos = GetTalentSpellPos(spellId))
601  return pos->rank + 1;
602 
603  return 0;
604 }
TalentSpellPos const * GetTalentSpellPos(uint32 spellId)
Definition: DBCStores.cpp:589
TalentSpellPos const* GetTalentSpellPos ( uint32  spellId)

Definition at line 589 of file DBCStores.cpp.

References sTalentSpellPosMap.

Referenced by Player::AddSpell(), GetTalentSpellCost(), SpellMgr::LoadSpellChains(), and Player::RemoveSpell().

590 {
591  TalentSpellPosMap::const_iterator itr = sTalentSpellPosMap.find(spellId);
592  if (itr == sTalentSpellPosMap.end())
593  return NULL;
594 
595  return &itr->second;
596 }
TalentSpellPosMap sTalentSpellPosMap
Definition: DBCStores.cpp:131
uint32 GetTalentTabInspectBitSize ( uint32  talentTabId)

Definition at line 757 of file DBCStores.cpp.

Referenced by WorldSession::HandleInspectOpcode().

758 {
759  TalentInspectMap::const_iterator itr = sTalentTabSizeInInspect.find(talentTabId);
760  if (itr == sTalentTabSizeInInspect.end())
761  return 0;
762 
763  return itr->second;
764 }
uint32 const* GetTalentTabPages ( uint32  cls)

Definition at line 766 of file DBCStores.cpp.

Referenced by WorldSession::HandleInspectOpcode().

767 {
768  return sTalentTabPages[cls];
769 }
uint32 GetVirtualMapForMapAndZone ( uint32  mapid,
uint32  zoneId 
)

Definition at line 652 of file DBCStores.cpp.

References sWorldMapAreaStore.

Referenced by Spell::CheckCast(), Spell::EffectScriptEffect(), GetContentLevelsForMapAndZone(), IsSpellAllowedInLocation(), and Player::UpdateZoneDependentAuras().

653 {
654  if (mapid != 530) // speed for most cases
655  return mapid;
656 
657  if (WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId))
658  return wma->virtual_map_id >= 0 ? wma->virtual_map_id : wma->map_id;
659 
660  return mapid;
661 }
DBCStorage< WorldMapAreaEntry > sWorldMapAreaStore(WorldMapAreaEntryfmt)
WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple ( int32  rootid,
int32  adtid,
int32  groupid 
)

Definition at line 615 of file DBCStores.cpp.

References WMOAreaTableTripple::WMOAreaTableTripple().

Referenced by Map::GetAreaFlag().

616 {
617  WMOAreaInfoByTripple::iterator i = sWMOAreaInfoByTripple.find(WMOAreaTableTripple(rootid, adtid, groupid));
618  if (i == sWMOAreaInfoByTripple.end())
619  return NULL;
620  return i->second;
621 }
bool IsAcceptableClientBuild ( uint32  build)

Definition at line 158 of file DBCStores.cpp.

References EXPECTED_OREGONCORE_CLIENT_BUILD.

Referenced by WorldSocket::HandleAuthSession().

159 {
160  uint32 accepted_versions[] = EXPECTED_OREGONCORE_CLIENT_BUILD;
161  for (int i = 0; accepted_versions[i]; ++i)
162  if (build == accepted_versions[i])
163  return true;
164 
165  return false;
166 }
#define EXPECTED_OREGONCORE_CLIENT_BUILD
ACE_UINT32 uint32
Definition: Define.h:71
bool IsTotemCategoryCompatiableWith ( uint32  itemTotemCategoryId,
uint32  requiredTotemCategoryId 
)

Definition at line 694 of file DBCStores.cpp.

References TotemCategoryEntry::categoryMask, TotemCategoryEntry::categoryType, and sTotemCategoryStore.

Referenced by Player::HasItemTotemCategory().

695 {
696  if (requiredTotemCategoryId == 0)
697  return true;
698  if (itemTotemCategoryId == 0)
699  return false;
700 
701  TotemCategoryEntry const* itemEntry = sTotemCategoryStore.LookupEntry(itemTotemCategoryId);
702  if (!itemEntry)
703  return false;
704  TotemCategoryEntry const* reqEntry = sTotemCategoryStore.LookupEntry(requiredTotemCategoryId);
705  if (!reqEntry)
706  return false;
707 
708  if (itemEntry->categoryType != reqEntry->categoryType)
709  return false;
710 
711  return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask;
712 }
DBCStorage< TotemCategoryEntry > sTotemCategoryStore(TotemCategoryEntryfmt)
void LoadDBCStores ( const std::string &  dataPath)

Definition at line 220 of file DBCStores.cpp.

References SpellEntry::Attributes, SpellEntry::Category, TalentTabEntry::ClassMask, CLASSMASK_ALL_PLAYABLE, TalentEntry::Col, SpellEntry::Id, LoadDBC(), MAX_CLASSES, MAX_SPELL_EFFECTS, TalentEntry::RankID, TalentEntry::Row, sAreaStore, sAreaTriggerStore, sAuctionHouseStore, sBankBagSlotPricesStore, sBattlemasterListStore, sCharStartOutfitStore, sCharTitlesStore, sChatChannelsStore, sChrClassesStore, sChrRacesStore, sCinematicCameraStore, sCinematicSequencesStore, sCreatureDisplayInfoStore, sCreatureFamilyStore, sCreatureSpellDataStore, sDurabilityCostsStore, sDurabilityQualityStore, sEmotesStore, sEmotesTextStore, sFactionStore, sFactionTemplateStore, sGameObjectDisplayInfoStore, sGemPropertiesStore, sGtChanceToMeleeCritBaseStore, sGtChanceToMeleeCritStore, sGtChanceToSpellCritBaseStore, sGtChanceToSpellCritStore, sGtCombatRatingsStore, sGtNPCManaCostScalerStore, sGtOCTRegenHPStore, sGtRegenHPPerSptStore, sGtRegenMPPerSptStore, sItemExtendedCostStore, sItemRandomPropertiesStore, sItemRandomSuffixStore, sItemSetStore, sItemStore, SkillLineAbilityEntry::skillId, CreatureFamilyEntry::skillLine, sLiquidTypeStore, sLockStore, sLog, sMailTemplateStore, sMapStore, SPELL_EFFECT_SEND_TAXI, SpellEntry::SpellFamilyFlags, SkillLineAbilityEntry::spellId, sPetFamilySpellsStore, sQuestSortStore, sRandomPropertiesPointsStore, sSkillLineAbilityStore, sSkillLineStore, sSoundEntriesStore, sSpellCastTimesStore, sSpellCategoryStore, sSpellDurationStore, sSpellFocusObjectStore, sSpellItemEnchantmentConditionStore, sSpellItemEnchantmentStore, sSpellRadiusStore, sSpellRangeStore, sSpellShapeshiftStore, sSpellStore, sStableSlotPricesStore, sSummonPropertiesStore, sTalentSpellPosMap, sTalentStore, sTalentTabStore, sTaxiNodesMask, sTaxiNodesStore, sTaxiPathNodesByPath, sTaxiPathSetBySource, sTaxiPathStore, sTotemCategoryStore, sWMOAreaTableStore, sWorldMapAreaStore, sWorldSafeLocsStore, TalentTabEntry::tabpage, TalentEntry::TalentID, TalentEntry::TalentTab, and FactionEntry::team.

Referenced by World::SetInitialWorldSettings().

221 {
222  std::string dbcPath = dataPath + "dbc/";
223 
224  const uint32 DBCFilesCount = 61;
225 
226 
227  StoreProblemList bad_dbc_files;
228  uint32 availableDbcLocales = 0xFFFFFFFF;
229 
230  LoadDBC(availableDbcLocales, bad_dbc_files, sAreaStore, dbcPath, "AreaTable.dbc");
231 
232  // must be after sAreaStore loading
233  for (uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0
234  {
235  if (AreaTableEntry const* area = sAreaStore.LookupEntry(i))
236  {
237  // fill AreaId->DBC records
238  sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID), area->exploreFlag));
239 
240  // fill MapId->DBC records ( skip sub zones and continents)
241  if (area->zone == 0 && area->mapid != 0 && area->mapid != 1 && area->mapid != 530)
242  sAreaFlagByMapID.insert(AreaFlagByMapID::value_type(area->mapid, area->exploreFlag));
243  }
244  }
245 
246  LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");
247  LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");
248  LoadDBC(availableDbcLocales, bad_dbc_files, sBankBagSlotPricesStore, dbcPath, "BankBagSlotPrices.dbc");
249  LoadDBC(availableDbcLocales, bad_dbc_files, sBattlemasterListStore, dbcPath, "BattlemasterList.dbc");
250  LoadDBC(availableDbcLocales, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc");
251 
252  LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc");
253  LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");
254  LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc");
255  LoadDBC(availableDbcLocales, bad_dbc_files, sChrRacesStore, dbcPath, "ChrRaces.dbc");
256  LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicCameraStore, dbcPath, "CinematicCamera.dbc");
257  LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicSequencesStore, dbcPath, "CinematicSequences.dbc");
258  LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoStore, dbcPath, "CreatureDisplayInfo.dbc");
259  LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureFamilyStore, dbcPath, "CreatureFamily.dbc");
260  LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureSpellDataStore, dbcPath, "CreatureSpellData.dbc");
261  LoadDBC(availableDbcLocales, bad_dbc_files, sDurabilityCostsStore, dbcPath, "DurabilityCosts.dbc");
262  LoadDBC(availableDbcLocales, bad_dbc_files, sDurabilityQualityStore, dbcPath, "DurabilityQuality.dbc");
263  LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesStore, dbcPath, "Emotes.dbc");
264  LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesTextStore, dbcPath, "EmotesText.dbc");
265  LoadDBC(availableDbcLocales, bad_dbc_files, sFactionStore, dbcPath, "Faction.dbc");
266  for (uint32 i = 0; i < sFactionStore.GetNumRows(); ++i)
267  {
268  FactionEntry const* faction = sFactionStore.LookupEntry(i);
269  if (faction && faction->team)
270  {
271  SimpleFactionsList& flist = sFactionTeamMap[faction->team];
272  flist.push_back(i);
273  }
274  }
275 
276  LoadDBC(availableDbcLocales, bad_dbc_files, sFactionTemplateStore, dbcPath, "FactionTemplate.dbc");
277 
278  LoadDBC(availableDbcLocales, bad_dbc_files,sGameObjectDisplayInfoStore,dbcPath,"GameObjectDisplayInfo.dbc");
279  for (uint32 i = 0; i < sGameObjectDisplayInfoStore.GetNumRows(); ++i)
280  {
281  if (GameObjectDisplayInfoEntry const* info = sGameObjectDisplayInfoStore.LookupEntry(i))
282  {
283  if (info->maxX < info->minX)
284  std::swap(*(float*)(&info->maxX), *(float*)(&info->minX));
285  if (info->maxY < info->minY)
286  std::swap(*(float*)(&info->maxY), *(float*)(&info->minY));
287  if (info->maxZ < info->minZ)
288  std::swap(*(float*)(&info->maxZ), *(float*)(&info->minZ));
289  }
290  }
291 
292  LoadDBC(availableDbcLocales, bad_dbc_files, sGemPropertiesStore, dbcPath, "GemProperties.dbc");
293 
294  LoadDBC(availableDbcLocales, bad_dbc_files, sGtCombatRatingsStore, dbcPath, "gtCombatRatings.dbc");
295 
296  LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritBaseStore, dbcPath, "gtChanceToMeleeCritBase.dbc");
297  LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritStore, dbcPath, "gtChanceToMeleeCrit.dbc");
298 
299  LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritBaseStore, dbcPath, "gtChanceToSpellCritBase.dbc");
300  LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritStore, dbcPath, "gtChanceToSpellCrit.dbc");
301 
302  LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTRegenHPStore, dbcPath, "gtOCTRegenHP.dbc");
303  LoadDBC(availableDbcLocales, bad_dbc_files, sGtNPCManaCostScalerStore, dbcPath, "gtNPCManaCostScaler.dbc");
304  //LoadDBC(availableDbcLocales,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently
305  LoadDBC(availableDbcLocales, bad_dbc_files, sGtRegenHPPerSptStore, dbcPath, "gtRegenHPPerSpt.dbc");
306  LoadDBC(availableDbcLocales, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc");
307  LoadDBC(availableDbcLocales, bad_dbc_files, sItemStore, dbcPath, "Item.dbc");
308  //LoadDBC(availableDbcLocales,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently
309  //LoadDBC(availableDbcLocales,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc");
310  LoadDBC(availableDbcLocales, bad_dbc_files, sItemExtendedCostStore, dbcPath, "ItemExtendedCost.dbc");
311  LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc");
312  LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc");
313  LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc");
314  LoadDBC(availableDbcLocales, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc");
315  LoadDBC(availableDbcLocales, bad_dbc_files,sLiquidTypeStore, dbcPath,"LiquidType.dbc");
316  LoadDBC(availableDbcLocales, bad_dbc_files, sMailTemplateStore, dbcPath, "MailTemplate.dbc");
317  LoadDBC(availableDbcLocales, bad_dbc_files, sMapStore, dbcPath, "Map.dbc");
318  LoadDBC(availableDbcLocales, bad_dbc_files, sQuestSortStore, dbcPath, "QuestSort.dbc");
319  LoadDBC(availableDbcLocales, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc");
320  LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc");
321  LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc");
322  LoadDBC(availableDbcLocales, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc");
323  LoadDBC(availableDbcLocales, bad_dbc_files, sSpellStore, dbcPath, "Spell.dbc");
324  for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
325  {
326  SpellEntry const* spell = sSpellStore.LookupEntry(i);
327  if (spell && spell->Category)
328  sSpellCategoryStore[spell->Category].insert(i);
329 
330  // DBC not support uint64 fields but SpellEntry have SpellFamilyFlags mapped at 2 uint32 fields
331  // uint32 field already converted to bigendian if need, but must be swapped for correct uint64 bigendian view
332  #if OREGON_ENDIAN == OREGON_BIGENDIAN
333  std::swap(*((uint32*)(&spell->SpellFamilyFlags)), *(((uint32*)(&spell->SpellFamilyFlags)) + 1));
334  #endif
335  }
336 
337  for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
338  {
339  SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j);
340 
341  if (!skillLine)
342  continue;
343 
344  SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
345 
346  if (spellInfo && (spellInfo->Attributes & 0x1D0) == 0x1D0)
347  {
348  for (unsigned int i = 1; i < sCreatureFamilyStore.GetNumRows(); ++i)
349  {
350  CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(i);
351  if (!cFamily)
352  continue;
353 
354  if (skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1])
355  continue;
356 
357  sPetFamilySpellsStore[i].insert(spellInfo->Id);
358  }
359  }
360  }
361 
362  LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc");
363  LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc");
364  LoadDBC(availableDbcLocales, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc");
365  LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentStore, dbcPath, "SpellItemEnchantment.dbc");
366  LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentConditionStore, dbcPath, "SpellItemEnchantmentCondition.dbc");
367  LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRadiusStore, dbcPath, "SpellRadius.dbc");
368  LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc");
369  LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftStore, dbcPath, "SpellShapeshiftForm.dbc");
370  LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc");
371  LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");
372  LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");
373 
374  // create talent spells set
375  for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i)
376  {
377  TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
378  if (!talentInfo) continue;
379  for (int j = 0; j < 5; j++)
380  if (talentInfo->RankID[j])
381  sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i, j);
382  }
383 
384  LoadDBC(availableDbcLocales, bad_dbc_files, sTalentTabStore, dbcPath, "TalentTab.dbc");
385 
386  // prepare fast data access to bit pos of talent ranks for use at inspecting
387  {
388  // fill table by amount of talent ranks and fill sTalentTabBitSizeInInspect
389  // store in with (row,col,talent)->size key for correct sorting by (row,col)
390  typedef std::map<uint32, uint32> TalentBitSize;
391  TalentBitSize sTalentBitSize;
392  for (uint32 i = 1; i < sTalentStore.GetNumRows(); ++i)
393  {
394  TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
395  if (!talentInfo) continue;
396 
397  TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry( talentInfo->TalentTab);
398  if (!talentTabInfo)
399  continue;
400 
401  // find talent rank
402  uint32 curtalent_maxrank = 0;
403  for (uint32 k = 5; k > 0; --k)
404  {
405  if (talentInfo->RankID[k - 1])
406  {
407  curtalent_maxrank = k;
408  break;
409  }
410  }
411 
412  sTalentBitSize[(talentInfo->Row << 24) + (talentInfo->Col << 16) + talentInfo->TalentID] = curtalent_maxrank;
413  sTalentTabSizeInInspect[talentInfo->TalentTab] += curtalent_maxrank;
414  }
415 
416  // now have all max ranks (and then bit amount used for store talent ranks in inspect)
417  for (uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId)
418  {
419  TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentTabId);
420  if (!talentTabInfo)
421  continue;
422 
423  // prevent memory corruption; otherwise cls will become 12 below
424  if ((talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE) == 0)
425  continue;
426 
427  // store class talent tab pages
428  uint32 cls = 1;
429  for (uint32 m = 1; !(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES; m <<= 1, ++cls) {}
430 
431  sTalentTabPages[cls][talentTabInfo->tabpage] = talentTabId;
432 
433  // add total amount bits for first rank starting from talent tab first talent rank pos.
434  uint32 pos = 0;
435  for (TalentBitSize::iterator itr = sTalentBitSize.begin(); itr != sTalentBitSize.end(); ++itr)
436  {
437  uint32 talentId = itr->first & 0xFFFF;
438  TalentEntry const* talentInfo = sTalentStore.LookupEntry( talentId);
439  if (!talentInfo)
440  continue;
441 
442  if (talentInfo->TalentTab != talentTabId)
443  continue;
444 
445  sTalentPosInInspect[talentId] = pos;
446  pos += itr->second;
447  }
448  }
449  }
450 
451  LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiNodesStore, dbcPath, "TaxiNodes.dbc");
452 
453  // Initialize global taxinodes mask
454  memset(sTaxiNodesMask, 0, sizeof(sTaxiNodesMask));
455  for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
456  {
457  if (sTaxiNodesStore.LookupEntry(i))
458  {
459  uint8 field = (uint8)((i - 1) / 32);
460  uint32 submask = 1 << ((i - 1) % 32);
461  sTaxiNodesMask[field] |= submask;
462  }
463  }
464 
465  LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathStore, dbcPath, "TaxiPath.dbc");
466  for (uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i)
467  if (TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i))
468  sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID, entry->price);
469  uint32 pathCount = sTaxiPathStore.GetNumRows();
470 
471  //## TaxiPathNode.dbc ## Loaded only for initialization different structures
472  LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathNodeStore, dbcPath, "TaxiPathNode.dbc");
473  // Calculate path nodes count
474  std::vector<uint32> pathLength;
475  pathLength.resize(pathCount); // 0 and some other indexes not used
476  for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
477  if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i))
478  ++pathLength[entry->path];
479  // Set path length
480  sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used
481  for (uint32 i = 1; i < sTaxiPathNodesByPath.size(); ++i)
482  sTaxiPathNodesByPath[i].resize(pathLength[i]);
483  // fill data
484  for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
485  if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i))
486  sTaxiPathNodesByPath[entry->path].set(entry->index, entry);
487 
488  // Initialize global taxinodes mask
489  // include existed nodes that have at least single not spell base (scripted) path
490  {
491  std::set<uint32> spellPaths;
492  for (uint32 i = 1; i < sSpellStore.GetNumRows (); ++i)
493  if (SpellEntry const* sInfo = sSpellStore.LookupEntry (i))
494  for (int j = 0; j < MAX_SPELL_EFFECTS; ++j)
495  if (sInfo->Effect[j] == SPELL_EFFECT_SEND_TAXI)
496  spellPaths.insert(sInfo->EffectMiscValue[j]);
497 
498  memset(sTaxiNodesMask, 0, sizeof(sTaxiNodesMask));
499  for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
500  {
501  TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
502  if (!node)
503  continue;
504 
505  TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(i);
506  if (src_i != sTaxiPathSetBySource.end() && !src_i->second.empty())
507  {
508  bool ok = false;
509  for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i)
510  {
511  // not spell path
512  if (spellPaths.find(dest_i->second.ID) == spellPaths.end())
513  {
514  ok = true;
515  break;
516  }
517  }
518 
519  if (!ok)
520  continue;
521  }
522 
523  // valid taxi network node
524  uint8 field = (uint8)((i - 1) / 32);
525  uint32 submask = 1 << ((i - 1) % 32);
526  sTaxiNodesMask[field] |= submask;
527  }
528  }
529 
530  LoadDBC(availableDbcLocales, bad_dbc_files, sTotemCategoryStore, dbcPath, "TotemCategory.dbc");
531  LoadDBC(availableDbcLocales, bad_dbc_files, sWMOAreaTableStore, dbcPath, "WMOAreaTable.dbc");
532  for (uint32 i = 0; i < sWMOAreaTableStore.GetNumRows(); ++i)
533  {
534  if (WMOAreaTableEntry const* entry = sWMOAreaTableStore.LookupEntry(i))
535  sWMOAreaInfoByTripple.insert(WMOAreaInfoByTripple::value_type(WMOAreaTableTripple(entry->rootId, entry->adtId, entry->groupId), entry));
536  }
537  LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapAreaStore, dbcPath, "WorldMapArea.dbc");
538  LoadDBC(availableDbcLocales, bad_dbc_files, sWorldSafeLocsStore, dbcPath, "WorldSafeLocs.dbc");
539 
540  // error checks
541  if (bad_dbc_files.size() >= DBCFilesCount)
542  sLog.outFatal("\nIncorrect DataDir value in Oregond.conf or ALL required *.dbc files (%d) not found by path: %sdbc", DBCFilesCount, dataPath.c_str());
543  else if (!bad_dbc_files.empty())
544  {
545  std::string str;
546  for (std::list<std::string>::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
547  str += *i + "\n";
548 
549  sLog.outFatal("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s", bad_dbc_files.size(), DBCFilesCount, str.c_str());
550  }
551 
552  // check at up-to-date DBC files (53085 is last added spell in 2.4.3)
553  // check at up-to-date DBC files (17514 is last ID in SkillLineAbilities in 2.4.3)
554  // check at up-to-date DBC files (598 is last map added in 2.4.3)
555  // check at up-to-date DBC files (1127 is last gem property added in 2.4.3)
556  // check at up-to-date DBC files (2425 is last item extended cost added in 2.4.3)
557  // check at up-to-date DBC files (71 is last char title added in 2.4.3)
558  // check at up-to-date DBC files (1768 is last area added in 2.4.3)
559  if ( !sSpellStore.LookupEntry(53085) ||
560  !sSkillLineAbilityStore.LookupEntry(17514) ||
561  !sMapStore.LookupEntry(598) ||
562  !sGemPropertiesStore.LookupEntry(1127) ||
563  !sItemExtendedCostStore.LookupEntry(2425) ||
564  !sCharTitlesStore.LookupEntry(71) ||
565  !sAreaStore.LookupEntry(1768))
566  sLog.outFatal("\nYou have _outdated_ DBC files. Please extract correct versions from 2.4.3 client.");
567 
568  sLog.outString(">> Initialized %d data stores", DBCFilesCount);
569 }
uint32 Category
Definition: DBCStructure.h:675
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsEntryfmt)
DBCStorage< LiquidTypeEntry > sLiquidTypeStore(LiquidTypefmt)
DBCStorage< WMOAreaTableEntry > sWMOAreaTableStore(WMOAreaTableEntryfmt)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
DBCStorage< DurabilityCostsEntry > sDurabilityCostsStore(DurabilityCostsfmt)
DBCStorage< ItemSetEntry > sItemSetStore(ItemSetEntryfmt)
DBCStorage< ChatChannelsEntry > sChatChannelsStore(ChatChannelsEntryfmt)
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
DBCStorage< SpellCastTimesEntry > sSpellCastTimesStore(SpellCastTimefmt)
TaxiMask sTaxiNodesMask
Definition: DBCStores.cpp:141
DBCStorage< CharStartOutfitEntry > sCharStartOutfitStore(CharStartOutfitEntryfmt)
DBCStorage< EmotesEntry > sEmotesStore(EmotesEntryfmt)
DBCStorage< ItemExtendedCostEntry > sItemExtendedCostStore(ItemExtendedCostEntryfmt)
DBCStorage< BattlemasterListEntry > sBattlemasterListStore(BattlemasterListEntryfmt)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
DBCStorage< ItemRandomSuffixEntry > sItemRandomSuffixStore(ItemRandomSuffixfmt)
DBCStorage< GtNPCManaCostScalerEntry > sGtNPCManaCostScalerStore(GtNPCManaCostScalerfmt)
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
#define sLog
Log class singleton.
Definition: Log.h:187
DBCStorage< SpellItemEnchantmentConditionEntry > sSpellItemEnchantmentConditionStore(SpellItemEnchantmentConditionfmt)
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerEntryfmt)
TaxiPathNodesByPath sTaxiPathNodesByPath
Definition: DBCStores.cpp:148
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
void LoadDBC(uint32 &availableDbcLocales, StoreProblemList &errlist, DBCStorage< T > &storage, const std::string &dbc_path, const std::string &filename)
Definition: DBCStores.cpp:186
DBCStorage< SpellEntry > sSpellStore(SpellEntryfmt)
DBCStorage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore(CreatureDisplayInfofmt)
DBCStorage< BankBagSlotPricesEntry > sBankBagSlotPricesStore(BankBagSlotPricesEntryfmt)
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesEntryfmt)
DBCStorage< CharTitlesEntry > sCharTitlesStore(CharTitlesEntryfmt)
uint32 Attributes
Definition: DBCStructure.h:679
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
uint32 TalentID
Definition: DBCStructure.h:930
DBCStorage< ItemRandomPropertiesEntry > sItemRandomPropertiesStore(ItemRandomPropertiesfmt)
ACE_UINT8 uint8
Definition: Define.h:73
DBCStorage< GtRegenHPPerSptEntry > sGtRegenHPPerSptStore(GtRegenHPPerSptfmt)
std::list< std::string > StoreProblemList
Definition: DBCStores.cpp:156
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesEntryfmt)
DBCStorage< MailTemplateEntry > sMailTemplateStore(MailTemplateEntryfmt)
SpellCategoryStore sSpellCategoryStore
Definition: DBCStores.cpp:119
uint32 TalentTab
Definition: DBCStructure.h:931
DBCStorage< RandomPropertiesPointsEntry > sRandomPropertiesPointsStore(RandomPropertiesPointsfmt)
DBCStorage< SpellFocusObjectEntry > sSpellFocusObjectStore(SpellFocusObjectfmt)
DBCStorage< ItemEntry > sItemStore(Itemfmt)
DBCStorage< CinematicCameraEntry > sCinematicCameraStore(CinematicCameraEntryfmt)
#define CLASSMASK_ALL_PLAYABLE
Definition: SharedDefines.h:93
uint64 SpellFamilyFlags
Definition: DBCStructure.h:761
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< GtCombatRatingsEntry > sGtCombatRatingsStore(GtCombatRatingsfmt)
DBCStorage< TotemCategoryEntry > sTotemCategoryStore(TotemCategoryEntryfmt)
DBCStorage< GtChanceToMeleeCritEntry > sGtChanceToMeleeCritStore(GtChanceToMeleeCritfmt)
DBCStorage< CinematicSequencesEntry > sCinematicSequencesStore(CinematicSequencesEntryfmt)
DBCStorage< AuctionHouseEntry > sAuctionHouseStore(AuctionHouseEntryfmt)
DBCStorage< CreatureSpellDataEntry > sCreatureSpellDataStore(CreatureSpellDatafmt)
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
#define MAX_CLASSES
Definition: SharedDefines.h:91
TalentSpellPosMap sTalentSpellPosMap
Definition: DBCStores.cpp:131
DBCStorage< GtRegenMPPerSptEntry > sGtRegenMPPerSptStore(GtRegenMPPerSptfmt)
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)
DBCStorage< GameObjectDisplayInfoEntry > sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt)
DBCStorage< StableSlotPricesEntry > sStableSlotPricesStore(StableSlotPricesfmt)
DBCStorage< GtChanceToMeleeCritBaseEntry > sGtChanceToMeleeCritBaseStore(GtChanceToMeleeCritBasefmt)
DBCStorage< SpellDurationEntry > sSpellDurationStore(SpellDurationfmt)
DBCStorage< GtChanceToSpellCritEntry > sGtChanceToSpellCritStore(GtChanceToSpellCritfmt)
uint32 RankID[5]
Definition: DBCStructure.h:934
DBCStorage< GtOCTRegenHPEntry > sGtOCTRegenHPStore(GtOCTRegenHPfmt)
DBCStorage< TalentTabEntry > sTalentTabStore(TalentTabEntryfmt)
DBCStorage< DurabilityQualityEntry > sDurabilityQualityStore(DurabilityQualityfmt)
DBCStorage< SpellRadiusEntry > sSpellRadiusStore(SpellRadiusfmt)
DBCStorage< GemPropertiesEntry > sGemPropertiesStore(GemPropertiesEntryfmt)
TaxiPathSetBySource sTaxiPathSetBySource
Definition: DBCStores.cpp:144
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
DBCStorage< GtChanceToSpellCritBaseEntry > sGtChanceToSpellCritBaseStore(GtChanceToSpellCritBasefmt)
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:670
ACE_UINT16 uint16
Definition: Define.h:72
PetFamilySpellsStore sPetFamilySpellsStore
Definition: DBCStores.cpp:120
ACE_UINT32 uint32
Definition: Define.h:71
DBCStorage< EmotesTextEntry > sEmotesTextStore(EmotesTextEntryfmt)
DBCStorage< TaxiPathEntry > sTaxiPathStore(TaxiPathEntryfmt)
DBCStorage< WorldMapAreaEntry > sWorldMapAreaStore(WorldMapAreaEntryfmt)
std::list< uint32 > SimpleFactionsList
Definition: DBCStores.h:30
DBCStorage< SpellShapeshiftEntry > sSpellShapeshiftStore(SpellShapeshiftfmt)
DBCStorage< SpellRangeEntry > sSpellRangeStore(SpellRangefmt)
DBCStorage< TaxiNodesEntry > sTaxiNodesStore(TaxiNodesEntryfmt)
DBCStorage< QuestSortEntry > sQuestSortStore(QuestSortEntryfmt)
DBCStorage< SkillLineAbilityEntry > sSkillLineAbilityStore(SkillLineAbilityfmt)
DBCStorage< AreaTableEntry > sAreaStore(AreaTableEntryfmt)
void Map2ZoneCoordinates ( float &  x,
float &  y,
uint32  zone 
)

Definition at line 735 of file DBCStores.cpp.

References sWorldMapAreaStore, WorldMapAreaEntry::x1, WorldMapAreaEntry::x2, WorldMapAreaEntry::y1, and WorldMapAreaEntry::y2.

Referenced by ChatHandler::HandleGPSCommand().

736 {
737  WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
738 
739  // if not listed then map coordinates (instance)
740  if (!maEntry)
741  return;
742 
743  x = (x - maEntry->x1) / ((maEntry->x2 - maEntry->x1) / 100);
744  y = (y - maEntry->y1) / ((maEntry->y2 - maEntry->y1) / 100); // client y coord from top to down
745  std::swap(x, y); // client have map coords swapped
746 }
DBCStorage< WorldMapAreaEntry > sWorldMapAreaStore(WorldMapAreaEntryfmt)
void Zone2MapCoordinates ( float &  x,
float &  y,
uint32  zone 
)

Definition at line 722 of file DBCStores.cpp.

References sWorldMapAreaStore, WorldMapAreaEntry::x1, WorldMapAreaEntry::x2, WorldMapAreaEntry::y1, and WorldMapAreaEntry::y2.

Referenced by ChatHandler::HandleGoZoneXYCommand().

723 {
724  WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
725 
726  // if not listed then map coordinates (instance)
727  if (!maEntry)
728  return;
729 
730  std::swap(x, y); // at client map coords swapped
731  x = x * ((maEntry->x2 - maEntry->x1) / 100) + maEntry->x1;
732  y = y * ((maEntry->y2 - maEntry->y1) / 100) + maEntry->y1; // client y coord from top to down
733 }
DBCStorage< WorldMapAreaEntry > sWorldMapAreaStore(WorldMapAreaEntryfmt)

Variable Documentation

DBCStorage<CharStartOutfitEntry> sCharStartOutfitStore

Referenced by Player::Create(), and LoadDBCStores().

DBCStorage<CinematicCameraEntry> sCinematicCameraStore

Referenced by LoadDBCStores(), and LoadM2Cameras().

DBCStorage<DurabilityCostsEntry> sDurabilityCostsStore
DBCStorage<DurabilityQualityEntry> sDurabilityQualityStore
DBCStorage<GameObjectDisplayInfoEntry> sGameObjectDisplayInfoStore
DBCStorage<MapEntry> sMapStore

Referenced by MapManager::_createBaseMap(), Group::_homebindIfInstance(), Player::_LoadBoundInstances(), Player::_LoadHomeBind(), InstanceSaveManager::AddInstanceSave(), Spell::CheckCast(), ObjectMgr::CheckCreatureLinkedRespawn(), MapInstanced::CreateInstance(), GetAreaEntryByAreaFlagAndMap(), Group::GetBoundInstance(), Player::GetBoundInstance(), ObjectMgr::GetClosestGraveYard(), GetContentLevelsForMapAndZone(), ObjectMgr::GetGoBackTrigger(), InstanceSave::GetMapEntry(), InstanceSave::GetResetTimeForDB(), WorldSession::HandleAreaTriggerOpcode(), WorldSession::HandleCorpseQueryOpcode(), ChatHandler::HandleGPSCommand(), ChatHandler::HandleGroupTeleCommand(), WorldSession::HandleMoveWorldportAckOpcode(), ChatHandler::HandleNameTeleCommand(), ChatHandler::HandleTeleCommand(), ConditionMgr::isConditionTypeValid(), DisableMgr::IsDisabledFor(), SmartAIMgr::IsEventValid(), IsSpellAllowedInLocation(), MapManager::IsValidMAP(), Player::KillPlayer(), ObjectMgr::LoadAreaTriggerTeleports(), Player::LoadCorpse(), CreatureEventAIMgr::LoadCreatureEventAI_Scripts(), ObjectMgr::LoadCreatures(), LoadDBCStores(), DisableMgr::LoadDisables(), Player::LoadFromDB(), ObjectMgr::LoadGroups(), ObjectMgr::LoadInstanceTemplate(), ObjectMgr::LoadItemTemplates(), ObjectMgr::LoadPlayerInfo(), InstanceSaveManager::LoadResetTimes(), ObjectMgr::LoadScripts(), SpellMgr::LoadSpellTargetPositions(), ObjectMgr::LoadTempSummons(), MapManager::PlayerCannotEnter(), Group::ResetInstances(), Player::ResetInstances(), Player::RewardPlayerAndGroupAtKill(), Player::Satisfy(), Player::SaveToDB(), Pet::setDeathState(), World::SetInitialWorldSettings(), and Player::TeleportTo().

PetFamilySpellsStore sPetFamilySpellsStore

Definition at line 120 of file DBCStores.cpp.

Referenced by Pet::LearnPetPassives(), and LoadDBCStores().

DBCStorage<QuestSortEntry> sQuestSortStore
DBCStorage<RandomPropertiesPointsEntry> sRandomPropertiesPointsStore
DBCStorage<SpellCastTimesEntry> sSpellCastTimesStore

Referenced by GetSpellCastTime(), and LoadDBCStores().

SpellCategoryStore sSpellCategoryStore

Definition at line 119 of file DBCStores.cpp.

Referenced by LoadDBCStores(), and Spell::SendSpellCooldown().

DBCStorage<SpellRadiusEntry> sSpellRadiusStore

Referenced by GetSpellRadius(), and LoadDBCStores().

DBCStorage<SpellEntry> sSpellStore

Referenced by Pet::_LoadAuras(), Player::_LoadAuras(), Pet::_LoadSpellCooldowns(), Player::_LoadSpellCooldowns(), Player::addActionButton(), Unit::AddAura(), Creature::AddCreatureSpellCooldown(), AddItemsSetItem(), Battleground::AddPlayerToResurrectQueue(), Pet::addSpell(), Player::AddSpell(), Player::ApplyItemEquipSpell(), Player::ApplySpellMod(), Aura::Aura(), Spell::cast(), Unit::CastCustomSpell(), Player::CastItemCombatSpell(), GameObject::CastSpell(), Unit::CastSpell(), Player::CheckAreaExploreAndOutdoor(), Spell::CheckCast(), Aura::CleanupTriggeredSpells(), CompareAuraRanks(), ObjectMgr::ConvertCreatureAddonAuras(), Unit::DealMeleeDamage(), Unit::DealSpellDamage(), Spell::EffectApplyAura(), Spell::EffectDestroyAllTotems(), Spell::EffectDispel(), Spell::EffectDispelMechanic(), Spell::EffectDummy(), Spell::EffectEnergize(), Spell::EffectForceCast(), Spell::EffectLearnPetSpell(), Spell::EffectStealBeneficialBuff(), Spell::EffectStuck(), Spell::EffectTriggerMissileSpell(), Spell::EffectTriggerRitualOfSummoning(), Spell::EffectTriggerSpell(), Spell::EffectTriggerSpellWithValue(), Unit::EnergizeBySpell(), Player::EquipItem(), GetSpellSpecific(), GetSpellStore(), Player::GetTotalFlatMods(), Player::GetTotalPctMods(), Player::GetTrainerSpellState(), ChatHandler::HandleAuraCommand(), Aura::HandleAuraDummy(), Aura::HandleAuraModShapeshift(), WorldSession::HandleCancelAuraOpcode(), ChatHandler::HandleCastBackCommand(), ChatHandler::HandleCastCommand(), ChatHandler::HandleCastDistCommand(), ChatHandler::HandleCastSelfCommand(), WorldSession::HandleCastSpellOpcode(), ChatHandler::HandleCastTargetCommand(), ChatHandler::HandleCooldownCommand(), ChatHandler::HandleDamageCommand(), Unit::HandleDummyAuraProc(), ChatHandler::HandleFreezeCommand(), Unit::HandleHasteAuraProc(), WorldSession::HandleItemQuerySingleOpcode(), ChatHandler::HandleLearnAllCommand(), ChatHandler::HandleLearnAllCraftsCommand(), ChatHandler::HandleLearnAllGMCommand(), ChatHandler::HandleLearnAllMySpellsCommand(), ChatHandler::HandleLearnAllMyTalentsCommand(), ChatHandler::HandleLearnAllRecipesCommand(), ChatHandler::HandleLearnCommand(), ChatHandler::HandleLookupSpellCommand(), Unit::HandleOverrideClassScriptAuraProc(), WorldSession::HandlePetActionHelper(), WorldSession::HandlePetCancelAuraOpcode(), WorldSession::HandlePetCastSpellOpcode(), ChatHandler::HandlePetLearnCommand(), Unit::HandleProcTriggerSpell(), WorldSession::HandleSelfResOpcode(), Aura::HandleShapeshiftBoosts(), ChatHandler::HandleSpellCrashTestCommand(), WorldSession::HandleUseItemOpcode(), Creature::HasCategoryCooldown(), CharmInfo::InitCharmCreateSpells(), Pet::InitPetCreateSpells(), Totem::InitStats(), SpellMgr::IsAffectedBySpell(), IsAuraAddedBySpell(), IsAutocastableSpell(), ConditionMgr::isConditionTypeValid(), SmartAIMgr::IsEventValid(), SpellMgr::IsNoStackSpellDueToSpell(), IsPassiveSpell(), IsPassiveStackableSpell(), IsPositiveEffect(), SpellMgr::IsPrimaryProfessionSpell(), SpellMgr::IsProfessionSpell(), IsQuestTameSpell(), SpellMgr::IsRankSpellDueToSpell(), ConditionMgr::isSourceTypeValid(), SpellMgr::IsSpellValid(), SmartAIMgr::IsSpellValid(), ChatHandler::isValidChatMessage(), Player::LearnQuestRewardedSpells(), Player::LearnSkillRewardedSpells(), CreatureEventAIMgr::LoadCreatureEventAI_Scripts(), Creature::LoadCreaturesAddon(), ObjectMgr::LoadCreatureTemplates(), LoadDBCStores(), DisableMgr::LoadDisables(), ObjectMgr::LoadEventScripts(), ObjectMgr::LoadGameobjectInfo(), SmartAIMgr::LoadHelperStores(), ObjectMgr::LoadItemTemplates(), ObjectMgr::LoadPetCreateSpells(), Pet::LoadPetFromDB(), ObjectMgr::LoadQuests(), ObjectMgr::LoadScripts(), LoadSkillDiscoveryTable(), LoadSkillExtraItemTable(), SpellMgr::LoadSpellAffects(), SpellMgr::LoadSpellChains(), SpellMgr::LoadSpellCustomAttr(), SpellMgr::LoadSpellGroups(), SpellMgr::LoadSpellLearnSkills(), SpellMgr::LoadSpellLearnSpells(), SpellMgr::LoadSpellLinked(), SpellMgr::LoadSpellPetAuras(), SpellMgr::LoadSpellProcEvents(), ObjectMgr::LoadSpellScripts(), SpellMgr::LoadSpellTargetPositions(), SpellMgr::LoadSpellThreats(), ObjectMgr::LoadTrainerSpell(), Unit::ModifyAuraState(), Unit::Mount(), Unit::ProcDamageAndSpellFor(), SmartScript::ProcessAction(), CreatureEventAI::ProcessAction(), Player::ProhibitSpellSchool(), Creature::reachWithSpellAttack(), Creature::reachWithSpellCure(), Player::RemoveArenaSpellCooldowns(), Unit::RemoveGameObject(), Player::RemovePet(), Unit::RemoveRankAurasDueToSpell(), Player::RewardQuest(), SpellMgr::SelectAuraRankForPlayerLevel(), Player::SendInitialSpells(), Unit::SetMinion(), Spell::SpellDamageWeaponDmg(), Unit::SpellNonMeleeDamageLog(), GameObject::TriggeringLinkedGameObject(), Aura::TriggerSpell(), Aura::Update(), GameObject::Update(), PetAI::UpdateAI(), TotemAI::UpdateAI(), Player::UpdateCraftSkill(), GameObject::Use(), and Oregon::DynamicObjectUpdater::VisitHelper().

TaxiMask sTaxiNodesMask
TaxiPathSetBySource sTaxiPathSetBySource

Definition at line 144 of file DBCStores.cpp.

Referenced by ObjectMgr::GetTaxiPath(), and LoadDBCStores().

DBCStorage<WMOAreaTableEntry> sWMOAreaTableStore

Referenced by LoadDBCStores().