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
917 {
918 Unit* target = GetHitUnit();
919 if (!target)
920 return;
921 std::list<AuraEffect*> AuraEffectList = target->GetAuraEffectsByType(SPELL_AURA_MOD_DECREASE_SPEED);
922 bool bonusDamage = false;
923 for (AuraEffect* eff : AuraEffectList)
924 {
925 const SpellInfo* spellInfo = eff->GetSpellInfo();
926 if (!spellInfo)
927 continue;
928
929 // Warrior Spells: Piercing Howl or Dazed (29703)
930 if (spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && (spellInfo->SpellFamilyFlags[1] & (0x20 | 0x200000)))
931 {
932 bonusDamage = true;
933 break;
934 }
935
936 // Generic Daze: icon 15 with mechanic daze or snare
937 if ((spellInfo->SpellIconID == ICON_GENERIC_DAZE)
938 && ((spellInfo->Mechanic == MECHANIC_DAZE || spellInfo->HasEffectMechanic(MECHANIC_DAZE))
939 || (spellInfo->Mechanic == MECHANIC_SNARE || spellInfo->HasEffectMechanic(MECHANIC_SNARE))
940 )
941 )
942 {
943 bonusDamage = true;
944 break;
945 }
946
947 if ((spellInfo->Id == SPELL_GENERIC_AFTERMATH)
948 || (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->SpellFamilyFlags[1] & 0x40)) // Blast Wave
949 || (spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && (spellInfo->SpellFamilyFlags[2] & 0x4000)) // Avenger's Shield
950 )
951 {
952 bonusDamage = true;
953 break;
954 }
955 }
956 if (bonusDamage)
957 {
958 int32 damage = GetHitDamage();
959 AddPct(damage, 35); // "Causes ${0.35*$m1} additional damage against Dazed targets."
960 SetHitDamage(damage);
961 }
962 }
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:3531
@ SPELLFAMILY_WARRIOR
Definition SharedDefines.h:3532
@ SPELLFAMILY_PALADIN
Definition SharedDefines.h:3538
@ 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:636
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1358
@ ICON_GENERIC_DAZE
Definition spell_warrior.cpp:908
@ SPELL_GENERIC_AFTERMATH
Definition spell_warrior.cpp:909

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.

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

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


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