TrinityCore
SpellEffectInfo Class Reference

#include <SpellInfo.h>

Classes

struct  ScalingInfo
 
struct  StaticData
 

Public Member Functions

 SpellEffectInfo (SpellInfo const *spellInfo)
 
 SpellEffectInfo (SpellInfo const *spellInfo, SpellEffectEntry const &effect)
 
bool IsEffect () const
 
bool IsEffect (SpellEffectName effectName) const
 
bool IsAura () const
 
bool IsAura (AuraType aura) const
 
bool IsTargetingArea () const
 
bool IsAreaAuraEffect () const
 
bool IsUnitOwnedAuraEffect () const
 
int32 CalcValue (WorldObject const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
 
int32 CalcBaseValue (WorldObject const *caster, Unit const *target, uint32 itemId, int32 itemLevel) const
 
float CalcValueMultiplier (WorldObject *caster, Spell *spell=nullptr) const
 
float CalcDamageMultiplier (WorldObject *caster, Spell *spell=nullptr) const
 
bool HasRadius () const
 
bool HasMaxRadius () const
 
float CalcRadius (WorldObject *caster=nullptr, Spell *=nullptr) const
 
uint32 GetProvidedTargetMask () const
 
uint32 GetMissingTargetMask (bool srcSet=false, bool destSet=false, uint32 mask=0) const
 
SpellEffectImplicitTargetTypes GetImplicitTargetType () const
 
SpellTargetObjectTypes GetUsedTargetObjectType () const
 
ExpectedStatType GetScalingExpectedStat () const
 
ImmunityInfo const * GetImmunityInfo () const
 

Public Attributes

SpellEffIndex EffectIndex
 
SpellEffectName Effect
 
AuraType ApplyAuraName
 
uint32 ApplyAuraPeriod
 
int32 BasePoints
 
float RealPointsPerLevel
 
float PointsPerResource
 
float Amplitude
 
float ChainAmplitude
 
float BonusCoefficient
 
int32 MiscValue
 
int32 MiscValueB
 
Mechanics Mechanic
 
float PositionFacing
 
SpellImplicitTargetInfo TargetA
 
SpellImplicitTargetInfo TargetB
 
SpellRadiusEntry const * RadiusEntry
 
SpellRadiusEntry const * MaxRadiusEntry
 
int32 ChainTargets
 
uint32 ItemType
 
uint32 TriggerSpell
 
flag128 SpellClassMask
 
float BonusCoefficientFromAP
 
std::vector< Condition * > * ImplicitTargetConditions
 
EnumFlag< SpellEffectAttributesEffectAttributes
 
struct SpellEffectInfo::ScalingInfo Scaling
 

Private Attributes

SpellInfo const * _spellInfo
 
ImmunityInfo _immunityInfo
 

Static Private Attributes

static StaticData _data [TOTAL_SPELL_EFFECTS]
 

Friends

class SpellInfo
 

Constructor & Destructor Documentation

◆ SpellEffectInfo() [1/2]

SpellEffectInfo::SpellEffectInfo ( SpellInfo const *  spellInfo)
inline
269  RadiusEntry(nullptr), MaxRadiusEntry(nullptr), ChainTargets(0), ItemType(0), TriggerSpell(0),
int32 MiscValue
Definition: SpellInfo.h:242
SpellEffectName Effect
Definition: SpellInfo.h:233
Definition: SharedDefines.h:2342
float RealPointsPerLevel
Definition: SpellInfo.h:237
Definition: SharedDefines.h:1098
float ChainAmplitude
Definition: SpellInfo.h:240
float PositionFacing
Definition: SpellInfo.h:245
AuraType
Definition: SpellAuraDefines.h:86
float PointsPerResource
Definition: SpellInfo.h:238
SpellRadiusEntry const * MaxRadiusEntry
Definition: SpellInfo.h:249
float Amplitude
Definition: SpellInfo.h:239
Mechanics Mechanic
Definition: SpellInfo.h:244
uint32 TriggerSpell
Definition: SpellInfo.h:252
SpellRadiusEntry const * RadiusEntry
Definition: SpellInfo.h:248
std::vector< Condition * > * ImplicitTargetConditions
Definition: SpellInfo.h:255
struct SpellEffectInfo::ScalingInfo Scaling
uint32 ItemType
Definition: SpellInfo.h:251
SpellEffIndex EffectIndex
Definition: SpellInfo.h:232
float BonusCoefficient
Definition: SpellInfo.h:241
AuraType ApplyAuraName
Definition: SpellInfo.h:234
Definition: SharedDefines.h:28
SpellInfo const * _spellInfo
Definition: SpellInfo.h:230
int32 ChainTargets
Definition: SpellInfo.h:250
int32 BasePoints
Definition: SpellInfo.h:236
float BonusCoefficientFromAP
Definition: SpellInfo.h:254
EnumFlag< SpellEffectAttributes > EffectAttributes
Definition: SpellInfo.h:256
int32 MiscValueB
Definition: SpellInfo.h:243
uint32 ApplyAuraPeriod
Definition: SpellInfo.h:235

◆ SpellEffectInfo() [2/2]

SpellEffectInfo::SpellEffectInfo ( SpellInfo const *  spellInfo,
SpellEffectEntry const &  effect 
)
377 {
378  ASSERT(spellInfo);
379 
380  _spellInfo = spellInfo;
381  EffectIndex = SpellEffIndex(_effect.EffectIndex);
382  Effect = SpellEffectName(_effect.Effect);
383  ApplyAuraName = AuraType(_effect.EffectAura);
384  ApplyAuraPeriod = _effect.EffectAuraPeriod;
385  BasePoints = _effect.EffectBasePoints;
386  RealPointsPerLevel = _effect.EffectRealPointsPerLevel;
387  PointsPerResource = _effect.EffectPointsPerResource;
388  Amplitude = _effect.EffectAmplitude;
389  ChainAmplitude = _effect.EffectChainAmplitude;
390  BonusCoefficient = _effect.EffectBonusCoefficient;
391  MiscValue = _effect.EffectMiscValue[0];
392  MiscValueB = _effect.EffectMiscValue[1];
393  Mechanic = Mechanics(_effect.EffectMechanic);
394  PositionFacing = _effect.EffectPosFacing;
395  TargetA = SpellImplicitTargetInfo(_effect.ImplicitTarget[0]);
396  TargetB = SpellImplicitTargetInfo(_effect.ImplicitTarget[1]);
397  RadiusEntry = sSpellRadiusStore.LookupEntry(_effect.EffectRadiusIndex[0]);
398  MaxRadiusEntry = sSpellRadiusStore.LookupEntry(_effect.EffectRadiusIndex[1]);
399  ChainTargets = _effect.EffectChainTargets;
400  ItemType = _effect.EffectItemType;
401  TriggerSpell = _effect.EffectTriggerSpell;
402  SpellClassMask = _effect.EffectSpellClassMask;
403  BonusCoefficientFromAP = _effect.BonusCoefficientFromAP;
404  Scaling.Class = _effect.ScalingClass;
405  Scaling.Coefficient = _effect.Coefficient;
406  Scaling.Variance = _effect.Variance;
407  Scaling.ResourceCoefficient = _effect.ResourceCoefficient;
408  ImplicitTargetConditions = nullptr;
409  EffectAttributes = _effect.GetEffectAttributes();
410 }
int32 MiscValue
Definition: SpellInfo.h:242
SpellEffectName Effect
Definition: SpellInfo.h:233
float RealPointsPerLevel
Definition: SpellInfo.h:237
float Variance
Definition: SpellInfo.h:262
Mechanics
Definition: SharedDefines.h:2340
int32 Class
Definition: SpellInfo.h:260
float ChainAmplitude
Definition: SpellInfo.h:240
SpellEffectName
Definition: SharedDefines.h:1096
float Coefficient
Definition: SpellInfo.h:261
float ResourceCoefficient
Definition: SpellInfo.h:263
float PositionFacing
Definition: SpellInfo.h:245
AuraType
Definition: SpellAuraDefines.h:86
float PointsPerResource
Definition: SpellInfo.h:238
SpellRadiusEntry const * MaxRadiusEntry
Definition: SpellInfo.h:249
SpellEffIndex
Definition: SharedDefines.h:26
float Amplitude
Definition: SpellInfo.h:239
SpellImplicitTargetInfo TargetA
Definition: SpellInfo.h:246
DB2Storage< SpellRadiusEntry > sSpellRadiusStore("SpellRadius.db2", SpellRadiusLoadInfo::Instance())
Mechanics Mechanic
Definition: SpellInfo.h:244
uint32 TriggerSpell
Definition: SpellInfo.h:252
SpellRadiusEntry const * RadiusEntry
Definition: SpellInfo.h:248
std::vector< Condition * > * ImplicitTargetConditions
Definition: SpellInfo.h:255
struct SpellEffectInfo::ScalingInfo Scaling
uint32 ItemType
Definition: SpellInfo.h:251
SpellEffIndex EffectIndex
Definition: SpellInfo.h:232
float BonusCoefficient
Definition: SpellInfo.h:241
flag128 SpellClassMask
Definition: SpellInfo.h:253
Definition: SpellInfo.h:180
AuraType ApplyAuraName
Definition: SpellInfo.h:234
SpellInfo const * _spellInfo
Definition: SpellInfo.h:230
SpellImplicitTargetInfo TargetB
Definition: SpellInfo.h:247
int32 ChainTargets
Definition: SpellInfo.h:250
int32 BasePoints
Definition: SpellInfo.h:236
#define ASSERT
Definition: Errors.h:61
float BonusCoefficientFromAP
Definition: SpellInfo.h:254
EnumFlag< SpellEffectAttributes > EffectAttributes
Definition: SpellInfo.h:256
int32 MiscValueB
Definition: SpellInfo.h:243
uint32 ApplyAuraPeriod
Definition: SpellInfo.h:235
+ Here is the call graph for this function:

Member Function Documentation

◆ CalcBaseValue()

int32 SpellEffectInfo::CalcBaseValue ( WorldObject const *  caster,
Unit const *  target,
uint32  itemId,
int32  itemLevel 
) const
516 {
517  if (Scaling.Coefficient != 0.0f)
518  {
519  uint32 level = _spellInfo->SpellLevel;
521  level = target->getLevel();
522  else if (caster && caster->IsUnit())
523  level = caster->ToUnit()->getLevel();
524 
526  level = _spellInfo->BaseLevel;
527 
530 
533 
534  float value = 0.0f;
535  if (level > 0)
536  {
537  if (!Scaling.Class)
538  return 0;
539 
540  uint32 effectiveItemLevel = itemLevel != -1 ? uint32(itemLevel) : 1u;
542  {
544  effectiveItemLevel = _spellInfo->Scaling.ScalesFromItemLevel;
545 
546  if (Scaling.Class == -8 || Scaling.Class == -9)
547  {
548  RandPropPointsEntry const* randPropPoints = sRandPropPointsStore.LookupEntry(effectiveItemLevel);
549  if (!randPropPoints)
550  randPropPoints = sRandPropPointsStore.AssertEntry(sRandPropPointsStore.GetNumRows() - 1);
551 
552  value = Scaling.Class == -8 ? randPropPoints->DamageReplaceStatF : randPropPoints->DamageSecondaryF;
553  }
554  else
555  value = GetRandomPropertyPoints(effectiveItemLevel, ITEM_QUALITY_RARE, INVTYPE_CHEST, 0);
556  }
557  else
559 
560  if (Scaling.Class == -7)
561  if (GtCombatRatingsMultByILvl const* ratingMult = sCombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel))
562  if (ItemSparseEntry const* itemSparse = sItemSparseStore.LookupEntry(itemId))
563  value *= GetIlvlStatMultiplier(ratingMult, InventoryType(itemSparse->InventoryType));
564 
565  if (Scaling.Class == -6)
566  if (GtStaminaMultByILvl const* staminaMult = sStaminaMultByILvlGameTable.GetRow(effectiveItemLevel))
567  if (ItemSparseEntry const* itemSparse = sItemSparseStore.LookupEntry(itemId))
568  value *= GetIlvlStatMultiplier(staminaMult, InventoryType(itemSparse->InventoryType));
569  }
570 
571  value *= Scaling.Coefficient;
572  if (value > 0.0f && value < 1.0f)
573  value = 1.0f;
574 
575  return int32(round(value));
576  }
577  else
578  {
579  float value = BasePoints;
581  if (stat != ExpectedStatType::None)
582  {
585 
586  // TODO - add expansion and content tuning id args?
587  uint32 contentTuningId = _spellInfo->ContentTuningId; // content tuning should be passed as arg, the one stored in SpellInfo is fallback
588  int32 expansion = -2;
589  if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(contentTuningId))
590  expansion = contentTuning->ExpansionID;
591 
592  int32 level = caster && caster->IsUnit() ? int32(caster->ToUnit()->getLevel()) : 1;
593  value = sDB2Manager.EvaluateExpectedStat(stat, level, expansion, 0, CLASS_NONE) * BasePoints / 100.0f;
594  }
595 
596  return int32(round(value));
597  }
598 }
#define sDB2Manager
Definition: DB2Stores.h:446
TC_GAME_API float GetRandomPropertyPoints(uint32 itemLevel, uint32 quality, uint32 inventoryType, uint32 subClass)
Definition: ItemEnchantmentMgr.cpp:110
Definition: DB2Structure.h:836
SpellEffectName Effect
Definition: SpellInfo.h:233
struct SpellInfo::ScalingInfo Scaling
GameTable< GtSpellScalingEntry > sSpellScalingGameTable
Definition: GameTables.cpp:36
Definition: DB2Structure.h:2132
uint32 SpellLevel
Definition: SpellInfo.h:394
DB2Storage< ContentTuningEntry > sContentTuningStore("ContentTuning.db2", ContentTuningLoadInfo::Instance())
int32 Class
Definition: SpellInfo.h:260
Definition: DB2Structure.h:2814
Definition: SharedDefines.h:754
float Coefficient
Definition: SpellInfo.h:261
bool IsPositiveEffect(uint8 effIndex) const
Definition: SpellInfo.cpp:1613
Definition: SharedDefines.h:401
Definition: GameTables.h:95
Definition: SharedDefines.h:1104
GameTable< GtCombatRatingsMultByILvl > sCombatRatingsMultByILvlGameTable
Definition: GameTables.cpp:32
uint32 ScalesFromItemLevel
Definition: SpellInfo.h:432
float GetIlvlStatMultiplier(T const *row, InventoryType invType)
Definition: GameTables.cpp:141
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:449
uint32 ContentTuningId
Definition: SpellInfo.h:411
Definition: GameTables.h:142
int32_t int32
Definition: Define.h:148
uint32_t uint32
Definition: Define.h:152
struct SpellEffectInfo::ScalingInfo Scaling
DB2Storage< RandPropPointsEntry > sRandPropPointsStore("RandPropPoints.db2", RandPropPointsLoadInfo::Instance())
SpellEffIndex EffectIndex
Definition: SpellInfo.h:232
float DamageReplaceStatF
Definition: DB2Structure.h:2817
float DamageSecondaryF
Definition: DB2Structure.h:2818
InventoryType
Definition: ItemTemplate.h:377
SpellInfo const * _spellInfo
Definition: SpellInfo.h:230
float GetSpellScalingColumnForClass(GtSpellScalingEntry const *row, int32 class_)
Definition: GameTables.h:230
Definition: SharedDefines.h:137
uint32 BaseLevel
Definition: SpellInfo.h:393
Definition: ItemTemplate.h:384
uint32 MaxScalingLevel
Definition: SpellInfo.h:431
Definition: SharedDefines.h:780
int32 BasePoints
Definition: SpellInfo.h:236
GameTable< GtStaminaMultByILvl > sStaminaMultByILvlGameTable
Definition: GameTables.cpp:37
Definition: SharedDefines.h:341
uint32 MinScalingLevel
Definition: SpellInfo.h:430
DB2Storage< ItemSparseEntry > sItemSparseStore("ItemSparse.db2", ItemSparseLoadInfo::Instance())
ExpectedStatType GetScalingExpectedStat() const
Definition: SpellInfo.cpp:694
ExpectedStatType
Definition: DBCEnums.h:690
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcDamageMultiplier()

