From b0fe236265465a0f39aa98a8cee2916d1ccfaa02 Mon Sep 17 00:00:00 2001 From: QAston Date: Tue, 26 Jul 2011 23:09:28 +0200 Subject: 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 --- src/server/scripts/Commands/cs_debug.cpp | 4 ++-- src/server/scripts/Commands/cs_learn.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/server/scripts/Commands') 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; -- cgit v1.2.3