AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
spell_warr_heroic_strike Class Reference
Inheritance diagram for spell_warr_heroic_strike:
SpellScript _SpellScript

Private Member Functions

 PrepareSpellScript (spell_warr_heroic_strike)
 
void HandleOnHit ()
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from SpellScript
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Spell *spell)
 
void _InitHit ()
 
bool _IsEffectPrevented (SpellEffIndex effIndex)
 
bool _IsDefaultEffectPrevented (SpellEffIndex effIndex)
 
void _PrepareScriptCall (SpellScriptHookType hookType)
 
void _FinishScriptCall ()
 
bool IsInCheckCastHook () const
 
bool IsInTargetHook () const
 
bool IsInHitPhase () const
 
bool IsInEffectHook () const
 
UnitGetCaster ()
 
UnitGetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObjectGetExplTargetWorldObject ()
 
UnitGetExplTargetUnit ()
 
GameObjectGetExplTargetGObj ()
 
ItemGetExplTargetItem ()
 
UnitGetHitUnit ()
 
CreatureGetHitCreature ()
 
PlayerGetHitPlayer ()
 
ItemGetHitItem ()
 
GameObjectGetHitGObj ()
 
WorldLocationGetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
SpellGetSpell ()
 
AuraGetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo const * GetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void Cancel ()
 
void SetCustomCastResultMessage (SpellCustomErrors result)
 
- Public Member Functions inherited from _SpellScript
 _SpellScript ()
 
virtual ~_SpellScript ()
 
virtual void _Register ()
 
virtual void _Unload ()
 
virtual void _Init (std::string const *scriptname, uint32 spellId)
 
std::string const * _GetScriptName () const
 
virtual bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
virtual void Unload ()
 
- Static Public Member Functions inherited from _SpellScript
static bool ValidateSpellInfo (std::initializer_list< uint32 > spellIds)
 
template<class T >
static bool ValidateSpellInfo (T const &spellIds)
 
- Public Attributes inherited from SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ HandleOnHit()

void spell_warr_heroic_strike::HandleOnHit ( )
inlineprivate
937 {
938 Unit* target = GetHitUnit();
939 if (!target)
940 return;
942 bool bonusDamage = false;
943 for (AuraEffect* eff : AuraEffectList)
944 {
945 SpellInfo const* spellInfo = eff->GetSpellInfo();
946 if (!spellInfo)
947 continue;
948
949 // Warrior Spells: Piercing Howl or Dazed (29703)
950 if (spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && (spellInfo->SpellFamilyFlags[1] & (0x20 | 0x200000)))
951 {
952 bonusDamage = true;
953 break;
954 }
955
956 // Generic Daze: icon 15 with mechanic daze or snare
957 if ((spellInfo->SpellIconID == ICON_GENERIC_DAZE)
958 && ((spellInfo->Mechanic == MECHANIC_DAZE || spellInfo->HasEffectMechanic(MECHANIC_DAZE))
959 || (spellInfo->Mechanic == MECHANIC_SNARE || spellInfo->HasEffectMechanic(MECHANIC_SNARE))
960 )
961 )
962 {
963 bonusDamage = true;
964 break;
965 }
966
967 if ((spellInfo->Id == SPELL_GENERIC_AFTERMATH)
968 || (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->SpellFamilyFlags[1] & 0x40)) // Blast Wave
969 || (spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && (spellInfo->SpellFamilyFlags[2] & 0x4000)) // Avenger's Shield
970 )
971 {
972 bonusDamage = true;
973 break;
974 }
975 }
976 if (bonusDamage)
977 {
978 int32 damage = GetHitDamage();
979 AddPct(damage, 35); // "Causes ${0.35*$m1} additional damage against Dazed targets."
980 SetHitDamage(damage);
981 }
982 }
std::int32_t int32
Definition Define.h:103
@ MECHANIC_DAZE
Definition SharedDefines.h:1340
@ MECHANIC_SNARE
Definition SharedDefines.h:1324
@ SPELLFAMILY_MAGE
Definition SharedDefines.h:3787
@ SPELLFAMILY_WARRIOR
Definition SharedDefines.h:3788
@ SPELLFAMILY_PALADIN
Definition SharedDefines.h:3794
@ SPELL_AURA_MOD_DECREASE_SPEED
Definition SpellAuraDefines.h:96
T AddPct(T &base, U pct)
Definition Util.h:58
Definition SpellAuraEffects.h:39
Definition SpellInfo.h:340
flag96 SpellFamilyFlags
Definition SpellInfo.h:412
uint32 Mechanic
Definition SpellInfo.h:347
uint32 Id
Definition SpellInfo.h:344
uint32 SpellIconID
Definition SpellInfo.h:404
bool HasEffectMechanic(Mechanics mechanic) const
Definition SpellInfo.cpp:893
uint32 SpellFamilyName
Definition SpellInfo.h:411
Unit * GetHitUnit()
Definition SpellScript.cpp:448
void SetHitDamage(int32 damage)
Definition SpellScript.cpp:524
int32 GetHitDamage()
Definition SpellScript.cpp:514
Definition Unit.h:665
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1429
std::vector< AuraEffect * > AuraEffectList
Definition Unit.h:681
@ ICON_GENERIC_DAZE
Definition spell_warrior.cpp:928
@ SPELL_GENERIC_AFTERMATH
Definition spell_warrior.cpp:929

References AddPct(), Unit::GetAuraEffectsByType(), SpellScript::GetHitDamage(), SpellScript::GetHitUnit(), SpellInfo::HasEffectMechanic(), ICON_GENERIC_DAZE, SpellInfo::Id, SpellInfo::Mechanic, MECHANIC_DAZE, MECHANIC_SNARE, SpellScript::SetHitDamage(), SPELL_AURA_MOD_DECREASE_SPEED, SPELL_GENERIC_AFTERMATH, SPELLFAMILY_MAGE, SPELLFAMILY_PALADIN, SPELLFAMILY_WARRIOR, SpellInfo::SpellFamilyFlags, SpellInfo::SpellFamilyName, and SpellInfo::SpellIconID.

Referenced by Register().

◆ PrepareSpellScript()

spell_warr_heroic_strike::PrepareSpellScript ( spell_warr_heroic_strike  )
private

◆ Register()

void spell_warr_heroic_strike::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

985 {
987 }
#define SpellHitFn(F)
Definition SpellScript.h:349
HookList< HitHandler > OnHit
Definition SpellScript.h:345
void HandleOnHit()
Definition spell_warrior.cpp:936

References HandleOnHit(), SpellScript::OnHit, and SpellHitFn.


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