TrinityCore
spell_q9452_cast_net::spell_q9452_cast_net_SpellScript Class Reference

Private Member Functions

 PrepareSpellScript (spell_q9452_cast_net_SpellScript)
 
bool Load () override
 
void HandleDummy (SpellEffIndex)
 
void HandleActiveObject (SpellEffIndex effIndex)
 
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) const
 
bool _IsDefaultEffectPrevented (SpellEffIndex effIndex) const
 
void _PrepareScriptCall (SpellScriptHookType hookType)
 
void _FinishScriptCall ()
 
bool IsInCheckCastHook () const
 
bool IsAfterTargetSelectionPhase () const
 
bool IsInTargetHook () const
 
bool IsInModifiableHook () const
 
bool IsInHitPhase () const
 
bool IsInEffectHook () const
 
UnitGetCaster () const
 
GameObjectGetGObjCaster () const
 
UnitGetOriginalCaster () const
 
SpellInfo const * GetSpellInfo () const
 
SpellEffectInfo const & GetEffectInfo (SpellEffIndex effIndex) const
 
SpellValue const * GetSpellValue () const
 
WorldLocation const * GetExplTargetDest () const
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObjectGetExplTargetWorldObject () const
 
UnitGetExplTargetUnit () const
 
GameObjectGetExplTargetGObj () const
 
ItemGetExplTargetItem () const
 
int64 GetUnitTargetCountForEffect (SpellEffIndex effect) const
 
int64 GetGameObjectTargetCountForEffect (SpellEffIndex effect) const
 
int64 GetItemTargetCountForEffect (SpellEffIndex effect) const
 
UnitGetHitUnit () const
 
CreatureGetHitCreature () const
 
PlayerGetHitPlayer () const
 
ItemGetHitItem () const
 
GameObjectGetHitGObj () const
 
WorldLocationGetHitDest () const
 
int32 GetHitDamage () const
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal () const
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
SpellGetSpell () const
 
AuraGetHitAura (bool dynObjAura=false) const
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
SpellEffectInfo const & GetEffectInfo () const
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem () const
 
void CreateItem (uint32 itemId, ItemContext context)
 
SpellInfo const * GetTriggeringSpell () const
 
void FinishCast (SpellCastResult result, uint32 *param1=nullptr, uint32 *param2=nullptr)
 
void SetCustomCastResultMessage (SpellCustomErrors result)
 
Difficulty GetCastDifficulty () const
 
- Public Member Functions inherited from _SpellScript
 _SpellScript ()
 
virtual ~_SpellScript ()
 
void _Register ()
 
void _Unload ()
 
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< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< EffectHandlerOnEffectSuccessfulDispel
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< OnCalcCritChanceHandlerOnCalcCritChance
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Member Function Documentation

◆ HandleActiveObject()

void spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::HandleActiveObject ( SpellEffIndex  effIndex)
inlineprivate
1129  {
1130  PreventHitDefaultEffect(effIndex);
1131  GetHitGObj()->SetRespawnTime(roll_chance_i(50) ? 2 * MINUTE : 3 * MINUTE);
1132  GetHitGObj()->Use(GetCaster());
1134  }
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:702
bool roll_chance_i(int chance)
Definition: Random.h:59
Definition: GameObject.h:75
void SetRespawnTime(int32 respawn)
Definition: GameObject.cpp:1394
Unit * GetCaster() const
Definition: SpellScript.cpp:461
Definition: Common.h:62
GameObject * GetHitGObj() const
Definition: SpellScript.cpp:600
void SetLootState(LootState s, Unit *unit=nullptr)
Definition: GameObject.cpp:2453
void Use(Unit *user)
Definition: GameObject.cpp:1544
+ Here is the call graph for this function:

◆ HandleDummy()

void spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::HandleDummy ( SpellEffIndex  )
inlineprivate
1120  {
1121  Player* caster = GetCaster()->ToPlayer();
1122  if (roll_chance_i(66))
1123  caster->AddItem(ITEM_RED_SNAPPER, 1);
1124  else
1125  caster->CastSpell(caster, SPELL_FISHED_UP_MURLOC, true);
1126  }
bool AddItem(uint32 itemId, uint32 count)
Definition: Player.cpp:27722
bool roll_chance_i(int chance)
Definition: Random.h:59
Definition: spell_quest.cpp:1102
Player * ToPlayer()
Definition: Object.h:192
Unit * GetCaster() const
Definition: SpellScript.cpp:461
void CastSpell(SpellCastTargets const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2631
Definition: spell_quest.cpp:1100
Definition: Player.h:1056
+ Here is the call graph for this function:

◆ Load()

bool spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1115  {
1116  return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1117  }
TypeID GetTypeId() const
Definition: Object.h:167
Unit * GetCaster() const
Definition: SpellScript.cpp:461
Definition: ObjectGuid.h:40
+ Here is the call graph for this function:

◆ PrepareSpellScript()

spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::PrepareSpellScript ( spell_q9452_cast_net_SpellScript  )
private

◆ Register()

void spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1137  {
1140  }
Definition: SharedDefines.h:1178
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:351
void HandleActiveObject(SpellEffIndex effIndex)
Definition: spell_quest.cpp:1128
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:354
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:352
Definition: SharedDefines.h:1095
Definition: SharedDefines.h:28
Definition: SharedDefines.h:29
void HandleDummy(SpellEffIndex)
Definition: spell_quest.cpp:1119

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