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

Public Member Functions

 spell_shadow_portal_rooms_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_rooms_SpellScript)
 
bool Load () override
 
void HandleSendEvent (SpellEffIndex effIndex)
 
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_rooms::spell_shadow_portal_rooms_SpellScript::spell_shadow_portal_rooms_SpellScript ( )
inline
296  {
297  _instance = nullptr;
298  }
InstanceScript * _instance
Definition: boss_darkmaster_gandling.cpp:374

Member Function Documentation

void spell_shadow_portal_rooms::spell_shadow_portal_rooms_SpellScript::HandleSendEvent ( SpellEffIndex  effIndex)
inlineprivate
308  {
309  // If only one player in threat list fail spell
310 
311  Unit* caster = GetCaster();
312 
313  int8 pos_to_summon = 0;
314  int8 phase_to_set = 0;
315  int32 gate_to_close = 0;
316 
317  switch (GetSpellInfo()->GetEffect(effIndex)->MiscValue)
318  {
320  pos_to_summon = 0; // Not yet spawned
321  phase_to_set = 1;
322  gate_to_close = GO_GATE_RAVENIAN;
323  break;
325  pos_to_summon = 0;
326  phase_to_set = 2;
327  gate_to_close = GO_GATE_THEOLEN;
328  break;
330  pos_to_summon = 3;
331  phase_to_set = 3;
332  gate_to_close = GO_GATE_MALICIA;
333  break;
335  pos_to_summon = 6;
336  phase_to_set = 4;
337  gate_to_close = GO_GATE_ILLUCIA;
338  break;
340  pos_to_summon = 9;
341  phase_to_set = 5;
342  gate_to_close = GO_GATE_BAROV;
343  break;
345  pos_to_summon = 0; // Not yet spawned
346  phase_to_set = 6;
347  gate_to_close = GO_GATE_POLKELT;
348  break;
349  default:
350  break;
351  }
352 
353  if (gate_to_close && (caster->GetMap()->GetId() == 289))
354  {
355  for (uint8 i = 0; i < 3; ++i)
356  {
357  if (Creature* Summoned = caster->SummonCreature(NPC_RISEN_GUARDIAN, SummonPos[pos_to_summon++], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
358  {
359  Summoned->GetMotionMaster()->MoveRandom(5);
360  Summoned->AI()->SetData(0, phase_to_set);
361  }
362  }
363 
364  if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, _instance->GetGuidData(gate_to_close)))
365  gate->SetGoState(GO_STATE_READY);
366  }
367  }
Definition: boss_darkmaster_gandling.cpp:279
int8_t int8
Definition: Define.h:148
Definition: scholomance.h:49
Map * GetMap() const
Definition: Object.h:543
Definition: boss_darkmaster_gandling.cpp:281
Definition: Creature.h:467
Definition: scholomance.h:47
uint32 GetId(void) const
Definition: Map.h:325
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: boss_darkmaster_gandling.cpp:272
Position const SummonPos[18]
Definition: boss_darkmaster_gandling.cpp:242
Definition: boss_darkmaster_gandling.cpp:280
int32_t int32
Definition: Define.h:146
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:404
Definition: GameObject.h:880
Definition: scholomance.h:51
Definition: scholomance.h:50
Definition: GameObject.h:823
InstanceScript * _instance
Definition: boss_darkmaster_gandling.cpp:374
Unit * GetCaster()
Definition: SpellScript.cpp:394
Definition: boss_darkmaster_gandling.cpp:277
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
Definition: boss_darkmaster_gandling.cpp:282
Definition: scholomance.h:48
Definition: Unit.h:1305
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
Definition: boss_darkmaster_gandling.cpp:278

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool spell_shadow_portal_rooms::spell_shadow_portal_rooms_SpellScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

302  {
304  return _instance != nullptr;
305  }
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
InstanceScript * _instance
Definition: boss_darkmaster_gandling.cpp:374
Unit * GetCaster()
Definition: SpellScript.cpp:394

+ Here is the call graph for this function:

spell_shadow_portal_rooms::spell_shadow_portal_rooms_SpellScript::PrepareSpellScript ( spell_shadow_portal_rooms_SpellScript  )
private
void spell_shadow_portal_rooms::spell_shadow_portal_rooms_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

370  {
372  }
Definition: SharedDefines.h:29
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:294
void HandleSendEvent(SpellEffIndex effIndex)
Definition: boss_darkmaster_gandling.cpp:307
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
Definition: SharedDefines.h:1071

+ Here is the call graph for this function:

Member Data Documentation

InstanceScript* spell_shadow_portal_rooms::spell_shadow_portal_rooms_SpellScript::_instance
private

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