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

Private Member Functions

 PrepareSpellScript (spell_warr_heroic_leap_SpellScript)
 
bool Validate (SpellInfo const *) override
 
SpellCastResult CheckElevation ()
 
void HandleDummy (SpellEffIndex)
 
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 Load ()
 
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_warr_heroic_leap::spell_warr_heroic_leap_SpellScript::CheckElevation ( )
inlineprivate
973  {
974  if (WorldLocation const* dest = GetExplTargetDest())
975  {
976  if (GetCaster()->HasUnitMovementFlag(MOVEMENTFLAG_ROOT))
977  return SPELL_FAILED_ROOTED;
978 
979  if (GetCaster()->GetMap()->Instanceable())
980  {
981  float range = GetSpellInfo()->GetMaxRange(true, GetCaster()) * 1.5f;
982 
983  PathGenerator generatedPath(GetCaster());
984  generatedPath.SetPathLengthLimit(range);
985 
986  bool result = generatedPath.CalculatePath(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), false, true);
987  if (generatedPath.GetPathType() & PATHFIND_SHORT)
989  else if (!result || generatedPath.GetPathType() & PATHFIND_NOPATH)
990  {
991  result = generatedPath.CalculatePath(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), false, false);
992  if (generatedPath.GetPathType() & PATHFIND_SHORT)
994  else if (!result || generatedPath.GetPathType() & PATHFIND_NOPATH)
995  return SPELL_FAILED_NOPATH;
996  }
997  }
998  else if (dest->GetPositionZ() > GetCaster()->GetPositionZ() + 4.0f)
999  return SPELL_FAILED_NOPATH;
1000 
1001  return SPELL_CAST_OK;
1002  }
1003 
1005  }
Definition: Position.h:228
Definition: PathGenerator.h:47
Definition: SharedDefines.h:1383
float GetMaxRange(bool positive=false, Unit *caster=NULL, Spell *spell=NULL) const
Definition: SpellInfo.cpp:2475
Definition: SharedDefines.h:1389
WorldLocation const * GetExplTargetDest()
Definition: SpellScript.cpp:409
float GetPositionZ() const
Definition: Position.h:106
Definition: SharedDefines.h:1342
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:404
Definition: PathGenerator.h:52
Definition: PathGenerator.h:49
Unit * GetCaster()
Definition: SpellScript.cpp:394
Definition: Unit.h:786
Definition: SharedDefines.h:1538
Definition: SharedDefines.h:1485

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_warr_heroic_leap::spell_warr_heroic_leap_SpellScript::HandleDummy ( SpellEffIndex  )
inlineprivate
1008  {
1009  if (WorldLocation* dest = GetHitDest())
1010  GetCaster()->CastSpell(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), SPELL_WARRIOR_HEROIC_LEAP_JUMP, true);
1011  }
Definition: Position.h:228
WorldLocation * GetHitDest()
Definition: SpellScript.cpp:497
Definition: spell_warrior.cpp:66
Unit * GetCaster()
Definition: SpellScript.cpp:394
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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

spell_warr_heroic_leap::spell_warr_heroic_leap_SpellScript::PrepareSpellScript ( spell_warr_heroic_leap_SpellScript  )
private
void spell_warr_heroic_leap::spell_warr_heroic_leap_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1014  {
1017  }
Definition: SharedDefines.h:28
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:294
void HandleDummy(SpellEffIndex)
Definition: spell_warrior.cpp:1007
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
SpellCastResult CheckElevation()
Definition: spell_warrior.cpp:972
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:287
Definition: SharedDefines.h:1013
#define SpellCheckCastFn(F)
Definition: SpellScript.h:288

+ Here is the call graph for this function:

bool spell_warr_heroic_leap::spell_warr_heroic_leap_SpellScript::Validate ( SpellInfo const )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

966  {
967  if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_HEROIC_LEAP_JUMP))
968  return false;
969  return true;
970  }
#define sSpellMgr
Definition: SpellMgr.h:756
Definition: spell_warrior.cpp:66

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