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:
QAston
2011-07-26 23:09:28 +02:00
parent 29c228a801
commit b0fe236265
195 changed files with 4630 additions and 6929 deletions
@@ -98,7 +98,7 @@ public:
void UpdateAI(const uint32 diff);
void SpellHit(Unit* /*source*/, const SpellEntry *spell)
void SpellHit(Unit* /*source*/, const SpellInfo *spell)
{
if (spell->Mechanic == MECHANIC_DISARM)
DoScriptText(SAY_DISARMED, me);
@@ -149,7 +149,7 @@ public:
CAST_CRE(pMalchezaar)->AI()->KilledUnit(who);
}
void SpellHit(Unit* /*who*/, const SpellEntry *spell)
void SpellHit(Unit* /*who*/, const SpellInfo *spell)
{
if (spell->Id == SPELL_INFERNAL_RELAY)
{
@@ -305,7 +305,7 @@ public:
void EnfeebleHealthEffect()
{
const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT);
const SpellInfo *info = sSpellMgr->GetSpellInfo(SPELL_ENFEEBLE_EFFECT);
if (!info)
return;
@@ -486,12 +486,12 @@ public:
DrinkInturrupted = true;
}
void SpellHit(Unit* /*pAttacker*/, const SpellEntry* Spell)
void SpellHit(Unit* /*pAttacker*/, const SpellInfo* Spell)
{
//We only care about interrupt effects and only if they are durring a spell currently being casted
if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST &&
Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST &&
Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false))
if ((Spell->Effects[0].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
Spell->Effects[1].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
Spell->Effects[2].Effect != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false))
return;
//Interrupt effect
@@ -340,7 +340,7 @@ public:
me->DespawnOrUnsummon();
}
void SpellHit(Unit* /*caster*/, const SpellEntry *Spell)
void SpellHit(Unit* /*caster*/, const SpellInfo *Spell)
{
if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10)))
{
@@ -1080,7 +1080,7 @@ public:
me->DespawnOrUnsummon();
}
void SpellHit(Unit* /*caster*/, const SpellEntry *Spell)
void SpellHit(Unit* /*caster*/, const SpellInfo *Spell)
{
if (Spell->Id == SPELL_DRINK_POISON)
{
@@ -138,14 +138,14 @@ public:
if (lList.isEmpty())
return;
SpellEntry const* pSpell = GetSpellStore()->LookupEntry(SPELL_ORB_KILL_CREDIT);
SpellInfo const* pSpell = sSpellMgr->GetSpellInfo(SPELL_ORB_KILL_CREDIT);
for (Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i)
{
if (Player* player = i->getSource())
{
if (pSpell && pSpell->EffectMiscValue[0])
player->KilledMonsterCredit(pSpell->EffectMiscValue[0], 0);
if (pSpell && pSpell->Effects[0].MiscValue)
player->KilledMonsterCredit(pSpell->Effects[0].MiscValue, 0);
}
}
}
@@ -436,7 +436,7 @@ public:
m_bIsDuelInProgress = false;
}
void SpellHit(Unit* pCaster, const SpellEntry* pSpell)
void SpellHit(Unit* pCaster, const SpellInfo* pSpell)
{
if (!m_bIsDuelInProgress && pSpell->Id == SPELL_DUEL)
{
@@ -625,7 +625,7 @@ public:
{
npc_salanar_the_horsemanAI(Creature* c) : ScriptedAI(c) {}
void SpellHit(Unit* caster, const SpellEntry *spell)
void SpellHit(Unit* caster, const SpellInfo *spell)
{
if (spell->Id == DELIVER_STOLEN_HORSE)
{
@@ -71,7 +71,7 @@ public:
me->RestoreFaction();
}
void SpellHit(Unit* caster, const SpellEntry *spell)
void SpellHit(Unit* caster, const SpellInfo *spell)
{
if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && !uiSpeech_counter)
{
@@ -143,13 +143,6 @@ public:
mob_wisp_invisAI(Creature* c) : ScriptedAI(c)
{
Creaturetype = delay = spell = spell2 = 0;
//that's hack but there are no info about range of this spells in dbc
SpellEntry *wisp = GET_SPELL(SPELL_WISP_BLUE);
if (wisp)
wisp->rangeIndex = 6; //100 yards
SpellEntry *port = GET_SPELL(SPELL_WISP_FLIGHT_PORT);
if (port)
port->rangeIndex = 6;
}
uint32 Creaturetype;
@@ -183,7 +176,7 @@ public:
DoCast(me, spell);
}
void SpellHit(Unit* /*caster*/, const SpellEntry *spell)
void SpellHit(Unit* /*caster*/, const SpellInfo *spell)
{
if (spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4)
me->SetDisplayId(2027);
@@ -290,7 +283,7 @@ public:
}
}
void SpellHit(Unit* caster, const SpellEntry* spell)
void SpellHit(Unit* caster, const SpellInfo* spell)
{
if (!withbody)
return;
@@ -534,7 +527,7 @@ public:
return NULL;
}
void SpellHitTarget(Unit* unit, const SpellEntry* spell)
void SpellHitTarget(Unit* unit, const SpellInfo* spell)
{
if (spell->Id == SPELL_CONFLAGRATION && unit->HasAura(SPELL_CONFLAGRATION))
SaySound(SAY_CONFLAGRATION, unit);
@@ -553,7 +546,7 @@ public:
pInstance->SetData(DATA_HORSEMAN_EVENT, DONE);
}
void SpellHit(Unit* caster, const SpellEntry* spell)
void SpellHit(Unit* caster, const SpellInfo* spell)
{
if (withhead)
return;
@@ -781,7 +774,7 @@ public:
void EnterCombat(Unit* /*who*/){}
void SpellHit(Unit* /*caster*/, const SpellEntry *spell)
void SpellHit(Unit* /*caster*/, const SpellInfo *spell)
{
if (spell->Id == SPELL_SPROUTING)
{
@@ -157,7 +157,7 @@ public:
}
}
void SpellHit(Unit* /*who*/, const SpellEntry* pSpell)
void SpellHit(Unit* /*who*/, const SpellInfo* pSpell)
{
//When hit with ressurection say text
if (pSpell->Id == SPELL_SCARLETRESURRECTION)
@@ -148,7 +148,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)
{
@@ -224,7 +224,7 @@ public:
void EnterCombat(Unit* /*who*/) {}
void SpellHit(Unit* /*caster*/, const SpellEntry *spell)
void SpellHit(Unit* /*caster*/, const SpellInfo *spell)
{
if (!Tagged && spell->Id == SPELL_EGAN_BLASTER)
Tagged = true;
@@ -181,7 +181,7 @@ public:
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
void SpellHitTarget(Unit* target, const SpellEntry* spell)
void SpellHitTarget(Unit* target, const SpellInfo* spell)
{
switch(spell->Id)
{
@@ -476,7 +476,7 @@ public:
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
void SpellHitTarget(Unit* target, const SpellEntry* spell)
void SpellHitTarget(Unit* target, const SpellInfo* spell)
{
switch(spell->Id)
{
@@ -701,7 +701,7 @@ public:
void EnterCombat(Unit* /*who*/){}
void SpellHitTarget(Unit* target, const SpellEntry* spell)
void SpellHitTarget(Unit* target, const SpellInfo* spell)
{
switch(spell->Id)
{
@@ -118,17 +118,6 @@ public:
boss_felmystAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceScript();
// wait for core patch be accepted
/*SpellEntry *TempSpell = GET_SPELL(SPELL_ENCAPSULATE_EFFECT);
if (TempSpell->SpellIconID == 2294)
TempSpell->SpellIconID = 2295;
TempSpell = GET_SPELL(SPELL_VAPOR_TRIGGER);
if ((TempSpell->Attributes & SPELL_ATTR0_PASSIVE) == 0)
TempSpell->Attributes |= SPELL_ATTR0_PASSIVE;
TempSpell = GET_SPELL(SPELL_FOG_CHARM2);
if ((TempSpell->Attributes & SPELL_ATTR0_PASSIVE) == 0)
TempSpell->Attributes |= SPELL_ATTR0_PASSIVE;*/
}
InstanceScript *pInstance;
@@ -203,7 +192,7 @@ public:
pInstance->SetData(DATA_FELMYST_EVENT, DONE);
}
void SpellHit(Unit* caster, const SpellEntry *spell)
void SpellHit(Unit* caster, const SpellInfo *spell)
{
// workaround for linked aura
/*if (spell->Id == SPELL_VAPOR_FORCE)
@@ -122,9 +122,6 @@ public:
DoorGUID = 0;
bJustReset = false;
me->setActive(true);
SpellEntry *TempSpell = GET_SPELL(SPELL_SPECTRAL_BLAST);
if (TempSpell)
TempSpell->EffectImplicitTargetB[0] = TARGET_UNIT_TARGET_ENEMY;
}
InstanceScript *pInstance;
@@ -413,7 +413,7 @@ public:
Summons.Summon(summoned);
}
void SpellHit(Unit* /*caster*/, const SpellEntry* Spell)
void SpellHit(Unit* /*caster*/, const SpellInfo* Spell)
{
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
@@ -475,10 +475,10 @@ public:
me->AddUnitState(UNIT_STAT_STUNNED);
}
void SpellHit(Unit* /*caster*/, const SpellEntry* Spell)
void SpellHit(Unit* /*caster*/, const SpellInfo* Spell)
{
for (uint8 i = 0; i < 3; ++i)
if (Spell->Effect[i] == 38)
if (Spell->Effects[i].Effect == 38)
me->DisappearAndDie();
}
@@ -112,10 +112,10 @@ class boss_archaedas : public CreatureScript
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
}
void SpellHit(Unit* /*caster*/, const SpellEntry *spell)
void SpellHit(Unit* /*caster*/, const SpellInfo *spell)
{
// Being woken up from the altar, start the awaken sequence
if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN))
if (spell == sSpellMgr->GetSpellInfo(SPELL_ARCHAEDAS_AWAKEN))
{
me->MonsterYell(SAY_AGGRO, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_AGGRO);
@@ -267,9 +267,9 @@ class mob_archaedas_minions : public CreatureScript
bAmIAwake = true;
}
void SpellHit (Unit* /*caster*/, const SpellEntry *spell) {
void SpellHit (Unit* /*caster*/, const SpellInfo *spell) {
// time to wake up, start animation
if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN))
if (spell == sSpellMgr->GetSpellInfo(SPELL_ARCHAEDAS_AWAKEN))
{
iAwakenTimer = 5000;
bWakingUp = true;
@@ -37,7 +37,6 @@ enum Spells
SPELL_GUST_OF_WIND = 43621,
SPELL_ELECTRICAL_STORM = 43648,
SPELL_BERSERK = 45078,
SPELL_ELECTRICAL_DAMAGE = 43657,
SPELL_ELECTRICAL_OVERLOAD = 43658,
SPELL_EAGLE_SWOOP = 44732
};
@@ -75,9 +74,6 @@ class boss_akilzon : public CreatureScript
{
boss_akilzonAI(Creature* c) : ScriptedAI(c)
{
SpellEntry *TempSpell = GET_SPELL(SPELL_ELECTRICAL_DAMAGE);
if (TempSpell)
TempSpell->EffectBasePoints[1] = 49;//disable bugged lightning until fixed in core
pInstance = c->GetInstanceScript();
}
InstanceScript *pInstance;
@@ -61,7 +61,6 @@ EndScriptData */
#define SPELL_SHRED_ARMOR 43243
#define MOB_TOTEM 24224
#define SPELL_LIGHTNING 43301
enum PhaseHalazzi
{
@@ -87,10 +86,6 @@ class boss_halazzi : public CreatureScript
boss_halazziAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceScript();
// need to find out what controls totem's spell cooldown
SpellEntry *TempSpell = GET_SPELL(SPELL_LIGHTNING);
if (TempSpell && TempSpell->CastingTimeIndex != 5)
TempSpell->CastingTimeIndex = 5; // 2000 ms casting time
}
InstanceScript *pInstance;
@@ -147,7 +142,7 @@ class boss_halazzi : public CreatureScript
damage = 0;
}
void SpellHit(Unit*, const SpellEntry *spell)
void SpellHit(Unit*, const SpellInfo *spell)
{
if (spell->Id == SPELL_TRANSFORM_SPLIT2)
EnterPhase(PHASE_HUMAN);
@@ -454,7 +454,7 @@ class mob_janalai_firebomb : public CreatureScript
void Reset() {}
void SpellHit(Unit* /*caster*/, const SpellEntry *spell)
void SpellHit(Unit* /*caster*/, const SpellInfo *spell)
{
if (spell->Id == SPELL_FIRE_BOMB_THROW)
DoCast(me, SPELL_FIRE_BOMB_DUMMY, true);
@@ -685,7 +685,7 @@ public:
void UpdateAI(uint32 const /*diff*/) {}
void SpellHit(Unit* /*caster*/, const SpellEntry* spell)
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
{
if (spell->Id == SPELL_HATCH_EGG)
{
@@ -610,7 +610,7 @@ class mob_zuljin_vortex : public CreatureScript
void EnterCombat(Unit* /*pTarget*/) {}
void SpellHit(Unit* caster, const SpellEntry* spell)
void SpellHit(Unit* caster, const SpellInfo* spell)
{
if (spell->Id == SPELL_ZAP_INFORM)
DoCast(caster, SPELL_ZAP_DAMAGE, true);
@@ -91,7 +91,7 @@ class npc_forest_frog : public CreatureScript
}
}
void SpellHit(Unit* caster, const SpellEntry *spell)
void SpellHit(Unit* caster, const SpellInfo *spell)
{
if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == ENTRY_FOREST_FROG)
{
@@ -120,7 +120,7 @@ public:
PlayerGUID = 0;
}
void SpellHit(Unit* caster, const SpellEntry* spell)
void SpellHit(Unit* caster, const SpellInfo* spell)
{
if (!caster)
return;
@@ -85,7 +85,7 @@ public:
}
}
void SpellHit(Unit* Hitter, const SpellEntry *Spellkind)
void SpellHit(Unit* Hitter, const SpellInfo *Spellkind)
{
if ((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit &&
(Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD)))
@@ -59,7 +59,7 @@ public:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
}
void SpellHit(Unit* caster, const SpellEntry *spell)
void SpellHit(Unit* caster, const SpellInfo *spell)
{
if (caster->GetTypeId() == TYPEID_PLAYER)
{