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

Public Member Functions

 spell_generic_quest_update_entry_SpellScript (uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, uint32 despawnTime=0)
 
void HandleDummy (SpellEffIndex)
 
void Register () override
 
- 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 ()
 

Private Member Functions

 PrepareSpellScript (spell_generic_quest_update_entry_SpellScript)
 

Private Attributes

uint16 _spellEffect
 
uint8 _effIndex
 
uint32 _originalEntry
 
uint32 _newEntry
 
bool _shouldAttack
 
uint32 _despawnTime
 

Additional Inherited Members

- 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

Constructor & Destructor Documentation

◆ spell_generic_quest_update_entry_SpellScript()

spell_generic_quest_update_entry_SpellScript::spell_generic_quest_update_entry_SpellScript ( uint16  spellEffect,
uint8  effIndex,
uint32  originalEntry,
uint32  newEntry,
bool  shouldAttack,
uint32  despawnTime = 0 
)
inline
755 :
756 SpellScript(), _spellEffect(spellEffect), _effIndex(effIndex), _originalEntry(originalEntry),
757 _newEntry(newEntry), _shouldAttack(shouldAttack), _despawnTime(despawnTime) { }
Definition: SpellScript.h:182
uint32 _despawnTime
Definition: spell_quest.cpp:752
uint8 _effIndex
Definition: spell_quest.cpp:748
bool _shouldAttack
Definition: spell_quest.cpp:751
uint32 _newEntry
Definition: spell_quest.cpp:750
uint32 _originalEntry
Definition: spell_quest.cpp:749
uint16 _spellEffect
Definition: spell_quest.cpp:747

Member Function Documentation

◆ HandleDummy()

void spell_generic_quest_update_entry_SpellScript::HandleDummy ( SpellEffIndex  )
inline
760 {
761 if (Creature* creatureTarget = GetHitCreature())
762 if (!creatureTarget->IsPet() && creatureTarget->GetEntry() == _originalEntry)
763 {
764 creatureTarget->UpdateEntry(_newEntry);
765 if (_shouldAttack && creatureTarget->IsAIEnabled)
766 creatureTarget->AI()->AttackStart(GetCaster());
767
768 if (_despawnTime)
769 creatureTarget->DespawnOrUnsummon(_despawnTime);
770 }
771 }
Definition: Creature.h:43
Creature * GetHitCreature()
Definition: SpellScript.cpp:458
Unit * GetCaster()
Definition: SpellScript.cpp:401

References _despawnTime, _newEntry, _originalEntry, _shouldAttack, SpellScript::GetCaster(), and SpellScript::GetHitCreature().

Referenced by Register().

◆ PrepareSpellScript()

spell_generic_quest_update_entry_SpellScript::PrepareSpellScript ( spell_generic_quest_update_entry_SpellScript  )
private

◆ Register()

void spell_generic_quest_update_entry_SpellScript::Register ( )
inlineoverridevirtual

Implements _SpellScript.

774 {
776 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleDummy(SpellEffIndex)
Definition: spell_quest.cpp:759

References _effIndex, _spellEffect, HandleDummy(), SpellScript::OnEffectHitTarget, and SpellEffectFn.

Member Data Documentation

◆ _despawnTime

uint32 spell_generic_quest_update_entry_SpellScript::_despawnTime
private

Referenced by HandleDummy().

◆ _effIndex

uint8 spell_generic_quest_update_entry_SpellScript::_effIndex
private

Referenced by Register().

◆ _newEntry

uint32 spell_generic_quest_update_entry_SpellScript::_newEntry
private

Referenced by HandleDummy().

◆ _originalEntry

uint32 spell_generic_quest_update_entry_SpellScript::_originalEntry
private

Referenced by HandleDummy().

◆ _shouldAttack

bool spell_generic_quest_update_entry_SpellScript::_shouldAttack
private

Referenced by HandleDummy().

◆ _spellEffect

uint16 spell_generic_quest_update_entry_SpellScript::_spellEffect
private

Referenced by Register().