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

Private Member Functions

 PrepareSpellScript (spell_gen_pet_summoned)
 
bool Load () override
 
void HandleScript (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
 
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 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

◆ HandleScript()

void spell_gen_pet_summoned::HandleScript ( SpellEffIndex  )
inlineprivate
1783 {
1784 Player* player = GetCaster()->ToPlayer();
1785 if (player->GetLastPetNumber() && player->CanResummonPet(player->GetLastPetSpell()))
1786 {
1788 Pet* newPet = new Pet(player, newPetType);
1789 if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true, 100, true))
1790 {
1791 switch (newPet->GetEntry())
1792 {
1793 case NPC_DOOMGUARD:
1794 case NPC_INFERNAL:
1795 newPet->SetEntry(NPC_IMP);
1796 break;
1797 default:
1798 break;
1799 }
1800 }
1801 else
1802 delete newPet;
1803 }
1804 }
@ NPC_DOOMGUARD
Definition PetDefines.h:100
@ NPC_INFERNAL
Definition PetDefines.h:95
@ NPC_IMP
Definition PetDefines.h:96
PetType
Definition PetDefines.h:31
@ SUMMON_PET
Definition PetDefines.h:32
@ HUNTER_PET
Definition PetDefines.h:33
@ CLASS_HUNTER
Definition SharedDefines.h:128
@ CLASS_CONTEXT_PET
Definition UnitDefines.h:243
Player * ToPlayer()
Definition Object.h:208
uint32 GetEntry() const
Definition Object.h:123
void SetEntry(uint32 entry)
Definition Object.h:124
Definition Pet.h:41
bool LoadPetFromDB(Player *owner, uint32 petEntry, uint32 petnumber, bool current, uint32 healthPct=0, bool fullMana=false)
Definition Pet.cpp:216
Definition Player.h:1086
uint32 GetLastPetSpell() const
Definition Player.h:2508
bool IsClass(Classes playerClass, ClassContext context=CLASS_CONTEXT_NONE) const override
Definition Player.cpp:1350
uint32 GetLastPetNumber() const
Definition Player.h:2506
bool CanResummonPet(uint32 spellid)
Definition Player.cpp:14600
Unit * GetCaster()
Definition SpellScript.cpp:401

References Player::CanResummonPet(), CLASS_CONTEXT_PET, CLASS_HUNTER, SpellScript::GetCaster(), Object::GetEntry(), Player::GetLastPetNumber(), Player::GetLastPetSpell(), HUNTER_PET, Player::IsClass(), Pet::LoadPetFromDB(), NPC_DOOMGUARD, NPC_IMP, NPC_INFERNAL, Object::SetEntry(), SUMMON_PET, and Object::ToPlayer().

Referenced by Register().

◆ Load()

bool spell_gen_pet_summoned::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1778 {
1779 return GetCaster()->IsPlayer();
1780 }
bool IsPlayer() const
Definition Object.h:207

References SpellScript::GetCaster(), and Object::IsPlayer().

◆ PrepareSpellScript()

spell_gen_pet_summoned::PrepareSpellScript ( spell_gen_pet_summoned  )
private

◆ Register()

void spell_gen_pet_summoned::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1807 {
1809 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition SharedDefines.h:843
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
void HandleScript(SpellEffIndex)
Definition spell_generic.cpp:1782

References EFFECT_0, HandleScript(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_SCRIPT_EFFECT, and SpellEffectFn.


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