float SpellEffectInfo::CalcDamageMultiplier ( WorldObject caster,
Spell spell = nullptr 
) const
609 {
610  float multiplierPercent = ChainAmplitude * 100.0f;
611  if (Player* modOwner = (caster ? caster->GetSpellModOwner() : nullptr))
612  modOwner->ApplySpellMod(_spellInfo, SpellModOp::ChainAmplitude, multiplierPercent, spell);
613  return multiplierPercent / 100.0f;
614 }
float ChainAmplitude
Definition: SpellInfo.h:240
SpellInfo const * _spellInfo
Definition: SpellInfo.h:230
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
Definition: Player.h:1081
+ Here is the call graph for this function:

◆ CalcRadius()

float SpellEffectInfo::CalcRadius ( WorldObject caster = nullptr,
Spell spell = nullptr 
) const
627 {
628  const SpellRadiusEntry* entry = RadiusEntry;
629  if (!HasRadius() && HasMaxRadius())
630  entry = MaxRadiusEntry;
631 
632  if (!entry)
633  return 0.0f;
634 
635  float radius = entry->RadiusMin;
636 
637  // Client uses max if min is 0
638  if (radius == 0.0f)
639  radius = entry->RadiusMax;
640 
641  if (caster)
642  {
643  if (Unit* casterUnit = caster->ToUnit())
644  radius += entry->RadiusPerLevel * casterUnit->getLevel();
645 
646  radius = std::min(radius, entry->RadiusMax);
647 
648  if (Player* modOwner = caster->GetSpellModOwner())
649  modOwner->ApplySpellMod(_spellInfo, SpellModOp::Radius, radius, spell);
650  }
651 
652  return radius;
653 }
float RadiusMax
Definition: DB2Structure.h:3302
Definition: DB2Structure.h:3296
bool HasMaxRadius() const
Definition: SpellInfo.cpp:621
bool HasRadius() const
Definition: SpellInfo.cpp:616
float RadiusMin
Definition: DB2Structure.h:3301
float RadiusPerLevel
Definition: DB2Structure.h:3300
SpellRadiusEntry const * MaxRadiusEntry
Definition: SpellInfo.h:249
SpellRadiusEntry const * RadiusEntry
Definition: SpellInfo.h:248
SpellInfo const * _spellInfo
Definition: SpellInfo.h:230
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
Definition: Unit.h:737
Definition: Player.h:1081
Unit * ToUnit()
Definition: Object.h:200
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcValue()

