TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
kalecgos_teleporter Class Reference

Public Member Functions

 kalecgos_teleporter ()
 
bool OnGossipHello (Player *player, GameObject *go) override
 
- Public Member Functions inherited from GameObjectScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, GameObject *)
 
virtual bool OnGossipSelect (Player *, GameObject *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, GameObject *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, GameObject *, Quest const *)
 
virtual bool OnQuestReward (Player *, GameObject *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, GameObject *)
 
virtual void OnDestroyed (GameObject *, Player *)
 
virtual void OnDamaged (GameObject *, Player *)
 
virtual void OnLootStateChanged (GameObject *, uint32, Unit *)
 
virtual void OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAIGetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 
- Public Member Functions inherited from UpdatableScript< GameObject >
virtual void OnUpdate (GameObject *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from GameObjectScript
 GameObjectScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

kalecgos_teleporter::kalecgos_teleporter ( )
inline
550 : GameObjectScript("kalecgos_teleporter") { }
GameObjectScript(const char *name)
Definition: ScriptMgr.cpp:1592

Member Function Documentation

bool kalecgos_teleporter::OnGossipHello ( Player player,
GameObject go 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

553  {
554 #if MAX_PLAYERS_IN_SPECTRAL_REALM > 0
555  uint8 SpectralPlayers = 0;
556  Map::PlayerList const &PlayerList = go->GetMap()->GetPlayers();
557  for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
558  {
559  if (i->GetSource() && i->GetSource()->GetPositionZ() < DEMON_REALM_Z + 5)
560  ++SpectralPlayers;
561  }
562 
563  if (player->HasAura(AURA_SPECTRAL_EXHAUSTION) || SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM)
564  {
565  player->GetSession()->SendNotification(GO_FAILED);
566  return true;
567  }
568 #else
569  (void)go;
570 #endif
571 
572  player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true);
573  return true;
574  }
Map * GetMap() const
Definition: Object.h:543
#define GO_FAILED
Definition: boss_kalecgos.cpp:82
#define MAX_PLAYERS_IN_SPECTRAL_REALM
Definition: boss_kalecgos.cpp:97
iterator begin()
Definition: MapRefManager.h:37
Definition: LinkedList.h:141
void CastSpell(Unit *target, uint32 spell, bool triggered=true)
Definition: GameObject.cpp:1833
Definition: boss_kalecgos.cpp:59
#define DEMON_REALM_Z
Definition: boss_kalecgos.cpp:95
PlayerList const & GetPlayers() const
Definition: Map.h:433
Definition: MapRefManager.h:26
Definition: boss_kalecgos.cpp:53
uint8_t uint8
Definition: Define.h:152
iterator end()
Definition: MapRefManager.h:38

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: