AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
go_celestial_planetarium_access::go_celestial_planetarium_accessAI Struct Reference
Inheritance diagram for go_celestial_planetarium_access::go_celestial_planetarium_accessAI:
GameObjectAI

Public Member Functions

 go_celestial_planetarium_accessAI (GameObject *go)
 
bool GossipHello (Player *player, bool) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from GameObjectAI
 GameObjectAI (GameObject *go)
 
virtual ~GameObjectAI ()
 
virtual void UpdateAI (uint32)
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void DoAction (int32)
 
virtual void SetGUID (ObjectGuid, int32)
 
virtual ObjectGuid GetGUID (int32) const
 
virtual bool GossipHello (Player *, bool)
 
virtual bool GossipSelect (Player *, uint32, uint32)
 
virtual bool GossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual bool QuestAccept (Player *, Quest const *)
 
virtual bool QuestReward (Player *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *)
 
virtual void Destroyed (Player *, uint32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void OnGameEvent (bool, uint16)
 
virtual void OnStateChanged (uint32, Unit *)
 
virtual void EventInform (uint32)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual void JustSummoned (Creature *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 

Public Attributes

EventMap events
 
bool _locked
 

Additional Inherited Members

- Static Public Member Functions inherited from GameObjectAI
static int32 Permissible (GameObject const *go)
 
- Protected Attributes inherited from GameObjectAI
GameObject *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ go_celestial_planetarium_accessAI()

go_celestial_planetarium_access::go_celestial_planetarium_accessAI::go_celestial_planetarium_accessAI ( GameObject go)
inline
1114 : GameObjectAI(go)
1115 {
1116 _locked = false;
1117 }
Definition: GameObjectAI.h:34
bool _locked
Definition: boss_algalon_the_observer.cpp:1120

References _locked.

Member Function Documentation

◆ GossipHello()

bool go_celestial_planetarium_access::go_celestial_planetarium_accessAI::GossipHello ( Player player,
bool   
)
inlineoverridevirtual

Reimplemented from GameObjectAI.

1123 {
1124 bool hasKey = true;
1125 if (LockEntry const* lock = sLockStore.LookupEntry(me->GetGOInfo()->goober.lockId))
1126 {
1127 hasKey = false;
1128 for (uint32 i = 0; i < MAX_LOCK_CASE; ++i)
1129 {
1130 if (!lock->Index[i])
1131 continue;
1132
1133 if (player->HasItemCount(lock->Index[i]))
1134 {
1135 hasKey = true;
1136 break;
1137 }
1138 }
1139 }
1140
1141 if (!hasKey)
1142 return false;
1143
1144 if (_locked)
1145 return false;
1146 _locked = true;
1147 // Start Algalon event
1149 events.ScheduleEvent(EVENT_DESPAWN_CONSOLE, 5000ms);
1151 brann->AI()->DoAction(ACTION_START_INTRO);
1152
1153 if (InstanceScript* instance = me->GetInstanceScript())
1154 {
1155 instance->SetData(DATA_ALGALON_SUMMON_STATE, 1);
1156 if (GameObject* sigil = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_DOODAD_UL_SIGILDOOR_01)))
1157 sigil->SetGoState(GO_STATE_ACTIVE);
1158
1159 if (GameObject* sigil = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_DOODAD_UL_SIGILDOOR_02)))
1160 sigil->SetGoState(GO_STATE_ACTIVE);
1161
1162 if (Map* map = player->GetMap())
1163 {
1164 if (InstanceMap* instanceMap = map->ToInstanceMap())
1165 {
1166 instanceMap->PermBindAllPlayers();
1167 }
1168 }
1169 }
1170
1171 return false;
1172 }
std::uint32_t uint32
Definition: Define.h:107
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ ACTION_START_INTRO
Definition: boss_algalon_the_observer.cpp:81
Position const BrannIntroSpawnPos
Definition: boss_algalon_the_observer.cpp:198
@ EVENT_DESPAWN_CONSOLE
Definition: boss_algalon_the_observer.cpp:108
@ DATA_ALGALON_SUMMON_STATE
Definition: ulduar.h:90
@ GO_DOODAD_UL_SIGILDOOR_01
Definition: ulduar.h:250
@ GO_DOODAD_UL_SIGILDOOR_02
Definition: ulduar.h:251
@ NPC_BRANN_BRONZBEARD_ALG
Definition: ulduar.h:160
events
Definition: boss_sartura.cpp:43
@ GO_FLAG_IN_USE
Definition: SharedDefines.h:1603
#define MAX_LOCK_CASE
Definition: DBCStructure.h:1305
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:187
GameObject *const me
Definition: GameObjectAI.h:36
Definition: Creature.h:46
Definition: GameObject.h:121
void SetGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:219
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:137
struct GameObjectTemplate::@227::@238 goober
uint32 lockId
Definition: GameObjectData.h:47
Map * GetMap() const
Definition: Object.h:531
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2355
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition: PlayerStorage.cpp:661
Definition: InstanceScript.h:142
Definition: Map.h:313
InstanceMap * ToInstanceMap()
Definition: Map.h:546
Definition: Map.h:819
Definition: DBCStructure.h:1308

References _locked, ACTION_START_INTRO, BrannIntroSpawnPos, DATA_ALGALON_SUMMON_STATE, EVENT_DESPAWN_CONSOLE, ObjectAccessor::GetGameObject(), GameObject::GetGOInfo(), WorldObject::GetInstanceScript(), WorldObject::GetMap(), GO_DOODAD_UL_SIGILDOOR_01, GO_DOODAD_UL_SIGILDOOR_02, GO_FLAG_IN_USE, GO_STATE_ACTIVE, GameObjectTemplate::goober, Player::HasItemCount(), GameObjectTemplate::lockId, MAX_LOCK_CASE, GameObjectAI::me, NPC_BRANN_BRONZBEARD_ALG, GameObject::SetGameObjectFlag(), sLockStore, WorldObject::SummonCreature(), and Map::ToInstanceMap().

◆ UpdateAI()

void go_celestial_planetarium_access::go_celestial_planetarium_accessAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from GameObjectAI.

1175 {
1176 if (events.Empty())
1177 return;
1178
1179 events.Update(diff);
1180 switch (events.ExecuteEvent())
1181 {
1183 me->Delete();
1184 break;
1185 }
1186 }
void Delete()
Definition: GameObject.cpp:979

References GameObject::Delete(), EVENT_DESPAWN_CONSOLE, and GameObjectAI::me.

Member Data Documentation

◆ _locked

bool go_celestial_planetarium_access::go_celestial_planetarium_accessAI::_locked

◆ events

EventMap go_celestial_planetarium_access::go_celestial_planetarium_accessAI::events