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

Private Member Functions

 PrepareAuraScript (spell_hun_lock_and_load)
 
bool Validate (SpellInfo const *) override
 
bool CheckProc (ProcEventInfo &eventInfo)
 
bool CheckTrapProc (AuraEffect const *aurEff, ProcEventInfo &eventInfo)
 
bool CheckPeriodicProc (AuraEffect const *aurEff, ProcEventInfo &eventInfo)
 
void HandleProc (ProcEventInfo &eventInfo)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from AuraScript
 AuraScript ()
 
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Aura *aura)
 
void _PrepareScriptCall (AuraScriptHookType hookType, AuraApplication const *aurApp=nullptr)
 
void _FinishScriptCall ()
 
bool _IsDefaultActionPrevented ()
 
void PreventDefaultAction ()
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
ObjectGuid GetCasterGUID () const
 
UnitGetCaster () const
 
WorldObjectGetOwner () const
 
UnitGetUnitOwner () const
 
DynamicObjectGetDynobjOwner () const
 
void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
AuraGetAura () const
 
AuraObjectType GetType () const
 
int32 GetDuration () const
 
void SetDuration (int32 duration, bool withMods=false)
 
void RefreshDuration ()
 
time_t GetApplyTime () const
 
int32 GetMaxDuration () const
 
void SetMaxDuration (int32 duration)
 
int32 CalcMaxDuration () const
 
bool IsExpired () const
 
bool IsPermanent () const
 
uint8 GetCharges () const
 
void SetCharges (uint8 charges)
 
uint8 CalcMaxCharges () const
 
bool ModCharges (int8 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool DropCharge (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
uint8 GetStackAmount () const
 
void SetStackAmount (uint8 num)
 
bool ModStackAmount (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool IsPassive () const
 
bool IsDeathPersistent () const
 
bool HasEffect (uint8 effIndex) const
 
AuraEffectGetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
UnitGetTarget () const
 
AuraApplication const * GetTargetApplication () const
 
- 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 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 AuraScript
HookList< CheckAreaTargetHandlerDoCheckAreaTarget
 
HookList< AuraDispelHandlerOnDispel
 
HookList< AuraDispelHandlerAfterDispel
 
HookList< EffectApplyHandlerOnEffectApply
 
HookList< EffectApplyHandlerAfterEffectApply
 
HookList< EffectApplyHandlerOnEffectRemove
 
HookList< EffectApplyHandlerAfterEffectRemove
 
HookList< EffectPeriodicHandlerOnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandlerOnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandlerDoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandlerDoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandlerDoEffectCalcSpellMod
 
HookList< EffectAbsorbHandlerOnEffectAbsorb
 
HookList< EffectAbsorbHandlerAfterEffectAbsorb
 
HookList< EffectManaShieldHandlerOnEffectManaShield
 
HookList< EffectManaShieldHandlerAfterEffectManaShield
 
HookList< EffectSplitHandlerOnEffectSplit
 
HookList< CheckProcHandlerDoCheckProc
 
HookList< CheckEffectProcHandlerDoCheckEffectProc
 
HookList< AfterCheckProcHandlerDoAfterCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ CheckPeriodicProc()

bool spell_hun_lock_and_load::CheckPeriodicProc ( AuraEffect const *  aurEff,
ProcEventInfo eventInfo 
)
inlineprivate
1256 {
1257 if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_PERIODIC))
1258 return false;
1259
1260 return roll_chance_i(aurEff->GetAmount());
1261 }
bool roll_chance_i(int chance)
Definition Random.h:63
@ PROC_FLAG_DONE_PERIODIC
Definition SpellMgr.h:137
uint32 GetTypeMask() const
Definition Unit.h:462

References AuraEffect::GetAmount(), ProcEventInfo::GetTypeMask(), PROC_FLAG_DONE_PERIODIC, and roll_chance_i().

Referenced by Register().

◆ CheckProc()

bool spell_hun_lock_and_load::CheckProc ( ProcEventInfo eventInfo)
inlineprivate
1229 {
1231 return false;
1232 return true;
1233 }
Unit * GetActor()
Definition Unit.h:459
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5982
@ SPELL_LOCK_AND_LOAD_MARKER
Definition spell_hunter.cpp:69

References ProcEventInfo::GetActor(), Unit::HasAura(), and SPELL_LOCK_AND_LOAD_MARKER.

Referenced by Register().

◆ CheckTrapProc()

bool spell_hun_lock_and_load::CheckTrapProc ( AuraEffect const *  aurEff,
ProcEventInfo eventInfo 
)
inlineprivate
1236 {
1237 if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_TRAP_ACTIVATION))
1238 return false;
1239
1240 // Patch 3.3.3: Lock and Load no longer triggers from Explosive Trap activation,
1241 // only from frost trap activation. Fire traps proc via CheckPeriodicProc instead.
1242 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1243 if (!spellInfo || !(spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST))
1244 return false;
1245
1246 // immune to Frost Trap slow (bosses) in WotLK patch 3.2.0
1247 if (Spell const* procSpell = eventInfo.GetProcSpell())
1248 if (Unit* target = procSpell->GetOriginalTarget())
1249 if (target->IsImmunedToSpell(sSpellMgr->GetSpellInfo(SPELL_FROST_TRAP_SLOW)))
1250 return false;
1251
1252 return roll_chance_i(aurEff->GetAmount());
1253 }
@ SPELL_SCHOOL_MASK_FROST
Definition SharedDefines.h:289
#define sSpellMgr
Definition SpellMgr.h:836
@ PROC_FLAG_DONE_TRAP_ACTIVATION
Definition SpellMgr.h:141
Spell const * GetProcSpell() const
Definition Unit.h:468
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:299
Definition SpellInfo.h:340
SpellSchoolMask GetSchoolMask() const
Definition SpellInfo.cpp:1894
Definition Spell.h:298
Definition Unit.h:664
@ SPELL_FROST_TRAP_SLOW
Definition spell_hunter.cpp:70

