300 std::vector<AuraEffect*> aurEffs(auras.begin(), auras.end());
304 SpellInfo const* spellInfo = aurEff->GetSpellInfo();
307 aurEff->RecalculateAmount();
408 target->
CastSpell(target, triggerspell, aurEff);
459 int32 const mod = std::min(
static_cast<int32>(rage), 100);
571 return healInfo && healInfo->
GetHeal();
613 uint32 countMin = rip->GetBase()->GetMaxDuration();
616 uint32 countMax = rip->GetSpellInfo()->GetMaxDuration();
625 if (countMin < countMax)
656 Aura* aura = aurEff->GetBase();
665 if (countMin < countMax)
764 amount += relicAurEff->GetAmount() / aurEff->
GetTotalTicks();
893 return healInfo && healInfo->
GetHeal();
995 if (caster->
GetGUID() == hot->GetCasterGUID())
999 AddPct(heal, aurEff->GetAmount() * auraCount);
1024 target->
CastSpell(target, spellId, aurEff);
1091 target->UpdateAttackPowerAndDamage();
1207 canBeRecalculated =
false;
1212 uint8 cp = caster->ToPlayer()->GetComboPoints();
1216 amount += cp * auraEffIdolOfFeralShadows->GetAmount();
1219 amount += cp * auraEffIdolOfWorship->GetAmount();
1416 if (caster->Has310Flyer(
false))
1699 target->
CastSpell(target, triggerspell, aurEff);
1724 if (!damageInfo || !damageInfo->
GetDamage())
1759 if (!
GetCaster()->ToPlayer()->GetGroup())
1766 std::list<Unit*> tempTargets;
1767 for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
1769 tempTargets.push_back((*itr)->ToUnit());
1771 if (tempTargets.empty())
1780 targets.push_back(target);
1807 if (!healInfo || !healInfo->
GetHeal())
1869 if (targets.size() > maxTargets)
1872 targets.resize(maxTargets);
1916 float const bonus = 6.f - reduction;
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
std::chrono::seconds Seconds
Seconds shorthand typedef.
bool roll_chance_i(int chance)
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
#define RegisterSpellScript(spell_script)
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_KNOCK_BACK
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_UNIT_DEST_AREA_ENEMY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_FAILED_DONT_REPORT
@ SPELL_FAILED_ONLY_SHAPESHIFT
@ SPELL_FAILED_NOT_SHAPESHIFT
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_INCREASE_SPEED
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_ADD_FLAT_MODIFIER
@ SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_PERIODIC_ENERGIZE
@ SPELL_AURA_MOD_BASE_RESISTANCE_PCT
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
#define SpellCheckCastFn(F)
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraCheckEffectProcFn(F, I, N)
#define AuraEffectUpdatePeriodicFn(F, I, N)
#define AuraEffectAbsorbFn(F, I)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraCheckProcFn(F)
#define AuraEffectCalcSpellModFn(F, I, N)
#define AuraEffectRemoveFn(F, I, N, M)
T CalculatePct(T base, U pct)
uint32 GetTickNumber() const
SpellInfo const * GetSpellInfo() const
SpellEffectInfo const & GetSpellEffectInfo() const
void SetAmount(int32 amount)
uint32 GetTotalTicks() const
ObjectGuid GetCasterGUID() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< CheckEffectProcHandler > DoCheckEffectProc
HookList< EffectPeriodicHandler > OnEffectPeriodic
SpellInfo const * GetSpellInfo() const
HookList< EffectApplyHandler > AfterEffectApply
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
HookList< EffectCalcSpellModHandler > DoEffectCalcSpellMod
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
AuraEffect * GetEffect(uint8 effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
ObjectGuid GetCasterGUID() const
HookList< CheckProcHandler > DoCheckProc
HookList< AuraDispelHandler > AfterDispel
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
uint8 GetStackAmount() const
int32 GetMaxDuration() const
int32 GetDuration() const
void SetDuration(int32 duration, bool withMods=false)
SpellInfo const * GetSpellInfo() const
void SetMaxDuration(int32 duration)
uint8 GetRemovedCharges() const
static Unit * ToUnit(Object *o)
static ObjectGuid GetGUID(Object const *o)
static Player * ToPlayer(Object *o)
HealInfo * GetHealInfo() const
Unit * GetActionTarget() const
SpellInfo const * GetSpellInfo() const
DamageInfo * GetDamageInfo() const
RaidCheck(Unit const *caster)
bool operator()(WorldObject *obj) const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr) const
void AddCooldown(uint32 spellId, uint32 itemId, std::chrono::duration< Type, Period > cooldownDuration)
bool HasCooldown(SpellInfo const *spellInfo, uint32 itemId=0, bool ignoreCategoryCooldown=false) const
void ResetCooldowns(Predicate predicate, bool update=false)
uint32 GetMaxTicks() const
uint32 GetCategory() const
int32 GetMaxDuration() const
SpellSchoolMask GetSchoolMask() const
int32 CalcPowerCost(WorldObject const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
HookList< CheckCastHandler > OnCheckCast
HookList< HitHandler > AfterHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
SpellInfo const * GetTriggeringSpell() const
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
void SetHitHeal(int32 heal)
Unit * GetExplTargetUnit() const
void FinishCast(SpellCastResult result, uint32 *param1=nullptr, uint32 *param2=nullptr)
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
ShapeshiftForm GetShapeshiftForm() const
bool IsInDisallowedMountForm() const
Powers GetPowerType() const
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
uint32 GetCreatureType() const
bool HealthBelowPct(int32 pct) const
uint32 GetMaxPower(Powers power) const
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool force=false)
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool HasUnitState(const uint32 f) const
bool IsInRaidWith(Unit const *unit) const
bool IsInFeralForm() const
uint32 CountPctFromMaxHealth(int32 pct) const
SpellHistory * GetSpellHistory()
uint32 GetPower(Powers power) const
std::list< AuraEffect * > AuraEffectList
uint32 GetCreatePowerValue(Powers power) const
float GetTotalAttackPowerValue(WeaponAttackType attType) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_barkskin)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_dru_berserk)
PrepareAuraScript(spell_dru_dash)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
TimePoint _solarProcCooldownEnd
bool CheckProc(ProcEventInfo &eventInfo)
TimePoint _lunarProcCooldownEnd
void ProcSolar(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_eclipse)
bool CheckLunar(AuraEffect const *, ProcEventInfo &eventInfo)
void ProcLunar(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool CheckSolar(AuraEffect const *, ProcEventInfo &eventInfo)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void RecalculateBaseArmor()
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_enrage)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_frenzied_regeneration)
void PeriodicTick(AuraEffect const *aurEff)
PrepareAuraScript(spell_dru_glyph_of_barkskin)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_innervate)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_rake)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_rejuvenation)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_shred)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_starfire_dummy)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
PrepareSpellScript(spell_dru_glyph_of_starfire)
bool Validate(SpellInfo const *) override
void HandleEffectCalcSpellMod(AuraEffect const *aurEff, SpellModifier *&spellMod)
PrepareAuraScript(spell_dru_idol_lifebloom)
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
PrepareAuraScript(spell_dru_innervate)
PrepareAuraScript(spell_dru_insect_swarm)
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_item_t6_trinket)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_leader_of_the_pack)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void HandleDispel(DispelInfo *dispelInfo)
PrepareAuraScript(spell_dru_lifebloom)
bool Validate(SpellInfo const *) override
void OnRemoveEffect(Unit *target, AuraEffect const *aurEff, uint32 stack)
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
PrepareAuraScript(spell_dru_living_seed_proc)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_living_seed)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_dru_nourish)
void HandleHeal(SpellEffIndex)
PrepareAuraScript(spell_dru_nurturing_instinct)
bool Validate(SpellInfo const *) override
void AfterApply(AuraEffect const *aurEff, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_dru_omen_of_clarity)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
PrepareAuraScript(spell_dru_owlkin_frenzy)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_dru_predatory_strikes)
void UpdateAmount(AuraEffect const *, AuraEffectHandleModes)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_dru_primal_tenacity)
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
spell_dru_primal_tenacity()
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_revitalize)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &canBeRecalculated)
PrepareAuraScript(spell_dru_rip)
PrepareAuraScript(spell_dru_savage_defense)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *spellInfo) override
void AfterApply(AuraEffect const *aurEff, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_savage_roar_aura)
SpellCastResult CheckCast()
PrepareSpellScript(spell_dru_savage_roar)
PrepareSpellScript(spell_dru_starfall_aoe)
void FilterTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_dru_starfall_dummy)
void HandleDummy(SpellEffIndex)
void FilterTargets(std::list< WorldObject * > &targets)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_dru_survival_instincts_aura)
bool Validate(SpellInfo const *) override
void AfterApply(AuraEffect const *aurEff, AuraEffectHandleModes)
PrepareSpellScript(spell_dru_survival_instincts)
SpellCastResult CheckCast()
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_dru_swift_flight_passive)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t10_balance_4p_bonus)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_t10_restoration_4p_bonus_dummy)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
PrepareSpellScript(spell_dru_t10_restoration_4p_bonus)
void FilterTargets(std::list< WorldObject * > &targets)
bool CheckProc(ProcEventInfo &)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t3_2p_bonus)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t3_6p_bonus)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_t3_8p_bonus)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t4_2p_bonus)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t9_feral_relic)
PrepareSpellScript(spell_dru_tiger_s_fury)
PrepareSpellScript(spell_dru_typhoon)
void HandleKnockBack(SpellEffIndex effIndex)
void SetTickHeal(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_dru_wild_growth_aura)
void HandleTickUpdate(AuraEffect *aurEff)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_dru_wild_growth)
bool Validate(SpellInfo const *spellInfo) override
void SetTargets(std::list< WorldObject * > &targets)
std::list< WorldObject * > _targets
void FilterTargets(std::list< WorldObject * > &targets)
TimePoint Now()
Current chrono steady_clock time point.
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
void RandomResize(C &container, std::size_t requestedSize)
void AddSC_druid_spell_scripts()
@ SPELL_CATEGORY_MANGLE_BEAR
@ SPELL_DRUID_GLYPH_OF_REJUVENATION_HEAL
@ SPELL_DRUID_ITEM_T8_BALANCE_RELIC
@ SPELL_DRUID_BLESSING_OF_CENARIUS
@ SPELL_DRUID_BLESSING_OF_ELUNE
@ SPELL_DRUID_LIFEBLOOM_ENERGIZE
@ SPELL_DRUID_KING_OF_THE_JUNGLE
@ SPELL_DRUID_GLYPH_OF_RAKE_TRIGGERED
@ SPELL_DRUID_REVITALIZE_ENERGIZE_MANA
@ SPELL_DRUID_BLESSING_OF_THE_CLAW
@ SPELL_DRUID_NURTURING_INSTINCT_R1
@ SPELL_DRUID_REVITALIZE_ENERGIZE_RP
@ SPELL_DRUID_LIVING_SEED_PROC
@ SPELL_DRUID_BLESSING_OF_REMULOS
@ SPELL_DRUID_FORMS_TRINKET_BEAR
@ SPELL_DRUID_FRENZIED_REGENERATION_HEAL
@ SPELL_DRUID_RIP_DURATION_LACERATE_DMG
@ SPELL_DRUID_REVITALIZE_ENERGIZE_ENERGY
@ SPELL_DRUID_DIRE_BEAR_FORM_PASSIVE
@ SPELL_DRUID_BARKSKIN_01
@ SPELL_DRUID_LIVING_SEED_HEAL
@ SPELL_DRUID_FORMS_TRINKET_CAT
@ SPELL_DRUID_T9_FERAL_RELIC_CAT
@ SPELL_DRUID_IMP_LEADER_OF_THE_PACK_HEAL
@ SPELL_DRUID_REJUVENATION_T10_PROC
@ SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN
@ SPELL_DRUID_T9_FERAL_RELIC_BEAR
@ SPELL_DRUID_BALANCE_T10_BONUS_PROC
@ SPELL_DRUID_ECLIPSE_SOLAR_PROC
@ SPELL_DRUID_ENRAGED_DEFENSE
@ SPELL_DRUID_SAVAGE_ROAR
@ SPELL_DRUID_LIFEBLOOM_FINAL_HEAL
@ SPELL_DRUID_ITEM_T10_FERAL_4P_BONUS
@ SPELL_DRUID_T3_PROC_ENERGIZE_MANA
@ SPELL_DRUID_INCREASED_MOONFIRE_DURATION
@ SPELL_DRUID_SURVIVAL_INSTINCTS
@ SPELL_DRUID_BEAR_FORM_PASSIVE
@ SPELL_DRUID_T3_PROC_ENERGIZE_RAGE
@ SPELL_DRUID_ECLIPSE_LUNAR_PROC
@ SPELL_DRUID_IMP_LEADER_OF_THE_PACK_R1
@ SPELL_DRUID_GLYPH_OF_RIP
@ SPELL_DRUID_IDOL_OF_FERAL_SHADOWS
@ SPELL_DRUID_IDOL_OF_WORSHIP
@ SPELL_DRUID_REVITALIZE_ENERGIZE_RAGE
@ SPELL_DRUID_FORMS_TRINKET_NONE
@ SPELL_DRUID_GLYPH_OF_TYPHOON
@ SPELL_DRUID_T3_PROC_ENERGIZE_ENERGY
@ SPELL_DRUID_FORMS_TRINKET_MOONKIN
@ SPELL_DRUID_IMP_LEADER_OF_THE_PACK_MANA
@ SPELL_DRUID_BALANCE_T10_BONUS
@ SPELL_DRUID_FORMS_TRINKET_TREE
@ SPELL_DRUID_TIGER_S_FURY_ENERGIZE
@ SPELL_DRUID_NURTURING_INSTINCT_R2
@ SPELL_DRUID_GLYPH_OF_STARFIRE_SCRIPT
@ SPELL_DRUID_GLYPH_OF_NOURISH
@ SPELL_DRUID_NATURES_SPLENDOR
@ SPELL_DRUID_ENRAGE_MOD_DAMAGE
@ SPELL_DRUID_RESTORATION_T10_2P_BONUS