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
909 {
910 Unit* target = GetHitUnit();
911 if (!target)
912 return;
914 bool bonusDamage = false;
915 for (AuraEffect* eff : AuraEffectList)
916 {
917 const SpellInfo* spellInfo = eff->GetSpellInfo();
918 if (!spellInfo)
919 continue;
920
921 // Warrior Spells: Piercing Howl or Dazed (29703)
922 if (spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && (spellInfo->SpellFamilyFlags[1] & (0x20 | 0x200000)))
923 {
924 bonusDamage = true;
925 break;
926 }
927
928 // Generic Daze: icon 15 with mechanic daze or snare
929 if ((spellInfo->SpellIconID == ICON_GENERIC_DAZE)
930 && ((spellInfo->Mechanic == MECHANIC_DAZE || spellInfo->HasEffectMechanic(MECHANIC_DAZE))
931 || (spellInfo->Mechanic == MECHANIC_SNARE || spellInfo->HasEffectMechanic(MECHANIC_SNARE))
932 )
933 )
934 {
935 bonusDamage = true;
936 break;
937 }
938
939 if ((spellInfo->Id == SPELL_GENERIC_AFTERMATH)
940 || (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->SpellFamilyFlags[1] & 0x40)) // Blast Wave
941 || (spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && (spellInfo->SpellFamilyFlags[2] & 0x4000)) // Avenger's Shield
942 )
943 {
944 bonusDamage = true;
945 break;
946 }
947 }
948 if (bonusDamage)
949 {
950 int32 damage = GetHitDamage();
951 AddPct(damage, 35); // "Causes ${0.35*$m1} additional damage against Dazed targets."
952 SetHitDamage(damage);
953 }
954 }
std::int32_t int32
Definition Define.h:103
@ MECHANIC_DAZE
Definition SharedDefines.h:1352
@ MECHANIC_SNARE
Definition SharedDefines.h:1336
@ SPELLFAMILY_MAGE
Definition SharedDefines.h:3786
@ SPELLFAMILY_WARRIOR
Definition SharedDefines.h:3787
@ SPELLFAMILY_PALADIN
Definition SharedDefines.h:3793
@ SPELL_AURA_MOD_DECREASE_SPEED
Definition SpellAuraDefines.h:96
T AddPct(T &base, U pct)
Definition Util.h:67
Definition SpellAuraEffects.h:39
Definition SpellInfo.h:316
flag96 SpellFamilyFlags
Definition SpellInfo.h:388
uint32 Mechanic
Definition SpellInfo.h:323
uint32 Id
Definition SpellInfo.h:320
uint32 SpellIconID
Definition SpellInfo.h:380
bool HasEffectMechanic(Mechanics mechanic) const
Definition SpellInfo.cpp:884
uint32 SpellFamilyName
Definition SpellInfo.h:387
Unit * GetHitUnit()
Definition SpellScript.cpp:448
void SetHitDamage(int32 damage)
Definition SpellScript.cpp:524
int32 GetHitDamage()
Definition SpellScript.cpp:514
Definition Unit.h:620
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1351
std::vector< AuraEffect * > AuraEffectList
Definition Unit.h:636
@ ICON_GENERIC_DAZE
Definition spell_warrior.cpp:900
@ SPELL_GENERIC_AFTERMATH
Definition spell_warrior.cpp:901

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.

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

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


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