References AuraEffect::GetAmount(), ProcEventInfo::GetProcSpell(), SpellInfo::GetSchoolMask(), ProcEventInfo::GetSpellInfo(), ProcEventInfo::GetTypeMask(), PROC_FLAG_DONE_TRAP_ACTIVATION, roll_chance_i(), SPELL_FROST_TRAP_SLOW, SPELL_SCHOOL_MASK_FROST, and sSpellMgr.

Referenced by Register().

◆ HandleProc()

void spell_hun_lock_and_load::HandleProc ( ProcEventInfo eventInfo)
inlineprivate
1264 {
1266
1267 Unit* caster = eventInfo.GetActor();
1268 caster->CastSpell(caster, SPELL_LOCK_AND_LOAD_TRIGGER, true);
1269 caster->CastSpell(caster, SPELL_LOCK_AND_LOAD_MARKER, true);
1270 }
void PreventDefaultAction()
Definition SpellScript.cpp:1000
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1350
@ SPELL_LOCK_AND_LOAD_TRIGGER
Definition spell_hunter.cpp:68

References Unit::CastSpell(), ProcEventInfo::GetActor(), AuraScript::PreventDefaultAction(), SPELL_LOCK_AND_LOAD_MARKER, and SPELL_LOCK_AND_LOAD_TRIGGER.

Referenced by Register().

◆ PrepareAuraScript()

spell_hun_lock_and_load::PrepareAuraScript ( spell_hun_lock_and_load  )
private

◆ Register()

void spell_hun_lock_and_load::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1273 {
1275
1278
1280 }
@ EFFECT_1
Definition SharedDefines.h:32
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_AURA_PROC_TRIGGER_SPELL
Definition SpellAuraDefines.h:105
@ SPELL_AURA_DUMMY
Definition SpellAuraDefines.h:67
#define AuraProcFn(F)
Definition SpellScript.h:855
#define AuraCheckEffectProcFn(F, I, N)
Definition SpellScript.h:835
#define AuraCheckProcFn(F)
Definition SpellScript.h:829
HookList< CheckEffectProcHandler > DoCheckEffectProc
Definition SpellScript.h:834
HookList< CheckProcHandler > DoCheckProc
Definition SpellScript.h:828
HookList< AuraProcHandler > OnProc
Definition SpellScript.h:850
bool CheckTrapProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition spell_hunter.cpp:1235
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_hunter.cpp:1228
void HandleProc(ProcEventInfo &eventInfo)
Definition spell_hunter.cpp:1263
bool CheckPeriodicProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition spell_hunter.cpp:1255

References AuraCheckEffectProcFn, AuraCheckProcFn, AuraProcFn, CheckPeriodicProc(), CheckProc(), CheckTrapProc(), AuraScript::DoCheckEffectProc, AuraScript::DoCheckProc, EFFECT_0, EFFECT_1, HandleProc(), AuraScript::OnProc, SPELL_AURA_DUMMY, and SPELL_AURA_PROC_TRIGGER_SPELL.

◆ Validate()

bool spell_hun_lock_and_load::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1219 {
1220 return ValidateSpellInfo(
1221 {
1225 });
1226 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition SpellScript.h:125

References SPELL_FROST_TRAP_SLOW, SPELL_LOCK_AND_LOAD_MARKER, SPELL_LOCK_AND_LOAD_TRIGGER, and _SpellScript::ValidateSpellInfo().


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