aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2011-07-26 23:09:28 +0200
committerQAston <qaston@gmail.com>2011-07-26 23:09:28 +0200
commitb0fe236265465a0f39aa98a8cee2916d1ccfaa02 (patch)
tree77ed4bde46de983c280a542d657a30b24865638c /src/server/scripts/World
parent29c228a80170e4264129d4e3bed4d2fc41aca5a7 (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/World')
-rw-r--r--src/server/scripts/World/boss_emerald_dragons.cpp6
-rw-r--r--src/server/scripts/World/guards.cpp8
-rw-r--r--src/server/scripts/World/item_scripts.cpp4
-rw-r--r--src/server/scripts/World/mob_generic_creature.cpp10
-rw-r--r--src/server/scripts/World/npc_professions.cpp4
-rw-r--r--src/server/scripts/World/npcs_special.cpp6
6 files changed, 19 insertions, 19 deletions
diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp
index ac101d239b5..26f3e238193 100644
--- a/src/server/scripts/World/boss_emerald_dragons.cpp
+++ b/src/server/scripts/World/boss_emerald_dragons.cpp
@@ -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;
}
diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp
index 52b7b233f88..6c71f3c2167 100644
--- a/src/server/scripts/World/guards.cpp
+++ b/src/server/scripts/World/guards.cpp
@@ -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))
diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp
index 10b0f14e632..f8095ba9c1e 100644
--- a/src/server/scripts/World/item_scripts.cpp
+++ b/src/server/scripts/World/item_scripts.cpp
@@ -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;
diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp
index f8616c3fa5e..5cb707bb2a4 100644
--- a/src/server/scripts/World/mob_generic_creature.cpp
+++ b/src/server/scripts/World/mob_generic_creature.cpp
@@ -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)
{
diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp
index 60a67250efb..66fdf0a3fbe 100644
--- a/src/server/scripts/World/npc_professions.cpp
+++ b/src/server/scripts/World/npc_professions.cpp
@@ -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;
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 6cbdf4f90a3..22ce27d98cd 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -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;