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
 
Unit * GetCaster ()
 
GameObject * GetGObjCaster ()
 
Unit * GetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObject * GetExplTargetWorldObject ()
 
Unit * GetExplTargetUnit ()
 
GameObject * GetExplTargetGObj ()
 
Item * GetExplTargetItem ()
 
Unit * GetHitUnit ()
 
Creature * GetHitCreature ()
 
Player * GetHitPlayer ()
 
Item * GetHitItem ()
 
GameObject * GetHitGObj ()
 
WorldLocation * GetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
Spell * GetSpell ()
 
Aura * GetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
Item * GetCastItem ()
 
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< CastHandler > BeforeCast
 
HookList< CastHandler > OnCast
 
HookList< CastHandler > AfterCast
 
HookList< CheckCastHandler > OnCheckCast
 
HookList< EffectHandler > OnEffectLaunch
 
HookList< EffectHandler > OnEffectLaunchTarget
 
HookList< EffectHandler > OnEffectHit
 
HookList< EffectHandler > OnEffectHitTarget
 
HookList< BeforeHitHandler > BeforeHit
 
HookList< HitHandler > OnHit
 
HookList< HitHandler > AfterHit
 
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
 
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
 
- 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
945 {
946 Unit* target = GetHitUnit();
947 if (!target)
948 return;
950 bool bonusDamage = false;
951 for (AuraEffect* eff : AuraEffectList)
952 {
953 SpellInfo const* spellInfo = eff->GetSpellInfo();
954 if (!spellInfo)
955 continue;
956
957 // Warrior Spells: Piercing Howl or Dazed (29703)
958 if (spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && (spellInfo->SpellFamilyFlags[1] & (0x20 | 0x200000)))
959 {
960 bonusDamage = true;
961 break;
962 }
963
964 // Generic Daze: icon 15 with mechanic daze or snare
965 if ((spellInfo->SpellIconID == ICON_GENERIC_DAZE)
966 && ((spellInfo->Mechanic == MECHANIC_DAZE || spellInfo->HasEffectMechanic(MECHANIC_DAZE))
967 || (spellInfo->Mechanic == MECHANIC_SNARE || spellInfo->HasEffectMechanic(MECHANIC_SNARE))
968 )
969 )
970 {
971 bonusDamage = true;
972 break;
973 }
974
975 if ((spellInfo->Id == SPELL_GENERIC_AFTERMATH)
976 || (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->SpellFamilyFlags[1] & 0x40)) // Blast Wave
977 || (spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && (spellInfo->SpellFamilyFlags[2] & 0x4000)) // Avenger's Shield
978 )
979 {
980 bonusDamage = true;
981 break;
982 }
983 }
984 if (bonusDamage)
985 {
986 int32 damage = GetHitDamage();
987 AddPct(damage, 35); // "Causes ${0.35*$m1} additional damage against Dazed targets."
988 SetHitDamage(damage);
989 }
990 }
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:897
uint32 SpellFamilyName
Definition SpellInfo.h:411
Unit * GetHitUnit()
Definition SpellScript.cpp:453
void SetHitDamage(int32 damage)
Definition SpellScript.cpp:529
int32 GetHitDamage()
Definition SpellScript.cpp:519
Definition Unit.h:670
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1445
std::vector< AuraEffect * > AuraEffectList
Definition Unit.h:686
@ ICON_GENERIC_DAZE
Definition spell_warrior.cpp:936
@ SPELL_GENERIC_AFTERMATH
Definition spell_warrior.cpp:937

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.

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

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


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