AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
at_frozen_throne_teleport Class Reference
Inheritance diagram for at_frozen_throne_teleport:
AreaTriggerScript ScriptObject

Public Member Functions

 at_frozen_throne_teleport ()
 
bool OnTrigger (Player *player, AreaTrigger const *) override
 
- Public Member Functions inherited from AreaTriggerScript
bool IsDatabaseBound () const override
 
virtual bool OnTrigger (Player *, AreaTrigger const *)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Additional Inherited Members

- Protected Member Functions inherited from AreaTriggerScript
 AreaTriggerScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ at_frozen_throne_teleport()

at_frozen_throne_teleport::at_frozen_throne_teleport ( )
inline
110: AreaTriggerScript("at_frozen_throne_teleport") { }
Definition: AreaTriggerScript.h:24

Member Function Documentation

◆ OnTrigger()

bool at_frozen_throne_teleport::OnTrigger ( Player player,
AreaTrigger const *   
)
inlineoverridevirtual

Reimplemented from AreaTriggerScript.

113 {
114 if (player->IsInCombat())
115 {
116 if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(FROZEN_THRONE_TELEPORT))
118 return true;
119 }
120
121 if (InstanceScript* instance = player->GetInstanceScript())
122 if (instance->GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE &&
123 instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE &&
124 instance->GetBossState(DATA_SINDRAGOSA) == DONE &&
125 instance->GetBossState(DATA_THE_LICH_KING) != IN_PROGRESS)
126 player->CastSpell(player, FROZEN_THRONE_TELEPORT, false);
127
128 return true;
129 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
#define sSpellMgr
Definition: SpellMgr.h:825
@ FROZEN_THRONE_TELEPORT
Definition: icecrown_citadel.h:85
@ DATA_THE_LICH_KING
Definition: icecrown_citadel.h:104
@ DATA_SINDRAGOSA
Definition: icecrown_citadel.h:103
@ DATA_BLOOD_QUEEN_LANA_THEL
Definition: icecrown_citadel.h:100
@ DATA_PROFESSOR_PUTRICIDE
Definition: icecrown_citadel.h:98
@ SPELL_FAILED_AFFECTING_COMBAT
Definition: SharedDefines.h:950
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
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
bool IsInCombat() const
Definition: Unit.h:820
Definition: InstanceScript.h:142
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE)
Definition: Spell.cpp:4661
Definition: SpellInfo.h:316

References Unit::CastSpell(), DATA_BLOOD_QUEEN_LANA_THEL, DATA_PROFESSOR_PUTRICIDE, DATA_SINDRAGOSA, DATA_THE_LICH_KING, DONE, FROZEN_THRONE_TELEPORT, WorldObject::GetInstanceScript(), IN_PROGRESS, Unit::IsInCombat(), Spell::SendCastResult(), SPELL_FAILED_AFFECTING_COMBAT, and sSpellMgr.