TrinityCore
Loading...
Searching...
No Matches
spell_monk.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Scripts for spells with SPELLFAMILY_MONK and SPELLFAMILY_GENERIC spells used by monk players.
20 * Scriptnames of files in this file should be prefixed with "spell_monk_".
21 */
22
23#include "ScriptMgr.h"
24#include "AreaTrigger.h"
25#include "AreaTriggerAI.h"
26#include "DB2Stores.h"
27#include "PathGenerator.h"
28#include "Player.h"
29#include "Spell.h"
30#include "SpellAuraEffects.h"
31#include "SpellInfo.h"
32#include "SpellMgr.h"
33#include "SpellScript.h"
34
69
70// 399226 - Burst of Life (attached to 116849 - Life Cocoon)
72{
73 bool Validate(SpellInfo const* /*spellInfo*/) override
74 {
77 }
78
79 bool Load() override
80 {
81 Unit* caster = GetCaster();
83 }
84
85 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
86 {
88 if (removeMode != AURA_REMOVE_BY_EXPIRE && (removeMode != AURA_REMOVE_BY_ENEMY_SPELL || aurEff->GetAmountAsInt()))
89 return;
90
91 Unit* caster = GetCaster();
92 if (!caster)
93 return;
94
96 if (!burstOfLife)
97 return;
98
101 .SpellValueOverrides = { { SPELLVALUE_MAX_TARGETS, burstOfLife->GetAmountAsInt() } }
102 });
103 }
104
109};
110
111// 399230 - Burst of Life
113{
114 void FilterTargets(std::list<WorldObject*>& targets) const
115 {
116 Trinity::SelectRandomInjuredTargets(targets, GetSpellValue()->MaxAffectedTargets, true, GetExplTargetUnit());
117 }
118
123};
124
125// 117952 - Crackling Jade Lightning
127{
128 bool Validate(SpellInfo const* /*spellInfo*/) override
129 {
130 return ValidateSpellInfo(
131 {
134 });
135 }
136
137 void OnTick(AuraEffect const* /*aurEff*/)
138 {
139 if (Unit* caster = GetCaster())
140 if (caster->HasAura(SPELL_MONK_STANCE_OF_THE_SPIRITED_CRANE))
142 }
143
148};
149
150// 117959 - Crackling Jade Lightning
189
190// 450553 - Jade Walk
192{
193 bool Validate(SpellInfo const* /*spellInfo*/) override
194 {
196 }
197
198 void HandlePeriodicTick(AuraEffect const* aurEff)
199 {
200 Unit* target = GetTarget();
201 if (!target->IsInCombat())
204 .TriggeringAura = aurEff
205 });
206 else
208 }
209
214};
215
216// 116849 - Life Cocoon
218{
219 bool Validate(SpellInfo const* /*spellInfo*/) override
220 {
222 }
223
225 {
227 if (Player* player = GetCaster()->ToPlayer())
228 AddPct(absorb, player->GetRatingBonusValue(CR_VERSATILITY_HEALING_DONE));
229
230 if (AuraEffect* calmingCoalescence = GetCaster()->GetAuraEffect(SPELL_MONK_CALMING_COALESCENCE, EFFECT_0, GetCaster()->GetGUID()))
231 {
232 AddPct(absorb, calmingCoalescence->GetAmount());
233 calmingCoalescence->GetBase()->Remove();
234 }
235
237 }
238
243};
244
245// 388548 - Mists of Life (attached to 116849 - Life Cocoon)
276
277// 392972 - Open Palm Strikes
279{
280 bool Validate(SpellInfo const* /*spellInfo*/) override
281 {
283 }
284
285 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*procInfo*/)
286 {
288 return talent && roll_chance(talent->GetAmount());
289 }
290
295};
296
297// 121817 - Power Strike
315
316// 129914 - Power Strike Proc
318{
319 bool Validate(SpellInfo const* /*spellInfo*/) override
320 {
322 }
323
324 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
325 {
327 }
328
333};
334
335// 115078 - Paralysis
337{
338 bool Validate(SpellInfo const* spellInfo) override
339 {
341 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } })
343 }
344
345 bool Load() override
346 {
348 }
349
350 static void PreventDispel(SpellScript const&, WorldObject*& target)
351 {
352 target = nullptr;
353 }
354
359};
360
361// 115546 - Provoke
363{
364 static uint32 const BlackOxStatusEntry = 61146;
365
366 bool Validate(SpellInfo const* spellInfo) override
367 {
368 if (!(spellInfo->GetExplicitTargetMask() & TARGET_FLAG_UNIT_MASK)) // ensure GetExplTargetUnit() will return something meaningful during CheckCast
369 return false;
370 return ValidateSpellInfo(
371 {
374 });
375 }
376
378 {
380 {
381 SpellInfo const* singleTarget = sSpellMgr->AssertSpellInfo(SPELL_MONK_PROVOKE_SINGLE_TARGET, GetCastDifficulty());
382 SpellCastResult singleTargetExplicitResult = singleTarget->CheckExplicitTarget(GetCaster(), GetExplTargetUnit());
383 if (singleTargetExplicitResult != SPELL_CAST_OK)
384 return singleTargetExplicitResult;
385 }
386 else if (GetExplTargetUnit()->GetOwnerGUID() != GetCaster()->GetGUID())
388
389 return SPELL_CAST_OK;
390 }
391
400
406};
407
408// 107428 - Rising Sun Kick
434
435// 109132 - Roll
463
464// 107427 - Roll
465// 109131 - Roll (backward)
467{
468 void CalcMovementAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
469 {
470 amount += 100.0;
471 }
472
473 void CalcImmunityAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
474 {
475 amount -= 100.0;
476 }
477
478 void ChangeRunBackSpeed(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
479 {
481 }
482
483 void RestoreRunBackSpeed(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
484 {
486 }
487
500};
501
502// 389579 - Save Them All
504{
505 bool Validate(SpellInfo const* spellInfo) override
506 {
508 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
509 }
510
511 bool CheckProc(ProcEventInfo const& eventInfo) const
512 {
513 return eventInfo.GetActionTarget()->HealthBelowPct(GetEffectInfo(EFFECT_2).CalcValue(eventInfo.GetActor()));
514 }
515
523
529};
530
531// 198898 - Song of Chi-Ji
533{
535
536 void OnInitialize() override
537 {
538 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(at->GetSpellId(), DIFFICULTY_NONE);
539 if (!spellInfo)
540 return;
541
542 Unit* caster = at->GetCaster();
543 if (!caster)
544 return;
545
546 Position destPos = at->GetFirstCollisionPosition(spellInfo->GetMaxRange(false, caster), 0.0f);
547 PathGenerator path(at);
548
549 path.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), false);
550
551 at->InitSplines(path.GetPath());
552 }
553
554 void OnUnitEnter(Unit* unit) override
555 {
556 if (Unit* caster = at->GetCaster())
557 if (caster->IsValidAttackTarget(unit))
559 }
560};
561
562// Utility for stagger scripts
564{
565 if (Aura* auraLight = unit->GetAura(SPELL_MONK_STAGGER_LIGHT))
566 return auraLight;
567
568 if (Aura* auraModerate = unit->GetAura(SPELL_MONK_STAGGER_MODERATE))
569 return auraModerate;
570
571 if (Aura* auraHeavy = unit->GetAura(SPELL_MONK_STAGGER_HEAVY))
572 return auraHeavy;
573
574 return nullptr;
575}
576
579
580// 115069 - Stagger
582{
587
588 void AbsorbNormal(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& /*absorbAmount*/)
589 {
590 Absorb(dmgInfo, 1.0f);
591 }
592
593 void AbsorbMagic(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& /*absorbAmount*/)
594 {
595 AuraEffect const* effect = GetEffect(EFFECT_4);
596 if (!effect)
597 return;
598
599 Absorb(dmgInfo, effect->GetAmount() / 100.0);
600 }
601
602 void Absorb(DamageInfo& dmgInfo, float multiplier)
603 {
604 // Prevent default action (which would remove the aura)
606
607 // make sure damage doesn't come from stagger damage spell SPELL_MONK_STAGGER_DAMAGE_AURA
608 if (SpellInfo const* dmgSpellInfo = dmgInfo.GetSpellInfo())
609 if (dmgSpellInfo->Id == SPELL_MONK_STAGGER_DAMAGE_AURA)
610 return;
611
613 if (!effect)
614 return;
615
616 Unit* target = GetTarget();
617 float agility = target->GetStat(STAT_AGILITY);
618 float base = CalculatePct(agility, float(effect->GetAmount()));
619 float K = sDB2Manager.EvaluateExpectedStat(ExpectedStatType::ArmorConstant, target->GetLevel(), -2, 0, Classes(target->GetClass()), 0);
620
621 float newAmount = (base / (base + K));
622 newAmount *= multiplier;
623
624 // Absorb X percentage of the damage
625 float absorbAmount = float(dmgInfo.GetDamage()) * newAmount;
626 if (absorbAmount > 0)
627 {
628 dmgInfo.AbsorbDamage(absorbAmount);
629
630 // Cast stagger and make it tick on each tick
631 AddAndRefreshStagger(absorbAmount);
632 }
633 }
634
640
641private:
642 void AddAndRefreshStagger(float amount) const
643 {
644 Unit* target = GetTarget();
645 if (Aura* auraStagger = FindExistingStaggerEffect(target))
646 {
647 AuraEffect* effStaggerRemaining = auraStagger->GetEffect(AuraStaggerEffectTotal);
648 if (!effStaggerRemaining)
649 return;
650
651 SpellEffectValue newAmount = effStaggerRemaining->GetAmount() + amount;
652 uint32 spellId = GetStaggerSpellId(target, newAmount);
653 if (spellId == effStaggerRemaining->GetSpellInfo()->Id)
654 {
655 auraStagger->RefreshDuration();
656 effStaggerRemaining->ChangeAmount(newAmount, false, true /* reapply */);
657 }
658 else
659 {
660 // amount changed the stagger type so we need to change the stagger amount (e.g. from medium to light)
661 GetTarget()->RemoveAura(auraStagger);
662 AddNewStagger(target, spellId, newAmount);
663 }
664 }
665 else
666 AddNewStagger(target, GetStaggerSpellId(target, amount), amount);
667 }
668
669 static uint32 GetStaggerSpellId(Unit const* unit, SpellEffectValue amount)
670 {
671 constexpr double StaggerHeavy = 0.6;
672 constexpr double StaggerModerate = 0.3;
673
674 double staggerPct = amount / SpellEffectValue(unit->GetMaxHealth());
675 return (staggerPct >= StaggerHeavy) ? SPELL_MONK_STAGGER_HEAVY :
676 (staggerPct >= StaggerModerate) ? SPELL_MONK_STAGGER_MODERATE :
678 }
679
680 static void AddNewStagger(Unit* unit, uint32 staggerSpellId, SpellEffectValue staggerAmount)
681 {
682 // We only set the total stagger amount. The amount per tick will be set by the stagger spell script
683 unit->CastSpell(unit, staggerSpellId, CastSpellExtraArgs(SPELLVALUE_BASE_POINT1, staggerAmount).SetTriggerFlags(TRIGGERED_FULL_MASK));
684 }
685};
686
687// 124255 - Stagger - SPELL_MONK_STAGGER_DAMAGE_AURA
689{
694
695 void OnPeriodicDamage(AuraEffect const* aurEff)
696 {
697 // Update our light/medium/heavy stagger with the correct stagger amount left
698 if (Aura* auraStagger = FindExistingStaggerEffect(GetTarget()))
699 {
700 if (AuraEffect* totalEffect = auraStagger->GetEffect(AuraStaggerEffectTotal))
701 {
702 SpellEffectValue total = totalEffect->GetAmount();
703 SpellEffectValue tickDamage = aurEff->GetAmount();
704 totalEffect->ChangeAmount(total - tickDamage);
705 }
706 }
707 }
708
713};
714
715// 124273, 124274, 124275 - Light/Moderate/Heavy Stagger - SPELL_MONK_STAGGER_LIGHT / SPELL_MONK_STAGGER_MODERATE / SPELL_MONK_STAGGER_HEAVY
717{
718 bool Validate(SpellInfo const* /*spellInfo*/) override
719 {
722 }
723
724 bool Load() override
725 {
726 _period = float(sSpellMgr->AssertSpellInfo(SPELL_MONK_STAGGER_DAMAGE_AURA, GetCastDifficulty())->GetEffect(EFFECT_0).ApplyAuraPeriod);
727 return true;
728 }
729
730 void OnReapply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
731 {
732 // Calculate damage per tick
733 SpellEffectValue total = aurEff->GetAmount();
734 SpellEffectValue perTick = total * _period / float(GetDuration()); // should be same as GetMaxDuration() TODO: verify
735
736 // Set amount on effect for tooltip
738 if (effInfo)
739 effInfo->ChangeAmount(perTick);
740
741 // Set amount on damage aura (or cast it if needed)
742 CastOrChangeTickDamage(perTick);
743 }
744
745 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
746 {
747 if (mode != AURA_EFFECT_HANDLE_REAL)
748 return;
749
750 // Remove damage aura
752 }
753
759
760private:
761 float _period = 0.0f;
762
764 {
765 Unit* unit = GetTarget();
766 Aura* auraDamage = unit->GetAura(SPELL_MONK_STAGGER_DAMAGE_AURA);
767 if (!auraDamage)
768 {
769 unit->CastSpell(unit, SPELL_MONK_STAGGER_DAMAGE_AURA, true);
770 auraDamage = unit->GetAura(SPELL_MONK_STAGGER_DAMAGE_AURA);
771 }
772
773 if (auraDamage)
774 if (AuraEffect* eff = auraDamage->GetEffect(AuraStaggerEffectTick))
775 eff->ChangeAmount(tickDamage);
776 }
777};
778
779// 116841 - Tiger's Lust
792
T GetEntry(std::unordered_map< uint32, T > const &map, CriteriaTreeEntry const *tree)
#define sDB2Manager
Definition DB2Stores.h:569
@ DIFFICULTY_NONE
Definition DBCEnums.h:933
uint32_t uint32
Definition Define.h:154
bool roll_chance(T chance)
Definition Random.h:55
#define RegisterAreaTriggerAI(ai_name)
Definition ScriptMgr.h:1428
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_6
@ EFFECT_1
@ EFFECT_5
@ EFFECT_0
@ EFFECT_4
@ EFFECT_2
Classes
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_UNIT_TARGET_ENEMY
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_TRIGGER_SPELL
@ SPELL_EFFECT_DISPEL
@ SPELL_EFFECT_APPLY_AURA
SpellCastResult
@ SPELL_FAILED_ROOTED
@ SPELL_FAILED_BAD_TARGETS
@ SPELL_CAST_OK
@ STAT_AGILITY
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
AuraRemoveMode
@ AURA_REMOVE_BY_EXPIRE
@ AURA_REMOVE_BY_ENEMY_SPELL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MECHANIC_IMMUNITY
@ SPELL_AURA_MOD_MINIMUM_SPEED
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_MOD_SPEED_NO_CONTROL
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED
@ SPELLVALUE_MAX_TARGETS
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
@ TARGET_FLAG_UNIT_MASK
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
@ TRIGGERED_IGNORE_POWER_COST
Will ignore power and reagent cost.
@ TRIGGERED_IGNORE_GCD
Will ignore GCD.
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ TRIGGERED_IGNORE_CAST_TIME
Will always be instantly cast.
@ SPELLVALUE_BASE_POINT1
@ SPELLVALUE_BASE_POINT0
#define sSpellMgr
Definition SpellMgr.h:812
#define SpellObjectTargetSelectFn(F, I, N)
#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 AuraEffectAbsorbFn(F, I)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraCheckProcFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
@ MOVE_RUN
@ MOVE_RUN_BACK
@ MOVEMENTFLAG_BACKWARD
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:599
@ UNIT_STATE_ROOT
Definition Unit.h:271
@ CR_VERSATILITY_HEALING_DONE
Definition Unit.h:346
T AddPct(T &base, U pct)
Definition Util.h:85
T CalculatePct(T base, U pct)
Definition Util.h:72
AreaTrigger *const at
AreaTriggerAI(AreaTrigger *a, uint32 scriptId={}) noexcept
void InitSplines(std::vector< G3D::Vector3 > const &splinePoints, Optional< float > overrideSpeed={}, Optional< bool > speedIsTimeInSeconds={})
uint32 GetSpellId() const
Unit * GetCaster() const
AuraRemoveMode GetRemoveMode() const
Definition SpellAuras.h:96
void ChangeAmount(SpellEffectValue newAmount, bool mark=true, bool onStackOrReapply=false, AuraEffect const *triggeredBy=nullptr)
SpellInfo const * GetSpellInfo() const
int32 GetAmountAsInt() const
SpellEffectValue GetAmount() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
int32 GetDuration() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< CheckEffectProcHandler > DoCheckEffectProc
HookList< EffectPeriodicHandler > OnEffectPeriodic
HookList< EffectApplyHandler > AfterEffectApply
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
AuraEffect * GetEffect(uint8 effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Aura * GetAura() const
Unit * GetTarget() const
Difficulty GetCastDifficulty() const
HookList< CheckProcHandler > DoCheckProc
HookList< EffectProcHandler > OnEffectProc
AuraEffect * GetEffect(uint32 index) const
void AbsorbDamage(uint32 amount)
Definition Unit.cpp:212
SpellInfo const * GetSpellInfo() const
Definition Unit.h:448
uint32 GetDamage() const
Definition Unit.h:452
Movement::PointsArray const & GetPath() const
bool CalculatePath(float srcX, float srcY, float srcZ, float destX, float destY, float destZ, bool forceDest=false)
Unit * GetActionTarget() const
Definition Unit.h:500
Unit * GetActor() const
Definition Unit.h:499
bool IsEffect() const
float GetMaxRange(bool positive=false, WorldObject const *caster=nullptr, Spell *spell=nullptr) const
uint32 const Id
Definition SpellInfo.h:328
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:588
uint32 GetExplicitTargetMask() const
SpellCastResult CheckExplicitTarget(WorldObject const *caster, WorldObject const *target, Item const *itemTarget=nullptr) const
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
HookList< CheckCastHandler > OnCheckCast
Unit * GetCaster() const
SpellEffectValue GetEffectValue() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellValue const * GetSpellValue() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
Spell * GetSpell() const
HookList< EffectHandler > OnEffectLaunchTarget
Difficulty GetCastDifficulty() const
HookList< EffectHandler > OnEffectLaunch
Unit * GetExplTargetUnit() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition Spell.h:277
SpellInfo const * GetSpellInfo() const
Definition Spell.h:702
void SetSpellValue(CastSpellExtraArgsInit::SpellValueOverride const &value)
Definition Spell.cpp:8790
Definition Unit.h:635
uint64 CountPctFromMaxHealth(float pct) const
Definition Unit.h:797
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3828
uint8 GetClass() const
Definition Unit.h:764
void UpdateSpeed(UnitMoveType mtype)
Definition Unit.cpp:8778
void SetSpeed(UnitMoveType mtype, float newValue)
Definition Unit.cpp:8937
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4604
uint64 GetMaxHealth() const
Definition Unit.h:789
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition Unit.cpp:4774
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4700
bool HealthBelowPct(float pct) const
Definition Unit.h:792
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
float GetStat(Stats stat) const
Definition Unit.h:772
void RemoveMovementImpairingAuras(bool withRoot)
Definition Unit.cpp:4294
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
uint8 GetLevel() const
Definition Unit.h:757
bool IsInCombat() const
Definition Unit.h:1058
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:1466
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
Position GetFirstCollisionPosition(float dist, float angle)
Definition Object.cpp:2762
void FilterTargets(std::list< WorldObject * > &targets) const
bool Validate(SpellInfo const *) override
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes) const
void Register() override
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void OnTick(AuraEffect const *)
void HandlePeriodicTick(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void Register() override
void Register() override
bool Validate(SpellInfo const *) override
void CalculateAbsorb(SpellEffIndex)
void HandleEffectApply(SpellEffIndex) const
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
bool CheckProc(AuraEffect const *, ProcEventInfo &)
void HandlePeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *, ProcEventInfo &)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
static void PreventDispel(SpellScript const &, WorldObject *&target)
void HandleDummy(SpellEffIndex effIndex)
static uint32 const BlackOxStatusEntry
bool Validate(SpellInfo const *spellInfo) override
void Register() override
SpellCastResult CheckExplicitTarget()
void HandleOnHit(SpellEffIndex) const
bool Validate(SpellInfo const *) override
void RestoreRunBackSpeed(AuraEffect const *, AuraEffectHandleModes)
void CalcImmunityAmount(AuraEffect const *, SpellEffectValue &amount, bool &)
void CalcMovementAmount(AuraEffect const *, SpellEffectValue &amount, bool &)
void Register() override
void ChangeRunBackSpeed(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *) override
SpellCastResult CheckCast()
void HandleDummy(SpellEffIndex)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo const &) const
bool CheckProc(ProcEventInfo const &eventInfo) const
void Register() override
bool Validate(SpellInfo const *spellInfo) override
bool Validate(SpellInfo const *) override
void OnPeriodicDamage(AuraEffect const *aurEff)
void OnReapply(AuraEffect const *aurEff, AuraEffectHandleModes)
void CastOrChangeTickDamage(SpellEffectValue tickDamage)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes mode)
void AbsorbMagic(AuraEffect *, DamageInfo &dmgInfo, uint32 &)
void Absorb(DamageInfo &dmgInfo, float multiplier)
void AbsorbNormal(AuraEffect *, DamageInfo &dmgInfo, uint32 &)
static void AddNewStagger(Unit *unit, uint32 staggerSpellId, SpellEffectValue staggerAmount)
void Register() override
bool Validate(SpellInfo const *) override
static uint32 GetStaggerSpellId(Unit const *unit, SpellEffectValue amount)
void AddAndRefreshStagger(float amount) const
void Register() override
void HandleRemoveImpairingAuras(SpellEffIndex)
void SelectRandomInjuredTargets(std::list< WorldObject * > &targets, size_t maxTargets, bool prioritizePlayers, Unit const *prioritizeGroupMembersOf)
Definition Spell.cpp:9577
void AddSC_monk_spell_scripts()
Aura * FindExistingStaggerEffect(Unit *unit)
MonkSpells
@ SPELL_MONK_NO_FEATHER_FALL
@ SPELL_MONK_RENEWING_MIST
@ SPELL_MONK_JADE_WALK
@ SPELL_MONK_PROVOKE_AOE
@ SPELL_MONK_STAGGER_LIGHT
@ SPELL_MONK_CRACKLING_JADE_LIGHTNING_KNOCKBACK_CD
@ SPELL_MONK_CRACKLING_JADE_LIGHTNING_KNOCKBACK
@ SPELL_MONK_CRACKLING_JADE_LIGHTNING_CHANNEL
@ SPELL_MONK_POWER_STRIKE_ENERGIZE
@ SPELL_MONK_BURST_OF_LIFE_HEAL
@ SPELL_MONK_PRESSURE_POINTS
@ SPELL_MONK_MISTS_OF_LIFE
@ SPELL_MONK_STAGGER_HEAVY
@ SPELL_MONK_OPEN_PALM_STRIKES_TALENT
@ SPELL_MONK_ROLL_BACKWARD
@ SPELL_MONK_BURST_OF_LIFE_TALENT
@ SPELL_MONK_SAVE_THEM_ALL_HEAL_BONUS
@ SPELL_MONK_STAGGER_MODERATE
@ SPELL_MONK_PROVOKE_SINGLE_TARGET
@ SPELL_MONK_STAGGER_DAMAGE_AURA
@ SPELL_MONK_MORTAL_WOUNDS
@ SPELL_MONK_POWER_STRIKE_PROC
@ SPELL_MONK_SONG_OF_CHI_JI_STUN
@ SPELL_MONK_SURGING_MIST_HEAL
@ SPELL_MONK_ROLL_FORWARD
@ SPELL_MONK_CALMING_COALESCENCE
@ SPELL_MONK_STANCE_OF_THE_SPIRITED_CRANE
@ SPELL_MONK_CRACKLING_JADE_LIGHTNING_CHI_PROC
@ SPELL_MONK_ENVELOPING_MIST
@ SPELL_MONK_COMBAT_CONDITIONING
@ SPELL_MONK_SOOTHING_MIST
static constexpr SpellEffIndex AuraStaggerEffectTick
static constexpr SpellEffIndex AuraStaggerEffectTotal
TriggerCastFlags TriggerFlags
CastSpellExtraArgs & SetTriggeringSpell(Spell const *triggeringSpell)
Definition Spell.cpp:9707
CastSpellExtraArgs & SetTriggerFlags(TriggerCastFlags flag)
constexpr float GetPositionX() const
Definition Position.h:87
constexpr float GetPositionY() const
Definition Position.h:88
constexpr float GetPositionZ() const
Definition Position.h:89
void OnUnitEnter(Unit *unit) override
void OnInitialize() override