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
210: _owner(owner), _sindragosaGUID(sindragosaGUID) { }
Unit * _owner
Definition: boss_sindragosa.cpp:239
ObjectGuid _sindragosaGUID
Definition: boss_sindragosa.cpp:240

Member Function Documentation

◆ Execute()

bool IceTombSummonEvent::Execute ( uint64  ,
uint32   
)
inlineoverridevirtual

Reimplemented from BasicEvent.

213 {
215 return true;
217 {
218 if (!sindragosa->IsAlive())
219 return true;
220
221 Position pos = _owner->GetPosition();
223
224 if (TempSummon* summon = sindragosa->SummonCreature(NPC_ICE_TOMB, pos))
225 {
226 summon->AI()->SetGUID(_owner->GetGUID(), DATA_TRAPPED_PLAYER);
228 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))
229 {
230 go->SetSpellId(SPELL_ICE_TOMB_DAMAGE);
231 summon->AddGameObject(go);
232 }
233 }
234 }
235 return true;
236 }
@ SPELL_ICE_TOMB_DAMAGE
Definition: boss_sindragosa.cpp:69
@ SPELL_ICE_TOMB_UNTARGETABLE
Definition: boss_sindragosa.cpp:68
@ DATA_TRAPPED_PLAYER
Definition: boss_sindragosa.cpp:150
@ NPC_ICE_TOMB
Definition: icecrown_citadel.h:338
@ GO_ICE_BLOCK
Definition: icecrown_citadel.h:466
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
Definition: Creature.h:46
Definition: TemporarySummon.h:40
Definition: GameObject.h:121
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
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:2355
void UpdateGroundPositionZ(float x, float y, float &z) const
Definition: Object.cpp:1530
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:2369
Definition: Position.h:28
float m_positionZ
Definition: Position.h:58
float m_positionX
Definition: Position.h:56
float GetPositionZ() const
Definition: Position.h:119
float m_positionY
Definition: Position.h:57
float GetOrientation() const
Definition: Position.h:120
float GetPositionX() const
Definition: Position.h:117
void GetPosition(float &x, float &y) const
Definition: Position.h:122
float GetPositionY() const
Definition: Position.h:118
bool IsAlive() const
Definition: Unit.h:1204
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5669
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:1168

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().