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

Public Member Functions

 at_icc_saurfang_portal ()
 
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_icc_saurfang_portal()

at_icc_saurfang_portal::at_icc_saurfang_portal ( )
inline
2183: AreaTriggerScript("at_icc_saurfang_portal") { }
Definition: AreaTriggerScript.h:24

Member Function Documentation

◆ OnTrigger()

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

Reimplemented from AreaTriggerScript.

2186 {
2187 InstanceScript* instance = player->GetInstanceScript();
2188 if (!instance || instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE)
2189 return true;
2190
2191 Position destPos = {4126.35f, 2769.23f, 350.963f, 0.0f};
2192
2193 if (instance->GetData(DATA_COLDFLAME_JETS) == NOT_STARTED)
2194 {
2195 // save original player position
2196 float x, y, z, o;
2197 player->GetPosition(x, y, z, o);
2198
2199 // move player to preload grid and be able to select nearby npcs
2200 player->GetMap()->PlayerRelocation(player, destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), destPos.GetOrientation());
2201
2203 std::list<Creature*> traps;
2205 traps.sort(Acore::ObjectDistanceOrderPred(player));
2206 bool instant = false;
2207 for (std::list<Creature*>::iterator itr = traps.begin(); itr != traps.end(); ++itr)
2208 {
2209 (*itr)->AI()->DoAction(instant ? 1000 : 11000);
2210 instant = !instant;
2211 }
2212
2213 // restore original position
2214 player->GetMap()->PlayerRelocation(player, x, y, z, o);
2215 }
2216
2217 player->TeleportTo(631, destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), destPos.GetOrientation());
2218
2219 return true;
2220 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
@ NOT_STARTED
Definition: InstanceScript.h:57
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:827
@ NPC_FROST_FREEZE_TRAP
Definition: icecrown_citadel.h:256
@ DATA_DEATHBRINGER_SAURFANG
Definition: icecrown_citadel.h:95
@ DATA_COLDFLAME_JETS
Definition: icecrown_citadel.h:123
Map * GetMap() const
Definition: Object.h:531
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
Definition: Object.h:696
Definition: Position.h:28
float GetPositionZ() const
Definition: Position.h:119
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 TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0, Unit *target=nullptr, bool newInstance=false)
Definition: Player.cpp:1330
Definition: InstanceScript.h:142
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
void PlayerRelocation(Player *, float x, float y, float z, float o)
Definition: Map.cpp:1000
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References DATA_COLDFLAME_JETS, DATA_DEATHBRINGER_SAURFANG, DONE, InstanceScript::GetBossState(), GetCreatureListWithEntryInGrid(), ZoneScript::GetData(), WorldObject::GetInstanceScript(), WorldObject::GetMap(), Position::GetOrientation(), Position::GetPosition(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), IN_PROGRESS, NOT_STARTED, NPC_FROST_FREEZE_TRAP, Map::PlayerRelocation(), ZoneScript::SetData(), and Player::TeleportTo().