AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
go_shadowforge_brazier Class Reference
Inheritance diagram for go_shadowforge_brazier:
GameObjectScript ScriptObject UpdatableScript< GameObject >

Public Member Functions

 go_shadowforge_brazier ()
 
bool OnGossipHello (Player *, GameObject *go) override
 
- Public Member Functions inherited from GameObjectScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, 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 OnModifyHealth (GameObject *, Unit *, int32 &, SpellInfo const *)
 
virtual void OnLootStateChanged (GameObject *, uint32, Unit *)
 
virtual void OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAIGetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
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 ()=default
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ go_shadowforge_brazier()

go_shadowforge_brazier::go_shadowforge_brazier ( )
inline
39: GameObjectScript("go_shadowforge_brazier") {}
Definition: GameObjectScript.h:25

Member Function Documentation

◆ OnGossipHello()

bool go_shadowforge_brazier::OnGossipHello ( Player ,
GameObject go 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

42 {
43 if (InstanceScript* instance = go->GetInstanceScript())
44 {
45 GameObject* northBrazier = ObjectAccessor::GetGameObject(*go, instance->GetGuidData(DATA_SF_BRAZIER_N));
46 GameObject* southBrazier = ObjectAccessor::GetGameObject(*go, instance->GetGuidData(DATA_SF_BRAZIER_S));
47
48 if (!northBrazier || !southBrazier)
49 {
50 return false;
51 }
52
53 // should only happen on first brazier
54 if (instance->GetData(TYPE_LYCEUM) == NOT_STARTED)
55 {
56 instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
57 }
58
59 // Check if the opposite brazier is lit - if it is, open the gates.
60 if ((go->GetGUID() == northBrazier->GetGUID() && southBrazier->GetGoState() == GO_STATE_ACTIVE) || (go->GetGUID() == southBrazier->GetGUID() && northBrazier->GetGoState() == GO_STATE_ACTIVE))
61 {
62 instance->SetData(TYPE_LYCEUM, DONE);
63 }
64 return false;
65 }
66 return false;
67 };
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
@ NOT_STARTED
Definition: InstanceScript.h:57
@ TYPE_LYCEUM
Definition: blackrock_depths.h:44
@ DATA_SF_BRAZIER_N
Definition: blackrock_depths.h:65
@ DATA_SF_BRAZIER_S
Definition: blackrock_depths.h:66
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:187
Definition: GameObject.h:122
GOState GetGoState() const
Definition: GameObject.h:207
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
Definition: InstanceScript.h:141

References DATA_SF_BRAZIER_N, DATA_SF_BRAZIER_S, DONE, ObjectAccessor::GetGameObject(), GameObject::GetGoState(), Object::GetGUID(), WorldObject::GetInstanceScript(), GO_STATE_ACTIVE, IN_PROGRESS, NOT_STARTED, and TYPE_LYCEUM.