aboutsummaryrefslogtreecommitdiff
path: root/src/game/DBCStores.cpp
diff options
context:
space:
mode:
authorRat <none@none>2010-04-09 10:47:11 +0200
committerRat <none@none>2010-04-09 10:47:11 +0200
commitcbbe587817f9d635338c1efc309418a9a6575d76 (patch)
treeab4db09b5c7fe4491fd6f6542c45a8c0ef9a18bb /src/game/DBCStores.cpp
parent1f46c1150d8d04d5d3e72f27c475062cc320d545 (diff)
*added code for loading Spelldifficulty.dbc + Custom Spelldifficulty from Database
*added spell searcher based on creature's map difficulty, usage is optional and only for scipts for now *added new table spelldifficulty_dbc --HG-- branch : trunk
Diffstat (limited to 'src/game/DBCStores.cpp')
-rw-r--r--src/game/DBCStores.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp
index a66fc887ce3..1b487262c13 100644
--- a/src/game/DBCStores.cpp
+++ b/src/game/DBCStores.cpp
@@ -128,6 +128,7 @@ SpellCategoryStore sSpellCategoryStore;
PetFamilySpellsStore sPetFamilySpellsStore;
DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore(SpellCastTimefmt);
+DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore(SpellDifficultyfmt);
DBCStorage <SpellDurationEntry> sSpellDurationStore(SpellDurationfmt);
DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore(SpellFocusObjectfmt);
DBCStorage <SpellRadiusEntry> sSpellRadiusStore(SpellRadiusfmt);
@@ -384,6 +385,7 @@ void LoadDBCStores(const std::string& dataPath)
}
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellCastTimesStore, dbcPath,"SpellCastTimes.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellDifficultyStore, dbcPath,"SpellDifficulty.dbc", &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex);
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellDurationStore, dbcPath,"SpellDuration.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellFocusObjectStore, dbcPath,"SpellFocusObject.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellItemEnchantmentStore,dbcPath,"SpellItemEnchantment.dbc");
@@ -396,6 +398,24 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSummonPropertiesStore, dbcPath,"SummonProperties.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTalentStore, dbcPath,"Talent.dbc");
+ // Create Spelldifficulty searcher
+ for (uint32 i = 0; i < sSpellDifficultyStore.GetNumRows(); ++i)
+ {
+ SpellDifficultyEntry const *spellDiff = sSpellDifficultyStore.LookupEntry(i);
+ if (!spellDiff)
+ continue;
+ for(int x = 0; x < MAX_DIFFICULTY; ++x)
+ {
+ if(spellDiff->SpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->SpellID[x]))
+ {
+ if(spellDiff->SpellID[x] > 0)//don't drop error if spell is <= 0, not all modes have spells and there are unknown negative values
+ sLog.outDebug("spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), skipped loading", spellDiff->SpellID[x], spellDiff->ID, x);
+ continue;
+ }
+ spellmgr.SetSpellDifficultyId(uint32(spellDiff->SpellID[x]), spellDiff->ID);
+ }
+ }
+
// create talent spells set
for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i)
{