diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-06-12 01:29:18 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-06-12 01:29:18 +0200 |
commit | c7306439e7004288fb85890d6a5f730cf1761d71 (patch) | |
tree | a1b6fd4af385923f321ff24ef4d66d09374397b9 /src/server/game/Skills/SkillDiscovery.cpp | |
parent | 1cdd1d0249ad49c860e117e1e39d451e1a3fbe43 (diff) |
Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower
Diffstat (limited to 'src/server/game/Skills/SkillDiscovery.cpp')
-rw-r--r-- | src/server/game/Skills/SkillDiscovery.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 2529060e6b3..1117589d0ab 100644 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -16,6 +16,7 @@ */ #include "DatabaseEnv.h" +#include "DB2Stores.h" #include "Log.h" #include "World.h" #include "Util.h" @@ -84,7 +85,7 @@ void LoadSkillDiscoveryTable() if (reqSkillOrSpell > 0) // spell case { uint32 absReqSkillOrSpell = uint32(reqSkillOrSpell); - SpellInfo const* reqSpellInfo = sSpellMgr->GetSpellInfo(absReqSkillOrSpell); + SpellInfo const* reqSpellInfo = sSpellMgr->GetSpellInfo(absReqSkillOrSpell, DIFFICULTY_NONE); if (!reqSpellInfo) { if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end()) @@ -139,9 +140,9 @@ void LoadSkillDiscoveryTable() TC_LOG_ERROR("sql.sql", "Some items can't be successfully discovered, their chance field value is < 0.000001 in the `skill_discovery_template` DB table. List:\n%s", ssNonDiscoverableEntries.str().c_str()); // report about empty data for explicit discovery spells - for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id) + for (SpellNameEntry const* spellNameEntry : sSpellNameStore) { - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spell_id); + SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spellNameEntry->ID, DIFFICULTY_NONE); if (!spellEntry) continue; @@ -149,8 +150,8 @@ void LoadSkillDiscoveryTable() if (!spellEntry->IsExplicitDiscovery()) continue; - if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end()) - TC_LOG_ERROR("sql.sql", "Spell (ID: %u) has got 100%% chance random discovery ability, but does not have data in the `skill_discovery_template` table.", spell_id); + if (SkillDiscoveryStore.find(int32(spellEntry->Id)) == SkillDiscoveryStore.end()) + TC_LOG_ERROR("sql.sql", "Spell (ID: %u) has got 100%% chance random discovery ability, but does not have data in the `skill_discovery_template` table.", spellEntry->Id); } TC_LOG_INFO("server.loading", ">> Loaded %u skill discovery definitions in %u ms.", count, GetMSTimeDiffToNow(oldMSTime)); |