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

Public Member Functions

 spell_deathbringer_blood_nova_targeting_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_deathbringer_blood_nova_targeting_SpellScript)
 
void FilterTargetsInitial (std::list< WorldObject * > &targets)
 
void FilterTargetsSubsequent (std::list< WorldObject * > &unitList)
 
void HandleForceCast (SpellEffIndex)
 
void Register () override
 

Private Attributes

WorldObjecttarget
 

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_deathbringer_blood_nova_targeting::spell_deathbringer_blood_nova_targeting_SpellScript::spell_deathbringer_blood_nova_targeting_SpellScript ( )
inline
1200  {
1201  target = nullptr;
1202  }
WorldObject * target
Definition: boss_deathbringer_saurfang.cpp:1253

Member Function Documentation

void spell_deathbringer_blood_nova_targeting::spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial ( std::list< WorldObject * > &  targets)
inlineprivate
1206  {
1207  if (targets.empty())
1208  return;
1209 
1210  // select one random target, preferring ranged targets
1211  uint32 targetsAtRange = 0;
1212  uint32 const minTargets = uint32(GetCaster()->GetMap()->Is25ManRaid() ? 10 : 4);
1213  targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
1214 
1215  // get target count at range
1216  for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr, ++targetsAtRange)
1217  if ((*itr)->GetDistance(GetCaster()) < 12.0f)
1218  break;
1219 
1220  // If not enough ranged targets are present just select anyone
1221  if (targetsAtRange < minTargets)
1222  targetsAtRange = uint32(targets.size());
1223 
1224  std::list<WorldObject*>::const_iterator itr = targets.begin();
1225  std::advance(itr, urand(0, targetsAtRange - 1));
1226  target = *itr;
1227  targets.clear();
1228  targets.push_back(target);
1229  }
Definition: Object.h:668
void advance(octet_iterator &it, distance_type n, octet_iterator end)
Definition: checked.h:190
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32_t uint32
Definition: Define.h:150
WorldObject * target
Definition: boss_deathbringer_saurfang.cpp:1253
Unit * GetCaster()
Definition: SpellScript.cpp:394
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_deathbringer_blood_nova_targeting::spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent ( std::list< WorldObject * > &  unitList)
inlineprivate
1233  {
1234  unitList.clear();
1235  if (!target)
1236  return;
1237 
1238  unitList.push_back(target);
1239  }
WorldObject * target
Definition: boss_deathbringer_saurfang.cpp:1253

+ Here is the caller graph for this function:

void spell_deathbringer_blood_nova_targeting::spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast ( SpellEffIndex  )
inlineprivate
1242  {
1244  }
Will ignore most target checks (mostly DBC target checks)
Definition: Unit.h:479
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
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_deathbringer_blood_nova_targeting::spell_deathbringer_blood_nova_targeting_SpellScript::PrepareSpellScript ( spell_deathbringer_blood_nova_targeting_SpellScript  )
private
void spell_deathbringer_blood_nova_targeting::spell_deathbringer_blood_nova_targeting_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1247  {
1251  }
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:310
Definition: SharedDefines.h:29
Definition: SharedDefines.h:28
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:311
Definition: SharedDefines.h:1885
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
void FilterTargetsSubsequent(std::list< WorldObject * > &unitList)
Definition: boss_deathbringer_saurfang.cpp:1232
void FilterTargetsInitial(std::list< WorldObject * > &targets)
Definition: boss_deathbringer_saurfang.cpp:1205
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:295
void HandleForceCast(SpellEffIndex)
Definition: boss_deathbringer_saurfang.cpp:1241
Definition: SharedDefines.h:1150

+ Here is the call graph for this function:

Member Data Documentation

WorldObject* spell_deathbringer_blood_nova_targeting::spell_deathbringer_blood_nova_targeting_SpellScript::target
private

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