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

Public Member Functions

 spell_shadow_portal_SpellScript ()
 
- 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 ()
 

Private Member Functions

 PrepareSpellScript (spell_shadow_portal_SpellScript)
 
bool Load () override
 
void HandleCast (SpellEffIndex)
 
void Register () override
 

Private Attributes

InstanceScript_instance
 

Additional Inherited Members

- 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
 

Constructor & Destructor Documentation

spell_shadow_portal::spell_shadow_portal_SpellScript::spell_shadow_portal_SpellScript ( )
inline
167  {
168  _instance = nullptr;
169  }
InstanceScript * _instance
Definition: boss_darkmaster_gandling.cpp:232

Member Function Documentation

void spell_shadow_portal::spell_shadow_portal_SpellScript::HandleCast ( SpellEffIndex  )
inlineprivate
179  {
180  Unit* caster = GetCaster();
181  uint8 attempts = 0;
182  uint32 spellId = 0;
183 
184  while (!spellId)
185  {
186  if (attempts++ >= 6) break;
187 
188  switch (urand(0, 5))
189  {
192  if (go->GetGoState() == GO_STATE_ACTIVE)
194  break;
197  if (go->GetGoState() == GO_STATE_ACTIVE)
199  break;
200  case ROOM_THE_COVEN:
202  if (go->GetGoState() == GO_STATE_ACTIVE)
204  break;
207  if (go->GetGoState() == GO_STATE_ACTIVE)
209  break;
212  if (go->GetGoState() == GO_STATE_ACTIVE)
214  break;
217  if (go->GetGoState() == GO_STATE_ACTIVE)
219  break;
220  }
221 
222  if (spellId)
223  GetHitUnit()->CastSpell(GetHitUnit(), spellId);
224  }
225  }
Definition: scholomance.h:49
Definition: boss_darkmaster_gandling.cpp:138
Definition: boss_darkmaster_gandling.cpp:139
Definition: boss_darkmaster_gandling.cpp:149
Definition: boss_darkmaster_gandling.cpp:148
Definition: boss_darkmaster_gandling.cpp:142
Definition: boss_darkmaster_gandling.cpp:153
Definition: scholomance.h:47
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: boss_darkmaster_gandling.cpp:143
Definition: boss_darkmaster_gandling.cpp:152
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
InstanceScript * _instance
Definition: boss_darkmaster_gandling.cpp:232
uint32_t uint32
Definition: Define.h:150
Definition: GameObject.h:880
Definition: boss_darkmaster_gandling.cpp:140
Definition: scholomance.h:51
Definition: scholomance.h:50
Definition: boss_darkmaster_gandling.cpp:150
Definition: GameObject.h:822
Definition: boss_darkmaster_gandling.cpp:151
Unit * GetCaster()
Definition: SpellScript.cpp:394
Definition: scholomance.h:52
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:143
uint8_t uint8
Definition: Define.h:152
Unit * GetHitUnit()
Definition: SpellScript.cpp:441
Definition: scholomance.h:48
Definition: Unit.h:1305
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: boss_darkmaster_gandling.cpp:141

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool spell_shadow_portal::spell_shadow_portal_SpellScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

173  {
175  return _instance != nullptr;
176  }
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
InstanceScript * _instance
Definition: boss_darkmaster_gandling.cpp:232
Unit * GetCaster()
Definition: SpellScript.cpp:394

+ Here is the call graph for this function:

spell_shadow_portal::spell_shadow_portal_SpellScript::PrepareSpellScript ( spell_shadow_portal_SpellScript  )
private
void spell_shadow_portal::spell_shadow_portal_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

228  {
230  }
Definition: SharedDefines.h:28
void HandleCast(SpellEffIndex)
Definition: boss_darkmaster_gandling.cpp:178
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:295
Definition: SharedDefines.h:1013

+ Here is the call graph for this function:

Member Data Documentation

InstanceScript* spell_shadow_portal::spell_shadow_portal_SpellScript::_instance
private

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