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
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ at_frozen_throne_teleport()

at_frozen_throne_teleport::at_frozen_throne_teleport ( )
inline
111: 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.

114 {
115 if (player->IsInCombat())
116 {
117 if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(FROZEN_THRONE_TELEPORT))
119 return true;
120 }
121
122 if (InstanceScript* instance = player->GetInstanceScript())
123 if (instance->GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE &&
124 instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE &&
125 instance->GetBossState(DATA_SINDRAGOSA) == DONE &&
126 instance->GetBossState(DATA_THE_LICH_KING) != IN_PROGRESS)
127 player->CastSpell(player, FROZEN_THRONE_TELEPORT, false);
128
129 return true;
130 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
#define sSpellMgr
Definition: SpellMgr.h:825
@ FROZEN_THRONE_TELEPORT
Definition: icecrown_citadel.h:87
@ DATA_THE_LICH_KING
Definition: icecrown_citadel.h:106
@ DATA_SINDRAGOSA
Definition: icecrown_citadel.h:105
@ DATA_BLOOD_QUEEN_LANA_THEL
Definition: icecrown_citadel.h:102
@ DATA_PROFESSOR_PUTRICIDE
Definition: icecrown_citadel.h:100
@ 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:1169
bool IsInCombat() const
Definition: Unit.h:1702
Definition: InstanceScript.h:141
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE)
Definition: Spell.cpp:4645
Definition: SpellInfo.h:314

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.