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
+16 -27
View File
@@ -31,8 +31,8 @@ class WorldObject;
class Aura;
class SpellScript;
class ByteBuffer;
struct SpellEntry;
class SpellInfo;
class SpellImplicitTargetInfo;
#define SPELL_CHANNEL_UPDATE_INTERVAL (1 * IN_MILLISECONDS)
@@ -211,14 +211,7 @@ class SpellCastTargets
struct SpellValue
{
explicit SpellValue(SpellEntry const* proto)
{
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
EffectBasePoints[i] = proto->EffectBasePoints[i];
MaxAffectedTargets = proto->MaxAffectedTargets;
RadiusMod = 1.0f;
AuraStackAmount = 1;
}
explicit SpellValue(SpellInfo const* proto);
int32 EffectBasePoints[MAX_SPELL_EFFECTS];
uint32 MaxAffectedTargets;
float RadiusMod;
@@ -387,7 +380,7 @@ class Spell
typedef std::set<Aura*> UsedSpellMods;
Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, bool skipCheck = false, bool castedClientside = false);
Spell(Unit* Caster, SpellInfo const *info, bool triggered, uint64 originalCasterGUID = 0, bool skipCheck = false, bool castedClientside = false);
~Spell();
void prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura = NULL);
@@ -431,7 +424,7 @@ class Spell
void WriteAmmoToPacket(WorldPacket * data);
void SelectSpellTargets();
void SelectEffectTargets(uint32 i, uint32 cur);
void SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur);
void SelectTrajTargets();
template<typename T> WorldObject* FindCorpseUsing();
@@ -441,7 +434,7 @@ class Spell
void CheckSrc() { if (!m_targets.HasSrc()) m_targets.SetSrc(*m_caster); }
void CheckDst() { if (!m_targets.HasDst()) m_targets.SetDst(*m_caster); }
static void SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE);
static void SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE);
void SendCastResult(SpellCastResult result);
void SendSpellStart();
void SendSpellGo();
@@ -463,9 +456,9 @@ class Spell
void SendResurrectRequest(Player* target);
void HandleEffects(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGOTarget, uint32 i);
void HandleThreatSpells(uint32 spellId);
void HandleThreatSpells();
const SpellEntry * const m_spellInfo;
SpellInfo const* const m_spellInfo;
Item* m_CastItem;
uint64 m_castItemGUID;
uint8 m_cast_count;
@@ -477,17 +470,14 @@ class Spell
UsedSpellMods m_appliedMods;
int32 GetCastTime() const { return m_casttime; }
int32 CalcCastTime() const { return m_casttime; }
bool IsAutoRepeat() const { return m_autoRepeat; }
void SetAutoRepeat(bool rep) { m_autoRepeat = rep; }
void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; }
bool IsNextMeleeSwingSpell() const
{
return m_spellInfo->Attributes & SPELL_ATTR0_ON_NEXT_SWING;
}
bool IsNextMeleeSwingSpell() const;
bool IsTriggered() const {return m_IsTriggeredSpell;};
bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; }
bool IsAutoActionResetSpell() const { return !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_AUTOATTACK); }
bool IsAutoActionResetSpell() const;
bool IsDeletable() const { return !m_referencedFromCurrentSpell && !m_executedCurrently; }
void SetReferencedFromCurrent(bool yes) { m_referencedFromCurrentSpell = yes; }
@@ -503,7 +493,7 @@ class Spell
Unit* GetCaster() const { return m_caster; }
Unit* GetOriginalCaster() const { return m_originalCaster; }
SpellEntry const* GetSpellInfo() const { return m_spellInfo; }
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
int32 GetPowerCost() const { return m_powerCost; }
void UpdatePointers(); // must be used at call Spell code after time delay (non triggered spell cast/update spell call/etc)
@@ -669,7 +659,7 @@ class Spell
bool CanExecuteTriggersOnHit(uint8 effMask) const;
void PrepareTriggersExecutedOnHit();
typedef std::list< std::pair<SpellEntry const*, int32> > HitTriggerSpells;
typedef std::list< std::pair<SpellInfo const*, int32> > HitTriggerSpells;
HitTriggerSpells m_hitTriggerSpells;
// effect helpers
@@ -689,9 +679,8 @@ class Spell
// if need this can be replaced by Aura copy
// we can't store original aura link to prevent access to deleted auras
// and in same time need aura data and after aura deleting.
SpellEntry const* m_triggeredByAuraSpell;
SpellInfo const* m_triggeredByAuraSpell;
uint32 m_customAttr;
bool m_skipCheck;
uint32 m_effectMask;
uint8 m_auraScaleMask;
@@ -719,10 +708,10 @@ namespace Trinity
uint32 i_entry;
const Position * const i_pos;
bool i_requireDeadTarget;
SpellEntry const* i_spellProto;
SpellInfo const* i_spellProto;
SpellNotifierCreatureAndPlayer(Unit *source, std::list<Unit*> &data, float radius, SpellNotifyPushType type,
SpellTargets TargetType = SPELL_TARGETS_ENEMY, const Position *pos = NULL, uint32 entry = 0, SpellEntry const* spellProto = NULL)
SpellTargets TargetType = SPELL_TARGETS_ENEMY, const Position *pos = NULL, uint32 entry = 0, SpellInfo const* spellProto = NULL)
: i_data(&data), i_push_type(type), i_radius(radius), i_TargetType(TargetType),
i_source(source), i_entry(entry), i_pos(pos), i_spellProto(spellProto)
{