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

Public Member Functions

 spell_garfrost_permafrost_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 bool Load ()
 
virtual void Unload ()
 

Private Member Functions

 PrepareSpellScript (spell_garfrost_permafrost_SpellScript)
 
void PreventHitByLoS ()
 
void RestoreImmunity ()
 
void Register () override
 

Private Attributes

bool prevented
 

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_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::spell_garfrost_permafrost_SpellScript ( )
inline
261  {
262  prevented = false;
263  }
bool prevented
Definition: boss_forgemaster_garfrost.cpp:312

Member Function Documentation

spell_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::PrepareSpellScript ( spell_garfrost_permafrost_SpellScript  )
private
void spell_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::PreventHitByLoS ( )
inlineprivate
267  {
268  if (Unit* target = GetHitUnit())
269  {
270  Unit* caster = GetCaster();
271  //Temporary Line of Sight Check
272  std::list<GameObject*> blockList;
273  caster->GetGameObjectListWithEntryInGrid(blockList, GO_SARONITE_ROCK, 100.0f);
274  if (!blockList.empty())
275  {
276  for (std::list<GameObject*>::const_iterator itr = blockList.begin(); itr != blockList.end(); ++itr)
277  {
278  if (!(*itr)->IsInvisibleDueToDespawn())
279  {
280  if ((*itr)->IsInBetween(caster, target, 4.0f))
281  {
282  prevented = true;
283  target->ApplySpellImmune(GetSpellInfo()->Id, IMMUNITY_ID, GetSpellInfo()->Id, true);
288  break;
289  }
290  }
291  }
292  }
293  }
294  }
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:583
Definition: SharedDefines.h:29
Definition: SharedDefines.h:1866
Definition: SharedDefines.h:28
void PreventHitDamage()
Definition: SpellScript.h:397
void GetGameObjectListWithEntryInGrid(std::list< GameObject * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2470
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:404
bool prevented
Definition: boss_forgemaster_garfrost.cpp:312
Unit * GetCaster()
Definition: SpellScript.cpp:394
Unit * GetHitUnit()
Definition: SpellScript.cpp:441
Definition: SharedDefines.h:30
Definition: Unit.h:1305
Definition: pit_of_saron.h:94

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

307  {
310  }
#define SpellHitFn(F)
Definition: SpellScript.h:306
HookList< HitHandler > BeforeHit
Definition: SpellScript.h:300
void PreventHitByLoS()
Definition: boss_forgemaster_garfrost.cpp:266
void RestoreImmunity()
Definition: boss_forgemaster_garfrost.cpp:296
HookList< HitHandler > AfterHit
Definition: SpellScript.h:304

+ Here is the call graph for this function:

void spell_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::RestoreImmunity ( )
inlineprivate
297  {
298  if (Unit* target = GetHitUnit())
299  {
300  target->ApplySpellImmune(GetSpellInfo()->Id, IMMUNITY_ID, GetSpellInfo()->Id, false);
301  if (prevented)
302  PreventHitAura();
303  }
304  }
Definition: SharedDefines.h:1866
void PreventHitAura()
Definition: SpellScript.cpp:561
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:404
bool prevented
Definition: boss_forgemaster_garfrost.cpp:312
Unit * GetHitUnit()
Definition: SpellScript.cpp:441
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

bool spell_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::prevented
private

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