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

Public Member Functions

 spell_sindragosa_s_fury_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_sindragosa_s_fury_SpellScript)
 
bool Load () override
 
void SelectDest ()
 
void CountTargets (std::list< WorldObject * > &targets)
 
void HandleDummy (SpellEffIndex effIndex)
 
void Register () override
 

Private Attributes

uint32 _targetCount
 

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_sindragosa_s_fury::spell_sindragosa_s_fury_SpellScript::spell_sindragosa_s_fury_SpellScript ( )
inline
1056  {
1057  _targetCount = 0;
1058  }
uint32 _targetCount
Definition: boss_sindragosa.cpp:1115

Member Function Documentation

void spell_sindragosa_s_fury::spell_sindragosa_s_fury_SpellScript::CountTargets ( std::list< WorldObject * > &  targets)
inlineprivate
1085  {
1086  _targetCount = targets.size();
1087  }
uint32 _targetCount
Definition: boss_sindragosa.cpp:1115

+ Here is the caller graph for this function:

void spell_sindragosa_s_fury::spell_sindragosa_s_fury_SpellScript::HandleDummy ( SpellEffIndex  effIndex)
inlineprivate
1090  {
1091  PreventHitDefaultEffect(effIndex);
1092 
1093  if (!GetHitUnit()->IsAlive() || !_targetCount)
1094  return;
1095 
1096  float resistance = float(GetHitUnit()->GetResistance(SpellSchoolMask(GetSpellInfo()->SchoolMask)));
1097  uint32 minResistFactor = uint32((resistance / (resistance + 510.0f)) * 10.0f) * 2;
1098  uint32 randomResist = urand(0, (9 - minResistFactor) * 100) / 100 + minResistFactor;
1099 
1100  uint32 damage = (uint32(GetEffectValue() / _targetCount) * randomResist) / 10;
1101 
1102  SpellNonMeleeDamage damageInfo(GetCaster(), GetHitUnit(), GetSpellInfo()->Id, GetSpellInfo()->SchoolMask);
1103  damageInfo.damage = damage;
1104  GetCaster()->DealSpellDamage(&damageInfo, false);
1105  GetCaster()->SendSpellNonMeleeDamageLog(&damageInfo);
1106  }
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:583
SpellSchoolMask
Definition: SharedDefines.h:285
uint32 _targetCount
Definition: boss_sindragosa.cpp:1115
Definition: Unit.h:1042
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32_t uint32
Definition: Define.h:150
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:404
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
Definition: Unit.cpp:1094
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
Definition: Unit.cpp:4839
Unit * GetCaster()
Definition: SpellScript.cpp:394
Unit * GetHitUnit()
Definition: SpellScript.cpp:441
int32 GetEffectValue() const
Definition: SpellScript.cpp:600
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool spell_sindragosa_s_fury::spell_sindragosa_s_fury_SpellScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1062  {
1063  // This script should execute only in Icecrown Citadel
1064  if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap())
1065  if (instance->GetInstanceScript())
1066  if (instance->GetScriptId() == sObjectMgr->GetScriptId(ICCScriptName))
1067  return true;
1068 
1069  return false;
1070  }
#define ICCScriptName
Definition: icecrown_citadel.h:23
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: Map.h:758
Unit * GetCaster()
Definition: SpellScript.cpp:394

+ Here is the call graph for this function:

spell_sindragosa_s_fury::spell_sindragosa_s_fury_SpellScript::PrepareSpellScript ( spell_sindragosa_s_fury_SpellScript  )
private
void spell_sindragosa_s_fury::spell_sindragosa_s_fury_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1109  {
1113  }
Definition: SharedDefines.h:1882
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:310
Definition: SharedDefines.h:29
#define SpellCastFn(F)
Definition: SpellScript.h:283
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:311
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
void HandleDummy(SpellEffIndex effIndex)
Definition: boss_sindragosa.cpp:1089
void CountTargets(std::list< WorldObject * > &targets)
Definition: boss_sindragosa.cpp:1084
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:295
Definition: SharedDefines.h:1013
HookList< CastHandler > BeforeCast
Definition: SpellScript.h:278
void SelectDest()
Definition: boss_sindragosa.cpp:1072

+ Here is the call graph for this function:

void spell_sindragosa_s_fury::spell_sindragosa_s_fury_SpellScript::SelectDest ( )
inlineprivate
1073  {
1074  if (Position* dest = const_cast<WorldLocation*>(GetExplTargetDest()))
1075  {
1076  float destX = float(rand_norm()) * 75.0f + 4350.0f;
1077  float destY = float(rand_norm()) * 75.0f + 2450.0f;
1078  float destZ = 205.0f; // random number close to ground, get exact in next call
1079  GetCaster()->UpdateGroundPositionZ(destX, destY, destZ);
1080  dest->Relocate(destX, destY, destZ);
1081  }
1082  }
WorldLocation const * GetExplTargetDest()
Definition: SpellScript.cpp:409
double rand_norm()
Definition: Random.cpp:69
Unit * GetCaster()
Definition: SpellScript.cpp:394
Definition: Position.h:27
void UpdateGroundPositionZ(float x, float y, float &z) const
Definition: Object.cpp:1827

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32 spell_sindragosa_s_fury::spell_sindragosa_s_fury_SpellScript::_targetCount
private

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