AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
spell_rotface_large_ooze_combine::spell_rotface_large_ooze_combine_SpellScript Class Reference
Inheritance diagram for spell_rotface_large_ooze_combine::spell_rotface_large_ooze_combine_SpellScript:
SpellScript _SpellScript

Private Member Functions

 PrepareSpellScript (spell_rotface_large_ooze_combine_SpellScript)
 
void HandleScript (SpellEffIndex)
 
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 const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
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)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo const * GetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void Cancel ()
 
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 Register ()=0
 
virtual bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
virtual void Unload ()
 
- Static Public Member Functions inherited from _SpellScript
static bool ValidateSpellInfo (std::initializer_list< uint32 > spellIds)
 
template<class T >
static bool ValidateSpellInfo (T const &spellIds)
 
- Public Attributes inherited from SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
virtual bool _Validate (SpellInfo const *entry)
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ HandleScript()

void spell_rotface_large_ooze_combine::spell_rotface_large_ooze_combine_SpellScript::HandleScript ( SpellEffIndex  )
inlineprivate
639 {
640 // large targetting large
641
642 if (!GetHitCreature() || !GetHitCreature()->IsAlive())
643 return;
644
645 uint8 casterStack = 1;
646 uint8 targetStack = 1;
647 Aura* casterAura = GetCaster()->GetAura(SPELL_UNSTABLE_OOZE);
648 if (casterAura)
649 casterStack = casterAura->GetStackAmount();
651 if (targetAura)
652 targetStack = targetAura->GetStackAmount();
653 uint8 newStack = casterStack + targetStack;
654 if (newStack > 5)
655 newStack = 5;
656 if (casterAura)
657 casterAura->SetStackAmount(newStack);
658 else
659 {
661 if (Aura* aur = GetCaster()->GetAura(SPELL_UNSTABLE_OOZE))
662 aur->SetStackAmount(newStack);
663 }
664
665 // red color!
666 if (newStack >= 4)
667 GetCaster()->CastSpell(GetCaster(), 69844, true);
668
669 // explode!
670 if (newStack >= 5)
671 {
674 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
675 if (Creature* rotface = ObjectAccessor::GetCreature(*GetCaster(), instance->GetGuidData(DATA_ROTFACE)))
676 if (rotface->IsAlive())
677 {
678 if (GetCaster()->GetTypeId() == TYPEID_UNIT)
680 rotface->AI()->Talk(SAY_UNSTABLE_EXPLOSION);
681 }
682
683 if (Creature* cre = GetCaster()->ToCreature())
684 cre->AI()->DoAction(EVENT_STICKY_OOZE);
685 GetCaster()->CastSpell(GetCaster(), SPELL_UNSTABLE_OOZE_EXPLOSION, false, nullptr, nullptr, GetCaster()->GetGUID());
686 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
687 instance->SetData(DATA_OOZE_DANCE_ACHIEVEMENT, uint32(false));
688 }
689
693 }
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
@ SPELL_LARGE_OOZE_COMBINE
Definition: boss_rotface.cpp:57
@ SPELL_UNSTABLE_OOZE_EXPLOSION
Definition: boss_rotface.cpp:64
@ SPELL_UNSTABLE_OOZE
Definition: boss_rotface.cpp:62
@ SPELL_LARGE_OOZE_BUFF_COMBINE
Definition: boss_rotface.cpp:58
@ SAY_UNSTABLE_EXPLOSION
Definition: boss_rotface.cpp:32
@ EMOTE_UNSTABLE_EXPLOSION
Definition: boss_rotface.cpp:31
@ EVENT_STICKY_OOZE
Definition: boss_rotface.cpp:87
@ DATA_OOZE_DANCE_ACHIEVEMENT
Definition: icecrown_citadel.h:113
@ DATA_ROTFACE
Definition: icecrown_citadel.h:98
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
Definition: CreatureAI.cpp:50
Definition: Creature.h:46
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2108
CreatureAI * AI() const
Definition: Creature.h:135
Creature * ToCreature()
Definition: Object.h:197
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5499
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4835
Definition: InstanceScript.h:140
Definition: SpellAuras.h:87
void SetStackAmount(uint8 num)
Definition: SpellAuras.cpp:1009
uint8 GetStackAmount() const
Definition: SpellAuras.h:148
Creature * GetHitCreature()
Definition: SpellScript.cpp:458
Unit * GetCaster()
Definition: SpellScript.cpp:401

References Creature::AI(), Unit::CastSpell(), DATA_OOZE_DANCE_ACHIEVEMENT, DATA_ROTFACE, Creature::DespawnOrUnsummon(), EMOTE_UNSTABLE_EXPLOSION, EVENT_STICKY_OOZE, Unit::GetAura(), SpellScript::GetCaster(), ObjectAccessor::GetCreature(), SpellScript::GetHitCreature(), Aura::GetStackAmount(), Unit::RemoveAurasDueToSpell(), SAY_UNSTABLE_EXPLOSION, Aura::SetStackAmount(), SPELL_LARGE_OOZE_BUFF_COMBINE, SPELL_LARGE_OOZE_COMBINE, SPELL_UNSTABLE_OOZE, SPELL_UNSTABLE_OOZE_EXPLOSION, CreatureAI::Talk(), Object::ToCreature(), and TYPEID_UNIT.

Referenced by Register().

◆ PrepareSpellScript()

spell_rotface_large_ooze_combine::spell_rotface_large_ooze_combine_SpellScript::PrepareSpellScript ( spell_rotface_large_ooze_combine_SpellScript  )
private

◆ Register()

void spell_rotface_large_ooze_combine::spell_rotface_large_ooze_combine_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

696 {
698 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition: SharedDefines.h:827
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleScript(SpellEffIndex)
Definition: boss_rotface.cpp:638

References EFFECT_0, HandleScript(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_SCRIPT_EFFECT, and SpellEffectFn.