aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
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/scripts/Commands
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/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp4
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp20
2 files changed, 12 insertions, 12 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 185cf05864d..10f7f2ad4e4 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -976,11 +976,11 @@ public:
{
// reset all states
for (int i = 1; i <= 32; ++i)
- unit->ModifyAuraState(AuraState(i), false);
+ unit->ModifyAuraState(AuraStateType(i), false);
return true;
}
- unit->ModifyAuraState(AuraState(abs(state)), state > 0);
+ unit->ModifyAuraState(AuraStateType(abs(state)), state > 0);
return true;
}
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index b93c995351b..eee9ebfc809 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -80,13 +80,13 @@ public:
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spell = handler->extractSpellIdFromLink((char*)args);
- if (!spell || !sSpellStore.LookupEntry(spell))
+ if (!spell || !sSpellMgr->GetSpellInfo(spell))
return false;
char const* allStr = strtok(NULL, " ");
bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false;
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer()))
{
handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
@@ -118,13 +118,13 @@ public:
static bool HandleLearnAllGMCommand(ChatHandler* handler, const char* /*args*/)
{
- for (uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i)
+ for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
{
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(i);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
- if (!sSpellMgr->IsSkillTypeSpell(i, SKILL_INTERNAL))
+ if (!spellInfo->IsAbilityOfSkillType(SKILL_INTERNAL))
continue;
handler->GetSession()->GetPlayer()->learnSpell(i, false);
@@ -154,12 +154,12 @@ public:
if (!entry)
continue;
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(entry->spellId);
+ SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(entry->spellId);
if (!spellInfo)
continue;
// skip server-side/triggered spells
- if (spellInfo->spellLevel == 0)
+ if (spellInfo->SpellLevel == 0)
continue;
// skip wrong class/race skills
@@ -218,7 +218,7 @@ public:
if (!spellId) // ??? none spells in talent
continue;
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
@@ -297,7 +297,7 @@ public:
if (!spellid) // ??? none spells in talent
continue;
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
@@ -456,7 +456,7 @@ public:
if (skillLine->classmask && (skillLine->classmask & classmask) == 0)
continue;
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->spellId);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false))
continue;