int32 SpellEffectInfo::CalcValue ( WorldObject const *  caster = nullptr,
int32 const *  basePoints = nullptr,
Unit const *  target = nullptr,
float *  variance = nullptr,
uint32  castItemId = 0,
int32  itemLevel = -1 
) const
457 {
458  float basePointsPerLevel = RealPointsPerLevel;
459  // TODO: this needs to be a float, not rounded
460  int32 basePoints = CalcBaseValue(caster, target, castItemId, itemLevel);
461  float value = bp ? *bp : basePoints;
462  float comboDamage = PointsPerResource;
463 
464  Unit const* casterUnit = nullptr;
465  if (caster)
466  casterUnit = caster->ToUnit();
467 
468  if (Scaling.Variance)
469  {
470  float delta = fabs(Scaling.Variance * 0.5f);
471  float valueVariance = frand(-delta, delta);
472  value += basePoints * valueVariance;
473 
474  if (variance)
475  *variance = valueVariance;
476  }
477 
478  // base amount modification based on spell lvl vs caster lvl
479  if (Scaling.Coefficient != 0.0f)
480  {
482  comboDamage = Scaling.ResourceCoefficient * value;
483  }
485  {
486  if (casterUnit && basePointsPerLevel != 0.0f)
487  {
488  int32 level = int32(casterUnit->getLevel());
489  if (level > int32(_spellInfo->MaxLevel) && _spellInfo->MaxLevel > 0)
490  level = int32(_spellInfo->MaxLevel);
491 
492  // if base level is greater than spell level, reduce by base level (eg. pilgrims foods)
493  level -= int32(std::max(_spellInfo->BaseLevel, _spellInfo->SpellLevel));
494  if (level < 0)
495  level = 0;
496  value += level * basePointsPerLevel;
497  }
498  }
499 
500  // random damage
501  if (casterUnit)
502  {
503  // bonus amount from combo points
504  if (comboDamage)
505  if (uint32 comboPoints = casterUnit->GetComboPoints())
506  value += comboDamage * comboPoints;
507  }
508 
509  if (caster)
510  value = caster->ApplyEffectModifiers(_spellInfo, EffectIndex, value);
511 
512  return int32(round(value));
513 }
uint32 MaxLevel
Definition: SpellInfo.h:392
uint32 SpellLevel
Definition: SpellInfo.h:394
float RealPointsPerLevel
Definition: SpellInfo.h:237
uint8 getLevel() const
Definition: Unit.h:847
float Variance
Definition: SpellInfo.h:262
float frand(float min, float max)
Definition: Random.cpp:59
float Coefficient
Definition: SpellInfo.h:261
float ResourceCoefficient
Definition: SpellInfo.h:263
uint32 GetComboPoints() const
--------—Combo point system----------------—
Definition: Unit.h:1728
float PointsPerResource
Definition: SpellInfo.h:238
int32_t int32
Definition: Define.h:148
uint32_t uint32
Definition: Define.h:152
struct SpellEffectInfo::ScalingInfo Scaling
int32 CalcBaseValue(WorldObject const *caster, Unit const *target, uint32 itemId, int32 itemLevel) const
Definition: SpellInfo.cpp:515
SpellEffIndex EffectIndex
Definition: SpellInfo.h:232
SpellInfo const * _spellInfo
Definition: SpellInfo.h:230
uint32 BaseLevel
Definition: SpellInfo.h:393
Definition: Unit.h:737
ExpectedStatType GetScalingExpectedStat() const
Definition: SpellInfo.cpp:694
Unit * ToUnit()
Definition: Object.h:200
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcValueMultiplier()

