Core/Datastores: refactor DBC storage helpers to use a class and fixed no pch build
This commit is contained in:
1 parent
7797c6a0ad
commit
f1f00c3ec3
43 files changed
+461
-461
No files matched your search
@@ -1539,7 +1539,7 @@ public:
|
||||
handler->PSendSysMessage("Invalid difficulty %d - specify in range [0,%d).", difficulty, MAX_RAID_DIFFICULTY);
|
||||
return false;
|
||||
}
|
||||
if (difficulty >= 0 && !GetMapDifficultyData(mEntry->ID, Difficulty(difficulty)))
|
||||
if (difficulty >= 0 && !sDBCManager.GetMapDifficultyData(mEntry->ID, Difficulty(difficulty)))
|
||||
{
|
||||
handler->PSendSysMessage("Difficulty %d is not valid for '%s'.", difficulty, mEntry->MapName[LOCALE_enUS]);
|
||||
return true;
|
||||
@@ -1550,7 +1550,7 @@ public:
|
||||
handler->PSendSysMessage("Resetting all difficulties for '%s'.", mEntry->MapName[LOCALE_enUS]);
|
||||
for (uint8 diff = (mEntry->IsRaid() ? 0 : 1); diff < (mEntry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY); ++diff)
|
||||
{
|
||||
if (GetMapDifficultyData(mEntry->ID, Difficulty(diff)))
|
||||
if (sDBCManager.GetMapDifficultyData(mEntry->ID, Difficulty(diff)))
|
||||
{
|
||||
handler->PSendSysMessage("Resetting difficulty %d for '%s'.", diff, mEntry->MapName[LOCALE_enUS]);
|
||||
sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(diff));
|
||||
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Zone2MapCoordinates(x, y, zoneEntry->ID);
|
||||
sDBCManager.Zone2MapCoordinates(x, y, zoneEntry->ID);
|
||||
|
||||
if (!MapManager::IsValidMapCoord(zoneEntry->ContinentID, x, y))
|
||||
{
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
else
|
||||
targetPlayer->LearnSpell(spell, false);
|
||||
|
||||
if (GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id))
|
||||
if (sDBCManager.GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id))
|
||||
targetPlayer->SendTalentsInfoData(false);
|
||||
|
||||
return true;
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
continue;
|
||||
|
||||
// skip spells with first rank learned as talent (and all talents then also)
|
||||
if (GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id) > 0)
|
||||
if (sDBCManager.GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id) > 0)
|
||||
continue;
|
||||
|
||||
// skip broken spells
|
||||
@@ -467,7 +467,7 @@ public:
|
||||
else
|
||||
handler->SendSysMessage(LANG_FORGET_SPELL);
|
||||
|
||||
if (GetTalentSpellCost(spellId))
|
||||
if (sDBCManager.GetTalentSpellCost(spellId))
|
||||
target->SendTalentsInfoData(false);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -503,7 +503,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, auras.size());
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
bool talent = GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0;
|
||||
bool talent = sDBCManager.GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0;
|
||||
|
||||
AuraApplication const* aurApp = itr->second;
|
||||
Aura const* aura = aurApp->GetBase();
|
||||
|
||||
@@ -771,7 +771,7 @@ public:
|
||||
|
||||
SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
|
||||
|
||||
uint32 talentCost = GetTalentSpellCost(id);
|
||||
uint32 talentCost = sDBCManager.GetTalentSpellCost(id);
|
||||
|
||||
bool talent = (talentCost > 0);
|
||||
bool passive = spellInfo->IsPassive();
|
||||
@@ -843,7 +843,7 @@ public:
|
||||
|
||||
SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
|
||||
|
||||
uint32 talentCost = GetTalentSpellCost(id);
|
||||
uint32 talentCost = sDBCManager.GetTalentSpellCost(id);
|
||||
|
||||
bool talent = (talentCost > 0);
|
||||
bool passive = spellInfo->IsPassive();
|
||||
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
float zoneX = object->GetPositionX();
|
||||
float zoneY = object->GetPositionY();
|
||||
|
||||
Map2ZoneCoordinates(zoneX, zoneY, zoneId);
|
||||
sDBCManager.Map2ZoneCoordinates(zoneX, zoneY, zoneId);
|
||||
|
||||
Map const* map = object->GetMap();
|
||||
float groundZ = object->GetMapHeight(object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
|
||||
@@ -1822,8 +1822,8 @@ public:
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_LEVEL_HIGH, level);
|
||||
|
||||
// Output XI. LANG_PINFO_CHR_RACE
|
||||
raceStr = GetRaceName(raceid, locale);
|
||||
classStr = GetClassName(classid, locale);
|
||||
raceStr = DBCManager::GetRaceName(raceid, locale);
|
||||
classStr = DBCManager::GetClassName(classid, locale);
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_RACE, (gender == 0 ? handler->GetTrinityString(LANG_CHARACTER_GENDER_MALE) : handler->GetTrinityString(LANG_CHARACTER_GENDER_FEMALE)), raceStr.c_str(), classStr.c_str());
|
||||
|
||||
// Output XII. LANG_PINFO_CHR_ALIVE
|
||||
|
||||
@@ -17,13 +17,15 @@
|
||||
|
||||
#include "dragon_soul.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "GameObject.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "Optional.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define DEF_DRAGONSOUL_H
|
||||
|
||||
#include "Define.h"
|
||||
#include "Creature.h"
|
||||
|
||||
#define DataHeader "DS"
|
||||
#define DSScriptName "instance_dragon_soul"
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "dragon_soul.h"
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
|
||||
@@ -3959,7 +3959,7 @@ public:
|
||||
if (Player* target = GetHitUnit()->ToPlayer())
|
||||
{
|
||||
target->HandleEmoteCommand(EMOTE_ONESHOT_TRAIN);
|
||||
if (EmotesTextSoundEntry const* soundEntry = FindTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->getRace(), target->getGender()))
|
||||
if (EmotesTextSoundEntry const* soundEntry = sDBCManager.FindTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->getRace(), target->getGender()))
|
||||
target->PlayDistanceSound(soundEntry->ID);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user