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/Spells | |
| 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/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 62 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 14 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 84 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 56 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 104 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 36 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 28 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 14 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 60 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_rogue.cpp | 28 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 18 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 20 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 4 |
13 files changed, 264 insertions, 264 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 8ae4a6dbf9c..b6384d5f185 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -55,7 +55,7 @@ class spell_dk_anti_magic_shell_raid : public SpellScriptLoader bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } @@ -96,14 +96,14 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader uint32 absorbPct, hpPct; bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster()); - hpPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); + hpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()); return true; } - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellStore.LookupEntry(DK_SPELL_RUNIC_POWER_ENERGIZE); + return sSpellMgr->GetSpellInfo(DK_SPELL_RUNIC_POWER_ENERGIZE); } void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) @@ -154,19 +154,19 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellStore.LookupEntry(DK_SPELL_ANTI_MAGIC_SHELL_TALENT); + return sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT); } void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { - SpellEntry const* talentSpell = sSpellStore.LookupEntry(DK_SPELL_ANTI_MAGIC_SHELL_TALENT); - amount = SpellMgr::CalculateSpellEffectAmount(talentSpell, EFFECT_0, GetCaster()); + SpellInfo const* talentSpell = sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT); + amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster()); // assume caster is a player here if (Unit* caster = GetCaster()) amount += int32(2 * caster->ToPlayer()->GetTotalAttackPowerValue(BASE_ATTACK)); @@ -200,11 +200,11 @@ class spell_dk_corpse_explosion : public SpellScriptLoader { PrepareSpellScript(spell_dk_corpse_explosion_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED)) return false; - if (!sSpellStore.LookupEntry(DK_SPELL_GHOUL_EXPLODE)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_GHOUL_EXPLODE)) return false; return true; } @@ -222,7 +222,7 @@ class spell_dk_corpse_explosion : public SpellScriptLoader else // Some corpse { bp = GetEffectValue(); - GetCaster()->CastCustomSpell(unitTarget, SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), 1), &bp, NULL, NULL, true); + GetCaster()->CastCustomSpell(unitTarget, GetSpellInfo()->Effects[EFFECT_1].CalcValue(), &bp, NULL, NULL, true); // Corpse Explosion (Suicide) unitTarget->CastSpell(unitTarget, DK_SPELL_CORPSE_EXPLOSION_TRIGGERED, true); // Set corpse look @@ -374,9 +374,9 @@ class spell_dk_scourge_strike : public SpellScriptLoader { PrepareSpellScript(spell_dk_scourge_strike_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(DK_SPELL_SCOURGE_STRIKE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_SCOURGE_STRIKE_TRIGGERED)) return false; return true; } @@ -417,7 +417,7 @@ class spell_dk_spell_deflection : public SpellScriptLoader bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } @@ -457,9 +457,9 @@ class spell_dk_blood_boil : public SpellScriptLoader { PrepareSpellScript(spell_dk_blood_boil_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(DK_SPELL_BLOOD_BOIL_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_BOIL_TRIGGERED)) return false; return true; } @@ -503,7 +503,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader { PrepareAuraScript(spell_dk_will_of_the_necropolis_AuraScript); - bool Validate(SpellEntry const *spellEntry) + bool Validate(SpellInfo const *spellEntry) { // can't use other spell than will of the necropolis due to spell_ranks dependency if (sSpellMgr->GetFirstSpellInChain(DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) @@ -520,7 +520,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } @@ -533,11 +533,11 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) { // min pct of hp is stored in effect 0 of talent spell - uint32 rank = sSpellMgr->GetSpellRank(GetSpellProto()->Id); - SpellEntry const* talentProto = sSpellStore.LookupEntry(sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank)); + uint32 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank)); int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage()); - int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(SpellMgr::CalculateSpellEffectAmount(talentProto, EFFECT_0, GetCaster()))); + int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(talentProto->Effects[EFFECT_0].CalcValue(GetCaster()))); // Damage that would take you below [effect0] health or taken while you are at [effect0] if (remainingHp < minHp) @@ -566,11 +566,11 @@ public: class spell_dk_improved_blood_presence_AuraScript : public AuraScript { PrepareAuraScript(spell_dk_improved_blood_presence_AuraScript) - bool Validate(SpellEntry const* /*entry*/) + bool Validate(SpellInfo const* /*entry*/) { - if (!sSpellStore.LookupEntry(DK_SPELL_BLOOD_PRESENCE)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_PRESENCE)) return false; - if (!sSpellStore.LookupEntry(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) return false; return true; } @@ -614,11 +614,11 @@ public: class spell_dk_improved_unholy_presence_AuraScript : public AuraScript { PrepareAuraScript(spell_dk_improved_unholy_presence_AuraScript) - bool Validate(SpellEntry const* /*entry*/) + bool Validate(SpellInfo const* /*entry*/) { - if (!sSpellStore.LookupEntry(DK_SPELL_UNHOLY_PRESENCE)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_UNHOLY_PRESENCE)) return false; - if (!sSpellStore.LookupEntry(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) return false; return true; } @@ -629,7 +629,7 @@ public: if (target->HasAura(DK_SPELL_UNHOLY_PRESENCE) && !target->HasAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) { // Not listed as any effect, only base points set in dbc - int32 basePoints0 = SpellMgr::CalculateSpellEffectAmount(aurEff->GetSpellProto(), 1); + int32 basePoints0 = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); target->CastCustomSpell(target, DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints0 , &basePoints0, &basePoints0, true, 0, aurEff); } } diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index c9d8b31e0b9..fec95a2294d 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -40,11 +40,11 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader { PrepareSpellScript(spell_dru_glyph_of_starfire_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(DRUID_INCREASED_MOONFIRE_DURATION)) + if (!sSpellMgr->GetSpellInfo(DRUID_INCREASED_MOONFIRE_DURATION)) return false; - if (!sSpellStore.LookupEntry(DRUID_NATURES_SPLENDOR)) + if (!sSpellMgr->GetSpellInfo(DRUID_NATURES_SPLENDOR)) return false; return true; } @@ -58,7 +58,7 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader Aura* aura = aurEff->GetBase(); uint32 countMin = aura->GetMaxDuration(); - uint32 countMax = GetSpellMaxDuration(aura->GetSpellProto()) + 9000; + uint32 countMax = aura->GetSpellInfo()->GetMaxDuration() + 9000; if (caster->HasAura(DRUID_INCREASED_MOONFIRE_DURATION)) countMax += 3000; if (caster->HasAura(DRUID_NATURES_SPLENDOR)) @@ -98,7 +98,7 @@ class spell_dru_moonkin_form_passive : public SpellScriptLoader bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } @@ -142,7 +142,7 @@ class spell_dru_primal_tenacity : public SpellScriptLoader bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()); return true; } @@ -186,7 +186,7 @@ class spell_dru_savage_defense : public SpellScriptLoader bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 5d8584e3cd1..5c41744b664 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -40,7 +40,7 @@ class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader bool Load() { // Max absorb stored in 1 dummy effect - limit = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1); + limit = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); return true; } @@ -177,11 +177,11 @@ class spell_gen_parachute : public SpellScriptLoader { PrepareAuraScript(spell_gen_parachute_AuraScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_PARACHUTE)) + if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE)) return false; - if (!sSpellStore.LookupEntry(SPELL_PARACHUTE_BUFF)) + if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF)) return false; return true; } @@ -320,11 +320,11 @@ class spell_gen_leeching_swarm : public SpellScriptLoader { PrepareAuraScript(spell_gen_leeching_swarm_AuraScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_DMG)) + if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_DMG)) return false; - if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_HEAL)) + if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_HEAL)) return false; return true; } @@ -378,27 +378,27 @@ class spell_gen_trick : public SpellScriptLoader class spell_gen_trick_SpellScript : public SpellScript { PrepareSpellScript(spell_gen_trick_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_PIRATE_COSTUME_MALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_PIRATE_COSTUME_FEMALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_NINJA_COSTUME_MALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_NINJA_COSTUME_FEMALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_LEPER_GNOME_COSTUME_MALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_LEPER_GNOME_COSTUME_FEMALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_SKELETON_COSTUME)) + if (!sSpellMgr->GetSpellInfo(SPELL_SKELETON_COSTUME)) return false; - if (!sSpellStore.LookupEntry(SPELL_GHOST_COSTUME_MALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_GHOST_COSTUME_FEMALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_TRICK_BUFF)) + if (!sSpellMgr->GetSpellInfo(SPELL_TRICK_BUFF)) return false; return true; } @@ -463,13 +463,13 @@ class spell_gen_trick_or_treat : public SpellScriptLoader { PrepareSpellScript(spell_gen_trick_or_treat_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_TRICK)) + if (!sSpellMgr->GetSpellInfo(SPELL_TRICK)) return false; - if (!sSpellStore.LookupEntry(SPELL_TREAT)) + if (!sSpellMgr->GetSpellInfo(SPELL_TREAT)) return false; - if (!sSpellStore.LookupEntry(SPELL_TRICKED_OR_TREATED)) + if (!sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED)) return false; return true; } @@ -538,11 +538,11 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader { PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) + if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) return false; - if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF)) + if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF)) return false; return true; } @@ -552,9 +552,9 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader Player* caster = GetCaster()->ToPlayer(); if (!caster) return; - SpellEntry const* spellInfo = GetSpellInfo(); + SpellInfo const* spellInfo = GetSpellInfo(); - caster->AddSpellCooldown(spellInfo->Id, 0, time(NULL) + GetSpellRecoveryTime(sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) / IN_MILLISECONDS); + caster->AddSpellCooldown(spellInfo->Id, 0, time(NULL) + sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)->GetRecoveryTime() / IN_MILLISECONDS); WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4); data << uint64(caster->GetGUID()); data << uint8(0); @@ -590,9 +590,9 @@ class spell_gen_animal_blood : public SpellScriptLoader { PrepareAuraScript(spell_gen_animal_blood_AuraScript); - bool Validate(SpellEntry const* /*spell*/) + bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellStore.LookupEntry(SPELL_SPAWN_BLOOD_POOL)) + if (!sSpellMgr->GetSpellInfo(SPELL_SPAWN_BLOOD_POOL)) return false; return true; } @@ -638,9 +638,9 @@ class spell_gen_divine_storm_cd_reset : public SpellScriptLoader { PrepareSpellScript(spell_gen_divine_storm_cd_reset_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_DIVINE_STORM)) + if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM)) return false; return true; } @@ -819,7 +819,7 @@ class spell_generic_clone : public SpellScriptLoader { PreventHitDefaultEffect(effIndex); Unit* caster = GetCaster(); - uint32 spellId = uint32(SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), effIndex)); + uint32 spellId = uint32(GetSpellInfo()->Effects[effIndex].CalcValue()); if (Unit* target = GetHitUnit()) target->CastSpell(caster, spellId, true); @@ -858,19 +858,19 @@ class spell_generic_clone_weapon : public SpellScriptLoader class spell_generic_clone_weapon_SpellScript : public SpellScript { PrepareSpellScript(spell_generic_clone_weapon_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_COPY_WEAPON)) + if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON)) return false; - if (!sSpellStore.LookupEntry(SPELL_COPY_WEAPON_2)) + if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2)) return false; - if (!sSpellStore.LookupEntry(SPELL_COPY_WEAPON_3)) + if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3)) return false; - if (!sSpellStore.LookupEntry(SPELL_COPY_OFFHAND)) + if (!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND)) return false; - if (!sSpellStore.LookupEntry(SPELL_COPY_OFFHAND_2)) + if (!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2)) return false; - if (!sSpellStore.LookupEntry(SPELL_COPY_RANGED)) + if (!sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED)) return false; return true; } @@ -884,7 +884,7 @@ class spell_generic_clone_weapon : public SpellScriptLoader if (!target) return; - uint32 spellId = uint32(SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), EFFECT_0)); + uint32 spellId = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue()); target->CastSpell(caster, spellId, true); if (target->GetTypeId() == TYPEID_PLAYER) @@ -959,9 +959,9 @@ class spell_gen_seaforium_blast : public SpellScriptLoader { PrepareSpellScript(spell_gen_seaforium_blast_SpellScript); - bool Validate(SpellEntry const* /*spell*/) + bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellStore.LookupEntry(SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT)) + if (!sSpellMgr->GetSpellInfo(SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT)) return false; return true; } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 931d63d954b..afc1ee056d6 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -49,13 +49,13 @@ public: class spell_hun_chimera_shot_SpellScript : public SpellScript { PrepareSpellScript(spell_hun_chimera_shot_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(HUNTER_SPELL_CHIMERA_SHOT_SERPENT)) + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SERPENT)) return false; - if (!sSpellStore.LookupEntry(HUNTER_SPELL_CHIMERA_SHOT_VIPER)) + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_VIPER)) return false; - if (!sSpellStore.LookupEntry(HUNTER_SPELL_CHIMERA_SHOT_SCORPID)) + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SCORPID)) return false; return true; } @@ -77,7 +77,7 @@ public: continue; // Search only Serpent Sting, Viper Sting, Scorpid Sting auras - flag96 familyFlag = aura->GetSpellProto()->SpellFamilyFlags; + flag96 familyFlag = aura->GetSpellInfo()->SpellFamilyFlags; if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000)) continue; if (AuraEffect const* aurEff = aura->GetEffect(0)) @@ -87,7 +87,7 @@ public: { int32 TickCount = aurEff->GetTotalTicks(); spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT; - basePoint = caster->SpellDamageBonus(unitTarget, aura->GetSpellProto(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); + basePoint = caster->SpellDamageBonus(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); ApplyPctN(basePoint, TickCount * 40); } // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. @@ -145,9 +145,9 @@ public: class spell_hun_invigoration_SpellScript : public SpellScript { PrepareSpellScript(spell_hun_invigoration_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(HUNTER_SPELL_INVIGORATION_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_INVIGORATION_TRIGGERED)) return false; return true; } @@ -180,9 +180,9 @@ public: class spell_hun_last_stand_pet_SpellScript : public SpellScript { PrepareSpellScript(spell_hun_last_stand_pet_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(HUNTER_PET_SPELL_LAST_STAND_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_LAST_STAND_TRIGGERED)) return false; return true; } @@ -215,13 +215,13 @@ public: class spell_hun_masters_call_SpellScript : public SpellScript { PrepareSpellScript(spell_hun_masters_call_SpellScript) - bool Validate(SpellEntry const* spellEntry) + bool Validate(SpellInfo const* spellEntry) { - if (!sSpellStore.LookupEntry(HUNTER_SPELL_MASTERS_CALL_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_MASTERS_CALL_TRIGGERED)) return false; - if (!sSpellStore.LookupEntry(SpellMgr::CalculateSpellEffectAmount(spellEntry, EFFECT_0))) + if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_0].CalcValue())) return false; - if (!sSpellStore.LookupEntry(SpellMgr::CalculateSpellEffectAmount(spellEntry, EFFECT_1))) + if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_1].CalcValue())) return false; return true; } @@ -238,7 +238,7 @@ public: if (Unit* ally = GetTargetUnit()) { target->CastSpell(ally, GetEffectValue(), true); - target->CastSpell(ally, SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), EFFECT_0), true); + target->CastSpell(ally, GetSpellInfo()->Effects[EFFECT_0].CalcValue(), true); } } } @@ -273,14 +273,14 @@ public: const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { - SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first); + SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(itr->first); ///! If spellId in cooldown map isn't valid, the above will return a null pointer. if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && spellInfo->Id != HUNTER_SPELL_READINESS && spellInfo->Id != HUNTER_SPELL_BESTIAL_WRATH && - GetSpellRecoveryTime(spellInfo) > 0) + spellInfo->GetRecoveryTime() > 0) caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true); else ++itr; @@ -348,11 +348,11 @@ public: class spell_hun_sniper_training_AuraScript : public AuraScript { PrepareAuraScript(spell_hun_sniper_training_AuraScript) - bool Validate(SpellEntry const* /*entry*/) + bool Validate(SpellInfo const* /*entry*/) { - if (!sSpellStore.LookupEntry(SPELL_SNIPER_TRAINING_R1)) + if (!sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_R1)) return false; - if (!sSpellStore.LookupEntry(SPELL_SNIPER_TRAINING_BUFF_R1)) + if (!sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_BUFF_R1)) return false; return true; } @@ -372,8 +372,8 @@ public: Unit* target = GetTarget(); if (!target->HasAura(spellId)) { - SpellEntry const* triggeredSpellInfo = sSpellStore.LookupEntry(spellId); - Unit* triggerCaster = GetTriggeredSpellCaster(triggeredSpellInfo, caster, target); + SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(spellId); + Unit* triggerCaster = triggeredSpellInfo->IsRequiringSelectedTarget() ? caster : target; triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff); } } @@ -385,7 +385,7 @@ public: { int32 baseAmount = aurEff->GetBaseAmount(); int32 amount = playerTarget->isMoving() ? - target->CalculateSpellDamage(target, GetSpellProto(), aurEff->GetEffIndex(), &baseAmount) : + target->CalculateSpellDamage(target, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount) : aurEff->GetAmount() - 1; aurEff->SetAmount(amount); } @@ -412,11 +412,11 @@ public: class spell_hun_pet_heart_of_the_phoenix_SpellScript : public SpellScript { PrepareSpellScript(spell_hun_pet_heart_of_the_phoenix_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED)) return false; - if (!sSpellStore.LookupEntry(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) + if (!sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) return false; return true; } @@ -459,9 +459,9 @@ public: class spell_hun_pet_carrion_feeder_SpellScript : public SpellScript { PrepareSpellScript(spell_hun_pet_carrion_feeder_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED)) return false; return true; } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index acf92d3a984..4d2cd15199b 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -42,9 +42,9 @@ public: public: spell_item_trigger_spell_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { } - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(_triggeredSpellId)) + if (!sSpellMgr->GetSpellInfo(_triggeredSpellId)) return false; return true; } @@ -87,10 +87,10 @@ public: { PrepareSpellScript(spell_item_deviate_fish_SpellScript) public: - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { for (uint32 spellId = SPELL_SLEEPY; spellId <= SPELL_HEALTHY_SPIRIT; ++spellId) - if (!sSpellStore.LookupEntry(spellId)) + if (!sSpellMgr->GetSpellInfo(spellId)) return false; return true; } @@ -135,13 +135,13 @@ public: { public: PrepareSpellScript(spell_item_flask_of_the_north_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_FLASK_OF_THE_NORTH_SP)) + if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_SP)) return false; - if (!sSpellStore.LookupEntry(SPELL_FLASK_OF_THE_NORTH_AP)) + if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_AP)) return false; - if (!sSpellStore.LookupEntry(SPELL_FLASK_OF_THE_NORTH_STR)) + if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_STR)) return false; return true; } @@ -211,11 +211,11 @@ public: { public: PrepareSpellScript(spell_item_gnomish_death_ray_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_GNOMISH_DEATH_RAY_SELF)) + if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_SELF)) return false; - if (!sSpellStore.LookupEntry(SPELL_GNOMISH_DEATH_RAY_TARGET)) + if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_TARGET)) return false; return true; } @@ -264,17 +264,17 @@ public: { public: PrepareSpellScript(spell_item_make_a_wish_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_MR_PINCHYS_BLESSING)) + if (!sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_BLESSING)) return false; - if (!sSpellStore.LookupEntry(SPELL_SUMMON_MIGHTY_MR_PINCHY)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_MIGHTY_MR_PINCHY)) return false; - if (!sSpellStore.LookupEntry(SPELL_SUMMON_FURIOUS_MR_PINCHY)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FURIOUS_MR_PINCHY)) return false; - if (!sSpellStore.LookupEntry(SPELL_TINY_MAGICAL_CRAWDAD)) + if (!sSpellMgr->GetSpellInfo(SPELL_TINY_MAGICAL_CRAWDAD)) return false; - if (!sSpellStore.LookupEntry(SPELL_MR_PINCHYS_GIFT)) + if (!sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_GIFT)) return false; return true; } @@ -381,13 +381,13 @@ public: { public: PrepareSpellScript(spell_item_net_o_matic_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_NET_O_MATIC_TRIGGERED1)) + if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED1)) return false; - if (!sSpellStore.LookupEntry(SPELL_NET_O_MATIC_TRIGGERED2)) + if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED2)) return false; - if (!sSpellStore.LookupEntry(SPELL_NET_O_MATIC_TRIGGERED3)) + if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED3)) return false; return true; } @@ -437,13 +437,13 @@ public: { public: PrepareSpellScript(spell_item_noggenfogger_elixir_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1)) + if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1)) return false; - if (!sSpellStore.LookupEntry(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2)) + if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2)) return false; - if (!sSpellStore.LookupEntry(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3)) + if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3)) return false; return true; } @@ -495,10 +495,10 @@ public: { public: PrepareSpellScript(spell_item_savory_deviate_delight_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { for (uint32 spellId = SPELL_FLIP_OUT_MALE; spellId <= SPELL_YAAARRRR_FEMALE; ++spellId) - if (!sSpellStore.LookupEntry(spellId)) + if (!sSpellMgr->GetSpellInfo(spellId)) return false; return true; } @@ -553,19 +553,19 @@ public: { public: PrepareSpellScript(spell_item_six_demon_bag_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_FROSTBOLT)) + if (!sSpellMgr->GetSpellInfo(SPELL_FROSTBOLT)) return false; - if (!sSpellStore.LookupEntry(SPELL_POLYMORPH)) + if (!sSpellMgr->GetSpellInfo(SPELL_POLYMORPH)) return false; - if (!sSpellStore.LookupEntry(SPELL_SUMMON_FELHOUND_MINION)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FELHOUND_MINION)) return false; - if (!sSpellStore.LookupEntry(SPELL_FIREBALL)) + if (!sSpellMgr->GetSpellInfo(SPELL_FIREBALL)) return false; - if (!sSpellStore.LookupEntry(SPELL_CHAIN_LIGHTNING)) + if (!sSpellMgr->GetSpellInfo(SPELL_CHAIN_LIGHTNING)) return false; - if (!sSpellStore.LookupEntry(SPELL_ENVELOPING_WINDS)) + if (!sSpellMgr->GetSpellInfo(SPELL_ENVELOPING_WINDS)) return false; return true; } @@ -632,13 +632,13 @@ public: { public: PrepareSpellScript(spell_item_underbelly_elixir_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_UNDERBELLY_ELIXIR_TRIGGERED1)) + if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED1)) return false; - if (!sSpellStore.LookupEntry(SPELL_UNDERBELLY_ELIXIR_TRIGGERED2)) + if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED2)) return false; - if (!sSpellStore.LookupEntry(SPELL_UNDERBELLY_ELIXIR_TRIGGERED3)) + if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED3)) return false; return true; } @@ -688,13 +688,13 @@ public: PrepareAuraScript(spell_item_shadowmourne_AuraScript) spell_item_shadowmourne_AuraScript() : AuraScript() { } - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_SHADOWMOURNE_VISUAL_LOW)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_LOW)) return false; - if (!sSpellStore.LookupEntry(SPELL_SHADOWMOURNE_VISUAL_HIGH)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_HIGH)) return false; - if (!sSpellStore.LookupEntry(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF)) return false; return true; } @@ -755,13 +755,13 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader { PrepareSpellScript(spell_item_red_rider_air_rifle_SpellScript); - bool Validate(SpellEntry const* /*spell*/) + bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellStore.LookupEntry(SPELL_AIR_RIFLE_HOLD_VISUAL)) + if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_HOLD_VISUAL)) return false; - if (!sSpellStore.LookupEntry(SPELL_AIR_RIFLE_SHOOT)) + if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT)) return false; - if (!sSpellStore.LookupEntry(SPELL_AIR_RIFLE_SHOOT_SELF)) + if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT_SELF)) return false; return true; } @@ -976,13 +976,13 @@ class spell_item_vanquished_clutches : public SpellScriptLoader { PrepareSpellScript(spell_item_vanquished_clutches_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_CRUSHER)) + if (!sSpellMgr->GetSpellInfo(SPELL_CRUSHER)) return false; - if (!sSpellStore.LookupEntry(SPELL_CONSTRICTOR)) + if (!sSpellMgr->GetSpellInfo(SPELL_CONSTRICTOR)) return false; - if (!sSpellStore.LookupEntry(SPELL_CORRUPTOR)) + if (!sSpellMgr->GetSpellInfo(SPELL_CORRUPTOR)) return false; return true; } @@ -1032,9 +1032,9 @@ class spell_item_ashbringer : public SpellScriptLoader class spell_item_ashbringer_SpellScript : public SpellScript { PrepareSpellScript(spell_item_ashbringer_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_ASHBRINGER)) + if (!sSpellMgr->GetSpellInfo(SPELL_ASHBRINGER)) return false; return true; } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 32dca054d43..d271bf36887 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -46,9 +46,9 @@ class spell_mage_blast_wave : public SpellScriptLoader class spell_mage_blast_wave_SpellScript : public SpellScript { PrepareSpellScript(spell_mage_blast_wave_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_MAGE_GLYPH_OF_BLAST_WAVE)) + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_BLAST_WAVE)) return false; return true; } @@ -90,11 +90,11 @@ class spell_mage_cold_snap : public SpellScriptLoader const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { - SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first); + SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(itr->first); if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && - (GetSpellSchoolMask(spellInfo) & SPELL_SCHOOL_MASK_FROST) && - spellInfo->Id != SPELL_MAGE_COLD_SNAP && GetSpellRecoveryTime(spellInfo) > 0) + (spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && + spellInfo->Id != SPELL_MAGE_COLD_SNAP && spellInfo->GetRecoveryTime() > 0) { caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true); } @@ -126,11 +126,11 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript) static const uint32 spell_list[6]; - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { // check if spell ids exist in dbc for (int i = 0; i < 6; i++) - if (!sSpellStore.LookupEntry(spell_list[i])) + if (!sSpellMgr->GetSpellInfo(spell_list[i])) return false; return true; } @@ -173,13 +173,13 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader class spell_mage_summon_water_elemental_SpellScript : public SpellScript { PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER)) + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER)) return false; - if (!sSpellStore.LookupEntry(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY)) + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY)) return false; - if (!sSpellStore.LookupEntry(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)) + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)) return false; return true; } @@ -225,10 +225,10 @@ public: SPELL_MAGE_FROST_WARDING_R1 = 28332, }; - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellStore.LookupEntry(SPELL_MAGE_FROST_WARDING_TRIGGERED) - && sSpellStore.LookupEntry(SPELL_MAGE_FROST_WARDING_R1); + return sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) + && sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1); } void Absorb(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) @@ -236,7 +236,7 @@ public: Unit* target = GetTarget(); if (AuraEffect * talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0)) { - int32 chance = SpellMgr::CalculateSpellEffectAmount(talentAurEff->GetSpellProto(), EFFECT_1); + int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); if (roll_chance_i(chance)) { @@ -268,10 +268,10 @@ public: SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394, }; - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellStore.LookupEntry(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED) - && sSpellStore.LookupEntry(SPELL_MAGE_INCANTERS_ABSORBTION_R1); + return sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED) + && sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1); } void Trigger(AuraEffect * aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 5beb421c88b..9269dade108 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -58,8 +58,8 @@ public: bool Load() { - healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1); - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0); + healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); return GetUnitOwner()->ToPlayer(); } @@ -123,15 +123,15 @@ public: class spell_pal_blessing_of_faith_SpellScript : public SpellScript { PrepareSpellScript(spell_pal_blessing_of_faith_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_DRUID)) + if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_DRUID)) return false; - if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PALADIN)) + if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PALADIN)) return false; - if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PRIEST)) + if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PRIEST)) return false; - if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN)) + if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN)) return false; return true; } @@ -177,9 +177,9 @@ public: class spell_pal_blessing_of_sanctuary_AuraScript : public AuraScript { PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript) - bool Validate(SpellEntry const* /*entry*/) + bool Validate(SpellInfo const* /*entry*/) { - if (!sSpellStore.LookupEntry(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF)) + if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF)) return false; return true; } @@ -219,9 +219,9 @@ public: class spell_pal_guarded_by_the_light_SpellScript : public SpellScript { PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(PALADIN_SPELL_DIVINE_PLEA)) + if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_DIVINE_PLEA)) return false; return true; } @@ -253,9 +253,9 @@ public: class spell_pal_holy_shock_SpellScript : public SpellScript { PrepareSpellScript(spell_pal_holy_shock_SpellScript) - bool Validate(SpellEntry const *spellEntry) + bool Validate(SpellInfo const *spellEntry) { - if (!sSpellStore.LookupEntry(PALADIN_SPELL_HOLY_SHOCK_R1)) + if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1)) return false; // can't use other spell than holy shock due to spell_ranks dependency @@ -310,7 +310,7 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { if (Unit* unitTarget = GetHitUnit()) - if (SpellEntry const* spell_proto = sSpellStore.LookupEntry(GetEffectValue())) + if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue())) GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 2d35ed41bf0..c07e6dfbf7f 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -46,14 +46,14 @@ class spell_pri_guardian_spirit : public SpellScriptLoader uint32 healPct; - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellStore.LookupEntry(PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL) != NULL; + return sSpellMgr->GetSpellInfo(PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL) != NULL; } bool Load() { - healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1); + healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); return true; } @@ -184,9 +184,9 @@ class spell_pri_penance : public SpellScriptLoader { PrepareSpellScript(spell_pri_penance_SpellScript); - bool Validate(SpellEntry const* spellEntry) + bool Validate(SpellInfo const* spellEntry) { - if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R1)) + if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_PENANCE_R1)) return false; // can't use other spell than this penance due to spell_ranks dependency if (sSpellMgr->GetFirstSpellInChain(PRIEST_SPELL_PENANCE_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) @@ -240,9 +240,9 @@ class spell_pri_reflective_shield_trigger : public SpellScriptLoader { PrepareAuraScript(spell_pri_reflective_shield_trigger_AuraScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellStore.LookupEntry(PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED) && sSpellStore.LookupEntry(PRIEST_SPELL_REFLECTIVE_SHIELD_R1); + return sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED) && sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_R1); } void Trigger(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index c760220b5e5..c7a174ff3d5 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -94,11 +94,11 @@ public: class spell_q5206_test_fetid_skull_SpellScript : public SpellScript { PrepareSpellScript(spell_q5206_test_fetid_skull_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_CREATE_RESONATING_SKULL)) + if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_RESONATING_SKULL)) return false; - if (!sSpellStore.LookupEntry(SPELL_CREATE_BONE_DUST)) + if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_BONE_DUST)) return false; return true; } @@ -254,11 +254,11 @@ public: class spell_q11396_11399_scourging_crystal_controller_SpellScript : public SpellScript { PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) + if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) return false; - if (!sSpellStore.LookupEntry(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) + if (!sSpellMgr->GetSpellInfo(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) return false; return true; } @@ -293,9 +293,9 @@ public: class spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript : public SpellScript { PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) + if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) return false; return true; } @@ -355,13 +355,13 @@ public: class spell_q11587_arcane_prisoner_rescue_SpellScript : public SpellScript { PrepareSpellScript(spell_q11587_arcane_prisoner_rescue_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_SUMMON_ARCANE_PRISONER_MALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_MALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_SUMMON_ARCANE_PRISONER_FEMALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_FEMALE)) return false; - if (!sSpellStore.LookupEntry(SPELL_ARCANE_PRISONER_KILL_CREDIT)) + if (!sSpellMgr->GetSpellInfo(SPELL_ARCANE_PRISONER_KILL_CREDIT)) return false; return true; } @@ -416,19 +416,19 @@ public: class spell_q11730_ultrasonic_screwdriver_SpellScript : public SpellScript { PrepareSpellScript(spell_q11730_ultrasonic_screwdriver_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_SUMMON_SCAVENGEBOT_004A8)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_004A8)) return false; - if (!sSpellStore.LookupEntry(SPELL_SUMMON_SENTRYBOT_57K)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SENTRYBOT_57K)) return false; - if (!sSpellStore.LookupEntry(SPELL_SUMMON_DEFENDOTANK_66D)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_DEFENDOTANK_66D)) return false; - if (!sSpellStore.LookupEntry(SPELL_SUMMON_SCAVENGEBOT_005B6)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_005B6)) return false; - if (!sSpellStore.LookupEntry(SPELL_SUMMON_55D_COLLECTATRON)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_55D_COLLECTATRON)) return false; - if (!sSpellStore.LookupEntry(SPELL_ROBOT_KILL_CREDIT)) + if (!sSpellMgr->GetSpellInfo(SPELL_ROBOT_KILL_CREDIT)) return false; return true; } @@ -545,15 +545,15 @@ public: { public: PrepareSpellScript(spell_q12634_despawn_fruit_tosser_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_BANANAS_FALL_TO_GROUND)) + if (!sSpellMgr->GetSpellInfo(SPELL_BANANAS_FALL_TO_GROUND)) return false; - if (!sSpellStore.LookupEntry(SPELL_ORANGE_FALLS_TO_GROUND)) + if (!sSpellMgr->GetSpellInfo(SPELL_ORANGE_FALLS_TO_GROUND)) return false; - if (!sSpellStore.LookupEntry(SPELL_PAPAYA_FALLS_TO_GROUND)) + if (!sSpellMgr->GetSpellInfo(SPELL_PAPAYA_FALLS_TO_GROUND)) return false; - if (!sSpellStore.LookupEntry(SPELL_SUMMON_ADVENTUROUS_DWARF)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ADVENTUROUS_DWARF)) return false; return true; } @@ -597,12 +597,12 @@ public: PrepareSpellScript(spell_q12683_take_sputum_sample_SpellScript) void HandleDummy(SpellEffIndex /*effIndex*/) { - uint32 reqAuraId = SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), 1); + uint32 reqAuraId = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); Unit* pCaster = GetCaster(); if (pCaster->HasAuraEffect(reqAuraId, 0)) { - uint32 spellId = SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), 0); + uint32 spellId = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); pCaster->CastSpell(pCaster, spellId, true, NULL); } } @@ -694,9 +694,9 @@ public: { public: PrepareSpellScript(spell_q12937_relief_for_the_fallen_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_TRIGGER_AID_OF_THE_EARTHEN)) + if (!sSpellMgr->GetSpellInfo(SPELL_TRIGGER_AID_OF_THE_EARTHEN)) return false; return true; } @@ -745,9 +745,9 @@ class spell_q10041_q10040_who_are_they : public SpellScriptLoader { PrepareSpellScript(spell_q10041_q10040_who_are_they_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SPELL_QUESTGIVER)) + if (!sSpellMgr->GetSpellInfo(SPELL_QUESTGIVER)) return false; return true; } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index e82e7fc79fd..1915697e018 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -48,14 +48,14 @@ public: ROG_SPELL_CHEAT_DEATH_COOLDOWN = 31231, }; - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellStore.LookupEntry(ROG_SPELL_CHEAT_DEATH_COOLDOWN); + return sSpellMgr->GetSpellInfo(ROG_SPELL_CHEAT_DEATH_COOLDOWN); } bool Load() { - absorbChance = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0); + absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); return GetUnitOwner()->ToPlayer(); } @@ -115,7 +115,7 @@ public: bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } @@ -153,9 +153,9 @@ class spell_rog_preparation : public SpellScriptLoader class spell_rog_preparation_SpellScript : public SpellScript { PrepareSpellScript(spell_rog_preparation_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(ROGUE_SPELL_GLYPH_OF_PREPARATION)) + if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_GLYPH_OF_PREPARATION)) return false; return true; } @@ -170,7 +170,7 @@ class spell_rog_preparation : public SpellScriptLoader const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { - SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first); + SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(itr->first); if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE) { @@ -217,9 +217,9 @@ public: class spell_rog_prey_on_the_weak_AuraScript : public AuraScript { PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(ROGUE_SPELL_PREY_ON_THE_WEAK)) + if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_PREY_ON_THE_WEAK)) return false; return true; } @@ -232,7 +232,7 @@ public: { if (!target->HasAura(ROGUE_SPELL_PREY_ON_THE_WEAK)) { - int32 bp = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), 0); + int32 bp = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); target->CastCustomSpell(target, ROGUE_SPELL_PREY_ON_THE_WEAK, &bp, 0, 0, true); } } @@ -260,9 +260,9 @@ class spell_rog_shiv : public SpellScriptLoader class spell_rog_shiv_SpellScript : public SpellScript { PrepareSpellScript(spell_rog_shiv_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(ROGUE_SPELL_SHIV_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_SHIV_TRIGGERED)) return false; return true; } @@ -348,7 +348,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellEntry const* spellInfo = sSpellStore.LookupEntry(enchant->spellid[s]); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]); if (!spellInfo) { sLog->outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", enchant->ID, enchant->spellid[s]); @@ -363,7 +363,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0)) continue; - if (IsPositiveSpell(enchant->spellid[s])) + if (spellInfo->IsPositive()) player->CastSpell(player, enchant->spellid[s], true, item); else player->CastSpell(target, enchant->spellid[s], true, item); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 8f81bb88fb2..7ffec9f7051 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -50,7 +50,7 @@ public: bool Load() { - absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster()); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } @@ -89,9 +89,9 @@ public: class spell_sha_fire_nova_SpellScript : public SpellScript { PrepareSpellScript(spell_sha_fire_nova_SpellScript) - bool Validate(SpellEntry const* spellEntry) + bool Validate(SpellInfo const* spellEntry) { - if (!sSpellStore.LookupEntry(SHAMAN_SPELL_FIRE_NOVA_R1)) + if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1)) return false; if (sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) return false; @@ -148,11 +148,11 @@ public: class spell_sha_mana_tide_totem_SpellScript : public SpellScript { PrepareSpellScript(spell_sha_mana_tide_totem_SpellScript) - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE)) + if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE)) return false; - if (!sSpellStore.LookupEntry(SHAMAN_SPELL_MANA_TIDE_TOTEM)) + if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM)) return false; return true; } @@ -198,11 +198,11 @@ public: { PrepareAuraScript(spell_sha_earthbind_totem_AuraScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM)) + if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM)) return false; - if (!sSpellStore.LookupEntry(SHAMAN_TOTEM_SPELL_EARTHEN_POWER)) + if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER)) return false; return true; } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index a7b99aed6b5..2ce34be1a70 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -46,17 +46,17 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader { PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS)) return false; - if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER)) return false; - if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD)) return false; - if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER)) return false; - if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_IMP)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_IMP)) return false; return true; } @@ -75,7 +75,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader break; case CREATURE_FAMILY_VOIDWALKER: { - SpellEntry const* spellInfo = sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER); int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0))); targetCreature->CastCustomSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true); //unitTarget->CastSpell(unitTarget, 54441, true); @@ -119,11 +119,11 @@ class spell_warl_create_healthstone : public SpellScriptLoader static uint32 const iTypes[8][3]; - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(WARLOCK_IMPROVED_HEALTHSTONE_R1)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R1)) return false; - if (!sSpellStore.LookupEntry(WARLOCK_IMPROVED_HEALTHSTONE_R2)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R2)) return false; return true; } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 3574c5c03fc..1019456aab3 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -37,9 +37,9 @@ class spell_warr_last_stand : public SpellScriptLoader { PrepareSpellScript(spell_warr_last_stand_SpellScript); - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellStore.LookupEntry(WARRIOR_SPELL_LAST_STAND_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(WARRIOR_SPELL_LAST_STAND_TRIGGERED)) return false; return true; } |
