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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user