TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
spell_q9452_cast_net::spell_q9452_cast_net_SpellScript Class Reference

Private Member Functions

 PrepareSpellScript (spell_q9452_cast_net_SpellScript)
 
bool Load () override
 
SpellCastResult CheckCast ()
 
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)
 
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 constGetSpellInfo ()
 
SpellValue constGetSpellValue ()
 
SpellEffectInfo constGetEffectInfo (SpellEffIndex) const
 
WorldLocation constGetExplTargetDest ()
 
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)
 
SpellEffectInfo constGetEffectInfo () const
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo constGetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
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 ()
 
- Public Attributes inherited from SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< EffectHandlerOnEffectSuccessfulDispel
 
HookList< HitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList
< ObjectAreaTargetSelectHandler
OnObjectAreaTargetSelect
 
HookList
< ObjectTargetSelectHandler
OnObjectTargetSelect
 
HookList
< DestinationTargetSelectHandler
OnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string constm_scriptName
 
uint32 m_scriptSpellId
 

Member Function Documentation

SpellCastResult spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::CheckCast ( )
inlineprivate
1103  {
1105  if (!go || go->GetRespawnTime())
1107 
1108  return SPELL_CAST_OK;
1109  }
GameObject * FindNearestGameObject(uint32 entry, float range) const
Definition: Object.cpp:2452
time_t GetRespawnTime() const
Definition: GameObject.h:935
Definition: SharedDefines.h:1388
Definition: spell_quest.cpp:1085
Definition: GameObject.h:880
Unit * GetCaster()
Definition: SpellScript.cpp:394
Definition: SharedDefines.h:1538

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::HandleActiveObject ( SpellEffIndex  effIndex)
inlineprivate
1121  {
1122  PreventHitDefaultEffect(effIndex);
1123  GetHitGObj()->SetRespawnTime(roll_chance_i(50) ? 2 * MINUTE : 3 * MINUTE);
1124  GetHitGObj()->Use(GetCaster());
1126  }
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:583
Definition: GameObject.h:871
void SetRespawnTime(int32 respawn)
Definition: GameObject.h:945
GameObject * GetHitGObj()
Definition: SpellScript.cpp:487
Definition: Common.h:97
void SetLootState(LootState s, Unit *unit=NULL)
Definition: GameObject.cpp:2112
bool roll_chance_i(int chance)
Definition: Random.h:53
void Use(Unit *user)
Definition: GameObject.cpp:1232
Unit * GetCaster()
Definition: SpellScript.cpp:394

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::HandleDummy ( SpellEffIndex  )
inlineprivate
1112  {
1113  Player* caster = GetCaster()->ToPlayer();
1114  if (roll_chance_i(66))
1115  caster->AddItem(ITEM_RED_SNAPPER, 1);
1116  else
1117  caster->CastSpell(caster, SPELL_NEW_SUMMON_TEST, true);
1118  }
Player * ToPlayer()
Definition: Object.h:191
Definition: spell_quest.cpp:1083
bool roll_chance_i(int chance)
Definition: Random.h:53
Unit * GetCaster()
Definition: SpellScript.cpp:394
Definition: spell_quest.cpp:1080

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1098  {
1099  return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1100  }
TypeID GetTypeId() const
Definition: Object.h:113
Definition: ObjectGuid.h:33
Unit * GetCaster()
Definition: SpellScript.cpp:394

+ Here is the call graph for this function:

spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::PrepareSpellScript ( spell_q9452_cast_net_SpellScript  )
private
void spell_q9452_cast_net::spell_q9452_cast_net_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1129  {
1133  }
Definition: SharedDefines.h:29
Definition: SharedDefines.h:1096
Definition: SharedDefines.h:28
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:294
void HandleActiveObject(SpellEffIndex effIndex)
Definition: spell_quest.cpp:1120
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:295
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:287
Definition: SharedDefines.h:1013
SpellCastResult CheckCast()
Definition: spell_quest.cpp:1102
void HandleDummy(SpellEffIndex)
Definition: spell_quest.cpp:1111
#define SpellCheckCastFn(F)
Definition: SpellScript.h:288

+ Here is the call graph for this function:


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