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
 
Unit * GetCaster ()
 
GameObject * GetGObjCaster ()
 
Unit * GetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObject * GetExplTargetWorldObject ()
 
Unit * GetExplTargetUnit ()
 
GameObject * GetExplTargetGObj ()
 
Item * GetExplTargetItem ()
 
Unit * GetHitUnit ()
 
Creature * GetHitCreature ()
 
Player * GetHitPlayer ()
 
Item * GetHitItem ()
 
GameObject * GetHitGObj ()
 
WorldLocation * GetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
Spell * GetSpell ()
 
Aura * GetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
Item * GetCastItem ()
 
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< CastHandler > BeforeCast
 
HookList< CastHandler > OnCast
 
HookList< CastHandler > AfterCast
 
HookList< CheckCastHandler > OnCheckCast
 
HookList< EffectHandler > OnEffectLaunch
 
HookList< EffectHandler > OnEffectLaunchTarget
 
HookList< EffectHandler > OnEffectHit
 
HookList< EffectHandler > OnEffectHitTarget
 
HookList< BeforeHitHandler > BeforeHit
 
HookList< HitHandler > OnHit
 
HookList< HitHandler > AfterHit
 
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
 
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
 
- 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.

1088 {
1089 _target = nullptr;
1090 return GetCaster()->IsCreature();
1091 }
bool IsCreature() const
Definition Object.h:211
Unit * GetCaster()
Definition SpellScript.cpp:401
WorldObject * _target
Definition boss_professor_putricide.cpp:1139

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.

1131 {
1136 }
@ 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:1424
#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:1112
void StartAttack()
Definition boss_professor_putricide.cpp:1119
void SelectTarget(std::list< WorldObject * > &targets)
Definition boss_professor_putricide.cpp:1093

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
1094 {
1095 // dbc has only 1 field for excluding, this will prevent anyone from getting both at the same time
1096 targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VOLATILE_OOZE_PROTECTION));
1097 targets.remove_if(Acore::UnitAuraCheck(true, SPELL_GASEOUS_BLOAT_PROTECTION));
1098
1099 if (targets.empty())
1100 {
1102 GetCaster()->ToCreature()->DespawnOrUnsummon(1ms); // despawn next update
1103 return;
1104 }
1105
1107 targets.clear();
1108 targets.push_back(target);
1109 _target = target;
1110 }
@ SPELL_FAILED_NO_VALID_TARGETS
Definition SharedDefines.h:1115
@ SPELL_GASEOUS_BLOAT_PROTECTION
Definition boss_professor_putricide.cpp:93
@ SPELL_VOLATILE_OOZE_PROTECTION
Definition boss_professor_putricide.cpp:100
Definition GridNotifiers.h:1689
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2216
Creature * ToCreature()
Definition Object.h:212
void FinishCast(SpellCastResult result)
Definition SpellScript.cpp:640
Definition Object.h:482
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
1113 {
1114 targets.clear();
1115 if (_target)
1116 targets.push_back(_target);
1117 }

References _target.

Referenced by Register().

◆ StartAttack()

void spell_putricide_ooze_channel::StartAttack ( )
inlineprivate
1120 {
1125 GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff
1126 if (Creature* c = GetCaster()->ToCreature())
1127 c->AI()->SetGUID(GetHitUnit()->GetGUID(), -1);
1128 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
Definition Creature.h:47
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2882
CreatureAI * AI() const
Definition Creature.h:144
Unit * GetHitUnit()
Definition SpellScript.cpp:453
void ClearAllThreat()
Definition ThreatManager.cpp:584
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:29
void ClearUnitState(uint32 f)
Definition Unit.h:738
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:11198
ThreatManager & GetThreatMgr()
Definition Unit.h:957

References Unit::AddThreat(), Creature::AI(), UnitAI::AttackStart(), ThreatManager::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.

1081 {
1082 return ValidateSpellInfo({ spell->ExcludeTargetAuraSpell });
1083 }
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: