diff options
| author | QAston <qaston@gmail.com> | 2011-07-26 23:09:28 +0200 |
|---|---|---|
| committer | QAston <qaston@gmail.com> | 2011-07-26 23:09:28 +0200 |
| commit | b0fe236265465a0f39aa98a8cee2916d1ccfaa02 (patch) | |
| tree | 77ed4bde46de983c280a542d657a30b24865638c /src/server/scripts/Kalimdor | |
| parent | 29c228a80170e4264129d4e3bed4d2fc41aca5a7 (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/Kalimdor')
16 files changed, 32 insertions, 47 deletions
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 6d6843c9720..d590bc5cfe2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -69,12 +69,6 @@ public: pInstance = c->GetInstanceScript(); pGo = false; pos = 0; - SpellEntry *TempSpell = GET_SPELL(SPELL_SLEEP); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) - { - TempSpell->EffectImplicitTargetA[0] = 1; - TempSpell->EffectImplicitTargetB[0] = 0; - } } uint32 SwarmTimer; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 25474b47c0f..477e0601d9e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -60,9 +60,6 @@ public: pInstance = c->GetInstanceScript(); pGo = false; pos = 0; - SpellEntry *TempSpell = GET_SPELL(SPELL_HOWL_OF_AZGALOR); - if (TempSpell) - TempSpell->EffectRadiusIndex[0] = 12;//100yards instead of 50000?! } uint32 RainTimer; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index f258444eb62..337c4cbb1f9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -57,12 +57,6 @@ public: pInstance = c->GetInstanceScript(); pGo = false; pos = 0; - SpellEntry *TempSpell = GET_SPELL(SPELL_MARK); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) - { - TempSpell->EffectImplicitTargetA[0] = 1; - TempSpell->EffectImplicitTargetB[0] = 0; - } } uint32 CleaveTimer; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index 2159d4bafd5..678a38ffeca 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -1215,7 +1215,7 @@ class npc_crate_helper : public CreatureScript _marked = false; } - void SpellHit(Unit* /*caster*/, SpellEntry const* spell) + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) { if (spell->Id == SPELL_ARCANE_DISRUPTION && !_marked) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index adffa01afbb..2b2151daf02 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -141,7 +141,7 @@ public: void EnterCombat(Unit* /*who*/) {} - void SpellHit(Unit* /*caster*/, const SpellEntry* spell) + void SpellHit(Unit* /*caster*/, const SpellInfo* spell) { if (SpellCorrupt_Timer) return; diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 3fedbeb583c..d9eaf0d255c 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -225,7 +225,7 @@ public: DoScriptText(SAY_KILL, me); } - void SpellHit(Unit* /*pCaster*/, const SpellEntry* pSpell) + void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) { if (pSpell->Id == SPELL_BREATH_EAST_TO_WEST || pSpell->Id == SPELL_BREATH_WEST_TO_EAST || @@ -285,7 +285,7 @@ public: } } - void SpellHitTarget(Unit* target, const SpellEntry* pSpell) + void SpellHitTarget(Unit* target, const SpellInfo* pSpell) { //Workaround - Couldn't find a way to group this spells (All Eruption) if (((pSpell->Id >= 17086 && pSpell->Id <= 17095) || diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index bd66602a24b..e5b6d79f912 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -157,7 +157,7 @@ struct boss_twinemperorsAI : public ScriptedAI } } - void SpellHit(Unit* caster, const SpellEntry *entry) + void SpellHit(Unit* caster, const SpellInfo *entry) { if (caster == me) return; diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 57001552302..d49a776fa4d 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -63,7 +63,7 @@ public: void EnterCombat(Unit* /*who*/) { } - void SpellHit(Unit* Hitter, const SpellEntry *Spellkind) + void SpellHit(Unit* Hitter, const SpellInfo *Spellkind) { if (!spellhit && Hitter->GetTypeId() == TYPEID_PLAYER && diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 35ba092e5cf..3e8bcbef02e 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -111,7 +111,7 @@ public: } } - void SpellHit(Unit* Caster, const SpellEntry *Spell) + void SpellHit(Unit* Caster, const SpellInfo *Spell) { if (Spell->SpellFamilyFlags[2] & 0x080000000) { diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index 052137f9d2e..3242797d3e7 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -122,7 +122,7 @@ public: } } - void SpellHit(Unit* /*pCaster*/, const SpellEntry* pSpell) + void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) { if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_AWAKEN) ClearSleeping(); diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index 997de5d9bff..71372f1d9e4 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -135,7 +135,7 @@ public: } } - void SpellHit(Unit* /*pCaster*/, SpellEntry const* pSpell) + void SpellHit(Unit* /*pCaster*/, SpellInfo const* pSpell) { if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP) { diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index 113afdc2e77..29c36c64628 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -67,7 +67,7 @@ public: work = true; } - void SpellHit(Unit* caster, const SpellEntry * spell) + void SpellHit(Unit* caster, const SpellInfo * spell) { if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER && CAST_PLR(caster)->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE) @@ -391,7 +391,7 @@ class npc_troll_volunteer : public CreatureScript me->DespawnOrUnsummon(); } - void SpellHit(Unit* caster, SpellEntry const* spell) + void SpellHit(Unit* caster, SpellInfo const* spell) { if (spell->Id == SPELL_AOE_TURNIN && caster->GetEntry() == NPC_URUZIN && !_complete) { @@ -424,9 +424,9 @@ class spell_mount_check : public SpellScriptLoader class spell_mount_check_AuraScript : public AuraScript { PrepareAuraScript(spell_mount_check_AuraScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_MOUNTING_CHECK)) + if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTING_CHECK)) return false; return true; } @@ -472,11 +472,11 @@ class spell_voljin_war_drums : public SpellScriptLoader class spell_voljin_war_drums_SpellScript : public SpellScript { PrepareSpellScript(spell_voljin_war_drums_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_MOTIVATE_1)) + if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_1)) return false; - if (!sSpellStore.LookupEntry(SPELL_MOTIVATE_2)) + if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_2)) return false; return true; } @@ -529,12 +529,12 @@ class spell_voodoo : public SpellScriptLoader { PrepareSpellScript(spell_voodoo_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_BREW) || !sSpellStore.LookupEntry(SPELL_GHOSTLY) || - !sSpellStore.LookupEntry(SPELL_HEX1) || !sSpellStore.LookupEntry(SPELL_HEX2) || - !sSpellStore.LookupEntry(SPELL_HEX3) || !sSpellStore.LookupEntry(SPELL_GROW) || - !sSpellStore.LookupEntry(SPELL_LAUNCH)) + if (!sSpellMgr->GetSpellInfo(SPELL_BREW) || !sSpellMgr->GetSpellInfo(SPELL_GHOSTLY) || + !sSpellMgr->GetSpellInfo(SPELL_HEX1) || !sSpellMgr->GetSpellInfo(SPELL_HEX2) || + !sSpellMgr->GetSpellInfo(SPELL_HEX3) || !sSpellMgr->GetSpellInfo(SPELL_GROW) || + !sSpellMgr->GetSpellInfo(SPELL_LAUNCH)) return false; return true; } diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 13d18a44483..6e11930a441 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -701,16 +701,16 @@ class spell_ooze_zap : public SpellScriptLoader { PrepareSpellScript(spell_ooze_zap_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_OOZE_ZAP)) + if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP)) return false; return true; } SpellCastResult CheckRequirement() { - if (!GetCaster()->HasAura(SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), EFFECT_1))) + if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue())) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct if (!GetTargetUnit()) @@ -748,9 +748,9 @@ class spell_ooze_zap_channel_end : public SpellScriptLoader { PrepareSpellScript(spell_ooze_zap_channel_end_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_OOZE_ZAP_CHANNEL_END)) + if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP_CHANNEL_END)) return false; return true; } @@ -784,9 +784,9 @@ class spell_energize_aoe : public SpellScriptLoader { PrepareSpellScript(spell_energize_aoe_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_ENERGIZED)) + if (!sSpellMgr->GetSpellInfo(SPELL_ENERGIZED)) return false; return true; } @@ -795,7 +795,7 @@ class spell_energize_aoe : public SpellScriptLoader { for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end();) { - if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), EFFECT_1)) == QUEST_STATUS_INCOMPLETE) + if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->Effects[EFFECT_1].CalcValue()) == QUEST_STATUS_INCOMPLETE) ++itr; else unitList.erase(itr++); diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index 2ee707e01ea..d0131068c3f 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -116,7 +116,7 @@ public: me->UpdateEntry(NPC_KYLE_FRENZIED); } - void SpellHit(Unit* pCaster, SpellEntry const* pSpell) + void SpellHit(Unit* pCaster, SpellInfo const* pSpell) { if (!me->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH) { diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index a94c98823be..f341e47c5e8 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -265,7 +265,7 @@ public: me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); } - void SpellHit(Unit* /*caster*/, const SpellEntry *spell) + void SpellHit(Unit* /*caster*/, const SpellInfo *spell) { if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) { diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index 4dfd64f4b1e..05ba6b2234e 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -237,7 +237,7 @@ public: } } - void SpellHit(Unit* /*pCaster*/, const SpellEntry* pSpell) + void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) { if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_REVIVE_RINGO) ClearFaint(); |
