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

Public Member Functions

 go_enchanted_scarlet_thread ()
 
void OnLootStateChanged (GameObject *go, uint32 state, Unit *) 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, char const *)
 
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 OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAI * GetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
std::string const & GetName () const
 
uint16 GetTotalAvailableHooks ()
 
- Public Member Functions inherited from UpdatableScript< GameObject >
virtual void OnUpdate (GameObject *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from GameObjectScript
 GameObjectScript (char const *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (char const *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ go_enchanted_scarlet_thread()

go_enchanted_scarlet_thread::go_enchanted_scarlet_thread ( )
inline
707: GameObjectScript("go_enchanted_scarlet_thread") { }
Definition GameObjectScript.h:25

Member Function Documentation

◆ OnLootStateChanged()

void go_enchanted_scarlet_thread::OnLootStateChanged ( GameObject *  go,
uint32  state,
Unit *   
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

710 {
711 if (state != GO_JUST_DEACTIVATED)
712 return;
713
714 for (LootItem const& item : go->loot.quest_items)
715 {
716 if (item.itemid != ITEM_ENCHANTED_SCARLET_THREAD || !item.is_looted)
717 continue;
718
719 if (InstanceScript* instance = go->GetInstanceScript())
720 instance->SetGuidData(DATA_SCARLET_THREAD_LOOTED, go->GetGUID());
721
722 return;
723 }
724
726 }
@ GO_READY
Definition GameObject.h:111
@ GO_JUST_DEACTIVATED
Definition GameObject.h:113
void SetLootState(LootState s, Unit *unit=nullptr)
Definition GameObject.cpp:2484
Definition InstanceScript.h:143
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
@ ITEM_ENCHANTED_SCARLET_THREAD
Definition stratholme.h:85
@ DATA_SCARLET_THREAD_LOOTED
Definition stratholme.h:33
Definition LootMgr.h:154

References DATA_SCARLET_THREAD_LOOTED, Object::GetGUID(), WorldObject::GetInstanceScript(), GO_JUST_DEACTIVATED, GO_READY, ITEM_ENCHANTED_SCARLET_THREAD, GameObject::loot, Loot::quest_items, and GameObject::SetLootState().


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