float SpellEffectInfo::CalcValueMultiplier ( WorldObject caster,
Spell spell = nullptr 
) const
601 {
602  float multiplier = Amplitude;
603  if (Player* modOwner = (caster ? caster->GetSpellModOwner() : nullptr))
604  modOwner->ApplySpellMod(_spellInfo, SpellModOp::Amplitude, multiplier, spell);
605  return multiplier;
606 }
float Amplitude
Definition: SpellInfo.h:239
SpellInfo const * _spellInfo
Definition: SpellInfo.h:230
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
Definition: Player.h:1081
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetImmunityInfo()

ImmunityInfo const* SpellEffectInfo::GetImmunityInfo ( ) const
inline
298 { return &_immunityInfo; }
ImmunityInfo _immunityInfo
Definition: SpellInfo.h:311
+ Here is the caller graph for this function:

◆ GetImplicitTargetType()

SpellEffectImplicitTargetTypes SpellEffectInfo::GetImplicitTargetType ( ) const
685 {
687 }
SpellEffectName Effect
Definition: SpellInfo.h:233
SpellEffectImplicitTargetTypes ImplicitTargetType
Definition: SpellInfo.h:306
static StaticData _data[TOTAL_SPELL_EFFECTS]
Definition: SpellInfo.h:309
+ Here is the caller graph for this function:

