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:
@@ -281,11 +281,11 @@ class spell_mark_of_nature : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_mark_of_nature_SpellScript);
|
||||
|
||||
bool Validate(SpellEntry const* /*spellInfo*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_MARK_OF_NATURE))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_NATURE))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_AURA_OF_NATURE))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_AURA_OF_NATURE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
{
|
||||
if (me->GetEntry() == NPC_CENARION_HOLD_INFANTRY)
|
||||
DoScriptText(RAND(SAY_GUARD_SIL_AGGRO1, SAY_GUARD_SIL_AGGRO2, SAY_GUARD_SIL_AGGRO3), me, who);
|
||||
if (SpellEntry const* spell = me->reachWithSpellAttack(who))
|
||||
if (SpellInfo const* spell = me->reachWithSpellAttack(who))
|
||||
DoCast(who, spell->Id);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
if (buffTimer <= diff)
|
||||
{
|
||||
//Find a spell that targets friendly and applies an aura (these are generally buffs)
|
||||
SpellEntry const *info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
|
||||
SpellInfo const *info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
|
||||
|
||||
if (info && !globalCooldown)
|
||||
{
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
if (me->IsWithinMeleeRange(me->getVictim()))
|
||||
{
|
||||
bool healing = false;
|
||||
SpellEntry const *info = NULL;
|
||||
SpellInfo const *info = NULL;
|
||||
|
||||
//Select a healing spell if less than 30% hp
|
||||
if (me->HealthBelowPct(30))
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
bool healing = false;
|
||||
SpellEntry const *info = NULL;
|
||||
SpellInfo const *info = NULL;
|
||||
|
||||
//Select a healing spell if less than 30% hp ONLY 33% of the time
|
||||
if (me->HealthBelowPct(30) && 33 > urand(0, 99))
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
disabled = true;
|
||||
break;
|
||||
case 34475:
|
||||
if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_ARCANE_CHARGES))
|
||||
if (const SpellInfo* pSpellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES))
|
||||
Spell::SendCastResult(player, pSpellInfo, 1, SPELL_FAILED_NOT_ON_GROUND);
|
||||
break;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ public:
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
|
||||
|
||||
if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_PETROV_BOMB))
|
||||
if (const SpellInfo* pSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
|
||||
Spell::SendCastResult(player, pSpellInfo, 1, SPELL_FAILED_NOT_HERE);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
if (BuffTimer <= diff)
|
||||
{
|
||||
//Find a spell that targets friendly and applies an aura (these are generally buffs)
|
||||
SpellEntry const *info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
|
||||
SpellInfo const *info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
|
||||
|
||||
if (info && !GlobalCooldown)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
bool Healing = false;
|
||||
SpellEntry const *info = NULL;
|
||||
SpellInfo const *info = NULL;
|
||||
|
||||
//Select a healing spell if less than 30% hp
|
||||
if (HealthBelowPct(30))
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
bool Healing = false;
|
||||
SpellEntry const *info = NULL;
|
||||
SpellInfo const *info = NULL;
|
||||
|
||||
//Select a healing spell if less than 30% hp ONLY 33% of the time
|
||||
if (HealthBelowPct(30) && rand() % 3 == 0)
|
||||
@@ -176,13 +176,13 @@ public:
|
||||
{
|
||||
trigger_periodicAI(Creature* c) : NullCreatureAI(c)
|
||||
{
|
||||
spell = me->m_spells[0] ? GetSpellStore()->LookupEntry(me->m_spells[0]) : NULL;
|
||||
spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0]) : NULL;
|
||||
interval = me->GetAttackTime(BASE_ATTACK);
|
||||
timer = interval;
|
||||
}
|
||||
|
||||
uint32 timer, interval;
|
||||
const SpellEntry * spell;
|
||||
const SpellInfo * spell;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
@@ -217,14 +217,14 @@ int32 DoLowUnlearnCost(Player* player) //blacksmith
|
||||
|
||||
bool EquippedOk(Player* player, uint32 spellId)
|
||||
{
|
||||
SpellEntry const* spell = GetSpellStore()->LookupEntry(spellId);
|
||||
SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId);
|
||||
|
||||
if (!spell)
|
||||
return false;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
uint32 reqSpell = spell->EffectTriggerSpell[i];
|
||||
uint32 reqSpell = spell->Effects[i].TriggerSpell;
|
||||
if (!reqSpell)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -737,7 +737,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/){}
|
||||
|
||||
void SpellHit(Unit* caster, const SpellEntry *spell)
|
||||
void SpellHit(Unit* caster, const SpellInfo *spell)
|
||||
{
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && spell->Id == 20804)
|
||||
{
|
||||
@@ -924,7 +924,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void SpellHit(Unit* pCaster, const SpellEntry *Spell)
|
||||
void SpellHit(Unit* pCaster, const SpellInfo *Spell)
|
||||
{
|
||||
if (Spell->Id == SPELL_LESSER_HEAL_R2 || Spell->Id == SPELL_FORTITUDE_R1)
|
||||
{
|
||||
@@ -1925,7 +1925,7 @@ public:
|
||||
}
|
||||
|
||||
// Fly away when dismissed
|
||||
void SpellHit(Unit* source, const SpellEntry *spell)
|
||||
void SpellHit(Unit* source, const SpellInfo *spell)
|
||||
{
|
||||
if (spell->Id != 50515 || !me->isAlive())
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user