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

Private Member Functions

 PrepareSpellScript (spell_putricide_ooze_channel)
 
bool Validate (SpellInfo const *spell) override
 
bool Load () override
 
void SelectTarget (std::list< WorldObject * > &targets)
 
void SetTarget (std::list< WorldObject * > &targets)
 
void StartAttack ()
 
void Register () override
 

Private Attributes

WorldObject_target
 

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 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
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ Load()

bool spell_putricide_ooze_channel::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1045 {
1046 _target = nullptr;
1047 return GetCaster()->IsCreature();
1048 }
bool IsCreature() const
Definition Object.h:204
Unit * GetCaster()
Definition SpellScript.cpp:401
WorldObject * _target
Definition boss_professor_putricide.cpp:1096

References _target, SpellScript::GetCaster(), and Object::IsCreature().

◆ PrepareSpellScript()

spell_putricide_ooze_channel::PrepareSpellScript ( spell_putricide_ooze_channel  )
private

◆ Register()

void spell_putricide_ooze_channel::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1088 {
1093 }
@ EFFECT_1
Definition SharedDefines.h:32
@ EFFECT_0
Definition SharedDefines.h:31
@ EFFECT_2
Definition SharedDefines.h:33
@ TARGET_UNIT_SRC_AREA_ENEMY
Definition SharedDefines.h:1420
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition SpellScript.h:354
#define SpellHitFn(F)
Definition SpellScript.h:349
HookList< HitHandler > AfterHit
Definition SpellScript.h:347
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition SpellScript.h:353
void SetTarget(std::list< WorldObject * > &targets)
Definition boss_professor_putricide.cpp:1069
void StartAttack()
Definition boss_professor_putricide.cpp:1076
void SelectTarget(std::list< WorldObject * > &targets)
Definition boss_professor_putricide.cpp:1050

References SpellScript::AfterHit, EFFECT_0, EFFECT_1, EFFECT_2, SpellScript::OnObjectAreaTargetSelect, SelectTarget(), SetTarget(), SpellHitFn, SpellObjectAreaTargetSelectFn, StartAttack(), and TARGET_UNIT_SRC_AREA_ENEMY.

◆ SelectTarget()

void spell_putricide_ooze_channel::SelectTarget ( std::list< WorldObject * > &  targets)
inlineprivate
1051 {
1052 // dbc has only 1 field for excluding, this will prevent anyone from getting both at the same time
1053 targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VOLATILE_OOZE_PROTECTION));
1054 targets.remove_if(Acore::UnitAuraCheck(true, SPELL_GASEOUS_BLOAT_PROTECTION));
1055
1056 if (targets.empty())
1057 {
1059 GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update
1060 return;
1061 }
1062
1064 targets.clear();
1065 targets.push_back(target);
1066 _target = target;
1067 }
@ SPELL_FAILED_NO_VALID_TARGETS
Definition SharedDefines.h:1127
@ SPELL_GASEOUS_BLOAT_PROTECTION
Definition boss_professor_putricide.cpp:92
@ SPELL_VOLATILE_OOZE_PROTECTION
Definition boss_professor_putricide.cpp:99
Definition GridNotifiers.h:1627
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition Creature.cpp:2183
Creature * ToCreature()
Definition Object.h:205
void FinishCast(SpellCastResult result)
Definition SpellScript.cpp:635
Definition Object.h:410
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:133

References _target, Creature::DespawnOrUnsummon(), SpellScript::FinishCast(), SpellScript::GetCaster(), Acore::Containers::SelectRandomContainerElement(), SPELL_FAILED_NO_VALID_TARGETS, SPELL_GASEOUS_BLOAT_PROTECTION, SPELL_VOLATILE_OOZE_PROTECTION, and Object::ToCreature().

Referenced by Register().

◆ SetTarget()

void spell_putricide_ooze_channel::SetTarget ( std::list< WorldObject * > &  targets)
inlineprivate
1070 {
1071 targets.clear();
1072 if (_target)
1073 targets.push_back(_target);
1074 }

References _target.

Referenced by Register().

◆ StartAttack()

void spell_putricide_ooze_channel::StartAttack ( )
inlineprivate
1077 {
1082 GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff
1083 if (Creature* c = GetCaster()->ToCreature())
1084 c->AI()->SetGUID(GetHitUnit()->GetGUID(), -1);
1085 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
Definition Creature.h:43
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2828
CreatureAI * AI() const
Definition Creature.h:141
Unit * GetHitUnit()
Definition SpellScript.cpp:448
void ClearAllThreat()
Definition ThreatMgr.cpp:417
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:27
void ClearUnitState(uint32 f)
Definition Unit.h:708
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:14705
ThreatMgr & GetThreatMgr()
Definition Unit.h:912

References Unit::AddThreat(), Creature::AI(), UnitAI::AttackStart(), ThreatMgr::ClearAllThreat(), Unit::ClearUnitState(), SpellScript::GetCaster(), SpellScript::GetHitUnit(), Unit::GetThreatMgr(), Creature::SetInCombatWithZone(), Object::ToCreature(), and UNIT_STATE_CASTING.

Referenced by Register().

◆ Validate()

bool spell_putricide_ooze_channel::Validate ( SpellInfo const *  spell)
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1038 {
1039 return ValidateSpellInfo({ spell->ExcludeTargetAuraSpell });
1040 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition SpellScript.h:125

References SpellInfo::ExcludeTargetAuraSpell, and _SpellScript::ValidateSpellInfo().

Member Data Documentation

◆ _target

WorldObject* spell_putricide_ooze_channel::_target
private

Referenced by Load(), SelectTarget(), and SetTarget().


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