◆ GetMissingTargetMask()

uint32 SpellEffectInfo::GetMissingTargetMask ( bool  srcSet = false,
bool  destSet = false,
uint32  mask = 0 
) const
661 {
662  uint32 effImplicitTargetMask = GetTargetFlagMask(GetUsedTargetObjectType());
663  uint32 providedTargetMask = GetProvidedTargetMask() | mask;
664 
665  // remove all flags covered by effect target mask
666  if (providedTargetMask & TARGET_FLAG_UNIT_MASK)
667  effImplicitTargetMask &= ~(TARGET_FLAG_UNIT_MASK);
668  if (providedTargetMask & TARGET_FLAG_CORPSE_MASK)
669  effImplicitTargetMask &= ~(TARGET_FLAG_UNIT_MASK | TARGET_FLAG_CORPSE_MASK);
670  if (providedTargetMask & TARGET_FLAG_GAMEOBJECT_ITEM)
671  effImplicitTargetMask &= ~(TARGET_FLAG_GAMEOBJECT_ITEM | TARGET_FLAG_GAMEOBJECT | TARGET_FLAG_ITEM);
672  if (providedTargetMask & TARGET_FLAG_GAMEOBJECT)
673  effImplicitTargetMask &= ~(TARGET_FLAG_GAMEOBJECT | TARGET_FLAG_GAMEOBJECT_ITEM);
674  if (providedTargetMask & TARGET_FLAG_ITEM)
675  effImplicitTargetMask &= ~(TARGET_FLAG_ITEM | TARGET_FLAG_GAMEOBJECT_ITEM);
676  if (dstSet || providedTargetMask & TARGET_FLAG_DEST_LOCATION)
677  effImplicitTargetMask &= ~(TARGET_FLAG_DEST_LOCATION);
678  if (srcSet || providedTargetMask & TARGET_FLAG_SOURCE_LOCATION)
679  effImplicitTargetMask &= ~(TARGET_FLAG_SOURCE_LOCATION);
680 
681  return effImplicitTargetMask;
682 }
Definition: SpellDefines.h:278
Definition: SpellDefines.h:281
Definition: SpellDefines.h:297
SpellTargetObjectTypes GetUsedTargetObjectType() const
Definition: SpellInfo.cpp:689
Definition: SpellDefines.h:294
uint32_t uint32
Definition: Define.h:152
Definition: SpellDefines.h:273
uint32 GetProvidedTargetMask() const
Definition: SpellInfo.cpp:655
Definition: SpellDefines.h:271
Definition: SpellDefines.h:272
uint32 GetTargetFlagMask(SpellTargetObjectTypes objType)
Definition: SpellInfo.cpp:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetProvidedTargetMask()

