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

Private Member Functions

 PrepareSpellScript (spell_putricide_ooze_channel_SpellScript)
 
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 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

◆ Load()

bool spell_putricide_ooze_channel::spell_putricide_ooze_channel_SpellScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1106 {
1107 _target = nullptr;
1108 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1109 }
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
TypeID GetTypeId() const
Definition: Object.h:121
Unit * GetCaster()
Definition: SpellScript.cpp:401
WorldObject * _target
Definition: boss_professor_putricide.cpp:1156

References _target, SpellScript::GetCaster(), Object::GetTypeId(), and TYPEID_UNIT.

◆ PrepareSpellScript()

spell_putricide_ooze_channel::spell_putricide_ooze_channel_SpellScript::PrepareSpellScript ( spell_putricide_ooze_channel_SpellScript  )
private

◆ Register()

void spell_putricide_ooze_channel::spell_putricide_ooze_channel_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1149 {
1154 }
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:354
#define SpellHitFn(F)
Definition: SpellScript.h:349
@ 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
HookList< HitHandler > AfterHit
Definition: SpellScript.h:347
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:353
void StartAttack()
Definition: boss_professor_putricide.cpp:1137
void SetTarget(std::list< WorldObject * > &targets)
Definition: boss_professor_putricide.cpp:1130
void SelectTarget(std::list< WorldObject * > &targets)
Definition: boss_professor_putricide.cpp:1111

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::spell_putricide_ooze_channel_SpellScript::SelectTarget ( std::list< WorldObject * > &  targets)
inlineprivate
1112 {
1113 // dbc has only 1 field for excluding, this will prevent anyone from getting both at the same time
1114 targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VOLATILE_OOZE_PROTECTION));
1115 targets.remove_if(Acore::UnitAuraCheck(true, SPELL_GASEOUS_BLOAT_PROTECTION));
1116
1117 if (targets.empty())
1118 {
1120 GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update
1121 return;
1122 }
1123
1125 targets.clear();
1126 targets.push_back(target);
1127 _target = target;
1128 }
@ SPELL_GASEOUS_BLOAT_PROTECTION
Definition: boss_professor_putricide.cpp:92
@ SPELL_VOLATILE_OOZE_PROTECTION
Definition: boss_professor_putricide.cpp:99
@ SPELL_FAILED_NO_VALID_TARGETS
Definition: SharedDefines.h:1127
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:135
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2117
Creature * ToCreature()
Definition: Object.h:197
Definition: Object.h:393
Definition: GridNotifiers.h:1623
void FinishCast(SpellCastResult result)
Definition: SpellScript.cpp:635

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::spell_putricide_ooze_channel_SpellScript::SetTarget ( std::list< WorldObject * > &  targets)
inlineprivate
1131 {
1132 targets.clear();
1133 if (_target)
1134 targets.push_back(_target);
1135 }

References _target.

Referenced by Register().

◆ StartAttack()

void spell_putricide_ooze_channel::spell_putricide_ooze_channel_SpellScript::StartAttack ( )
inlineprivate
1138 {
1143 GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff
1144 if (Creature* c = GetCaster()->ToCreature())
1145 c->AI()->SetGUID(GetHitUnit()->GetGUID(), -1);
1146 }
@ UNIT_STATE_CASTING
Definition: Unit.h:340
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
void ClearAllThreat()
Definition: ThreatMgr.cpp:417
Definition: Creature.h:46
void SetInCombatWithZone()
Definition: Creature.cpp:2732
CreatureAI * AI() const
Definition: Creature.h:136
void ClearUnitState(uint32 f)
Definition: Unit.h:1411
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14639
ThreatMgr & GetThreatMgr()
Definition: Unit.h:2159
Unit * GetHitUnit()
Definition: SpellScript.cpp:448

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::spell_putricide_ooze_channel_SpellScript::Validate ( SpellInfo const *  spell)
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1099 {
1100 return ValidateSpellInfo({ spell->ExcludeTargetAuraSpell });
1101 }
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::spell_putricide_ooze_channel_SpellScript::_target
private

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