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

Private Member Functions

 PrepareSpellScript (spell_scion_of_eternity_arcane_barrage_SpellScript)
 
bool Load () override
 
void FilterMeleeHoverDiskPassangers (std::list< WorldObject * > &targets)
 
void TriggerDamageSpellFromPlayer ()
 
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 Validate (SpellInfo const *)
 
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

void spell_scion_of_eternity_arcane_barrage::spell_scion_of_eternity_arcane_barrage_SpellScript::FilterMeleeHoverDiskPassangers ( std::list< WorldObject * > &  targets)
inlineprivate
1993  {
1994  if (targets.empty())
1995  return;
1996 
1997  Creature* caster = GetCaster()->ToCreature();
1998  InstanceScript* instance = caster->GetInstanceScript();
1999  Creature* malygos = ObjectAccessor::GetCreature(*caster, instance->GetGuidData(DATA_MALYGOS));
2000 
2001  // If max possible targets are more than 1 then Scions wouldn't select previosly selected target,
2002  // in longer terms this means if spell picks target X then 2nd cast of this spell will pick smth else
2003  // and if 3rd picks X again 4th will pick smth else (by not limiting the cast to certain caster).
2004  if (targets.size() > 1)
2005  if (malygos && !malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID).IsEmpty())
2006  targets.remove_if(Trinity::ObjectGUIDCheck(malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID)));
2007 
2008  // Remove players not on Hover Disk from second list
2009  std::list<WorldObject*> playersWithoutDisk;
2010  IsPlayerOnHoverDisk check(false);
2011  for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
2012  if (check(*itr))
2013  playersWithoutDisk.push_back(*itr);
2014 
2015  // if it's empty than we can have player on Hover disk as target.
2016  if (!playersWithoutDisk.empty())
2017  targets = playersWithoutDisk;
2018 
2019  // Finally here we remove all targets that have been damaged by Arcane Barrage
2020  // and have 2 seconds long aura still lasting. Used to give healers some time.
2021  if (!targets.empty())
2022  targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_ARCANE_BARRAGE_DAMAGE));
2023 
2024  // Now we resize the list to max output targets which can be only 1
2025  // to take it's guid and send/store it to DATA_LAST_TARGET_BARRAGE_GUID.
2026  // Same target is never picked until next pick pass. This doesn't mean
2027  // that it can't be hit more than once. In fact all is chance and raid speed.
2028  if (!targets.empty())
2029  {
2030  if (targets.size() > 1)
2032 
2033  if (WorldObject* filteredTarget = targets.front())
2034  if (malygos)
2035  malygos->AI()->SetGUID(filteredTarget->GetGUID(), DATA_LAST_TARGET_BARRAGE_GUID);
2036  }
2037  }
virtual ObjectGuid GetGUID(int32=0) const
Definition: UnitAI.h:142
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
void RandomResizeList(std::list< T > &list, uint32 size)
Definition: Containers.h:34
Definition: GridNotifiers.h:1376
Definition: Object.h:423
Definition: Creature.h:467
virtual void SetGUID(ObjectGuid, int32=0)
Definition: UnitAI.h:141
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: GridNotifiers.h:1344
CreatureAI * AI() const
Definition: Creature.h:525
Definition: boss_malygos.cpp:1960
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: eye_of_eternity.h:36
Unit * GetCaster()
Definition: SpellScript.cpp:394
Creature * ToCreature()
Definition: Object.h:194
Definition: boss_malygos.cpp:128
Definition: InstanceScript.h:141
Definition: boss_malygos.cpp:323
T check(T value)
Definition: format.h:305
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool spell_scion_of_eternity_arcane_barrage::spell_scion_of_eternity_arcane_barrage_SpellScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1988  {
1989  return GetCaster()->GetTypeId() == TYPEID_UNIT && GetCaster()->GetInstanceScript() != NULL;
1990  }
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
Definition: ObjectGuid.h:32
arena_t NULL
Definition: jemalloc_internal.h:624
TypeID GetTypeId() const
Definition: Object.h:113
Unit * GetCaster()
Definition: SpellScript.cpp:394

+ Here is the call graph for this function:

spell_scion_of_eternity_arcane_barrage::spell_scion_of_eternity_arcane_barrage_SpellScript::PrepareSpellScript ( spell_scion_of_eternity_arcane_barrage_SpellScript  )
private
void spell_scion_of_eternity_arcane_barrage::spell_scion_of_eternity_arcane_barrage_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2050  {
2053  }
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:310
HookList< HitHandler > OnHit
Definition: SpellScript.h:302
Definition: SharedDefines.h:28
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:311
Definition: SharedDefines.h:1885
#define SpellHitFn(F)
Definition: SpellScript.h:306
void FilterMeleeHoverDiskPassangers(std::list< WorldObject * > &targets)
Definition: boss_malygos.cpp:1992

+ Here is the call graph for this function:

void spell_scion_of_eternity_arcane_barrage::spell_scion_of_eternity_arcane_barrage_SpellScript::TriggerDamageSpellFromPlayer ( )
inlineprivate
2040  {
2041  if (Player* hitTarget = GetHitPlayer())
2042  {
2043  // There is some proc in this spell I have absolutely no idea of use, but just in case...
2045  hitTarget->CastSpell(hitTarget, SPELL_ARCANE_BARRAGE_DAMAGE, triggerFlags, NULL, NULL, GetCaster()->GetGUID());
2046  }
2047  }
Will ignore caster aura restrictions or requirements.
Definition: Unit.h:475
Player * GetHitPlayer()
Definition: SpellScript.cpp:464
arena_t NULL
Definition: jemalloc_internal.h:624
Will ignore most target checks (mostly DBC target checks)
Definition: Unit.h:479
TriggerCastFlags
Definition: Unit.h:458
Unit * GetCaster()
Definition: SpellScript.cpp:394
Definition: boss_malygos.cpp:128

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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