uint32 SpellEffectInfo::GetProvidedTargetMask ( ) const
656 {
658 }
SpellImplicitTargetInfo TargetA
Definition: SpellInfo.h:246
SpellImplicitTargetInfo TargetB
Definition: SpellInfo.h:247
SpellTargetObjectTypes GetObjectType() const
Definition: SpellInfo.cpp:88
uint32 GetTargetFlagMask(SpellTargetObjectTypes objType)
Definition: SpellInfo.cpp:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetScalingExpectedStat()

ExpectedStatType SpellEffectInfo::GetScalingExpectedStat ( ) const
695 {
696  switch (Effect)
697  {
704  case SPELL_EFFECT_HEAL:
709  if (MiscValue == POWER_MANA)
711  return ExpectedStatType::None;
725  switch (ApplyAuraName)
726  {
753  case SPELL_AURA_MOD_STAT:
770  if (MiscValue == POWER_MANA)
772  return ExpectedStatType::None;
773  default:
774  break;
775  }
776  break;
777  default:
778  break;
779  }
780 
781  return ExpectedStatType::None;
782 }
Definition: SpellAuraDefines.h:141
Definition: SharedDefines.h:1241
int32 MiscValue
Definition: SpellInfo.h:242
Definition: SpellAuraDefines.h:173
Definition: SpellAuraDefines.h:150
Definition: SharedDefines.h:1300
Definition: SpellAuraDefines.h:161
Definition: SpellAuraDefines.h:318
SpellEffectName Effect
Definition: SpellInfo.h:233
Definition: SpellAuraDefines.h:506
Definition: SpellAuraDefines.h:110
Definition: SpellAuraDefines.h:101
Definition: SharedDefines.h:1107
Definition: SharedDefines.h:1128
Definition: SharedDefines.h:1160
Definition: SpellAuraDefines.h:223
Definition: SpellAuraDefines.h:190
Definition: SharedDefines.h:1106
Definition: SpellAuraDefines.h:131
Definition: SpellAuraDefines.h:203
Definition: SpellAuraDefines.h:147
Definition: SpellAuraDefines.h:212
Definition: SharedDefines.h:1227
Definition: SharedDefines.h:1104
Definition: SpellAuraDefines.h:277
Definition: SpellAuraDefines.h:187
Definition: SharedDefines.h:1105
Definition: SpellAuraDefines.h:152
Definition: SharedDefines.h:1226
Definition: SharedDefines.h:1173
Definition: SpellAuraDefines.h:171
Definition: SharedDefines.h:1115
Definition: SharedDefines.h:1163
Definition: SpellAuraDefines.h:250
Definition: SpellAuraDefines.h:103
Definition: SharedDefines.h:1156
Definition: SharedDefines.h:1108
Definition: SpellAuraDefines.h:117
Definition: SpellAuraDefines.h:389
Definition: SpellAuraDefines.h:102
Definition: SpellAuraDefines.h:123
AuraType ApplyAuraName
Definition: SpellInfo.h:234
Definition: SharedDefines.h:1369
Definition: SpellAuraDefines.h:96
Definition: SpellAuraDefines.h:122
Definition: SpellAuraDefines.h:185
Definition: SpellAuraDefines.h:157
Definition: SpellAuraDefines.h:338
Definition: SpellAuraDefines.h:249
Definition: SharedDefines.h:1125
Definition: SpellAuraDefines.h:91
Definition: SharedDefines.h:1133
Definition: SharedDefines.h:265
Definition: SpellAuraDefines.h:553
Definition: SpellAuraDefines.h:112
Definition: SpellAuraDefines.h:172
Definition: SharedDefines.h:1100
Definition: SpellAuraDefines.h:211
Definition: SpellAuraDefines.h:268
Definition: SpellAuraDefines.h:219
Definition: SharedDefines.h:1217
Definition: SharedDefines.h:1272
+ Here is the caller graph for this function:

