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

Private Member Functions

 PrepareSpellScript (spell_malygos_surge_of_power_warning_selector_25_SpellScript)
 
bool Load () override
 
bool Validate (SpellInfo const *) override
 
void SendThreeTargets (std::list< WorldObject * > &targets)
 
void ExecuteMainSpell ()
 
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 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_malygos_surge_of_power_warning_selector_25::spell_malygos_surge_of_power_warning_selector_25_SpellScript::ExecuteMainSpell ( )
inlineprivate
2299  {
2301  }
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: boss_malygos.cpp:143
Unit * GetCaster()
Definition: SpellScript.cpp:394
Creature * ToCreature()
Definition: Object.h:194
Definition: Unit.h:1305
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:

bool spell_malygos_surge_of_power_warning_selector_25::spell_malygos_surge_of_power_warning_selector_25_SpellScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

2260  {
2261  return GetCaster()->GetTypeId() == TYPEID_UNIT;
2262  }
Definition: ObjectGuid.h:32
TypeID GetTypeId() const
Definition: Object.h:113
Unit * GetCaster()
Definition: SpellScript.cpp:394

+ Here is the call graph for this function:

spell_malygos_surge_of_power_warning_selector_25::spell_malygos_surge_of_power_warning_selector_25_SpellScript::PrepareSpellScript ( spell_malygos_surge_of_power_warning_selector_25_SpellScript  )
private
void spell_malygos_surge_of_power_warning_selector_25::spell_malygos_surge_of_power_warning_selector_25_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2304  {
2307  }
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:310
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 SendThreeTargets(std::list< WorldObject * > &targets)
Definition: boss_malygos.cpp:2272
HookList< HitHandler > AfterHit
Definition: SpellScript.h:304

+ Here is the call graph for this function:

void spell_malygos_surge_of_power_warning_selector_25::spell_malygos_surge_of_power_warning_selector_25_SpellScript::SendThreeTargets ( std::list< WorldObject * > &  targets)
inlineprivate
2273  {
2274  // This spell hits only vehicles (SMSG_SPELL_GO target)
2275  Creature* caster = GetCaster()->ToCreature();
2276  // Remove all objects that aren't* vehicles.
2277  targets.remove_if(IsCreatureVehicleCheck(false));
2278  if (targets.empty())
2279  return;
2280 
2281  // But in fact it selects 3 targets (SMSG_SPELL_GO target are not filtered)
2282  std::list<WorldObject*> selectedTargets = targets;
2283 
2284  uint8 guidDataSlot = DATA_FIRST_SURGE_TARGET_GUID; // SetGuid in Malygos AI is reserved for 14th, 15th and 16th Id for the three targets
2285  Trinity::Containers::RandomResizeList(selectedTargets, 3);
2286  for (std::list<WorldObject*>::const_iterator itr = selectedTargets.begin(); itr != selectedTargets.end(); ++itr)
2287  {
2288  Creature* target = (*itr)->ToCreature();
2289  caster->AI()->SetGUID(target->GetGUID(), guidDataSlot++);
2290 
2291  if (Vehicle* vehicle = target->GetVehicleKit())
2292  if (Unit* passenger = vehicle->GetPassenger(0))
2293  if (passenger->GetTypeId() == TYPEID_PLAYER)
2294  caster->AI()->Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, passenger);
2295  }
2296  }
Definition: Vehicle.h:32
void RandomResizeList(std::list< T > &list, uint32 size)
Definition: Containers.h:34
Definition: Creature.h:467
Definition: boss_malygos.cpp:1700
virtual void SetGUID(ObjectGuid, int32=0)
Definition: UnitAI.h:141
Definition: boss_malygos.cpp:320
CreatureAI * AI() const
Definition: Creature.h:525
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_malygos.cpp:217
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
Unit * GetCaster()
Definition: SpellScript.cpp:394
Creature * ToCreature()
Definition: Object.h:194
uint8_t uint8
Definition: Define.h:152
Definition: Unit.h:1305
Vehicle * GetVehicleKit() const
Definition: Unit.h:2165

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool spell_malygos_surge_of_power_warning_selector_25::spell_malygos_surge_of_power_warning_selector_25_SpellScript::Validate ( SpellInfo const )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

2265  {
2266  if (!sSpellMgr->GetSpellInfo(SPELL_SURGE_OF_POWER_PHASE_3_25))
2267  return false;
2268 
2269  return true;
2270  }
Definition: boss_malygos.cpp:143
#define sSpellMgr
Definition: SpellMgr.h:756

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