35struct SpellHealPrediction;
76#define SPELL_CHANNEL_UPDATE_INTERVAL (1 * IN_MILLISECONDS)
77#define MAX_SPELL_RANGE_TOLERANCE 3.0f
78#define TRAJECTORY_MISSILE_SIZE 3.0f
79#define AOE_DAMAGE_TARGET_CAP SI64LIT(20)
250typedef std::vector<std::pair<uint32, ObjectGuid>>
DispelList;
261 void EffectDistract();
262 void EffectSchoolDMG();
263 void EffectEnvironmentalDMG();
264 void EffectInstaKill();
266 void EffectTeleportUnits();
267 void EffectTeleportUnitsWithVisualLoadingScreen();
268 void EffectApplyAura();
269 void EffectSendEvent();
270 void EffectPowerBurn();
271 void EffectPowerDrain();
274 void EffectTeleportToReturnPoint();
275 void EffectIncreaseCurrencyCap();
276 void EffectHealthLeech();
277 void EffectQuestComplete();
278 void EffectCreateItem();
279 void EffectCreateItem2();
280 void EffectCreateRandomItem();
281 void EffectPersistentAA();
282 void EffectEnergize();
283 void EffectOpenLock();
284 void EffectSummonChangeItem();
285 void EffectProficiency();
286 void EffectSummonType();
287 void EffectLearnSpell();
289 void EffectDualWield();
290 void EffectPickPocket();
291 void EffectAddFarsight();
292 void EffectUntrainTalents();
293 void EffectHealMechanical();
295 void EffectJumpDest();
296 void EffectLeapBack();
297 void EffectQuestClear();
298 void EffectTeleUnitsFaceCaster();
299 void EffectLearnSkill();
300 void EffectPlayMovie();
301 void EffectTradeSkill();
302 void EffectEnchantItemPerm();
303 void EffectEnchantItemTmp();
304 void EffectTameCreature();
305 void EffectSummonPet();
306 void EffectLearnPetSpell();
307 void EffectWeaponDmg();
308 void EffectForceCast();
309 void EffectTriggerSpell();
310 void EffectTriggerMissileSpell();
312 void EffectHealMaxHealth();
313 void EffectInterruptCast();
314 void EffectSummonObjectWild();
315 void EffectScriptEffect();
316 void EffectSanctuary();
319 void EffectSummonPlayer();
320 void EffectActivateObject();
321 void EffectApplyGlyph();
322 void EffectEnchantHeldItem();
323 void EffectSummonObject();
324 void EffectChangeRaidMarker();
325 void EffectResurrect();
329 void EffectTransmitted();
330 void EffectDisEnchant();
331 void EffectInebriate();
332 void EffectFeedPet();
333 void EffectDismissPet();
334 void EffectReputation();
335 void EffectForceDeselect();
336 void EffectSelfResurrect();
337 void EffectSkinning();
339 void EffectChargeDest();
340 void EffectProspecting();
341 void EffectMilling();
342 void EffectRenamePet();
343 void EffectSendTaxi();
344 void EffectKnockBack();
345 void EffectPullTowards();
346 void EffectPullTowardsDest();
347 void EffectDispelMechanic();
348 void EffectResurrectPet();
349 void EffectDestroyAllTotems();
350 void EffectDurabilityDamage();
353 void EffectDurabilityDamagePCT();
354 void EffectModifyThreatPercent();
355 void EffectResurrectNew();
356 void EffectAddExtraAttacks();
357 void EffectSpiritHeal();
358 void EffectSkinPlayerCorpse();
359 void EffectStealBeneficialBuff();
360 void EffectUnlearnSpecialization();
361 void EffectHealPct();
362 void EffectEnergizePct();
363 void EffectTriggerRitualOfSummoning();
364 void EffectSummonRaFFriend();
365 void EffectUnlockGuildVaultTab();
366 void EffectKillCreditPersonal();
367 void EffectKillCredit();
368 void EffectQuestFail();
369 void EffectQuestStart();
370 void EffectRedirectThreat();
371 void EffectGameObjectDamage();
372 void EffectGameObjectRepair();
373 void EffectGameObjectSetDestructionState();
374 void EffectCreateTamedPet();
375 void EffectDiscoverTaxi();
376 void EffectTitanGrip();
377 void EffectEnchantItemPrismatic();
378 void EffectPlayMusic();
379 void EffectActivateSpec();
380 void EffectPlaySound();
381 void EffectRemoveAura();
382 void EffectDamageFromMaxHealthPCT();
383 void EffectCastButtons();
384 void EffectRechargeItem();
385 void EffectGiveCurrency();
386 void EffectSummonPersonalGameObject();
387 void EffectResurrectWithAura();
388 void EffectCreateAreaTrigger();
389 void EffectRemoveTalent();
390 void EffectDestroyItem();
391 void EffectLearnGarrisonBuilding();
392 void EffectRemoveAuraBySpellLabel();
393 void EffectCreateGarrison();
394 void EffectCreateConversation();
395 void EffectCancelConversation();
396 void EffectAddGarrisonFollower();
397 void EffectActivateGarrisonBuilding();
398 void EffectGrantBattlePetLevel();
399 void EffectGiveExperience();
400 void EffectGiveRestedExperience();
401 void EffectHealBattlePetPct();
402 void EffectEnableBattlePets();
403 void EffectChangeBattlePetQuality();
404 void EffectLaunchQuestChoice();
405 void EffectUncageBattlePet();
406 void EffectCreateHeirloomItem();
407 void EffectUpgradeHeirloom();
408 void EffectApplyEnchantIllusion();
409 void EffectUpdatePlayerPhase();
410 void EffectUpdateZoneAurasAndPhases();
411 void EffectGiveArtifactPower();
412 void EffectGiveArtifactPowerNoBonus();
413 void EffectPlaySceneScriptPackage();
414 void EffectCreateSceneObject();
415 void EffectCreatePrivateSceneObject();
416 void EffectPlayScene();
417 void EffectGiveHonor();
418 void EffectJumpCharge();
419 void EffectLearnTransmogSet();
420 void EffectRespecAzeriteEmpoweredItem();
421 void EffectLearnAzeriteEssencePower();
422 void EffectCreatePrivateConversation();
423 void EffectSendChatMessage();
424 void EffectGrantBattlePetExperience();
425 void EffectLearnTransmogIllusion();
426 void EffectModifyAuraStacks();
427 void EffectModifyCooldown();
428 void EffectModifyCooldowns();
429 void EffectModifyCooldownsByCategory();
430 void EffectModifySpellCharges();
431 void EffectCreateTraitTreeConfig();
432 void EffectChangeActiveCombatTraitConfig();
433 void EffectTeleportGraveyard();
441 void SelectExplicitTargets();
443 void SelectSpellTargets();
458 void SelectEffectTypeImplicitTargets(
SpellEffectInfo const& spellEffectInfo);
461 template<
class SEARCHER>
static void SearchTargets(SEARCHER& searcher,
uint32 containerMask,
WorldObject* referer,
Position const* pos,
float radius);
474 void update(
uint32 difftime);
475 void cast(
bool skipCheck =
false);
479 void TakeRunePower(
bool didHit);
487 void handle_immediate();
490 void _handle_immediate_phase();
491 void _handle_finish_phase();
501 bool CheckSpellCancelsAuraEffect(
AuraType auraType,
int32* param1)
const;
502 bool CheckSpellCancelsCharm(
int32* param1)
const;
503 bool CheckSpellCancelsStun(
int32* param1)
const;
504 bool CheckSpellCancelsSilence(
int32* param1)
const;
505 bool CheckSpellCancelsPacify(
int32* param1)
const;
506 bool CheckSpellCancelsFear(
int32* param1)
const;
507 bool CheckSpellCancelsConfuse(
int32* param1)
const;
508 bool CheckSpellCancelsNoActions(
int32* param1)
const;
513 void DelayedChannel();
522 bool CanAutoCast(
Unit* target);
530 void SendSpellStart();
532 void SendSpellCooldown();
533 void SendSpellExecuteLog();
553 void SendSpellInterruptLog(
Unit* victim,
uint32 spellId);
554 void SendInterrupted(
uint8 result);
555 void SendChannelUpdate(
uint32 time);
556 void SendChannelStart(
uint32 duration);
557 void SendResurrectRequest(
Player* target);
560 void HandleThreatSpells();
616 void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; }
617 bool IsTriggered()
const;
618 bool IsIgnoringCooldowns()
const;
619 bool IsFocusDisabled()
const;
620 bool IsProcDisabled()
const;
621 bool IsChannelActive()
const;
622 bool IsAutoActionResetSpell()
const;
623 bool IsPositive()
const;
629 bool IsDeletable()
const {
return !m_referencedFromCurrentSpell && !m_executedCurrently; }
636 uint64 CalculateDelayMomentForDst(
float launchDelay)
const;
637 void RecalculateDelayMomentForDst();
638 void UpdateDelayMomentForDst(
uint64 hitDelay);
639 void UpdateDelayMomentForUnitTarget(
Unit* unit,
uint64 hitDelay);
643 bool IsNeedSendToClient()
const;
652 std::vector<SpellPowerCost>
const&
GetPowerCost()
const {
return m_powerCost; }
653 bool HasPowerTypeCost(
Powers power)
const;
656 bool UpdatePointers();
658 void CleanupTargetList();
677 void CallScriptOnResistAbsorbCalculateHandlers(
DamageInfo const& damageInfo,
uint32& resistAmount,
int32& absorbAmount);
683 bool HasGlobalCooldown()
const;
684 void TriggerGlobalCooldown();
685 void CancelGlobalCooldown();
686 void _cast(
bool skipCheck =
false);
688 std::pair<float, float> GetMinMaxRange(
bool strict)
const;
712 if (m_delayAtDamageCount >= 2)
715 ++m_delayAtDamageCount;
743 Unit* GetUnitCasterForEffectHandlers()
const;
761 void prepareDataForTriggerSystem();
782 void PreprocessTarget(
Spell* spell)
override;
784 void DoDamageAndTriggers(
Spell* spell)
override;
794 bool IsAlive =
false;
801 bool Positive =
true;
805 Unit* _spellHitTarget =
nullptr;
806 bool _enablePVP =
false;
837 template <
class Container>
838 void DoProcessTargetContainer(Container& targetContainer);
844 void AddUnitTarget(
Unit* target,
uint32 effectMask,
bool checkIfValid =
true,
bool implicit =
true,
Position const* losPosition =
nullptr);
846 void AddItemTarget(
Item* item,
uint32 effectMask);
847 void AddCorpseTarget(
Corpse* target,
uint32 effectMask);
850 void PreprocessSpellLaunch(
TargetInfo& targetInfo);
854 void DoTriggersOnSpellHit(
Unit* unit);
855 bool UpdateChanneledTargetList();
856 bool IsValidDeadOrAliveTarget(
Unit const* target)
const;
857 void HandleLaunchPhase();
859 void ResetCombatTimers();
861 void PrepareTargetProcessing();
862 void FinishTargetProcessing();
866 void CallScriptOnPrecastHandler();
867 void CallScriptBeforeCastHandlers();
868 void CallScriptOnCastHandlers();
869 void CallScriptAfterCastHandlers();
871 int32 CallScriptCalcCastTimeHandlers(
int32 originalCastTime);
875 void CallScriptOnHitHandlers();
876 void CallScriptAfterHitHandlers();
878 void CallScriptCalcCritChanceHandlers(
Unit const* victim,
float& chance);
879 void CallScriptCalcDamageHandlers(
Unit* victim,
int32& damage,
int32& flatMod,
float& pctMod);
880 void CallScriptCalcHealingHandlers(
Unit* victim,
int32& healing,
int32& flatMod,
float& pctMod);
885 bool CheckScriptEffectImplicitTargets(
uint32 effIndex,
uint32 effIndexToCheck);
891 triggeredSpell(spellInfo), triggeredByAura(auraSpellInfo), chance(procChance) { }
899 bool CanExecuteTriggersOnHit(
Unit* unit,
SpellInfo const* triggeredByAura =
nullptr)
const;
900 void PrepareTriggersExecutedOnHit();
906 void CalculateJumpSpeeds(
SpellEffectInfo const* effInfo,
float dist,
float& speedXY,
float& speedZ);
909 int32 GetSpellCastDataAmmo();
std::vector< Condition > ConditionContainer
#define MAX_SPELL_EFFECTS
std::string GetDebugInfo()
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ SPELL_CUSTOM_ERROR_NONE
@ SPELL_CAST_SOURCE_SPELL
@ SPELL_CAST_SOURCE_PLAYER
@ SPELL_CAST_SOURCE_PASSIVE
@ SPELL_CAST_SOURCE_NORMAL
std::vector< std::pair< uint32, ObjectGuid > > DispelList
void(Spell::*)() SpellEffectHandlerFn
@ CAST_FLAG_EX_DELAY_STARTING_COOLDOWNS
@ CAST_FLAG_EX_UNKNOWN_15
@ CAST_FLAG_EX_UNKNOWN_17
@ CAST_FLAG_EX_DONT_CONSUME_CHARGES
@ CAST_FLAG_EX_USE_TOY_SPELL
@ CAST_FLAG_EX_UNKNOWN_11
@ CAST_FLAG_EX_UNKNOWN_14
@ CAST_FLAG_EX_UNKNOWN_12
@ CAST_FLAG_EX_UNKNOWN_19
@ CAST_FLAG_EX_IGNORE_COOLDOWN
@ CAST_FLAG_EX_UNKNOWN_13
@ CAST_FLAG_EX_UNKNOWN_18
@ CAST_FLAG_EX_IGNORE_PET_COOLDOWN
@ CAST_FLAG_EX_UNKNOWN_20
@ CAST_FLAG_EX_TRIGGER_COOLDOWN_ON_SPELL_START
@ SPELL_EFFECT_HANDLE_LAUNCH_TARGET
@ SPELL_EFFECT_HANDLE_LAUNCH
@ SPELL_EFFECT_HANDLE_HIT
@ SPELL_EFFECT_HANDLE_HIT_TARGET
static const uint32 SPELL_INTERRUPT_NONPLAYER
@ CAST_FLAG_ADJUST_MISSILE
@ CAST_FLAG_HEAL_PREDICTION
@ CAST_FLAG_POWER_LEFT_SELF
@ CAST_FLAG_TRIGGER_PET_COOLDOWN
@ CAST_FLAG_HAS_TRAJECTORY
@ SPELL_HEAL_PREDICTION_TARGET_AND_BEACON
@ SPELL_HEAL_PREDICTION_TARGET
@ SPELL_HEAL_PREDICTION_TARGET_PARTY
@ SPELL_HEAL_PREDICTION_TARGET_AND_CASTER
static ObjectGuid const Empty
int64 GetCorpseTargetCountForEffect(SpellEffIndex effect) const
int64 GetUnitTargetCountForEffect(SpellEffIndex effect) const
int64 GetItemTargetCountForEffect(SpellEffIndex effect) const
Difficulty GetCastDifficulty() const
int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const
SpellInfo const * GetSpellInfo() const
std::vector< HitTriggerSpell > HitTriggerSpellList
std::vector< SpellPowerCost > m_powerCost
std::vector< SpellScript * > m_loadedScripts
GameObject * gameObjTarget
SpellMissInfo targetMissInfo
bool m_referencedFromCurrentSpell
uint32 m_channelTargetEffectMask
SpellCastTargets m_targets
void setState(uint32 state)
std::unique_ptr< PathGenerator > m_preGeneratedPath
TriggerCastFlags _triggeredCastFlags
bool IsAutoRepeat() const
SpellEffectHandleMode effectHandleMode
int32 m_channeledDuration
std::vector< TargetInfo > m_UniqueTargetInfo
bool IsInterruptable() const
void SetExecutedCurrently(bool yes)
ObjectGuid m_originalCastId
uint8 m_delayAtDamageCount
ProcFlagsSpellType m_procSpellType
WeaponAttackType m_attackType
ObjectGuid m_originalCasterGUID
WorldObject *const m_caster
int32 GetCastTime() const
std::vector< CorpseTargetInfo > m_UniqueCorpseTargetInfo
std::unordered_set< Aura * > UsedSpellMods
ObjectGuid GetOriginalCasterGUID() const
SpellCustomErrors m_customError
Spell(Spell const &right)=delete
std::vector< GOTargetInfo > m_UniqueGOTargetInfo
int32 GetProcChainLength() const
HitTriggerSpellList m_hitTriggerSpells
void SetDelayStart(uint64 m_time)
SpellEffectInfo const * effectInfo
SpellInfo const * m_triggeredByAuraSpell
uint32 m_applyMultiplierMask
SpellSchoolMask m_spellSchoolMask
WorldObject * GetCaster() const
Unit * GetOriginalCaster() const
void SetAutoRepeat(bool rep)
WorldLocation * destTarget
std::vector< SpellPowerCost > const & GetPowerCost() const
bool IsTriggeredByAura(SpellInfo const *auraSpellInfo) const
void SetReferencedFromCurrent(bool yes)
uint64 GetDelayStart() const
ProcFlagsInit m_procVictim
void SetRuneState(uint8 value)
std::vector< SpellLogEffect > _executeLogEffects
uint64 GetDelayMoment() const
UsedSpellMods m_appliedMods
SpellValue *const m_spellValue
uint8 GetRuneState() const
std::vector< ItemTargetInfo > m_UniqueItemInfo
SpellInfo const * GetTriggeredByAuraSpell() const
ProcFlagsInit m_procAttacker
ObjectGuid m_castItemGUID
SpellCastVisual m_SpellVisual
Spell & operator=(Spell const &right)=delete
int32 GetRemainingCastTime() const
SpellInfo const *const m_spellInfo
std::vector< T > & GetExecuteLogEffectTargets(SpellEffectName effect, Optional< std::vector< T > > SpellLogEffect::*member)
Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.
WorldObjectSpellAreaTargetSearchReason
void SelectRandomInjuredTargets(std::list< WorldObject * > &targets, size_t maxTargets, bool prioritizePlayers, Unit const *prioritizeGroupMembersOf)
Optional< std::vector< SpellLogEffectTradeSkillItemParams > > TradeSkillTargets
Optional< std::vector< SpellLogEffectFeedPetParams > > FeedPetTargets
Optional< std::vector< SpellLogEffectPowerDrainParams > > PowerDrainTargets
Optional< std::vector< SpellLogEffectDurabilityDamageParams > > DurabilityDamageTargets
Optional< std::vector< SpellLogEffectGenericVictimParams > > GenericVictimTargets
Optional< std::vector< SpellLogEffectExtraAttacksParams > > ExtraAttacksTargets
Optional< int32 > Duration
Optional< int32 > ParentSpellTargetIndex
int32 EffectBasePoints[MAX_SPELL_EFFECTS]
uint32 CustomBasePointsMask
uint32 MaxAffectedTargets
Optional< int32 > ParentSpellTargetCount
SpellValue(SpellInfo const *proto, WorldObject const *caster)
SpellInfo const * triggeredSpell
HitTriggerSpell(SpellInfo const *spellInfo, SpellInfo const *auraSpellInfo, int32 procChance)
SpellInfo const * triggeredByAura
virtual void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo)=0
virtual void PreprocessTarget(Spell *)
virtual ~TargetInfoBase()
virtual void DoDamageAndTriggers(Spell *)
WorldObjectSpellAreaTargetSearchReason _searchReason
Position const * _position
Position const * _position
SpellTargetCheckTypes _targetSelectionType
std::unique_ptr< ConditionSourceInfo > _condSrcInfo
SpellInfo const * _spellInfo
ConditionContainer const * _condList
SpellTargetObjectTypes _objectType
Position const * _position