◆ GetUsedTargetObjectType()

SpellTargetObjectTypes SpellEffectInfo::GetUsedTargetObjectType ( ) const
690 {
692 }
SpellEffectName Effect
Definition: SpellInfo.h:233
SpellTargetObjectTypes UsedTargetObjectType
Definition: SpellInfo.h:307
static StaticData _data[TOTAL_SPELL_EFFECTS]
Definition: SpellInfo.h:309
+ Here is the caller graph for this function:

◆ HasMaxRadius()

bool SpellEffectInfo::HasMaxRadius ( ) const
622 {
623  return MaxRadiusEntry != nullptr;
624 }
SpellRadiusEntry const * MaxRadiusEntry
Definition: SpellInfo.h:249
+ Here is the caller graph for this function:

◆ HasRadius()

bool SpellEffectInfo::HasRadius ( ) const
617 {
618  return RadiusEntry != nullptr;
619 }
SpellRadiusEntry const * RadiusEntry
Definition: SpellInfo.h:248
+ Here is the caller graph for this function:

◆ IsAreaAuraEffect()

bool SpellEffectInfo::IsAreaAuraEffect ( ) const
438 {
447  return true;
448  return false;
449 }
Definition: SharedDefines.h:1241
Definition: SharedDefines.h:1300
SpellEffectName Effect
Definition: SpellInfo.h:233
Definition: SharedDefines.h:1227
Definition: SharedDefines.h:1226
Definition: SharedDefines.h:1163
Definition: SharedDefines.h:1369
Definition: SharedDefines.h:1133
Definition: SharedDefines.h:1217
+ Here is the caller graph for this function:

◆ IsAura() [1/2]

