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
109: AreaTriggerScript("at_frozen_throne_teleport") { }
Definition: ScriptMgr.h:801

Member Function Documentation

◆ OnTrigger()

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

Reimplemented from AreaTriggerScript.

112 {
113 if (player->IsInCombat())
114 {
115 if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(FROZEN_THRONE_TELEPORT))
117 return true;
118 }
119
120 if (InstanceScript* instance = player->GetInstanceScript())
121 if (instance->GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE &&
122 instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE &&
123 instance->GetBossState(DATA_SINDRAGOSA) == DONE &&
124 instance->GetBossState(DATA_THE_LICH_KING) != IN_PROGRESS)
125 player->CastSpell(player, FROZEN_THRONE_TELEPORT, false);
126
127 return true;
128 }
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ DONE
Definition: InstanceScript.h:59
#define sSpellMgr
Definition: SpellMgr.h:818
@ FROZEN_THRONE_TELEPORT
Definition: icecrown_citadel.h:86
@ DATA_THE_LICH_KING
Definition: icecrown_citadel.h:105
@ DATA_SINDRAGOSA
Definition: icecrown_citadel.h:104
@ DATA_BLOOD_QUEEN_LANA_THEL
Definition: icecrown_citadel.h:101
@ DATA_PROFESSOR_PUTRICIDE
Definition: icecrown_citadel.h:99
@ SPELL_FAILED_AFFECTING_COMBAT
Definition: SharedDefines.h:922
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:1688
Definition: InstanceScript.h:140
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE)
Definition: Spell.cpp:4631
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.