aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Skills/SkillDiscovery.cpp
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2011-07-26 23:09:28 +0200
committerQAston <qaston@gmail.com>2011-07-26 23:09:28 +0200
commitb0fe236265465a0f39aa98a8cee2916d1ccfaa02 (patch)
tree77ed4bde46de983c280a542d657a30b24865638c /src/server/game/Skills/SkillDiscovery.cpp
parent29c228a80170e4264129d4e3bed4d2fc41aca5a7 (diff)
Core: Use new SpellInfo class in core. Sadly, this commit is not compatibile with some of the custom code. To make your code work again you may need to change:
*SpellEntry is now SpellInfo *GetSpellProto is now GetSpellInfo *SpellEntry::Effect*[effIndex] is now avalible under SpellInfo.Effects[effIndex].* *sSpellStore.LookupEntry is no longer valid, use sSpellMgr->GetSpellInfo() *SpellFunctions from SpellMgr.h like DoSpellStuff(spellId) are now: spellInfo->DoStuff() *SpellMgr::CalculateEffectValue and similar functions are now avalible in SpellEffectInfo class. *GET_SPELL macro is removed, code which used it is moved to SpellMgr::LoadDbcDataCorrections *code which affected dbc data in SpellMgr::LoadSpellCustomAttr is now moved to LoadDbcDataCorrections
Diffstat (limited to 'src/server/game/Skills/SkillDiscovery.cpp')
-rwxr-xr-xsrc/server/game/Skills/SkillDiscovery.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp
index bdd635eb192..884d0710037 100755
--- a/src/server/game/Skills/SkillDiscovery.cpp
+++ b/src/server/game/Skills/SkillDiscovery.cpp
@@ -23,6 +23,7 @@
#include "SkillDiscovery.h"
#include "SpellMgr.h"
#include "Player.h"
+#include "SpellInfo.h"
#include <map>
struct SkillDiscoveryEntry
@@ -83,8 +84,8 @@ void LoadSkillDiscoveryTable()
if (reqSkillOrSpell > 0) // spell case
{
uint32 absReqSkillOrSpell = uint32(reqSkillOrSpell);
- SpellEntry const* reqSpellEntry = sSpellStore.LookupEntry(absReqSkillOrSpell);
- if (!reqSpellEntry)
+ SpellInfo const* reqSpellInfo = sSpellMgr->GetSpellInfo(absReqSkillOrSpell);
+ if (!reqSpellInfo)
{
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
@@ -95,9 +96,9 @@ void LoadSkillDiscoveryTable()
}
// mechanic discovery
- if (reqSpellEntry->Mechanic != MECHANIC_DISCOVERY &&
+ if (reqSpellInfo->Mechanic != MECHANIC_DISCOVERY &&
// explicit discovery ability
- !IsExplicitDiscoverySpell(reqSpellEntry))
+ !reqSpellInfo->IsExplicitDiscovery())
{
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
@@ -137,14 +138,14 @@ void LoadSkillDiscoveryTable()
sLog->outErrorDb("Some items can't be successfully discovered: have in chance field value < 0.000001 in `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 < sSpellStore.GetNumRows(); ++spell_id)
+ for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id)
{
- SpellEntry const* spellEntry = sSpellStore.LookupEntry(spell_id);
+ SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spell_id);
if (!spellEntry)
continue;
// skip not explicit discovery spells
- if (!IsExplicitDiscoverySpell(spellEntry))
+ if (!spellEntry->IsExplicitDiscovery())
continue;
if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end())