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

Private Member Functions

 PrepareSpellScript (spell_blood_queen_vampiric_bite)
 
bool Validate (SpellInfo const *) override
 
SpellCastResult CheckTarget ()
 
void OnCast (SpellMissInfo missInfo)
 
void HandlePresence (SpellEffIndex)
 
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 void Register ()=0
 
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
 
virtual bool _Validate (SpellInfo const *entry)
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ CheckTarget()

SpellCastResult spell_blood_queen_vampiric_bite::CheckTarget ( )
inlineprivate
804 {
805 if (GetExplTargetUnit()->GetMapId() != 631)
808 {
811 }
812 if (InstanceScript* instance = GetExplTargetUnit()->GetInstanceScript())
813 if (instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == IN_PROGRESS)
814 return SPELL_CAST_OK;
815
817 }
@ DATA_BLOOD_QUEEN_LANA_THEL
Definition: icecrown_citadel.h:94
bool IsVampire(Unit const *unit)
Definition: boss_blood_queen_lana_thel.cpp:95
@ SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES
Definition: SharedDefines.h:1227
@ SPELL_FAILED_CUSTOM_ERROR
Definition: SharedDefines.h:1121
@ SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW
Definition: SharedDefines.h:1122
@ SPELL_CAST_OK
Definition: SharedDefines.h:1138
@ IN_PROGRESS
Definition: InstanceScript.h:58
Definition: InstanceScript.h:142
Unit * GetExplTargetUnit()
Definition: SpellScript.cpp:433
void SetCustomCastResultMessage(SpellCustomErrors result)
Definition: SpellScript.cpp:646

References DATA_BLOOD_QUEEN_LANA_THEL, SpellScript::GetExplTargetUnit(), IN_PROGRESS, IsVampire(), SpellScript::SetCustomCastResultMessage(), SPELL_CAST_OK, SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES, SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW, and SPELL_FAILED_CUSTOM_ERROR.

Referenced by Register().

◆ HandlePresence()

void spell_blood_queen_vampiric_bite::HandlePresence ( SpellEffIndex  )
inlineprivate
853 {
856 }
@ SPELL_PRESENCE_OF_THE_DARKFALLEN_DUMMY
Definition: boss_blood_queen_lana_thel.cpp:55
@ SPELL_PRESENCE_OF_THE_DARKFALLEN_SE
Definition: boss_blood_queen_lana_thel.cpp:57
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:150
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:1167
Unit * GetHitUnit()
Definition: SpellScript.cpp:448

References Unit::CastSpell(), SpellScript::GetHitUnit(), SPELL_PRESENCE_OF_THE_DARKFALLEN_DUMMY, SPELL_PRESENCE_OF_THE_DARKFALLEN_SE, and TRIGGERED_FULL_MASK.

Referenced by Register().

◆ OnCast()

void spell_blood_queen_vampiric_bite::OnCast ( SpellMissInfo  missInfo)
inlineprivate
820 {
821 if (missInfo != SPELL_MISS_NONE)
822 {
823 return;
824 }
825
826 if (!GetCaster()->IsPlayer() || GetCaster()->GetMapId() != 631)
827 return;
829 if (!instance || instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) != IN_PROGRESS)
830 return;
831
832 uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_FRENZIED_BLOODTHIRST, GetCaster());
835
836 if (Aura* aura = GetCaster()->GetAura(SPELL_GUSHING_WOUND))
837 {
838 if (aura->GetStackAmount() == 3)
839 {
841 GetCaster()->RemoveAura(aura);
842 }
843 else
845 }
846
847 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
849 bloodQueen->AI()->SetGUID(GetHitUnit()->GetGUID(), GUID_VAMPIRE);
850 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_FRENZIED_BLOODTHIRST
Definition: boss_blood_queen_lana_thel.cpp:53
@ SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR
Definition: boss_blood_queen_lana_thel.cpp:51
@ SPELL_GUSHING_WOUND
Definition: boss_blood_queen_lana_thel.cpp:78
@ SPELL_THIRST_QUENCHED
Definition: boss_blood_queen_lana_thel.cpp:79
@ GUID_VAMPIRE
Definition: boss_blood_queen_lana_thel.cpp:121
@ SPELL_MISS_NONE
Definition: SharedDefines.h:1519
@ AURA_REMOVE_BY_ENEMY_SPELL
Definition: SpellAuraDefines.h:394
#define sSpellMgr
Definition: SpellMgr.h:825
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
Definition: Creature.h:43
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
Definition: SpellAuras.h:87
Unit * GetCaster()
Definition: SpellScript.cpp:401

References AURA_REMOVE_BY_ENEMY_SPELL, Unit::CastSpell(), DATA_BLOOD_QUEEN_LANA_THEL, ObjectGuid::Empty, InstanceScript::GetBossState(), SpellScript::GetCaster(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), SpellScript::GetHitUnit(), WorldObject::GetInstanceScript(), GUID_VAMPIRE, IN_PROGRESS, Unit::RemoveAura(), SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR, SPELL_FRENZIED_BLOODTHIRST, SPELL_GUSHING_WOUND, SPELL_MISS_NONE, SPELL_THIRST_QUENCHED, sSpellMgr, and TRIGGERED_FULL_MASK.

◆ PrepareSpellScript()

spell_blood_queen_vampiric_bite::PrepareSpellScript ( spell_blood_queen_vampiric_bite  )
private

◆ Register()

void spell_blood_queen_vampiric_bite::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

859 {
863 }
@ EFFECT_1
Definition: SharedDefines.h:32
@ SPELL_EFFECT_TRIGGER_SPELL
Definition: SharedDefines.h:842
#define BeforeSpellHitFn(F)
Definition: SpellScript.h:342
#define SpellCheckCastFn(F)
Definition: SpellScript.h:329
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:328
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
HookList< CastHandler > OnCast
Definition: SpellScript.h:321
HookList< BeforeHitHandler > BeforeHit
Definition: SpellScript.h:341
SpellCastResult CheckTarget()
Definition: boss_blood_queen_lana_thel.cpp:803
void HandlePresence(SpellEffIndex)
Definition: boss_blood_queen_lana_thel.cpp:852

References SpellScript::BeforeHit, BeforeSpellHitFn, CheckTarget(), EFFECT_1, HandlePresence(), SpellScript::OnCast, SpellScript::OnCheckCast, SpellScript::OnEffectHitTarget, SPELL_EFFECT_TRIGGER_SPELL, SpellCheckCastFn, and SpellEffectFn.

◆ Validate()

bool spell_blood_queen_vampiric_bite::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

794 {
795 return ValidateSpellInfo(
796 {
800 });
801 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:125

References SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR, SPELL_FRENZIED_BLOODTHIRST, SPELL_PRESENCE_OF_THE_DARKFALLEN_DUMMY, and _SpellScript::ValidateSpellInfo().