AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
IceTombSummonEvent Class Reference
Inheritance diagram for IceTombSummonEvent:
BasicEvent

Public Member Functions

 IceTombSummonEvent (Unit *owner, ObjectGuid sindragosaGUID)
 
bool Execute (uint64, uint32) override
 
- Public Member Functions inherited from BasicEvent
 BasicEvent ()=default
 
virtual ~BasicEvent ()=default
 
virtual bool Execute (uint64, uint32)
 
virtual bool IsDeletable () const
 
virtual void Abort (uint64)
 
void ScheduleAbort ()
 

Private Attributes

Unit_owner
 
ObjectGuid _sindragosaGUID
 

Detailed Description

Constructor & Destructor Documentation

◆ IceTombSummonEvent()

IceTombSummonEvent::IceTombSummonEvent ( Unit owner,
ObjectGuid  sindragosaGUID 
)
inline
212: _owner(owner), _sindragosaGUID(sindragosaGUID) { }
Unit * _owner
Definition: boss_sindragosa.cpp:241
ObjectGuid _sindragosaGUID
Definition: boss_sindragosa.cpp:242

Member Function Documentation

◆ Execute()

bool IceTombSummonEvent::Execute ( uint64  ,
uint32   
)
inlineoverridevirtual

Reimplemented from BasicEvent.

215 {
217 return true;
219 {
220 if (!sindragosa->IsAlive())
221 return true;
222
223 Position pos = _owner->GetPosition();
225
226 if (TempSummon* summon = sindragosa->SummonCreature(NPC_ICE_TOMB, pos))
227 {
228 summon->AI()->SetGUID(_owner->GetGUID(), DATA_TRAPPED_PLAYER);
230 if (GameObject* go = summon->SummonGameObject(GO_ICE_BLOCK, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0))
231 {
232 go->SetSpellId(SPELL_ICE_TOMB_DAMAGE);
233 summon->AddGameObject(go);
234 }
235 }
236 }
237 return true;
238 }
@ NPC_ICE_TOMB
Definition: icecrown_citadel.h:332
@ GO_ICE_BLOCK
Definition: icecrown_citadel.h:460
@ SPELL_ICE_TOMB_DAMAGE
Definition: boss_sindragosa.cpp:71
@ SPELL_ICE_TOMB_UNTARGETABLE
Definition: boss_sindragosa.cpp:70
@ DATA_TRAPPED_PLAYER
Definition: boss_sindragosa.cpp:152
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
Definition: Creature.h:43
Definition: TemporarySummon.h:40
Definition: GameObject.h:120
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366
void UpdateGroundPositionZ(float x, float y, float &z) const
Definition: Object.cpp:1541
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2380
Definition: Position.h:27
float m_positionZ
Definition: Position.h:57
float m_positionX
Definition: Position.h:55
float GetPositionZ() const
Definition: Position.h:118
float m_positionY
Definition: Position.h:56
float GetOrientation() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:116
void GetPosition(float &x, float &y) const
Definition: Position.h:121
float GetPositionY() const
Definition: Position.h:117
bool IsAlive() const
Definition: Unit.h:1654
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5698
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:1167

References _owner, _sindragosaGUID, Unit::CastSpell(), DATA_TRAPPED_PLAYER, ObjectAccessor::GetCreature(), Object::GetGUID(), Position::GetOrientation(), Position::GetPosition(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GO_ICE_BLOCK, Unit::HasAura(), Unit::IsAlive(), Position::m_positionX, Position::m_positionY, Position::m_positionZ, NPC_ICE_TOMB, SPELL_ICE_TOMB_DAMAGE, SPELL_ICE_TOMB_UNTARGETABLE, WorldObject::SummonCreature(), WorldObject::SummonGameObject(), and WorldObject::UpdateGroundPositionZ().

Member Data Documentation

◆ _owner

Unit* IceTombSummonEvent::_owner
private

Referenced by Execute().

◆ _sindragosaGUID

ObjectGuid IceTombSummonEvent::_sindragosaGUID
private

Referenced by Execute().