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

Private Member Functions

 PrepareSpellScript (spell_gen_break_shield_SpellScript)
 
void HandleScriptEffect (SpellEffIndex effIndex)
 
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 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

void spell_gen_break_shield::spell_gen_break_shield_SpellScript::HandleScriptEffect ( SpellEffIndex  effIndex)
inlineprivate
585  {
586  Unit* target = GetHitUnit();
587 
588  switch (effIndex)
589  {
590  case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
591  {
592  uint32 spellId;
593 
594  switch (GetSpellInfo()->Id)
595  {
599  break;
602  break;
603  default:
604  return;
605  }
606 
607  if (Unit* rider = GetCaster()->GetCharmer())
608  rider->CastSpell(target, spellId, false);
609  else
610  GetCaster()->CastSpell(target, spellId, false);
611  break;
612  }
613  case EFFECT_1: // On damaging spells, for removing a defend layer
614  {
615  Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
616  for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
617  {
618  if (Aura* aura = itr->second->GetBase())
619  {
620  SpellInfo const* auraInfo = aura->GetSpellInfo();
621  if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
622  {
623  aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
624  // Remove dummys from rider (Necessary for updating visual shields)
625  if (Unit* rider = target->GetCharmer())
626  if (Aura* defend = rider->GetAura(aura->GetId()))
627  defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
628  break;
629  }
630  }
631  }
632  break;
633  }
634  default:
635  break;
636  }
637  }
Unit * GetCharmer() const
Definition: Unit.cpp:7551
Definition: SpellAuraDefines.h:147
Definition: SharedDefines.h:29
Definition: SpellInfo.h:326
Definition: SharedDefines.h:28
Definition: spell_generic.cpp:567
AuraApplicationMap & GetAppliedAuras()
Definition: Unit.h:1789
Definition: spell_generic.cpp:572
uint32_t uint32
Definition: Define.h:150
Definition: spell_generic.cpp:568
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:404
Definition: Unit.h:453
Unit * GetCaster()
Definition: SpellScript.cpp:394
Definition: spell_generic.cpp:571
uint32 SpellIconID
Definition: SpellInfo.h:390
Unit * GetHitUnit()
Definition: SpellScript.cpp:441
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition: Unit.h:1315
Definition: SpellAuras.h:116
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
Definition: spell_generic.cpp:570

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

spell_gen_break_shield::spell_gen_break_shield_SpellScript::PrepareSpellScript ( spell_gen_break_shield_SpellScript  )
private
void spell_gen_break_shield::spell_gen_break_shield_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

640  {
642  }
void HandleScriptEffect(SpellEffIndex effIndex)
Definition: spell_generic.cpp:584
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:295
#define EFFECT_FIRST_FOUND
Definition: SharedDefines.h:63
Definition: SharedDefines.h:1087

+ Here is the call graph for this function:


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