bool SpellEffectInfo::IsAura ( ) const
423 {
425 }
SpellEffectName Effect
Definition: SpellInfo.h:233
bool IsUnitOwnedAuraEffect() const
Definition: SpellInfo.cpp:451
AuraType ApplyAuraName
Definition: SpellInfo.h:234
Definition: SharedDefines.h:1125
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsAura() [2/2]

bool SpellEffectInfo::IsAura ( AuraType  aura) const
428 {
429  return IsAura() && ApplyAuraName == uint32(aura);
430 }
bool IsAura() const
Definition: SpellInfo.cpp:422
uint32_t uint32
Definition: Define.h:152
AuraType ApplyAuraName
Definition: SpellInfo.h:234
+ Here is the call graph for this function:

◆ IsEffect() [1/2]

bool SpellEffectInfo::IsEffect ( ) const
413 {
414  return Effect != 0;
415 }
SpellEffectName Effect
Definition: SpellInfo.h:233
+ Here is the caller graph for this function:

◆ IsEffect() [2/2]

bool SpellEffectInfo::IsEffect ( SpellEffectName  effectName) const
418 {
419  return Effect == uint32(effectName);
420 }
SpellEffectName Effect
Definition: SpellInfo.h:233
uint32_t uint32
Definition: Define.h:152

◆ IsTargetingArea()

bool SpellEffectInfo::IsTargetingArea ( ) const
433 {
434  return TargetA.IsArea() || TargetB.IsArea();
435 }
bool IsArea() const
Definition: SpellInfo.cpp:73
SpellImplicitTargetInfo TargetA
Definition: SpellInfo.h:246
SpellImplicitTargetInfo TargetB
Definition: SpellInfo.h:247
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsUnitOwnedAuraEffect()

bool SpellEffectInfo::IsUnitOwnedAuraEffect ( ) const
452 {
454 }
SpellEffectName Effect
Definition: SpellInfo.h:233
bool IsAreaAuraEffect() const
Definition: SpellInfo.cpp:437
Definition: SharedDefines.h:1104
Definition: SharedDefines.h:1272
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ SpellInfo

friend class SpellInfo
friend

Member Data Documentation

◆ _data

SpellEffectInfo::StaticData SpellEffectInfo::_data
staticprivate

◆ _immunityInfo

ImmunityInfo SpellEffectInfo::_immunityInfo
private

◆ _spellInfo

SpellInfo const* SpellEffectInfo::_spellInfo
private

◆ Amplitude

float SpellEffectInfo::Amplitude

◆ ApplyAuraName

AuraType SpellEffectInfo::ApplyAuraName

◆ ApplyAuraPeriod

uint32 SpellEffectInfo::ApplyAuraPeriod

◆ BasePoints

int32 SpellEffectInfo::BasePoints

◆ BonusCoefficient

float SpellEffectInfo::BonusCoefficient

◆ BonusCoefficientFromAP

float SpellEffectInfo::BonusCoefficientFromAP

◆ ChainAmplitude

float SpellEffectInfo::ChainAmplitude

◆ ChainTargets

int32 SpellEffectInfo::ChainTargets

◆ Effect

SpellEffectName SpellEffectInfo::Effect

◆ EffectAttributes

EnumFlag<SpellEffectAttributes> SpellEffectInfo::EffectAttributes

◆ EffectIndex

SpellEffIndex SpellEffectInfo::EffectIndex

◆ ImplicitTargetConditions

std::vector<Condition*>* SpellEffectInfo::ImplicitTargetConditions

◆ ItemType

uint32 SpellEffectInfo::ItemType

◆ MaxRadiusEntry

SpellRadiusEntry const* SpellEffectInfo::MaxRadiusEntry

◆ Mechanic

Mechanics SpellEffectInfo::Mechanic

◆ MiscValue

int32 SpellEffectInfo::MiscValue

◆ MiscValueB

int32 SpellEffectInfo::MiscValueB

◆ PointsPerResource

float SpellEffectInfo::PointsPerResource

◆ PositionFacing

float SpellEffectInfo::PositionFacing

◆ RadiusEntry

SpellRadiusEntry const* SpellEffectInfo::RadiusEntry

◆ RealPointsPerLevel

float SpellEffectInfo::RealPointsPerLevel

◆ Scaling

struct SpellEffectInfo::ScalingInfo SpellEffectInfo::Scaling

◆ SpellClassMask

flag128 SpellEffectInfo::SpellClassMask

◆ TargetA

SpellImplicitTargetInfo SpellEffectInfo::TargetA

◆ TargetB

SpellImplicitTargetInfo SpellEffectInfo::TargetB

◆ TriggerSpell

uint32 SpellEffectInfo::TriggerSpell

The documentation for this class was generated from the following files: