mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
refactor(Core/Spell): Use ApplySpellFix with SpellInfo (#9938)
This commit is contained in:
@@ -6681,7 +6681,7 @@ SpellCastResult Spell::CheckRange(bool strict)
|
||||
if (m_spellInfo->RangeEntry->ID == 1)
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
range_type = m_spellInfo->RangeEntry->type;
|
||||
range_type = m_spellInfo->RangeEntry->Flags;
|
||||
}
|
||||
|
||||
Unit* target = m_targets.GetUnitTarget();
|
||||
|
||||
@@ -517,7 +517,7 @@ public:
|
||||
void HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, uint32 i, SpellEffectHandleMode mode);
|
||||
void HandleThreatSpells();
|
||||
|
||||
SpellInfo const* m_spellInfo;
|
||||
SpellInfo const* const m_spellInfo;
|
||||
Item* m_CastItem;
|
||||
Item* m_weaponItem;
|
||||
ObjectGuid m_castItemGUID;
|
||||
@@ -574,7 +574,6 @@ public:
|
||||
Unit* GetCaster() const { return m_caster; }
|
||||
Unit* GetOriginalCaster() const { return m_originalCaster; }
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
void SetSpellInfo(SpellInfo const* info) { m_spellInfo = info; }
|
||||
int32 GetPowerCost() const { return m_powerCost; }
|
||||
|
||||
bool UpdatePointers(); // must be used at call Spell code after time delay (non triggered spell cast/update spell call/etc)
|
||||
|
||||
@@ -2275,8 +2275,8 @@ float SpellInfo::GetMinRange(bool positive) const
|
||||
if (!RangeEntry)
|
||||
return 0.0f;
|
||||
if (positive)
|
||||
return RangeEntry->minRangeFriend;
|
||||
return RangeEntry->minRangeHostile;
|
||||
return RangeEntry->RangeMin[1];
|
||||
return RangeEntry->RangeMin[0];
|
||||
}
|
||||
|
||||
float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
|
||||
@@ -2285,9 +2285,9 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
|
||||
return 0.0f;
|
||||
float range;
|
||||
if (positive)
|
||||
range = RangeEntry->maxRangeFriend;
|
||||
range = RangeEntry->RangeMax[1];
|
||||
else
|
||||
range = RangeEntry->maxRangeHostile;
|
||||
range = RangeEntry->RangeMax[0];
|
||||
if (caster)
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell);
|
||||
|
||||
@@ -310,8 +310,10 @@ private:
|
||||
static std::array<StaticData, TOTAL_SPELL_EFFECTS> _data;
|
||||
};
|
||||
|
||||
class SpellInfo
|
||||
class AC_GAME_API SpellInfo
|
||||
{
|
||||
friend class SpellMgr;
|
||||
|
||||
public:
|
||||
uint32 Id;
|
||||
SpellCategoryEntry const* CategoryEntry;
|
||||
@@ -518,13 +520,23 @@ public:
|
||||
bool IsDifferentRankOf(SpellInfo const* spellInfo) const;
|
||||
bool IsHighRankOf(SpellInfo const* spellInfo) const;
|
||||
|
||||
// loading helpers
|
||||
void _InitializeExplicitTargetMask();
|
||||
std::array<SpellEffectInfo, MAX_SPELL_EFFECTS> const& GetEffects() const { return Effects; }
|
||||
SpellEffectInfo const& GetEffect(SpellEffIndex index) const { ASSERT(index < Effects.size()); return Effects[index]; }
|
||||
|
||||
bool _IsPositiveEffect(uint8 effIndex, bool deep) const;
|
||||
bool _IsPositiveSpell() const;
|
||||
static bool _IsPositiveTarget(uint32 targetA, uint32 targetB);
|
||||
|
||||
private:
|
||||
// loading helpers
|
||||
void _InitializeExplicitTargetMask();
|
||||
|
||||
AuraStateType LoadAuraState() const;
|
||||
SpellSpecificType LoadSpellSpecific() const;
|
||||
|
||||
std::array<SpellEffectInfo, MAX_SPELL_EFFECTS>& _GetEffects() { return Effects; }
|
||||
SpellEffectInfo& _GetEffect(SpellEffIndex index) { ASSERT(index < Effects.size()); return Effects[index]; }
|
||||
|
||||
// unloading helpers
|
||||
void _UnloadImplicitTargetConditionLists();
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -759,8 +759,8 @@ public:
|
||||
void LoadSpellInfoStore();
|
||||
void UnloadSpellInfoStore();
|
||||
void UnloadSpellInfoImplicitTargetConditionLists();
|
||||
void LoadSpellCustomAttr();
|
||||
void LoadDbcDataCorrections();
|
||||
void LoadSpellInfoCustomAttributes();
|
||||
void LoadSpellInfoCorrections();
|
||||
void LoadSpellSpecificAndAuraState();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user